Przeglądaj źródła

bug-4145设备档案出厂日期非必填,bug3869深圳肿瘤存水机设备非必填

wangxiaoyi 1 rok temu
rodzic
commit
afacdc3f24

+ 45 - 15
src/utils/query.js

@@ -37,77 +37,107 @@
         "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": []
         },
         "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": []
         },
         "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
+           "showDevice": true,
+           "displayField": ['deviceno1_','devicename1_'],
+           "requireField": ['deviceno1_','devicename1_']
         }
       }
     },

+ 0 - 7
src/views/component/device/deviceDialog.vue

@@ -225,9 +225,6 @@
                                     </el-col>
                                     <el-col :span="8">
                                         <el-form-item label="出厂日期:" prop="chuChangRiQi">
-                                            <template slot="label">
-                                                <span class="required">出厂日期</span>
-                                            </template>
                                             <el-date-picker
                                                 v-if="!readonly"
                                                 v-model="form.chuChangRiQi"
@@ -983,11 +980,7 @@ export default {
                 ],
                 shiFouXiaoZhun: [
                     { required: true, message: '是否校准不能为空', trigger: 'blur' }
-                ],
-                chuChangRiQi: [
-                    { required: true, message: '出厂日期不能为空', trigger: 'blur' }
                 ]
-
             }
         }
     },

+ 58 - 23
src/views/system/fasc/facilityEnvConfig.vue

@@ -141,12 +141,12 @@
                             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="被控设备名称"
                         />
@@ -322,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',
@@ -365,37 +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
+                    showDevice: true,
+                    displayField: ['deviceno1_', 'devicename1_'],
+                    requireField: ['deviceno1_', 'devicename1_']
                 }
             },
             subIdList: [],
@@ -413,11 +443,15 @@ export default {
         trueList () {
             return this.isSearch ? this.searchData : this.subForm
         },
-        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)
@@ -471,6 +505,7 @@ export default {
     async mounted () {
         const config = await getSetting('facilityEnv', 'typeList')
         if (config) {
+            console.log(config)
             console.debug(config)
             this.config = config
         }
@@ -679,7 +714,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)
             })
         },
         // 子表的提交事件
@@ -745,7 +780,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.form.lei_xing_ === '01-室内温湿度监控' && item.fang_jian_ === '') {

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

@@ -117,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>
@@ -154,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">
@@ -379,18 +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_)
         },
-        isShowDevice () {
-            return this.lei_xing_ !== '01-室内温湿度监控' && this.lei_xing_ !== '06-每日安全检查' && this.lei_xing_ !== '08-含氯有效性监测' && this.lei_xing_ !== '15-日常防护消毒'
+        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_) {
@@ -637,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.lei_xing_ === '01-室内温湿度监控' && this.form.fang_jian_ === '') {
@@ -701,10 +706,11 @@ 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)
             // 编辑
             if (this.isEdit) {