Browse Source

bug

feature
tianqian 2 years ago
parent
commit
0c995bcc27
  1. 239
      src/views/dataBoard/sida/cpts/fw02gxxq.vue
  2. 194
      src/views/dataBoard/sida/cpts/fw03zr.vue
  3. 2
      src/views/dataBoard/sida/cpts/fwBarOption01.js
  4. 2
      src/views/dataBoard/sida/cpts/fwBarOption04.js
  5. 2
      src/views/dataBoard/sida/cpts/fwBarOption05.js
  6. 1
      src/views/modules/shequzhili/tuceng/anquan/anquanxuncha/addForm.vue
  7. 8
      src/views/modules/shequzhili/tuceng/anquan/anquanxuncha/record.vue
  8. 887
      src/views/modules/shequzhili/tuceng/anquan/shebei/record.vue
  9. 8
      src/views/modules/shequzhili/tuceng/anquan/yinhuan/record.vue
  10. 9
      src/views/modules/shequzhili/tuceng/yingji/wuzi/record.vue
  11. 10
      src/views/modules/shequzhili/tuceng/zhonghe/shebei/record.vue

239
src/views/dataBoard/sida/cpts/fw02gxxq.vue

@ -1,7 +1,8 @@
<template> <template>
<div class="m-zyqd"> <div class="m-zyqd">
<div class="pieMain pieMain3"> <div class="pieMain pieMain3">
<div class="pie"><screen-echarts-frame @myChartMethod="pieInitOk" ref="pieChart"></screen-echarts-frame></div> <div class="pie"><screen-echarts-frame @myChartMethod="pieInitOk" ref="pieChart"></screen-echarts-frame>
</div>
<div class="legend"> <div class="legend">
<div class="legend-row" :key="'pie' + item.name" v-for="item in pieData" @click="handleClickItem(item)"> <div class="legend-row" :key="'pie' + item.name" v-for="item in pieData" @click="handleClickItem(item)">
<div class="name">{{ item.name }}</div> <div class="name">{{ item.name }}</div>
@ -15,32 +16,35 @@
</div> </div>
</template> </template>
<script> <script>
import screenEchartsFrame from '@/views/dataBoard/cpts/screen-echarts-frame/index'; import screenEchartsFrame from '@/views/dataBoard/cpts/screen-echarts-frame/index';
// import { pieOption } from './fwqdPieOption.js'; // import { pieOption } from './fwqdPieOption.js';
import { requestPostBi } from '@/js/dai/request-bipass'; import {
export default { requestPostBi
props: { } from '@/js/dai/request-bipass';
orgId: { export default {
type: String, props: {
default: '' orgId: {
type: String,
default: ''
},
searchDate: Array
}, },
searchDate: Array data() {
}, return {
data() { showNoData: false,
return { timer: null,
showNoData: false, pieChart: '',
timer: null, pieOption: {
pieChart: '', color: ['#1A95FF', '#FF6138', '#2adcea', '#2cc4ad', '#7377f5', '#32de66', '#8155d4', '#c7ea48',
pieOption: { '#ef47c2', 'd43349'
color: ['#1A95FF', '#FF6138', '#2adcea', '#2cc4ad', '#7377f5', '#32de66', '#8155d4', '#c7ea48', '#ef47c2', 'd43349'], ],
tooltip: { tooltip: {
trigger: 'item' trigger: 'item'
}, },
series: [ series: [{
{
name: '', name: '',
type: 'pie', type: 'pie',
radius: [40, 130], radius: [70, 130],
center: ['50%', '50%'], center: ['50%', '50%'],
// roseType: 'area', // roseType: 'area',
itemStyle: { itemStyle: {
@ -48,15 +52,22 @@ export default {
}, },
avoidLabelOverlap: false, avoidLabelOverlap: false,
labelLine: { labelLine: {
show: false show: true,
length: 50
}, },
label: { label: {
normal: { normal: {
position: 'inner',
show: true, show: true,
formatter: '{d}%', formatter: '{title|{b}}\n{d}%',
fontSize: 24, fontSize: 24,
color: '#FFFFFF' color: '#FFFFFF',
rich: {
title: {
fontSize: 12,
height: 25,
},
}
} }
}, },
emphasis: { emphasis: {
@ -67,111 +78,105 @@ export default {
} }
}, },
data: [] data: []
} }]
] },
}, pieInitState: false,
pieInitState: false, pieData: [],
pieData: [], info: []
};
info: []
};
},
components: {
screenEchartsFrame
},
mounted() {
this.init();
},
watch: {
currentTab() {
this.setPieData();
}, },
orgId() { components: {
screenEchartsFrame
},
mounted() {
this.init(); this.init();
}
},
methods: {
async init() {
await this.getInfo();
this.getPie();
}, },
watch: {
// currentTab() {
async getInfo() { this.setPieData();
let url = 'common_demand_response'; },
this.$refs.pieChart.showLoading(); orgId() {
const { data, code, msg } = await requestPostBi( this.init();
url, }
{ },
methods: {
async init() {
await this.getInfo();
this.getPie();
},
//
async getInfo() {
let url = 'common_demand_response';
this.$refs.pieChart.showLoading();
const {
data,
code,
msg
} = await requestPostBi(url, {
queryParam: { queryParam: {
org_id: this.orgId, org_id: this.orgId,
start_date: this.searchDate[0], start_date: this.searchDate[0],
end_date: this.searchDate[1] end_date: this.searchDate[1]
} }
}, }, {
{
// mockId: 69366649, // mockId: 69366649,
});
this.$refs.pieChart.hideLoading();
if (code === 0) {
if (data && Array.isArray(data) && data.length > 0) {
this.info = data;
}
} else {
this.$message.error(msg);
} }
); },
this.$refs.pieChart.hideLoading(); selItem(selItem, selIndex) {
if (code === 0) { this.tabList.forEach((element, index) => {
if (data && Array.isArray(data) && data.length > 0) { if (index === selIndex) {
this.info = data; element.sel = true;
} } else {
} else { element.sel = false;
this.$message.error(msg); }
} });
}, },
selItem(selItem, selIndex) { pieInitOk() {
this.tabList.forEach((element, index) => { this.pieInitState = true;
if (index === selIndex) { },
element.sel = true; getPie() {
if (this.pieInitState) {
console.log('d');
this.setPieData();
} else { } else {
element.sel = false; setTimeout(() => {
this.getPie();
}, 500);
} }
}); },
}, setPieData() {
pieInitOk() { let data = [...this.info];
this.pieInitState = true; data = JSON.parse(JSON.stringify(data).replace(/parent_type_name/g, 'name'));
}, data = JSON.parse(JSON.stringify(data).replace(/common_demand_num/g, 'value'));
getPie() { this.pieData = data;
if (this.pieInitState) { this.iniPieChart();
console.log('d'); },
this.setPieData(); //
} else { async iniPieChart() {
setTimeout(() => { this.$refs.pieChart.clear();
this.getPie(); // pieChart
}, 500); this.pieOption.series[0].name = this.currentTab;
this.pieOption.series[0].data = this.pieData;
this.$refs.pieChart.setOption(this.pieOption);
} }
},
setPieData() {
let data = [...this.info];
data = JSON.parse(JSON.stringify(data).replace(/parent_type_name/g, 'name'));
data = JSON.parse(JSON.stringify(data).replace(/common_demand_num/g, 'value'));
this.pieData = data;
this.iniPieChart();
},
//
async iniPieChart() {
this.$refs.pieChart.clear();
// pieChart
this.pieOption.series[0].name = this.currentTab;
this.pieOption.series[0].data = this.pieData;
this.$refs.pieChart.setOption(this.pieOption);
} }
} };
};
</script> </script>
<style lang="scss" src="@/assets/scss/dataBoard/renfang/index.scss" scoped></style> <style lang="scss" src="@/assets/scss/dataBoard/renfang/index.scss" scoped></style>
<style scoped lang="scss"> <style scoped lang="scss">
/deep/.pieMain3 { /deep/.pieMain3 {
.legend { .legend {
.legend-row { .legend-row {
margin-top: 10px !important; margin-top: 10px !important;
}
} }
} }
} </style>
</style>

194
src/views/dataBoard/sida/cpts/fw03zr.vue

@ -15,14 +15,15 @@
</el-col> </el-col>
</el-row> </el-row>
<div class="tablist"> <div class="tablist">
<div v-for="item in tabList" :key="item" :class="['item', { 'item-sel': currentTab == item }]" @click="changTab(item)">{{ item }}</div> <div v-for="item in tabList" :key="item" :class="['item', { 'item-sel': currentTab == item }]"
@click="changTab(item)">{{ item }}</div>
</div> </div>
<div> <div>
<div class="linecharts" v-if="resiCategoryData.length > 0"> <div class="linecharts" v-if="resiCategoryData.length > 0">
<div class="item" :key="index" v-for="(item, index) in resiCategoryData"> <div class="item" :key="index" v-for="(item, index) in resiCategoryData">
<div>{{ ('0' + (index + 1)).substr(-2) }}.</div> <div>{{ ('0' + (index + 1)).substr(-2) }}.</div>
<div class="item-name">{{ item.name }}</div> <div class="item-name">{{ item.name }}</div>
<div class="item-progress"><b :style="{ width: + '0%' }"></b></div> <div class="item-progress"><b :style="{ 'width': item.per }"></b></div>
<div class="item-count"> <div class="item-count">
<b>{{ item.count }}</b> <b>{{ item.count }}</b>
</div> </div>
@ -40,111 +41,114 @@
</div> </div>
</template> </template>
<script> <script>
import screenEchartsFrame from '@/views/dataBoard/cpts/screen-echarts-frame/index'; import screenEchartsFrame from '@/views/dataBoard/cpts/screen-echarts-frame/index';
import { requestPostBi } from '@/js/dai/request-bipass'; import {
export default { requestPostBi
props: { } from '@/js/dai/request-bipass';
orgId: { export default {
type: String, props: {
default: '' orgId: {
type: String,
default: ''
},
searchDate: Array
}, },
searchDate: Array data() {
}, return {
data() { lineData1: [],
return { lineData2: [],
lineData1: [], resiCategoryData: [],
lineData2: [], showNoData: false,
resiCategoryData: [], timer: null,
showNoData: false, pieChart: '',
timer: null, pieOption: {},
pieChart: '', pieInitState: false,
pieOption: {}, pieData: [],
pieInitState: false, tabList: ['服务次数排名', '服务人数排名'],
pieData: [], currentTab: '服务次数排名',
tabList: ['服务次数排名', '服务人数排名'], info: {}
currentTab: '服务次数排名', };
info: {}
};
},
components: {
screenEchartsFrame
},
mounted() {
this.init();
},
watch: {},
methods: {
changTab(item) {
this.currentTab=item
if (item == '服务次数排名') {
this.resiCategoryData = [...this.lineData1];
} else {
this.resiCategoryData = [...this.lineData2];
}
}, },
components: {
async init() { screenEchartsFrame
this.getResiCategoryData();
}, },
handleClickItem(item) { mounted() {
// const { type, name } = item; this.init();
// this.$router.push({
// path: '/dataBoard/renfang/resi-analyze',
// query: {
// org_id: this.orgId,
// type,
// type_category: this.currentTab,
// type_name: name
// }
// });
}, },
selItem(selItem, selIndex) { watch: {},
this.tabList.forEach((element, index) => { methods: {
if (index === selIndex) { changTab(item) {
element.sel = true; this.currentTab = item
if (item == '服务次数排名') {
this.resiCategoryData = [...this.lineData1];
this.total = this.total1
} else { } else {
element.sel = false; this.resiCategoryData = [...this.lineData2];
this.total = this.total2
} }
}); },
}, async init() {
async getResiCategoryData() { this.getResiCategoryData();
let url = 'service_search_person'; },
handleClickItem(item) {
const { data, code, msg } = await requestPostBi( // const { type, name } = item;
url, // this.$router.push({
{ // path: '/dataBoard/renfang/resi-analyze',
// query: {
// org_id: this.orgId,
// type,
// type_category: this.currentTab,
// type_name: name
// }
// });
},
selItem(selItem, selIndex) {
this.tabList.forEach((element, index) => {
if (index === selIndex) {
element.sel = true;
} else {
element.sel = false;
}
});
},
async getResiCategoryData() {
let url = 'service_search_person';
const {
data,
code,
msg
} = await requestPostBi(url, {
queryParam: { queryParam: {
org_id: this.orgId, org_id: this.orgId,
start_date: this.searchDate[0], start_date: this.searchDate[0],
end_date: this.searchDate[1] end_date: this.searchDate[1]
} }
}, }, {
{
// mockId: 60031937, // mockId: 60031937,
}
);
if (code === 0) {
this.info = data[0];
console.log(this.info);
this.lineData1 = this.info.child_service_num.map(item => {
return {
name: item.common_service_type_name,
count: item.service_num
};
});
console.log(this.lineData1);
this.lineData2 = this.info.child_service_person_num.map(item => {
return {
name: item.common_service_type_name,
count: item.service_person_num
};
}); });
this.resiCategoryData = [...this.lineData1]; if (code === 0) {
} else { this.info = data[0];
this.$message.error(msg); this.lineData1 = this.info.child_service_num.map(item => {
return {
name: item.common_service_type_name,
count: item.service_num,
per: (item.service_num / this.info.service_total * 100).toFixed(2) + '%'
};
});
this.lineData2 = this.info.child_service_person_num.map(item => {
return {
name: item.common_service_type_name,
count: item.service_person_num,
per: (item.service_person_num / this.info.service_person_total * 100).toFixed(2) + '%'
};
});
this.resiCategoryData = [...this.lineData1];
console.log(this.resiCategoryData)
} else {
this.$message.error(msg);
}
} }
} }
} };
};
</script> </script>
<style lang="scss" src="@/assets/scss/dataBoard/renfang/index.scss" scoped></style> <style lang="scss" src="@/assets/scss/dataBoard/renfang/index.scss" scoped></style>

2
src/views/dataBoard/sida/cpts/fwBarOption01.js

@ -53,7 +53,7 @@ export function pieOption() {
}], }],
yAxis: [{ yAxis: [{
type: 'value', type: 'value',
max: 1000,
splitNumber: 5, splitNumber: 5,
splitLine: { splitLine: {
show: true, show: true,

2
src/views/dataBoard/sida/cpts/fwBarOption04.js

@ -53,7 +53,7 @@ export function pieOption() {
}], }],
yAxis: [{ yAxis: [{
type: 'value', type: 'value',
max: 1000,
splitNumber: 5, splitNumber: 5,
splitLine: { splitLine: {
show: true, show: true,

2
src/views/dataBoard/sida/cpts/fwBarOption05.js

@ -53,7 +53,7 @@ export function pieOption() {
}], }],
yAxis: [{ yAxis: [{
type: 'value', type: 'value',
max: 1000,
splitNumber: 5, splitNumber: 5,
splitLine: { splitLine: {
show: true, show: true,

1
src/views/modules/shequzhili/tuceng/anquan/anquanxuncha/addForm.vue

@ -341,6 +341,7 @@ export default {
if (code === 0) { if (code === 0) {
this.$message.success('操作成功'); this.$message.success('操作成功');
this.detailIdcopy=data.enterpriseId; this.detailIdcopy=data.enterpriseId;
// this.handleCancle(); // this.handleCancle();
// // this.resetData(); // // this.resetData();
// this.$emit('handleComfirm'); // this.$emit('handleComfirm');

8
src/views/modules/shequzhili/tuceng/anquan/anquanxuncha/record.vue

@ -119,10 +119,11 @@
<el-button @click="handleChange(scope.row, 'cancle')" type="text" size="small" class="btn-color-edit">取消</el-button> <el-button @click="handleChange(scope.row, 'cancle')" type="text" size="small" class="btn-color-edit">取消</el-button>
</template> </template>
<template v-else> <template v-else>
<!-- v-if="formType == 'edit'" -->
<el-button @click="handleChange(scope.row, 'edit')" type="text" size="small" :disabled="disabled" class="btn-color-edit"> <el-button @click="handleChange(scope.row, 'edit')" type="text" size="small" :disabled="disabled" class="btn-color-edit">
修改 修改
</el-button> </el-button>
<el-popconfirm v-if="formType == 'edit'" title="删除之后无法恢复,确认删除?" @onConfirm="del(scope.row)" @confirm="del(scope.row)"> <el-popconfirm title="删除之后无法恢复,确认删除?" @onConfirm="del(scope.row)" @confirm="del(scope.row)">
<el-button slot="reference" type="text" size="small" class="btn-color-del" style="margin-left: 10px">删除</el-button> <el-button slot="reference" type="text" size="small" class="btn-color-del" style="margin-left: 10px">删除</el-button>
</el-popconfirm> </el-popconfirm>
</template> </template>
@ -202,6 +203,7 @@ export default {
watch: { watch: {
id: { id: {
handler(val) { handler(val) {
console.log("ddddddddddddd",val)
if (val.length > 0) { if (val.length > 0) {
this.btnDisabled = false; this.btnDisabled = false;
// this.getList(); // this.getList();
@ -343,10 +345,12 @@ export default {
}, },
async save(row) { async save(row) {
const params = { const params = {
...row,
enterpriseId: this.id, enterpriseId: this.id,
...row
}; };
console.log("params",params)
const url = `/actual/base/enterprise/addorupdate-patrol`; const url = `/actual/base/enterprise/addorupdate-patrol`;
const { data, code, msg } = await requestPost(url, params); const { data, code, msg } = await requestPost(url, params);
if (code === 0) { if (code === 0) {

887
src/views/modules/shequzhili/tuceng/anquan/shebei/record.vue

@ -1,455 +1,432 @@
<template> <template>
<div class="m-record"> <div class="m-record">
<h3>检查记录</h3> <h3>检查记录</h3>
<div> <div>
<!-- <div class="u-table-btn1 mt10" v-if="formType != 'view'"> <!-- <div class="u-table-btn1 mt10" v-if="formType != 'view'">
<el-button size="small" class="diy-button--blue" :disabled="btnDisabled || disabled" @click="handleAdd">新增</el-button> <el-button size="small" class="diy-button--blue" :disabled="btnDisabled || disabled" @click="handleAdd">新增</el-button>
</div> --> </div> -->
<div class="m-table-item"> <div class="m-table-item">
<el-table :data="tableData" class="resi-table" row-key="id" border style="width: 100%"> <el-table :data="tableData" class="resi-table" row-key="id" border style="width: 100%">
<el-table-column label="序号" type="index" align="center" width="50"></el-table-column> <el-table-column label="序号" type="index" align="center" width="50"></el-table-column>
<el-table-column prop="inspectTime" label="检查时间" align="center" width="200px">
<el-table-column prop="inspectTime" label="检查时间" align="center" width="200px"> <template slot-scope="scope">
<template slot-scope="scope"> <el-date-picker v-if="scope.row.isEdit" v-model="scope.row.inspectTime" type="date"
<el-date-picker class="input-width" value-format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>
v-if="scope.row.isEdit" <div v-else class="div-content">{{ scope.row.inspectTime }}</div>
v-model="scope.row.inspectTime" </template>
type="date" </el-table-column>
class="input-width" <el-table-column prop="inspectStaffId" label="检查人员" align="center" width="200px">
value-format="yyyy-MM-dd" <template slot-scope="scope">
placeholder="选择日期" <el-select v-if="scope.row.isEdit" v-model="scope.row.inspectStaffId" placeholder="请选择"
></el-date-picker> class="input-width" @change="handleChangeStaff(scope.row)" clearable>
<div v-else class="div-content">{{ scope.row.inspectTime }}</div> <el-option v-for="subItem in optionStaff" :key="subItem.value" :label="subItem.label"
</template> :value="subItem.value"></el-option>
</el-table-column> </el-select>
<div v-else class="div-content">{{ scope.row.inspectStaffName }}</div>
<el-table-column prop="inspectStaffId" label="检查人员" align="center" width="200px"> </template>
<template slot-scope="scope"> </el-table-column>
<el-select <el-table-column prop="inspectStaffMobile" label="联系电话" align="center" width="200px">
v-if="scope.row.isEdit" <template slot-scope="scope">
v-model="scope.row.inspectStaffId" <el-input v-if="scope.row.isEdit" type="number" v-model="scope.row.inspectStaffMobile"
placeholder="请选择" placeholder="请输入" class="input-width" clearable disabled></el-input>
class="input-width" <div v-else class="div-content">{{ scope.row.inspectStaffMobile }}</div>
@change="handleChangeStaff(scope.row)" </template>
clearable </el-table-column>
> <el-table-column prop="inspectResult" label="检查结果" align="center">
<el-option v-for="subItem in optionStaff" :key="subItem.value" :label="subItem.label" :value="subItem.value"></el-option> <template slot-scope="scope">
</el-select> <el-select v-if="scope.row.isEdit" v-model="scope.row.inspectResult" placeholder="请选择"
<div v-else class="div-content">{{ scope.row.inspectStaffName }}</div> class="input-width" size="small" clearable>
</template> <el-option v-for="subItem in optionResult" :key="subItem.value" :label="subItem.label"
</el-table-column> :value="subItem.value"></el-option>
</el-select>
<el-table-column prop="inspectStaffMobile" label="联系电话" align="center" width="200px"> <div v-else class="div-content">{{ scope.row.inspectResult == 1 ? '正常' : '异常' }}</div>
<template slot-scope="scope"> </template>
<el-input </el-table-column>
v-if="scope.row.isEdit" <!-- <el-table-column
type="number" prop="detailed"
v-model="scope.row.inspectStaffMobile" label="隐患明细"
placeholder="请输入" align="center"
class="input-width" width="200px"
clearable >
disabled <template slot-scope="scope">
></el-input> <el-input
<div v-else class="div-content">{{ scope.row.inspectStaffMobile }}</div> v-if="scope.row.isEdit"
</template> type="text"
</el-table-column> v-model="scope.row.detailed"
placeholder="请输入"
<el-table-column prop="inspectResult" label="检查结果" align="center"> class="input-width"
<template slot-scope="scope"> maxlength="500"
<el-select v-if="scope.row.isEdit" v-model="scope.row.inspectResult" placeholder="请选择" class="input-width" size="small" clearable> clearable
<el-option v-for="subItem in optionResult" :key="subItem.value" :label="subItem.label" :value="subItem.value"></el-option> ></el-input>
</el-select> <div v-else class="div-content">
<div v-else class="div-content">{{ scope.row.inspectResult == 1 ? '正常' : '异常' }}</div> {{ scope.row.detailed }}
</template> </div>
</el-table-column> </template>
</el-table-column> -->
<!-- <el-table-column <el-table-column prop="imgList" label="图片列表" align="center" width="150px">
prop="detailed" <template slot-scope="scope">
label="隐患明细" <div v-if="scope.row.isEdit">
align="center" <el-upload :disabled="scope.row.imgList.length == 3" :headers="$getElUploadHeaders()"
width="200px" class="avatar-uploader" :action="uploadUrl" :data="{ customerId: customerId }"
> :show-file-list="true" :limit="3" :file-list="scope.row.imgShowList"
<template slot-scope="scope"> :on-success="res => handleImgSuccess(res, scope.row)"
<el-input :on-remove="res => handleImgRemove(res, scope.row)" list-type="picture"
v-if="scope.row.isEdit" :before-upload="beforeImgUpload">
type="text" <div v-if="scope.row.imgList.length != 3"><i
v-model="scope.row.detailed" class="el-icon-plus avatar-uploader-icon"></i> 最多三张图片</div>
placeholder="请输入" </el-upload>
class="input-width" </div>
maxlength="500" <div v-else class="div-content">
clearable <el-image v-if="scope.row.imgList.length > 0" style="width: 100px; height: 50px"
></el-input> :src="scope.row.imgList[0]" fit="cover"
<div v-else class="div-content"> :preview-src-list="scope.row.imgList"></el-image>
{{ scope.row.detailed }} </div>
</div> </template>
</template> </el-table-column>
</el-table-column> --> <el-table-column prop="nextInspectTime" label="拟复查时间" align="center" width="200px">
<template slot-scope="scope">
<el-table-column prop="imgList" label="图片列表" align="center" width="150px"> <el-date-picker v-if="scope.row.isEdit" v-model="scope.row.nextInspectTime" type="date"
<template slot-scope="scope"> class="input-width" value-format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>
<div v-if="scope.row.isEdit"> <div v-else class="div-content">{{ scope.row.nextInspectTime }}</div>
<el-upload </template>
:disabled="scope.row.imgList.length == 3" </el-table-column>
:headers="$getElUploadHeaders()" <el-table-column v-if="!disabled" fixed="right" label="操作" align="center" width="120">
class="avatar-uploader" <template slot-scope="scope">
:action="uploadUrl" <template v-if="scope.row.isEdit">
:data="{ customerId: customerId }" <el-button @click="handleEdit(scope.row)" type="text" size="small"
:show-file-list="true" class="btn-color-edit">保存</el-button>
:limit="3" <el-button @click="handleChange(scope.row, 'cancle')" type="text" size="small"
:file-list="scope.row.imgShowList" class="btn-color-edit">取消</el-button>
:on-success="res => handleImgSuccess(res, scope.row)" </template>
:on-remove="res => handleImgRemove(res, scope.row)" <template v-else>
list-type="picture" <!-- v-if="formType == 'edit'" -->
:before-upload="beforeImgUpload" <el-button @click="handleChange(scope.row, 'edit')"
> type="text" size="small" :disabled="disabled" class="btn-color-edit"> 修改
<div v-if="scope.row.imgList.length != 3"><i class="el-icon-plus avatar-uploader-icon"></i> 最多三张图片</div> </el-button>
</el-upload> <el-popconfirm title="删除之后无法恢复,确认删除?"
</div> @onConfirm="del(scope.row)" @confirm="del(scope.row)">
<el-button slot="reference" type="text" size="small" class="btn-color-del"
<div v-else class="div-content"> style="margin-left: 10px">删除</el-button>
<el-image </el-popconfirm>
v-if="scope.row.imgList.length > 0" </template>
style="width: 100px; height: 50px" </template>
:src="scope.row.imgList[0]" </el-table-column>
fit="cover" </el-table>
:preview-src-list="scope.row.imgList" </div>
></el-image> </div>
</div> </div>
</template> </template>
</el-table-column> <script>
import {
<el-table-column prop="nextInspectTime" label="拟复查时间" align="center" width="200px"> requestPost,
<template slot-scope="scope"> requestGet
<el-date-picker } from '@/js/dai/request';
v-if="scope.row.isEdit" export default {
v-model="scope.row.nextInspectTime" props: {
type="date" id: {
class="input-width" type: String,
value-format="yyyy-MM-dd" default: ''
placeholder="选择日期" },
></el-date-picker> info: {
<div v-else class="div-content">{{ scope.row.nextInspectTime }}</div> type: Object,
</template> default: () => ({})
</el-table-column> },
disabled: {
<el-table-column v-if="!disabled" fixed="right" label="操作" align="center" width="120"> type: Boolean,
<template slot-scope="scope"> default: false
<template v-if="scope.row.isEdit"> },
<el-button @click="handleEdit(scope.row)" type="text" size="small" class="btn-color-edit">保存</el-button> formType: {
<el-button @click="handleChange(scope.row, 'cancle')" type="text" size="small" class="btn-color-edit">取消</el-button> type: String,
</template> default: ''
<template v-else> },
<el-button v-if="formType == 'edit'" @click="handleChange(scope.row, 'edit')" type="text" size="small" :disabled="disabled" class="btn-color-edit"> source: {
修改 //manage visiual
</el-button> type: String,
<el-popconfirm v-if="formType == 'edit'" title="删除之后无法恢复,确认删除?" @onConfirm="del(scope.row)" @confirm="del(scope.row)"> default: 'manage'
<el-button slot="reference" type="text" size="small" class="btn-color-del" style="margin-left: 10px">删除</el-button> }
</el-popconfirm> },
</template> data() {
</template> return {
</el-table-column> uploadUrl: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2',
</el-table> customerId: localStorage.getItem('customerId'),
</div> btnDisabled: false,
</div> btnType: 'cancle',
</div> isEdit: false,
</template> tableData: [],
tempRow: {},
<script> optionResult: [{
import { requestPost, requestGet } from '@/js/dai/request'; label: '异常',
export default { value: '0'
props: { }, {
id: { label: '正常',
type: String, value: '1'
default: '' }],
}, optionStaff: [
info: { // {
type: Object, // label: "",
default: () => ({}) // value: "inspectStaffId",
}, // },
disabled: { ]
type: Boolean, };
default: false },
}, computed: {
formType: { allowOperate() {
type: String, const {
default: '' info: {
}, agencyId
source: { }
//manage visiual } = this;
type: String, return agencyId && agencyId == this.$store.state.user.agencyId;
default: 'manage' }
} },
}, watch: {
data() { id: {
return { handler(val) {
uploadUrl: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2', console.log('val------points', val);
customerId: localStorage.getItem('customerId'), if (val.length > 0) {
this.btnDisabled = false;
btnDisabled: false, // this.getList();
btnType: 'cancle', } else this.btnDisabled = true;
isEdit: false, },
tableData: [], immediate: true
tempRow: {}, }
},
optionResult: [ created() {
{ console.log('id', this.id);
label: '异常', this.getOptionStaff();
value: '0' if (this.id) {
}, this.getList();
{ } else {
label: '正常', this.handleAdd();
value: '1' }
} },
], methods: {
optionStaff: [ beforeImgUpload(file) {
// { console.log(file);
// label: "", const isLt1M = file.size / 1024 / 1024 < 10;
// value: "inspectStaffId", const srcType = file.type;
// }, const format = file.name.split('.').pop();
] if (!isLt1M) {
}; this.$message.error('上传文件大小不能超过 10MB!');
}, return false;
}
computed: { if (srcType.indexOf('image') == -1) {
allowOperate() { this.$message.error('仅限图片格式');
const { return false;
info: { agencyId } }
} = this; return true;
return agencyId && agencyId == this.$store.state.user.agencyId; },
} handleImgSuccess(res, row) {
}, console.log('handleImgSuccess', res);
watch: { if (res.code === 0 && res.msg === 'success') {
id: { row.imgList.push(res.data.url);
handler(val) { this.computeImgShowList(row);
console.log('val------points', val); } else {
if (val.length > 0) { this.$message.error(res.msg);
this.btnDisabled = false; }
// this.getList(); },
} else this.btnDisabled = true; computeImgShowList(row) {
}, row.imgShowList = row.imgList.map(url => {
immediate: true return {
} name: '',
}, url
};
created() { });
console.log('id', this.id); },
this.getOptionStaff(); handleImgRemove(file, row) {
if (this.id) { console.log('handleImgRemove', file);
this.getList(); let url = file.url || file.response.data.url;
} else { if (url) {
this.handleAdd(); row.imgList = row.imgList.filter(item => item !== url);
} this.computeImgShowList(row);
}, }
},
methods: { getRowClass({
beforeImgUpload(file) { rowIndex,
console.log(file); columnIndex
const isLt1M = file.size / 1024 / 1024 < 10; }) {
const srcType = file.type; if (rowIndex === 0) {
const format = file.name.split('.').pop(); return 'background: #2195fe; color: #fff;';
}
if (!isLt1M) { },
this.$message.error('上传文件大小不能超过 10MB!'); handleChange(row, type) {
return false; console.log('type----', type);
} if (type == 'cancle') {
if (srcType.indexOf('image') == -1) { row = {
this.$message.error('仅限图片格式'); ...this.tempRow
return false; };
} row.isEdit = false;
return true; if (this.btnType == 'add') this.tableData.pop();
}, this.getList();
console.log('row----', row);
handleImgSuccess(res, row) { } else {
console.log('handleImgSuccess', res); this.tempRow = {
if (res.code === 0 && res.msg === 'success') { ...row
row.imgList.push(res.data.url); };
this.computeImgShowList(row); row.isEdit = true;
} else { }
this.$message.error(res.msg); this.btnType = type;
} this.isEdit = !this.isEdit;
}, },
handleChangeStaff(row) {
computeImgShowList(row) { const {
row.imgShowList = row.imgList.map(url => { inspectStaffId
return { name: '', url }; } = row;
}); const {
}, optionStaff
} = this;
handleImgRemove(file, row) { let item = optionStaff.find(item => item.value == inspectStaffId);
console.log('handleImgRemove', file); if (item) {
let url = file.url || file.response.data.url; row.inspectStaffName = item.name;
if (url) { row.inspectStaffMobile = item.mobile;
row.imgList = row.imgList.filter(item => item !== url); }
this.computeImgShowList(row); },
} async getOptionStaff() {
}, let url = `/data/aggregator/org/staff-select-list/${this.$store.state.user.agencyId}`;
const {
getRowClass({ rowIndex, columnIndex }) { data,
if (rowIndex === 0) { code,
return 'background: #2195fe; color: #fff;'; msg
} } = await requestPost(url, {});
}, if (code === 0) {
this.optionStaff = data || [];
handleChange(row, type) { } else {
console.log('type----', type); this.$message.error('请求工作人员数据失败!');
if (type == 'cancle') { }
row = { ...this.tempRow }; },
row.isEdit = false; async handleEdit(row) {
if (this.btnType == 'add') this.tableData.pop(); // if (row.result == '0' && row.reviewTime == '') {
this.getList(); // this.$message.error('');
console.log('row----', row); // } else {
} else { // if (this.id) {
this.tempRow = { ...row }; // console.log('id');
row.isEdit = true; // if (this.btnType == 'add') this.save(row);
} // else this.edit(row);
this.btnType = type; // } else {
this.isEdit = !this.isEdit; // this.$message.error('');
}, // }
// }
handleChangeStaff(row) { if (this.id) {
const { inspectStaffId } = row; console.log('有id');
const { optionStaff } = this; if (this.btnType == 'add') this.save(row);
let item = optionStaff.find(item => item.value == inspectStaffId); else this.edit(row);
if (item) { } else {
row.inspectStaffName = item.name; this.$message.error('请先保存上方信息');
row.inspectStaffMobile = item.mobile; }
} },
}, handleAdd() {
this.btnType = 'add';
async getOptionStaff() { this.isEdit = true;
let url = `/data/aggregator/org/staff-select-list/${this.$store.state.user.agencyId}`; const item = {
const { data, code, msg } = await requestPost(url, {}); isEdit: true,
// id: this.id,
if (code === 0) { inspectTime: '',
this.optionStaff = data || []; inspectStaffId: '',
} else { inspectStaffName: '',
this.$message.error('请求工作人员数据失败!'); inspectStaffMobile: '',
} inspectResult: '',
}, imgList: [],
nextInspectTime: ''
async handleEdit(row) { };
// if (row.result == '0' && row.reviewTime == '') { this.computeImgShowList(item);
// this.$message.error(''); if (!this.disabled) {
// } else { this.tableData.push(item);
// if (this.id) { }
// console.log('id'); },
// if (this.btnType == 'add') this.save(row); async save(row) {
// else this.edit(row); console.log(row, this.id);
// } else { const params = {
// this.$message.error(''); ...row,
// } equipmentId: this.id
// } };
if (this.id) { const url = `/actual/base/safetyEquipmentInspectRecord/save`;
console.log('有id'); const {
if (this.btnType == 'add') this.save(row); data,
else this.edit(row); code,
} else { msg
this.$message.error('请先保存上方信息'); } = await requestPost(url, params);
} if (code === 0) {
}, this.$message.success('保存成功');
row.isEdit = false;
handleAdd() { this.isEdit = false;
this.btnType = 'add'; this.btnType = 'cancle';
this.isEdit = true; this.getList();
} else {
const item = { this.$message.error(msg);
isEdit: true, }
// id: this.id, },
inspectTime: '', async edit(row) {
inspectStaffId: '', console.log(row, this.id);
inspectStaffName: '', const params = {
inspectStaffMobile: '', ...row
inspectResult: '', };
imgList: [], const url = `/actual/base/safetyEquipmentInspectRecord/update`;
nextInspectTime: '' const {
}; data,
this.computeImgShowList(item); code,
if (!this.disabled) { this.tableData.push(item); } msg
}, } = await requestPost(url, params);
if (code === 0) {
async save(row) { this.$message.success('保存成功');
console.log(row, this.id); row.isEdit = false;
const params = { this.isEdit = false;
equipmentId: this.id, this.getList();
...row } else {
}; this.$message.error(msg);
const url = `/actual/base/safetyEquipmentInspectRecord/save`; }
const { data, code, msg } = await requestPost(url, params); },
if (code === 0) { async del(row) {
this.$message.success('保存成功'); let arr = [row.id];
row.isEdit = false; const url = `/actual/base/safetyEquipmentInspectRecord/delete`;
this.isEdit = false; const {
this.btnType = 'cancle'; data,
this.getList(); code,
} else { msg
this.$message.error(msg); } = await requestPost(url, arr);
} if (code === 0) {
}, this.$message.success('删除成功');
this.getList();
async edit(row) { } else {
console.log(row, this.id); this.$message.error(msg);
const params = { }
...row },
}; async getList() {
const url = `/actual/base/safetyEquipmentInspectRecord/update`; const params = {
const { data, code, msg } = await requestPost(url, params); equipmentId: this.id,
if (code === 0) { pageNo: 1,
this.$message.success('保存成功'); pageSize: 10000
row.isEdit = false; };
this.isEdit = false; const url = `/actual/base/safetyEquipmentInspectRecord/page`;
this.getList(); const {
} else { data,
this.$message.error(msg); code,
} msg
}, } = await requestPost(url, params);
if (code === 0) {
async del(row) { this.tableData = data.list.map(item => {
let arr = [row.id]; this.computeImgShowList(item);
const url = `/actual/base/safetyEquipmentInspectRecord/delete`; return {
const { data, code, msg } = await requestPost(url, arr); ...item,
isEdit: false
if (code === 0) { };
this.$message.success('删除成功'); });
this.getList(); this.handleAdd();
} else { } else {
this.$message.error(msg); this.$message.error(msg);
} }
}, }
}
async getList() { };
const params = { </script>
equipmentId: this.id, <style lang="scss" scoped>
pageNo: 1, @import '@/assets/scss/buttonstyle.scss';
pageSize: 10000 @import '@/assets/scss/modules/management/list-main.scss';
};
const url = `/actual/base/safetyEquipmentInspectRecord/page`; .mt10 {
const { data, code, msg } = await requestPost(url, params); margin-bottom: 10px;
}
if (code === 0) {
this.tableData = data.list.map(item => { .input-width {
this.computeImgShowList(item); width: 170px;
return { }
...item, </style>
isEdit: false
};
});
this.handleAdd();
} else {
this.$message.error(msg);
}
}
}
};
</script>
<style lang="scss" scoped>
@import '@/assets/scss/buttonstyle.scss';
@import '@/assets/scss/modules/management/list-main.scss';
.mt10 {
margin-bottom: 10px;
}
.input-width {
width: 170px;
}
</style>

8
src/views/modules/shequzhili/tuceng/anquan/yinhuan/record.vue

@ -54,11 +54,12 @@
<el-button @click="handleEdit(scope.row)" type="text" size="small" class="btn-color-edit">保存</el-button> <el-button @click="handleEdit(scope.row)" type="text" size="small" class="btn-color-edit">保存</el-button>
<el-button @click="handleChange(scope.row, 'cancle')" type="text" size="small" class="btn-color-edit">取消</el-button> <el-button @click="handleChange(scope.row, 'cancle')" type="text" size="small" class="btn-color-edit">取消</el-button>
</template> </template>
<!-- v-if="formType == 'edit'" -->
<template v-else> <template v-else>
<el-button v-if="formType == 'edit'" @click="handleChange(scope.row, 'edit')" type="text" size="small" :disabled="disabled" class="btn-color-edit"> <el-button @click="handleChange(scope.row, 'edit')" type="text" size="small" :disabled="disabled" class="btn-color-edit">
修改 修改
</el-button> </el-button>
<el-popconfirm v-if="formType == 'edit'" title="删除之后无法恢复,确认删除?" @onConfirm="del(scope.row)" @confirm="del(scope.row)"> <el-popconfirm title="删除之后无法恢复,确认删除?" @onConfirm="del(scope.row)" @confirm="del(scope.row)">
<el-button slot="reference" type="text" size="small" class="btn-color-del" style="margin-left: 10px">删除</el-button> <el-button slot="reference" type="text" size="small" class="btn-color-del" style="margin-left: 10px">删除</el-button>
</el-popconfirm> </el-popconfirm>
</template> </template>
@ -273,7 +274,8 @@ export default {
async save(row) { async save(row) {
const params = { const params = {
...row ...row,
hiddenDangerRecordId: this.id,
}; };
const url = `/actual/base/hiddenDangerRecord/saveProcess`; const url = `/actual/base/hiddenDangerRecord/saveProcess`;
const { data, code, msg } = await requestPost(url, params); const { data, code, msg } = await requestPost(url, params);

9
src/views/modules/shequzhili/tuceng/yingji/wuzi/record.vue

@ -138,10 +138,11 @@
<el-button @click="handleChange(scope.row, 'cancle')" type="text" size="small" class="btn-color-edit">取消</el-button> <el-button @click="handleChange(scope.row, 'cancle')" type="text" size="small" class="btn-color-edit">取消</el-button>
</template> </template>
<template v-else> <template v-else>
<el-button v-if="formType == 'edit'" @click="handleChange(scope.row, 'edit')" type="text" size="small" :disabled="disabled" class="btn-color-edit"> <!-- v-if="formType == 'edit'" -->
<el-button @click="handleChange(scope.row, 'edit')" type="text" size="small" :disabled="disabled" class="btn-color-edit">
修改 修改
</el-button> </el-button>
<el-popconfirm v-if="formType == 'edit'" title="删除之后无法恢复,确认删除?" @onConfirm="del(scope.row)" @confirm="del(scope.row)"> <el-popconfirm title="删除之后无法恢复,确认删除?" @onConfirm="del(scope.row)" @confirm="del(scope.row)">
<el-button slot="reference" type="text" size="small" class="btn-color-del" style="margin-left: 10px">删除</el-button> <el-button slot="reference" type="text" size="small" class="btn-color-del" style="margin-left: 10px">删除</el-button>
</el-popconfirm> </el-popconfirm>
</template> </template>
@ -369,8 +370,8 @@ export default {
async save(row) { async save(row) {
const params = { const params = {
equipmentId: this.id, ...row,
...row equipmentId: this.id
}; };
const url = `/actual/base/emergencyEquipment/inspect-save`; const url = `/actual/base/emergencyEquipment/inspect-save`;
const { data, code, msg } = await requestPost(url, params); const { data, code, msg } = await requestPost(url, params);

10
src/views/modules/shequzhili/tuceng/zhonghe/shebei/record.vue

@ -139,10 +139,11 @@
<el-button @click="handleChange(scope.row, 'cancle')" type="text" size="small" class="btn-color-edit">取消</el-button> <el-button @click="handleChange(scope.row, 'cancle')" type="text" size="small" class="btn-color-edit">取消</el-button>
</template> </template>
<template v-else> <template v-else>
<el-button v-if="formType == 'edit'" @click="handleChange(scope.row, 'edit')" type="text" size="small" :disabled="disabled" class="btn-color-edit"> <!-- v-if="formType == 'edit'" -->
<el-button @click="handleChange(scope.row, 'edit')" type="text" size="small" :disabled="disabled" class="btn-color-edit">
修改 修改
</el-button> </el-button>
<el-popconfirm v-if="formType == 'edit'" title="删除之后无法恢复,确认删除?" @onConfirm="del(scope.row)" @confirm="del(scope.row)"> <el-popconfirm title="删除之后无法恢复,确认删除?" @onConfirm="del(scope.row)" @confirm="del(scope.row)">
<el-button slot="reference" type="text" size="small" class="btn-color-del" style="margin-left: 10px">删除</el-button> <el-button slot="reference" type="text" size="small" class="btn-color-del" style="margin-left: 10px">删除</el-button>
</el-popconfirm> </el-popconfirm>
</template> </template>
@ -363,8 +364,9 @@ export default {
async save(row) { async save(row) {
console.log(row, this.id); console.log(row, this.id);
const params = { const params = {
equipmentId: this.id,
...row ...row,
equipmentId: this.id
}; };
const url = `/actual/base/monitoringEquipmentInspectRecord/save`; const url = `/actual/base/monitoringEquipmentInspectRecord/save`;
const { data, code, msg } = await requestPost(url, params); const { data, code, msg } = await requestPost(url, params);

Loading…
Cancel
Save