Procházet zdrojové kódy

Merge branch '深圳三院' of http://119.23.210.103:3000/wy/zdqy_firm_former into 深圳三院

cfort před 1 rokem
rodič
revize
c9a66e3bf9

+ 4 - 0
src/business/platform/form/formrender/dynamic-form/dynamic-form-field.vue

@@ -1039,6 +1039,10 @@ export default {
         },
         // 日期格式调整
         selectTime (val) {
+            if (!val) {
+                this.dataModel = ''
+                return
+            }
             const date = new Date(new Date())
             const year = date.getFullYear()
             const month = this.trans(date.getMonth() + 1)

+ 8 - 1
src/views/component/facility/facilityData.vue

@@ -222,7 +222,7 @@ export default {
                     item.startTime = ''
                 }
 
-                // this.formData.jianCeShiJian = '2024-10-20' // 测试用
+                // this.formData.jianCeShiJian = '2025-03-01' // 测试用
                 if (!item.result && (item.rate && (this.formData.jianCeShiJian || this.readonly))) {
                     let jianCeShiJian = ''
                     if (this.readonly) {
@@ -236,6 +236,8 @@ export default {
                         day = 7
                     }
                     const dayofMonth = thatDate.getDate() // 多少号
+                    const monthofYear = thatDate.getMonth() + 1 // 多少月
+                    const monthInQuarter = monthofYear % 3 === 0 ? 3 : monthofYear % 3 // 计算当前月在当前季度中的第几个月
                     let dayDiff = ''
                     console.log(`监测时间:${jianCeShiJian},周${day}`)
                     switch (item.period) {
@@ -254,6 +256,11 @@ export default {
                                 result.push(item)
                             }
                             break
+                        case 'quarter':
+                            if (item.date === monthInQuarter && dayofMonth === 1) {
+                                result.push(item)
+                            }
+                            break
                         case 'repeat':
                             dayDiff = this.getDayDifference(item.startTime, jianCeShiJian)
                             if (dayDiff >= 0 && dayDiff % (item.date + 1) === 0) {

+ 12 - 1
src/views/component/facility/facilityDataDialog.vue

@@ -52,6 +52,14 @@
                                         :value="item"
                                     />
                                 </el-select>
+                                <el-select v-if="form.period==='quarter'" v-model="form.date" placeholder="请选择" size="mini" style="width:100%">
+                                    <el-option
+                                        v-for="item in 3"
+                                        :key="item"
+                                        :label="`第${item}个月`"
+                                        :value="item"
+                                    />
+                                </el-select>
                                 <div v-if="form.period==='repeat'" style="display:flex;align-items: center;width:100%">
                                     <el-select v-model="form.date" placeholder="请选择" size="mini" style="width:100%">
                                         <el-option
@@ -131,7 +139,7 @@ export default {
                 date: '',
                 startTime: dayjs().format('YYYY-MM-DD')
             },
-            periodList: [{ label: '日监测', value: 'day' }, { label: '周监测', value: 'week' }, { label: '月监测', value: 'month' }, { label: '按时间间隔监测', value: 'repeat' }],
+            periodList: [{ label: '日监测', value: 'day' }, { label: '周监测', value: 'week' }, { label: '月监测', value: 'month' }, { label: '季度监测', value: 'quarter' }, { label: '按时间间隔监测', value: 'repeat' }],
             weekDays: [{ label: '周一', value: 1 }, { label: '周二', value: 2 }, { label: '周三', value: 3 }, { label: '周四', value: 4 }, { label: '周五', value: 5 }, { label: '周六', value: 6 }, { label: '周日', value: 7 }]
         }
     },
@@ -166,6 +174,9 @@ export default {
                     case 'month':
                         rate = '每个月第' + this.form.date + '天'
                         break
+                    case 'quarter':
+                        rate = '每个季度第' + this.form.date + '个月'
+                        break
                     case 'repeat':
                         rate = this.form.startTime + '起每隔' + this.form.date + '天'
                         break

+ 1 - 1
src/views/system/fasc/facilityEnvConfig.vue

@@ -295,7 +295,7 @@ export default {
                 di_dian_: level.second || level.first,
                 bian_zhi_ren_: userId,
                 lei_xing_: '',
-                bian_zhi_bu_men_: position && position.split(',')[0],
+                bian_zhi_bu_men_: position && position.split(',').at(-1),
                 zhou_qi_: '',
                 gang_wei_: '',
                 tiao_jian_: '',

+ 6 - 5
src/views/system/fasc/fecDialog.vue

@@ -532,15 +532,16 @@ export default {
     },
     methods: {
         deviceno1Change (key, data) {
-            this.form.deviceid1_ = data.id_
-            this.form.devicename1_ = data.she_bei_ming_cheng_
+            this.form.deviceid1_ = data.id_ || ''
+            this.form.devicename1_ = data.she_bei_ming_cheng_ || ''
         },
         deviceno2Change (key, data) {
-            this.form.deviceid2_ = data.deviceId
+            this.form.deviceid2_ = data.deviceId || ''
         },
         fangJianChange (key, data) {
-            this.form.fang_jian_id_ = data.id_
-            this.form.qu_yu_ = data.qu_yu_
+            this.form.fang_jian_id_ = data.id_ || ''
+            this.form.qu_yu_ = data.qu_yu_ || ''
+            this.form.kong_zhi_biao_zhu = data.kong_zhi_biao_zhu || ''
         },
         // 接收自定义组件数据
         onFacilityData (...arg) {