11 changed files with 679 additions and 683 deletions
@ -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> |
|
||||
Loading…
Reference in new issue