|
|
|
|
@ -1,40 +1,68 @@ |
|
|
|
|
<template> |
|
|
|
|
<div> |
|
|
|
|
<avue-crud :option="option" :table-loading="loading" :data="data" v-model="form" v-model:page="page" ref="crud" |
|
|
|
|
@row-update="rowUpdate" |
|
|
|
|
@row-del="rowDel" @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange" |
|
|
|
|
@current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"> |
|
|
|
|
<avue-crud |
|
|
|
|
:option="option" |
|
|
|
|
:table-loading="loading" |
|
|
|
|
:data="data" |
|
|
|
|
v-model="form" |
|
|
|
|
v-model:page="page" |
|
|
|
|
ref="crud" |
|
|
|
|
@row-update="rowUpdate" |
|
|
|
|
@row-del="handleDelete" |
|
|
|
|
@search-change="searchChange" |
|
|
|
|
@search-reset="searchReset" |
|
|
|
|
@selection-change="selectionChange" |
|
|
|
|
@current-change="currentChange" |
|
|
|
|
@size-change="sizeChange" |
|
|
|
|
@refresh-change="refreshChange" |
|
|
|
|
@on-load="onLoad" |
|
|
|
|
> |
|
|
|
|
<template #menu-left> |
|
|
|
|
<!-- <el-button type="danger" icon="el-icon-delete" @click="handleDelete">删 除 |
|
|
|
|
</el-button> --> |
|
|
|
|
<el-button type="primary" @click="moldAddFn(null, true)">新增</el-button> |
|
|
|
|
<el-button type="primary" icon="el-icon-plus" @click="moldAddFn(null, true)" |
|
|
|
|
>新增</el-button |
|
|
|
|
> |
|
|
|
|
<el-button type="danger" icon="el-icon-delete" @click="handleBatchDelete">删 除 </el-button> |
|
|
|
|
</template> |
|
|
|
|
<template #menu-right> |
|
|
|
|
<el-button type="primary" @click="handleImport">导入 </el-button> |
|
|
|
|
<el-button type="primary" @click="handleImport">导入 </el-button> |
|
|
|
|
</template> |
|
|
|
|
</avue-crud> |
|
|
|
|
<!-- 新增弹窗 --> |
|
|
|
|
<addEditDialogDosingRecord ref="addEditDialogDosingRecord" |
|
|
|
|
@closeDialog="closeDialog" |
|
|
|
|
@submitData="handleSubmitData" |
|
|
|
|
:dosingManList ="dosingManList" |
|
|
|
|
:moldAddMore="moldAddMore" > |
|
|
|
|
<addEditDialogDosingRecord |
|
|
|
|
ref="addEditDialogDosingRecord" |
|
|
|
|
@closeDialog="closeDialog" |
|
|
|
|
@submitData="handleSubmitData" |
|
|
|
|
:dosingManList="dosingManList" |
|
|
|
|
:moldAddMore="moldAddMore" |
|
|
|
|
> |
|
|
|
|
</addEditDialogDosingRecord> |
|
|
|
|
<!-- 导入 --> |
|
|
|
|
<basic-import v-if="isShowImport" title="导入" :isShow="isShowImport" |
|
|
|
|
templateUrl="/blade-desk/bsDosingRec/downloadExcelTemplate" templateName="废水加药记录导入模板.xls" |
|
|
|
|
importUrl="/blade-desk/bsDosingRec/importExcel" @closeDialog="closeImportDialog"></basic-import> |
|
|
|
|
<basic-import |
|
|
|
|
v-if="isShowImport" |
|
|
|
|
title="导入" |
|
|
|
|
:isShow="isShowImport" |
|
|
|
|
templateUrl="/blade-desk/bsDosingRec/downloadExcelTemplate" |
|
|
|
|
templateName="废水加药记录导入模板.xls" |
|
|
|
|
importUrl="/blade-desk/bsDosingRec/importExcel" |
|
|
|
|
@closeDialog="closeImportDialog" |
|
|
|
|
></basic-import> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
<script> |
|
|
|
|
import { getList, update , getDosingManList,add } from '@/api/safetyManagement/dosingRecord.js'; |
|
|
|
|
import { |
|
|
|
|
getList, |
|
|
|
|
update, |
|
|
|
|
getDosingManList, |
|
|
|
|
add, |
|
|
|
|
remove, |
|
|
|
|
} from '@/api/safetyManagement/dosingRecord.js'; |
|
|
|
|
import basicImport from '@/components/basic-import/main.vue'; |
|
|
|
|
import addEditDialogDosingRecord from './addEditDialogDosingRecord.vue'; |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
components: { |
|
|
|
|
basicImport, |
|
|
|
|
addEditDialogDosingRecord |
|
|
|
|
addEditDialogDosingRecord, |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
@ -42,7 +70,7 @@ export default { |
|
|
|
|
isShowImport: false, |
|
|
|
|
loading: false, |
|
|
|
|
selectionList: [], |
|
|
|
|
dosingManList:[], |
|
|
|
|
dosingManList: [], |
|
|
|
|
option: { |
|
|
|
|
addBtn: false, |
|
|
|
|
height: 'auto', |
|
|
|
|
@ -58,15 +86,15 @@ export default { |
|
|
|
|
index: true, |
|
|
|
|
selection: true, |
|
|
|
|
viewBtn: false, |
|
|
|
|
delBtn: false, |
|
|
|
|
delBtn: true, |
|
|
|
|
editBtnText: '修改', |
|
|
|
|
addBtnIcon: ' ', |
|
|
|
|
viewBtnIcon: ' ', |
|
|
|
|
delBtnIcon: ' ', |
|
|
|
|
editBtnIcon: ' ', |
|
|
|
|
addBtnIcon: 'el-icon-plus', |
|
|
|
|
viewBtnIcon: 'el-icon-view', |
|
|
|
|
delBtnIcon: 'el-icon-delete', |
|
|
|
|
editBtnIcon: 'el-icon-edit', |
|
|
|
|
viewBtnText: '详情', |
|
|
|
|
labelWidth: 120, |
|
|
|
|
menuWidth: 80, |
|
|
|
|
menuWidth: 200, |
|
|
|
|
dialogWidth: 1040, |
|
|
|
|
dialogClickModal: false, |
|
|
|
|
searchEnter: true, |
|
|
|
|
@ -127,6 +155,7 @@ export default { |
|
|
|
|
filter: true, |
|
|
|
|
span: 12, |
|
|
|
|
searchLabelWidth: 70, |
|
|
|
|
type: 'number', |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
@ -142,8 +171,8 @@ export default { |
|
|
|
|
sortable: true, |
|
|
|
|
filter: true, |
|
|
|
|
display: false, |
|
|
|
|
editDisplay:false, |
|
|
|
|
hide:true, |
|
|
|
|
editDisplay: false, |
|
|
|
|
hide: true, |
|
|
|
|
span: 12, |
|
|
|
|
type: 'datetime', |
|
|
|
|
rules: [ |
|
|
|
|
@ -154,8 +183,8 @@ export default { |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
searchRange: true, |
|
|
|
|
startPlaceholder: "开始时间", |
|
|
|
|
endPlaceholder: "结束时间", |
|
|
|
|
startPlaceholder: '开始时间', |
|
|
|
|
endPlaceholder: '结束时间', |
|
|
|
|
format: 'YYYY-MM-DD HH:mm:ss', |
|
|
|
|
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|
|
|
|
}, |
|
|
|
|
@ -173,7 +202,8 @@ export default { |
|
|
|
|
trigger: 'blur', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
|
|
|
|
|
format: 'YYYY-MM-DD HH:mm:ss', |
|
|
|
|
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '加药人', |
|
|
|
|
@ -183,7 +213,7 @@ export default { |
|
|
|
|
sortable: true, |
|
|
|
|
filter: true, |
|
|
|
|
span: 12, |
|
|
|
|
type: "select", |
|
|
|
|
type: 'select', |
|
|
|
|
dicData: [], |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
@ -193,8 +223,8 @@ export default { |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
props: { |
|
|
|
|
label: 'name', |
|
|
|
|
value: 'id' |
|
|
|
|
label: 'name', |
|
|
|
|
value: 'id', |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
@ -216,44 +246,44 @@ export default { |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
this.fetchDosingManList() |
|
|
|
|
this.fetchDosingManList(); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 新增 |
|
|
|
|
moldAddFn(row, flag) { |
|
|
|
|
this.$refs.addEditDialogDosingRecord.show() |
|
|
|
|
this.moldAddMore = flag |
|
|
|
|
}, |
|
|
|
|
//关闭弹窗 |
|
|
|
|
closeDialog() { |
|
|
|
|
this.addOpen = false |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
// 新增 |
|
|
|
|
moldAddFn(row, flag) { |
|
|
|
|
this.$refs.addEditDialogDosingRecord.show(); |
|
|
|
|
this.moldAddMore = flag; |
|
|
|
|
}, |
|
|
|
|
//关闭弹窗 |
|
|
|
|
closeImportDialog() { |
|
|
|
|
this.isShowImport = false; // 关闭导入弹窗 |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
//关闭弹窗 |
|
|
|
|
closeDialog() { |
|
|
|
|
this.addOpen = false; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
}, |
|
|
|
|
//关闭弹窗 |
|
|
|
|
closeImportDialog() { |
|
|
|
|
this.isShowImport = false; // 关闭导入弹窗 |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
}, |
|
|
|
|
// 加药人 |
|
|
|
|
// 加药人 |
|
|
|
|
fetchDosingManList() { |
|
|
|
|
getDosingManList({ |
|
|
|
|
current: 1, |
|
|
|
|
size: 10000000, |
|
|
|
|
roleId: '2008474700619563009' |
|
|
|
|
roleId: '2008474700619563009', |
|
|
|
|
}).then(res => { |
|
|
|
|
const result = res.data.data.records |
|
|
|
|
this.dosingManList = result |
|
|
|
|
console.log("加药人result", result) |
|
|
|
|
const result = res.data.data.records; |
|
|
|
|
this.dosingManList = result; |
|
|
|
|
console.log('加药人result', result); |
|
|
|
|
this.option.column.forEach(col => { |
|
|
|
|
if (col.prop === 'dosingMan') { |
|
|
|
|
col.dicData = this.dosingManList; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 点击导入按钮 |
|
|
|
|
handleImport() { |
|
|
|
|
this.isShowImport = true |
|
|
|
|
this.isShowImport = true; |
|
|
|
|
}, |
|
|
|
|
// 处理子组件提交的数据 |
|
|
|
|
handleSubmitData(data) { |
|
|
|
|
@ -272,18 +302,35 @@ export default { |
|
|
|
|
loading(); |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
handleDelete() { |
|
|
|
|
// 批量删除 |
|
|
|
|
handleBatchDelete() { |
|
|
|
|
if (this.selectionList.length === 0) { |
|
|
|
|
this.$message.warning('请选择至少一条数据'); |
|
|
|
|
this.$message.error('请至少选择一条数据'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.$confirm('确定将选择数据删除?', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}).then(() => { }); |
|
|
|
|
}).then(() => { |
|
|
|
|
remove(this.selectionList.map(item => item.id).join(',')).then(res => { |
|
|
|
|
this.$message.success('删除成功'); |
|
|
|
|
this.refreshChange(); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
handleDelete(row) { |
|
|
|
|
this.$confirm('确定删除数据吗?', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}).then(() => { |
|
|
|
|
remove(row.id).then(res => { |
|
|
|
|
this.$message.success('删除成功'); |
|
|
|
|
this.refreshChange(); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 多选 |
|
|
|
|
selectionChange(list) { |
|
|
|
|
@ -312,24 +359,23 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 搜索重置 |
|
|
|
|
searchReset() { |
|
|
|
|
this.query = {} |
|
|
|
|
this.onLoad(this.page) |
|
|
|
|
this.query = {}; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
}, |
|
|
|
|
//搜索 |
|
|
|
|
searchChange(params, done) { |
|
|
|
|
this.query = params; |
|
|
|
|
this.page.currentPage = 1; |
|
|
|
|
this.onLoad(this.page, params) |
|
|
|
|
done() |
|
|
|
|
this.onLoad(this.page, params); |
|
|
|
|
done(); |
|
|
|
|
}, |
|
|
|
|
// 加载页面数据 |
|
|
|
|
onLoad(page, params = {}) { |
|
|
|
|
this.loading = true; |
|
|
|
|
this.query = { ...this.query, dorType: 2 } //类型:1、废气加药;2、废水加药 |
|
|
|
|
this.query = { ...this.query, dorType: 2 }; //类型:1、废气加药;2、废水加药 |
|
|
|
|
const requestParams = Object.assign({}, params, this.query); |
|
|
|
|
// 后端要字符串类型 |
|
|
|
|
if (requestParams.queryDosingTime && Array.isArray(requestParams.queryDosingTime)) { |
|
|
|
|
|
|
|
|
|
requestParams.queryDosingTime = requestParams.queryDosingTime.join(','); |
|
|
|
|
} |
|
|
|
|
getList(page.currentPage, page.pageSize, Object.assign(params, requestParams)) |
|
|
|
|
@ -342,7 +388,7 @@ export default { |
|
|
|
|
.catch(() => { |
|
|
|
|
this.loading = false; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|