页面问题修改

dev-scheduling
taozi 4 months ago
parent 166fcc9e6e
commit d845ffb01f
  1. 25
      src/views/safetyManagement/wastewater/components/addEditDialogDischargeRec.vue
  2. 66
      src/views/safetyManagement/wastewater/components/addEditDialogDosingRecord.vue
  3. 33
      src/views/safetyManagement/wastewater/components/addEditDialogTestRecord.vue
  4. 18
      src/views/safetyManagement/wastewater/components/dosingRecord.vue

@ -83,16 +83,7 @@ export default {
data() {
return {
openShow: false,
tableData: [
//
{
wasteType: null, //
teamName: null, //
amount: null, //
dirDate: null, //
memo: '', //
},
],
tableData: [],
};
},
watch: {
@ -113,21 +104,11 @@ export default {
},
//
addTable() {
this.tableData.push({
wasteType: null,
teamName: null,
amount: null,
dirDate: null,
memo: '',
});
this.tableData.push({});
},
//
delTable() {
if (this.tableData.length <= 1) {
this.$message.warning('至少保留一行数据');
return;
}
this.tableData.pop(); //
this.tableData.pop()
},
//
submit() {

@ -1,10 +1,10 @@
<template>
<el-dialog title="新增" append-to-body v-model="openShow" width="70%" @close="closeDialog">
<el-dialog title="新增" append-to-body v-model="openShow" width="70%" @close="closeDialog" destroy-on-close>
<div style="margin-bottom: 12px" v-if="moldAddMore">
<el-button type="primary" @click="addTable">插入一行</el-button>
<el-button type="danger" @click="delTable">删除行</el-button>
</div>
<el-table :data="tableData" style="width: 100%" border :cell-style="{padding: '5px'}">
<el-table :data="tableData" style="width: 100%" border :cell-style="{ padding: '5px' }">
<!-- 设施 -->
<el-table-column prop="device" label="设施" align="center" width="170">
<template #header>
@ -51,18 +51,18 @@
<span><i style="color: red">*</i>加药时间</span>
</template>
<template #default="scope">
<el-date-picker v-model="scope.row.dosingTime" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="选择时间" style="width: 100%" />
<el-date-picker v-model="scope.row.dosingTime" format="YYYY-MM-DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="选择时间" style="width: 100%" />
</template>
</el-table-column>
<!-- 备注输入框 -->
<el-table-column prop="memo" label="备注" align="center" >
<el-table-column prop="memo" label="备注" align="center">
<template #default="scope">
<el-input v-model="scope.row.memo" placeholder="请输入备注" />
</template>
</el-table-column>
</el-table>
<template #footer>
<span class="dialog-footer">
<el-button @click="closeDialog"> </el-button>
@ -86,17 +86,7 @@ export default {
data() {
return {
openShow: false,
tableData: [
//
{
device: null,
drug: null,
dose: null,
dosingTime: null,
dosingMan: null,
memo: '', //
},
],
tableData:[],
};
},
watch: {
@ -109,45 +99,24 @@ export default {
},
},
methods: {
show(){
this.openShow = true;
this.tableData = [];
},
closeDialog() {
this.openShow = false;
this.$emit('closeDialog');
//
this.tableData =
[{ device: null, drug: null, dose: null, dosingTime: null, dosingMan: null, memo: '' }];
},
//
addTable() {
this.tableData.push({
device: null,
drug: null,
dose: null,
dosingTime: null,
dosingMan: null,
memo: '', //
});
this.tableData.push({});
},
//
delTable() {
if (this.tableData.length <= 1) {
this.$message.warning('至少保留一行数据');
return;
}
this.tableData.pop(); //
this.tableData.pop()
},
//
submit() {
//
const isValid = this.tableData.every(row => {
//
console.log("验证数据:", {
device: row.device,
drug: row.drug,
dose: row.dose,
dosingTime: row.dosingTime,
dosingMan: row.dosingMan
});
//
if (!row.device || !row.drug || !row.dose || !row.dosingTime || !row.dosingMan) {
//
@ -163,9 +132,14 @@ export default {
return true;
});
if (isValid) {
//
this.$emit('submitData', this.tableData);
this.closeDialog(); //
//
// if(res.code == 200){
// this.$message.success("");
// this.closeDialog(); //
// this.$emit("submitData"); //
// }else{
// this.$message.error("");
// }
}
},
},

@ -106,20 +106,7 @@ export default {
data() {
return {
openShow: false,
tableData: [
//
{
device: null,
dosingTime: null,
dosingMan: null,
itNi: null,
itCu: null,
itCr: null,
itCn2: null,
itPh: null,
memo: '',
},
],
tableData: [],
};
},
watch: {
@ -151,25 +138,11 @@ export default {
},
//
addTable() {
this.tableData.push({
device: null,
dosingTime: null,
dosingMan: null,
itNi: null,
itCu: null,
itCr: null,
itCn2: null,
itPh: null,
memo: '',
});
this.tableData.push({});
},
//
delTable() {
if (this.tableData.length <= 1) {
this.$message.warning('至少保留一行数据');
return;
}
this.tableData.pop(); //
this.tableData.pop()
},
//
submit() {

@ -13,8 +13,8 @@
</template>
</avue-crud>
<!-- 新增弹窗 -->
<addEditDialogDosingRecord v-if="addOpen" :showDialog="addOpen" @closeDialog="closeDialog"
:moldAddMore="moldAddMore" @submitData="handleSubmitData">
<addEditDialogDosingRecord ref="addEditDialogDosingRecord"
:moldAddMore="moldAddMore" @submitData="onLoad()">
</addEditDialogDosingRecord>
<!-- 导入 -->
<basic-import v-if="isShowImport" title="导入" :isShow="isShowImport"
@ -32,7 +32,6 @@ export default {
},
data() {
return {
addOpen: false, //
moldAddMore: false,
isShowImport: false,
loading: false,
@ -186,21 +185,13 @@ export default {
methods: {
//
moldAddFn(row, flag) {
console.log(1)
this.addOpen = true
this.$refs.addEditDialogDosingRecord.show()
this.moldAddMore = flag
},
//
closeDialog() {
this.addOpen = false
},
//
handleSubmitData(data) {
console.log("提交的数据:", data);
//
this.$message.success("数据提交成功!");
this.addOpen = false;
},
//
handleImport() {
this.isShowImport = true
@ -307,9 +298,6 @@ export default {
];
this.page.total = this.data.length;
this.loading = false;
setTimeout(() => {
this.selectionClear();
}, 500);
},
},
};

Loading…
Cancel
Save