Quellcode durchsuchen

同步设施环境改动

cfort vor 1 Jahr
Ursprung
Commit
c35798d041
2 geänderte Dateien mit 73 neuen und 48 gelöschten Zeilen
  1. 57 33
      src/views/system/fasc/facilityEnvConfig.vue
  2. 16 15
      src/views/system/fasc/fecDialog.vue

+ 57 - 33
src/views/system/fasc/facilityEnvConfig.vue

@@ -141,18 +141,16 @@
                             label="房间"
                         />
                         <el-table-column
-                            v-if="isShowDevice"
+                            v-if="shouldShowColumn('deviceno1_')"
                             prop="deviceno1_"
                             label="被控设备编号"
                         />
                         <el-table-column
-                            v-if="isShowDevice"
+                            v-if="shouldShowColumn('devicename1_')"
                             prop="devicename1_"
                             label="被控设备名称"
                         />
-                        <!-- v-if="isShowJkDevice" -->
                         <el-table-column
-                          
                             prop="deviceno2_"
                             label="监控设备"
                         />
@@ -324,42 +322,58 @@ export default {
                 '01-室内温湿度监控': {
                     label: '室内温湿度监控',
                     path: '/sshjgl/wdjc/snwsdjkcd',
-                    showDevice: false
+                    showDevice: false,
+                    displayField: [],
+                    requireField: ['fang_jian_']
                 },
                 '02-冰箱温度监控': {
                     label: '冰箱温度监控',
                     path: '/sshjgl/wdjc/bxwdjc',
-                    showDevice: true
+                    showDevice: true,
+                    displayField: ['deviceno1_', 'devicename1_'],
+                    requireField: ['deviceno1_', 'devicename1_']
                 },
                 '03-温浴箱温度监控': {
                     label: '温浴箱温度监控',
                     path: '/sshjgl/wdjc/wyxwdjkywh',
-                    showDevice: true
+                    showDevice: true,
+                    displayField: ['deviceno1_', 'devicename1_'],
+                    requireField: ['deviceno1_', 'devicename1_']
                 },
                 '04-阴凉柜温度监控': {
                     label: '阴凉柜温度监控',
                     path: '/sshjgl/wdjc/ylgwdjc',
-                    showDevice: true
+                    showDevice: true,
+                    displayField: ['deviceno1_', 'devicename1_'],
+                    requireField: ['deviceno1_', 'devicename1_']
                 },
                 '05-纯水机水质监测': {
                     label: '纯水机水质监测',
                     path: '/sshjgl/csjszjcb',
-                    showDevice: true
+                    showDevice: true,
+                    displayField: ['deviceno1_', 'devicename1_'],
+                    requireField: ['deviceno1_', 'devicename1_']
                 },
                 '06-每日安全检查': {
                     label: '每日安全检查',
                     path: '/sshjgl/aqgl/mraqjc',
-                    showDevice: false
+                    showDevice: false,
+                    displayField: [],
+                    requireField: []
                 },
                 '07-每月安全检查': {
                     label: '每月安全检查',
                     path: '/sshjgl/aqgl/myaqjc',
-                    showDevice: true
+                    showDevice: true,
+                    displayField: ['deviceno1_', 'devicename1_'],
+                    requireField: []
                 },
                 '08-含氯有效性监测': {
                     label: '含氯有效性监测',
                     path: '/sshjgl/aqgl/hlyxxjc',
-                    showDevice: false
+                    showDevice: false,
+                    displayField: [],
+                    requireField: []
                 },
                 // '09-紫外灯辐照测定': {
                 //     path: '/sshjgl/aqgl/zwdfzd',
@@ -367,42 +381,51 @@ export default {
                 '10-洗眼器检查': {
                     label: '洗眼器检查',
                     path: '/sshjgl/aqgl/xyqjc',
-                    showDevice: true
+                    showDevice: true,
+                    displayField: ['deviceno1_', 'devicename1_'],
+                    requireField: []
                 },
                 '11-紧急淋浴器检查': {
                     label: '紧急淋浴器检查',
                     path: '/sshjgl/aqgl/jjlyqjc',
-                    showDevice: true
+                    showDevice: true,
+                    displayField: ['deviceno1_', 'devicename1_'],
+                    requireField: []
                 },
                 '12-紫外灯消毒': {
                     label: '紫外灯消毒',
                     path: '/sshjgl/aqgl/jykzwdxdjlb',
-                    showDevice: true
+                    showDevice: true,
+                    displayField: ['deviceno1_', 'devicename1_'],
+                    requireField: []
                 },
                 '13-高压灭菌': {
                     label: '高压灭菌',
                     path: '/sshjgl/aqgl/gymjjlb',
-                    showDevice: true
+                    showDevice: true,
+                    displayField: ['deviceno1_', 'devicename1_'],
+                    requireField: []
                 },
                 '14-空气消毒机': {
                     label: '空气消毒机',
                     path: '/sshjgl/aqgl/xdjsyjlb',
-                    showDevice: true
+                    showDevice: true,
+                    displayField: ['deviceno1_', 'devicename1_'],
+                    requireField: []
                 },
                 '15-日常防护消毒': {
                     label: '日常防护消毒',
                     path: '/sshjgl/aqgl/rcfhxd',
-                    showDevice: false
+                    showDevice: false,
+                    displayField: [],
+                    requireField: []
                 },
                 '16-设备排出废液': {
                     label: '设备排出废液',
                     path: '/sshjgl/aqgl/sbpcfyxd',
-                    showDevice: true
-                },
-                '17-医疗废弃物交接': {
-                    label: '医疗废弃物交接',
-                    path: '/sshjgl/aqgl/ylfwjjdj',
-                    showDevice: false
+                    showDevice: true,
+                    displayField: ['deviceno1_', 'devicename1_'],
+                    requireField: ['deviceno1_', 'devicename1_']
                 }
             },
             subIdList: [],
@@ -420,14 +443,15 @@ export default {
         trueList () {
             return this.isSearch ? this.searchData : this.subForm
         },
-        isShowJkDevice () {
-            return this.form.lei_xing_ !== '17-医疗废弃物交接'
-        },
-        isShowDevice () {
-            return this.config[this.form.lei_xing_]?.showDevice
+        shouldShowColumn () {
+            return (columnName) => {
+                return this.config[this.form.lei_xing_]?.displayField?.includes(columnName)
+            }
         },
-        deviceIsRequired () {
-            return this.form.lei_xing_ === '02-冰箱温度监控' || this.form.lei_xing_ === '05-纯水机水质监测' || this.form.lei_xing_ === '03-温浴箱温度监控' || this.form.lei_xing_ === '04-阴凉柜温度监控' || this.form.lei_xing_ === '16-设备排出废液'
+        shouldRequired () {
+            return (columnName) => {
+                return this.config[this.form.lei_xing_]?.requireField?.includes(columnName)
+            }
         },
         isEdit () {
             return !!(this.parentData instanceof Object && this.parentData.mainId)
@@ -689,7 +713,7 @@ export default {
             }
             this.subDialogVisible = true
             this.$nextTick(() => {
-                this.$refs.FecDialogRef.open(row, this.jianCeGangWeiList, this.form)
+                this.$refs.FecDialogRef.open(row, this.jianCeGangWeiList, this.form, this.config)
             })
         },
         // 子表的提交事件
@@ -755,7 +779,7 @@ export default {
                 if (item.jian_ce_gang_wei_ === '') {
                     return this.$message.warning(`子表第${i + 1}行监测岗位信息缺失!`)
                 }
-                if (this.deviceIsRequired && item.deviceno1_ === '') {
+                if (this.shouldRequired('deviceno1_') && item.deviceno1_ === '') {
                     return this.$message.warning(`子表第${i + 1}行设备信息缺失!`)
                 }
                 if (this.shouldRequired('fang_jian_') && item.fang_jian_ === '') {

+ 16 - 15
src/views/system/fasc/fecDialog.vue

@@ -97,7 +97,6 @@
                             </el-form-item>
                         </el-col>
                     </el-row>
-                    <!-- v-if="isShowJkDevice" -->
                     <el-row>
                         <el-col :span="12">
                             <el-form-item label="监控设备:">
@@ -118,9 +117,9 @@
                         </el-col>
 
                     </el-row>
-                    <el-row v-if="isShowDevice">
+                    <el-row v-if="shouldShowColumn('deviceno1_')">
                         <el-col :span="12">
-                            <el-form-item v-if="deviceIsRequired" label="被控设备/设施编号:" label-width="140">
+                            <el-form-item v-if="shouldRequired('deviceno1_')" label="被控设备/设施编号:" label-width="140">
                                 <template slot="label">
                                     <span class="required">被控设备/设施编号:</span>
                                 </template>
@@ -155,7 +154,7 @@
                             </el-form-item>
                         </el-col>
                         <el-col v-show="form.deviceno1_" :span="12">
-                            <el-form-item v-if="deviceIsRequired" label="被控设备/设施名称:" label-width="140">
+                            <el-form-item v-if="shouldRequired('devicename1_')" label="被控设备/设施名称:" label-width="140">
                                 <template slot="label">
                                     <span>被控设备/设施名称</span>
                                     <el-tooltip effect="dark" content="选择设备后自动带出名称" placement="top">
@@ -380,21 +379,23 @@ export default {
                 { label: '半年监测', value: '每半年' },
                 { label: '年监测', value: '每年' },
                 { label: '按时间间隔监测', value: '间隔' }
-            ]
+            ],
+            config: {}
         }
     },
     computed: {
         monitoringpPosition () {
             return this.jianCeGangWeiList.filter(i => i.suo_shu_bu_men_ === this.form.bu_men_)
         },
-        isShowJkDevice () {
-            return this.lei_xing_ !== '17-医疗废弃物交接'
-        },
-        isShowDevice () {
-            return this.lei_xing_ !== '01-室内温湿度监控' && this.lei_xing_ !== '06-每日安全检查' && this.lei_xing_ !== '08-含氯有效性监测' && this.lei_xing_ !== '15-日常防护消毒' && this.lei_xing_ !== '17-医疗废弃物交接'
+        shouldShowColumn () {
+            return (columnName) => {
+                return this.config[this.lei_xing_]?.displayField?.includes(columnName)
+            }
         },
-        deviceIsRequired () {
-            return this.lei_xing_ === '02-冰箱温度监控' || this.lei_xing_ === '05-纯水机水质监测' || this.lei_xing_ === '03-温浴箱温度监控' || this.lei_xing_ === '04-阴凉柜温度监控' || this.lei_xing_ === '16-设备排出废液'
+        shouldRequired () {
+            return (columnName) => {
+                return this.config[this.lei_xing_]?.requireField?.includes(columnName)
+            }
         },
         labelShow () {
             if (this.form.jian_ce_zhou_qi_) {
@@ -641,7 +642,7 @@ export default {
             if (this.form.jian_ce_gang_wei_ === '') {
                 throw new Error('监测岗位信息缺失!')
             }
-            if (this.deviceIsRequired && this.form.deviceno1_ === '') {
+            if (this.shouldRequired('deviceno1_') && this.form.deviceno1_ === '') {
                 throw new Error('请先选择设备!')
             }
             if (this.shouldRequired('fang_jian_') && this.form.fang_jian_ === '') {
@@ -705,12 +706,12 @@ export default {
                 })
             }
         },
-        open (row, jianCeGangWeiList, parentForm) {
+        open (row, jianCeGangWeiList, parentForm, config) {
             this.dialogVisible = true
             this.jianCeGangWeiList = jianCeGangWeiList
             this.lei_xing_ = parentForm.lei_xing_
+            this.config = config
             this.isEdit = !!(row && row.zi_wai_deng_wai_j)
-            console.log('parentForm111111', jianCeGangWeiList, parentForm.bian_zhi_bu_men_)
             // 编辑
             if (this.isEdit) {
                 // this.form = JSON.parse(JSON.stringify(row))