|
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
<avue-crud
|
|
|
|
|
:option="option"
|
|
|
|
|
:table-loading="loading"
|
|
|
|
|
:data="data"
|
|
|
|
|
v-model="form"
|
|
|
|
|
v-model:page="page"
|
|
|
|
|
ref="crud"
|
|
|
|
|
@row-del="rowDel"
|
|
|
|
|
@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="primary" @click="moldAddFn(null, true)">新增</el-button>
|
|
|
|
|
<!-- <el-button type="danger" icon="el-icon-delete" @click="handleDelete">删 除
|
|
|
|
|
</el-button> -->
|
|
|
|
|
</template>
|
|
|
|
|
<template #menu-right>
|
|
|
|
|
<el-button type="success" icon="el-icon-upload" @click="handleImport">导入 </el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</avue-crud>
|
|
|
|
|
<!-- 导入 -->
|
|
|
|
|
<basic-import
|
|
|
|
|
v-if="isShowImport"
|
|
|
|
|
title="导入"
|
|
|
|
|
:isShow="isShowImport"
|
|
|
|
|
templateUrl="/blade-safety/wasteGasDosingRecord/download-excel-template"
|
|
|
|
|
templateName="废气加药记录模板.xlsx"
|
|
|
|
|
importUrl="/blade-safety/wasteGasDosingRecord/import-excel"
|
|
|
|
|
@closeDialog="closeDialog"
|
|
|
|
|
></basic-import>
|
|
|
|
|
<!-- 新增 -->
|
|
|
|
|
<addEditDialogDosingRecord
|
|
|
|
|
v-if="addOpen"
|
|
|
|
|
:showDialog="addOpen"
|
|
|
|
|
@closeDialog="closeDialog"
|
|
|
|
|
:moldAddMore="moldAddMore"
|
|
|
|
|
@submitData="handleSubmitData">
|
|
|
|
|
</addEditDialogDosingRecord>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import basicImport from '@/components/basic-import/main.vue';
|
|
|
|
|
import addEditDialogDosingRecord from './addEditDialogDosingRecord.vue';
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
basicImport,
|
|
|
|
|
addEditDialogDosingRecord
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
addOpen: false, //新增弹窗
|
|
|
|
|
moldAddMore: false,
|
|
|
|
|
isShowImport: false,
|
|
|
|
|
loading: false,
|
|
|
|
|
selectionList: [],
|
|
|
|
|
option: {
|
|
|
|
|
addBtn: false,
|
|
|
|
|
height: 'auto',
|
|
|
|
|
calcHeight: 32,
|
|
|
|
|
tip: false,
|
|
|
|
|
size: 'medium',
|
|
|
|
|
simplePage: true,
|
|
|
|
|
searchShow: true,
|
|
|
|
|
searchMenuSpan: 6,
|
|
|
|
|
searchIcon: true,
|
|
|
|
|
searchIndex: 3,
|
|
|
|
|
tree: false,
|
|
|
|
|
border: true,
|
|
|
|
|
index: true,
|
|
|
|
|
selection: true,
|
|
|
|
|
viewBtn: false,
|
|
|
|
|
delBtn: false,
|
|
|
|
|
editBtnText: '修改',
|
|
|
|
|
addBtnIcon: ' ',
|
|
|
|
|
viewBtnIcon: ' ',
|
|
|
|
|
delBtnIcon: ' ',
|
|
|
|
|
editBtnIcon: ' ',
|
|
|
|
|
viewBtnText: '详情',
|
|
|
|
|
labelWidth: 120,
|
|
|
|
|
menuWidth: 120,
|
|
|
|
|
dialogWidth: 1040,
|
|
|
|
|
dialogClickModal: false,
|
|
|
|
|
searchEnter: true,
|
|
|
|
|
excelBtn: false,
|
|
|
|
|
filterBtn: true,
|
|
|
|
|
searchShowBtn: false,
|
|
|
|
|
columnSort: true,
|
|
|
|
|
excelBtn: true,
|
|
|
|
|
columnSort: true,
|
|
|
|
|
index: false,
|
|
|
|
|
showOverflowTooltip: true,
|
|
|
|
|
searchLabelPosition: 'left',
|
|
|
|
|
searchLabelPosition: 'left',
|
|
|
|
|
searchGutter: 24,
|
|
|
|
|
searchSpan: 6,
|
|
|
|
|
menuAlign: 'left',
|
|
|
|
|
gridBtn: false,
|
|
|
|
|
searchMenuPosition: 'right',
|
|
|
|
|
align: 'center',
|
|
|
|
|
column: [
|
|
|
|
|
{
|
|
|
|
|
label: '设施',
|
|
|
|
|
prop: 'device',
|
|
|
|
|
sortable: true,
|
|
|
|
|
filter: true,
|
|
|
|
|
span: 12,
|
|
|
|
|
search: true,
|
|
|
|
|
rules: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: '请输入设施',
|
|
|
|
|
trigger: 'blur',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '药品',
|
|
|
|
|
prop: 'drug',
|
|
|
|
|
search: true,
|
|
|
|
|
sortable: true,
|
|
|
|
|
filter: true,
|
|
|
|
|
span: 12,
|
|
|
|
|
rules: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: '请输入药品',
|
|
|
|
|
trigger: 'blur',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '剂量(kg)',
|
|
|
|
|
prop: 'dose',
|
|
|
|
|
search: true,
|
|
|
|
|
sortable: true,
|
|
|
|
|
filter: true,
|
|
|
|
|
span: 12,
|
|
|
|
|
rules: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: '请输入剂量(kg)',
|
|
|
|
|
trigger: 'blur',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '加药时间',
|
|
|
|
|
prop: 'dosingTime',
|
|
|
|
|
search: true,
|
|
|
|
|
sortable: true,
|
|
|
|
|
filter: true,
|
|
|
|
|
span: 12,
|
|
|
|
|
type: 'datetime',
|
|
|
|
|
// format: 'yyyy-MM-dd HH:mm:ss',
|
|
|
|
|
// valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
|
|
|
|
rules: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: '请选择加药时间',
|
|
|
|
|
trigger: 'blur',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '加药人',
|
|
|
|
|
prop: 'dosingMan.userName',
|
|
|
|
|
bind: 'dosingMan.userName',
|
|
|
|
|
search: false,
|
|
|
|
|
sortable: true,
|
|
|
|
|
filter: true,
|
|
|
|
|
span: 12,
|
|
|
|
|
type: 'select',
|
|
|
|
|
valueKey: 'userId',
|
|
|
|
|
labelKey: 'userName',
|
|
|
|
|
dicData: [
|
|
|
|
|
{ label: '测试', value: 521 },
|
|
|
|
|
],
|
|
|
|
|
rules: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: '请选择加药人',
|
|
|
|
|
trigger: 'blur',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '备注',
|
|
|
|
|
prop: 'memo',
|
|
|
|
|
search: false,
|
|
|
|
|
sortable: true,
|
|
|
|
|
filter: true,
|
|
|
|
|
span: 12,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
form: {},
|
|
|
|
|
page: {
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
currentPage: 1,
|
|
|
|
|
total: 0,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
// 新增
|
|
|
|
|
moldAddFn(row, flag) {
|
|
|
|
|
this.addOpen = true
|
|
|
|
|
this.moldAddMore = flag
|
|
|
|
|
},
|
|
|
|
|
//关闭弹窗
|
|
|
|
|
closeDialog() {
|
|
|
|
|
this.addOpen = false
|
|
|
|
|
},
|
|
|
|
|
// 处理子组件提交的数据
|
|
|
|
|
handleSubmitData(data) {
|
|
|
|
|
this.$message.success("数据提交成功!");
|
|
|
|
|
this.addOpen = false;
|
|
|
|
|
},
|
|
|
|
|
// 点击导入按钮
|
|
|
|
|
handleImport() {
|
|
|
|
|
this.isShowImport = true
|
|
|
|
|
},
|
|
|
|
|
handleDelete() {
|
|
|
|
|
if (this.selectionList.length === 0) {
|
|
|
|
|
this.$message.warning('请选择至少一条数据');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.$confirm('确定将选择数据删除?', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
}).then(() => {});
|
|
|
|
|
},
|
|
|
|
|
// 多选
|
|
|
|
|
selectionChange(list) {
|
|
|
|
|
this.selectionList = list;
|
|
|
|
|
},
|
|
|
|
|
onLoad() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
this.data = [
|
|
|
|
|
{
|
|
|
|
|
bsTower: null,
|
|
|
|
|
device: '121',
|
|
|
|
|
dorId: 141,
|
|
|
|
|
dorType: 1,
|
|
|
|
|
dose: 121.0,
|
|
|
|
|
dosingMan: {
|
|
|
|
|
userId: 521,
|
|
|
|
|
userName: '测试',
|
|
|
|
|
},
|
|
|
|
|
dosingTime: '2023-09-13 00:00:00',
|
|
|
|
|
drug: '212',
|
|
|
|
|
handleResult: 1,
|
|
|
|
|
handleResultTitle: '手动新增',
|
|
|
|
|
keyValue: 141,
|
|
|
|
|
memo: '11',
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
this.page.total = this.data.length;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.selectionClear();
|
|
|
|
|
}, 500);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="scss" scoped></style>
|