|
|
|
@ -8,25 +8,25 @@ |
|
|
|
<div class="m-table-item"> |
|
|
|
<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 prop="inspectTime" label="检查时间" align="center" width="200px"> |
|
|
|
<el-table-column prop="patrolTime" label="检查时间" align="center" width="200px"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-date-picker |
|
|
|
v-if="scope.row.isEdit" |
|
|
|
v-model="scope.row.inspectTime" |
|
|
|
v-model="scope.row.patrolTime" |
|
|
|
type="date" |
|
|
|
class="input-width" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
placeholder="选择日期" |
|
|
|
></el-date-picker> |
|
|
|
<div v-else class="div-content">{{ scope.row.inspectTime }}</div> |
|
|
|
<div v-else class="div-content">{{ scope.row.patrolTime }}</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="inspectStaffId" label="检查人员" align="center" width="200px"> |
|
|
|
<el-table-column prop="staffId" label="检查人员" align="center" width="200px"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-select |
|
|
|
v-if="scope.row.isEdit" |
|
|
|
v-model="scope.row.inspectStaffId" |
|
|
|
v-model="scope.row.staffId" |
|
|
|
placeholder="请选择" |
|
|
|
class="input-width" |
|
|
|
@change="handleChangeStaff(scope.row)" |
|
|
|
@ -34,31 +34,23 @@ |
|
|
|
> |
|
|
|
<el-option v-for="subItem in optionStaff" :key="subItem.value" :label="subItem.label" :value="subItem.value"></el-option> |
|
|
|
</el-select> |
|
|
|
<div v-else class="div-content">{{ scope.row.inspectStaffName }}</div> |
|
|
|
<div v-else class="div-content">{{ scope.row.staffName }}</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="inspectStaffMobile" label="联系电话" align="center" width="200px"> |
|
|
|
<el-table-column prop="mobile" label="联系电话" align="center" width="200px"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input |
|
|
|
v-if="scope.row.isEdit" |
|
|
|
type="number" |
|
|
|
v-model="scope.row.inspectStaffMobile" |
|
|
|
placeholder="请输入" |
|
|
|
class="input-width" |
|
|
|
clearable |
|
|
|
disabled |
|
|
|
></el-input> |
|
|
|
<div v-else class="div-content">{{ scope.row.inspectStaffMobile }}</div> |
|
|
|
<el-input v-if="scope.row.isEdit" type="number" v-model="scope.row.mobile" placeholder="请输入" class="input-width" clearable disabled></el-input> |
|
|
|
<div v-else class="div-content">{{ scope.row.mobile }}</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="inspectResult" label="检查结果" align="center" width="200px"> |
|
|
|
<el-table-column prop="result" label="检查结果" align="center" width="200px"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-select v-if="scope.row.isEdit" v-model="scope.row.inspectResult" placeholder="请选择" class="input-width" size="small" clearable> |
|
|
|
<el-select v-if="scope.row.isEdit" v-model="scope.row.result" placeholder="请选择" class="input-width" size="small" clearable> |
|
|
|
<el-option v-for="subItem in optionResult" :key="subItem.value" :label="subItem.label" :value="subItem.value"></el-option> |
|
|
|
</el-select> |
|
|
|
<div v-else class="div-content">{{ scope.row.inspectResult == 1 ? '正常' : '异常' }}</div> |
|
|
|
<div v-else class="div-content">{{ scope.row.result == 1 ? '正常' : '异常' }}</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
@ -84,7 +76,7 @@ |
|
|
|
</template> |
|
|
|
</el-table-column> --> |
|
|
|
|
|
|
|
<el-table-column prop="imgList" label="图片列表" align="center" width="150px"> |
|
|
|
<el-table-column prop="imgList" label="图片列表" align="center" > |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div v-if="scope.row.isEdit"> |
|
|
|
<el-upload |
|
|
|
@ -94,7 +86,7 @@ |
|
|
|
:data="{ customerId: customerId }" |
|
|
|
:show-file-list="true" |
|
|
|
:limit="3" |
|
|
|
:file-list="scope.row.imgShowList" |
|
|
|
:file-list="scope.row.imgList" |
|
|
|
:on-success="res => handleImgSuccess(res, scope.row)" |
|
|
|
:on-remove="res => handleImgRemove(res, scope.row)" |
|
|
|
list-type="picture" |
|
|
|
@ -117,17 +109,17 @@ |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="nextInspectTime" label="拟复查时间" align="center" width="200px"> |
|
|
|
<el-table-column prop="reviewTime" label="拟复查时间" align="center" width="200px"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-date-picker |
|
|
|
v-if="scope.row.isEdit" |
|
|
|
v-model="scope.row.nextInspectTime" |
|
|
|
v-model="scope.row.reviewTime" |
|
|
|
type="date" |
|
|
|
class="input-width" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
placeholder="选择日期" |
|
|
|
></el-date-picker> |
|
|
|
<div v-else class="div-content">{{ scope.row.nextInspectTime }}</div> |
|
|
|
<div v-else class="div-content">{{ scope.row.reviewTime }}</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
@ -221,7 +213,6 @@ export default { |
|
|
|
watch: { |
|
|
|
id: { |
|
|
|
handler(val) { |
|
|
|
console.log('val------points', val); |
|
|
|
if (val.length > 0) { |
|
|
|
this.btnDisabled = false; |
|
|
|
this.getList(); |
|
|
|
@ -232,9 +223,7 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
created() { |
|
|
|
console.log('id', this.id); |
|
|
|
this.getOptionStaff(); |
|
|
|
this.getList(); |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
@ -256,7 +245,6 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
handleImgSuccess(res, row) { |
|
|
|
console.log('handleImgSuccess', res); |
|
|
|
if (res.code === 0 && res.msg === 'success') { |
|
|
|
row.imgList.push(res.data.url); |
|
|
|
this.computeImgShowList(row); |
|
|
|
@ -272,7 +260,6 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
handleImgRemove(file, row) { |
|
|
|
console.log('handleImgRemove', file); |
|
|
|
let url = file.url || file.response.data.url; |
|
|
|
if (url) { |
|
|
|
row.imgList = row.imgList.filter(item => item !== url); |
|
|
|
@ -287,13 +274,11 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
handleChange(row, type) { |
|
|
|
console.log('type----', type); |
|
|
|
if (type == 'cancle') { |
|
|
|
row = { ...this.tempRow }; |
|
|
|
row.isEdit = false; |
|
|
|
if (this.btnType == 'add') this.tableData.pop(); |
|
|
|
this.getList(); |
|
|
|
console.log('row----', row); |
|
|
|
} else { |
|
|
|
this.tempRow = { ...row }; |
|
|
|
row.isEdit = true; |
|
|
|
@ -303,12 +288,12 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
handleChangeStaff(row) { |
|
|
|
const { inspectStaffId } = row; |
|
|
|
const { staffId } = row; |
|
|
|
const { optionStaff } = this; |
|
|
|
let item = optionStaff.find(item => item.value == inspectStaffId); |
|
|
|
let item = optionStaff.find(item => item.value == staffId); |
|
|
|
if (item) { |
|
|
|
row.inspectStaffName = item.name; |
|
|
|
row.inspectStaffMobile = item.mobile; |
|
|
|
row.staffName = item.name; |
|
|
|
row.mobile = item.mobile; |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
@ -334,14 +319,14 @@ export default { |
|
|
|
|
|
|
|
const item = { |
|
|
|
isEdit: true, |
|
|
|
id: this.id, |
|
|
|
inspectTime: '', |
|
|
|
inspectStaffId: '', |
|
|
|
inspectStaffName: '', |
|
|
|
inspectStaffMobile: '', |
|
|
|
inspectResult: '', |
|
|
|
imgList: [], |
|
|
|
nextInspectTime: '' |
|
|
|
enterpriseId: this.id, |
|
|
|
patrolTime: '', |
|
|
|
staffId: '', |
|
|
|
staffName: '', |
|
|
|
mobile: '', |
|
|
|
result: '', |
|
|
|
reviewTime: '', |
|
|
|
imgList: [] |
|
|
|
}; |
|
|
|
this.computeImgShowList(item); |
|
|
|
this.tableData.push(item); |
|
|
|
@ -382,7 +367,7 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
async del(row) { |
|
|
|
const url = `/actual/base/enterprise/del-patrol/${this.id}`; |
|
|
|
const url = `/actual/base/enterprise/del-patrol/${row.patrolId}`; |
|
|
|
const { data, code, msg } = await requestPost(url); |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
@ -394,17 +379,11 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
async getList() { |
|
|
|
const url = `/actual/base/enterprise/patrollist/`; |
|
|
|
console.log('this.id', this.id); |
|
|
|
const params = { |
|
|
|
enterpriseId: this.id, |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 10000 |
|
|
|
}; |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
|
|
|
|
|
const url = `/actual/base/enterprise/patrollist/${this.id}`; |
|
|
|
console.log('getList---------------------------------------------------------------------------', url); |
|
|
|
const { data, code, msg } = await requestPost(url); |
|
|
|
if (code === 0) { |
|
|
|
console.log('data', data); |
|
|
|
this.tableData = data.list.map(item => { |
|
|
|
this.computeImgShowList(item); |
|
|
|
return { |
|
|
|
|