Эх сурвалжийг харах

🦄 refactor(瑞恒瑞鹰非生产时间): 简单调整

Zimo 3 өдөр өмнө
parent
commit
213474f441

+ 4 - 4
src/views/pms/iotrhdailyreport/rh-form.vue

@@ -203,12 +203,12 @@ const validateTotalTime =
     let total = 0
     let msg = ''
 
-    if (gasTime > 0) {
-      total = parseFloat((gasTime + nonProdSum).toFixed(2))
-      msg = `注气(${gasTime})+非生产(${nonProdSum})=${total}H,必须为24H`
-    } else {
+    if (gasTime === 0 && waterTime > 0) {
       total = parseFloat((waterTime + nonProdSum).toFixed(2))
       msg = `注水(${waterTime})+非生产(${nonProdSum})=${total}H,必须为24H`
+    } else {
+      total = parseFloat((gasTime + nonProdSum).toFixed(2))
+      msg = `注气(${gasTime})+非生产(${nonProdSum})=${total}H,必须为24H`
     }
 
     if (Math.abs(total - 24) > 0.01) {

+ 1 - 3
src/views/pms/iotrydailyreport/ry-form.vue

@@ -137,9 +137,7 @@ const { t } = useI18n()
 const initFormData = (): Form => {
   const base: any = {
     drillingWorkingTime: 0,
-    otherProductionTime: 0,
-    otherNptReason: '',
-    opinion: ''
+    otherProductionTime: 0
   }
   // 初始化所有非生产时间字段为 0
   NON_PROD_FIELDS.forEach((field) => {

+ 1 - 3
src/views/pms/iotrydailyreport/ry-xj-form.vue

@@ -133,9 +133,7 @@ const { t } = useI18n()
 const initFormData = (): Form => {
   const base: any = {
     ratedProductionTime: 0,
-    productionTime: 0,
-    otherNptReason: '',
-    opinion: ''
+    productionTime: 0
   }
   // 初始化所有非生产时间字段为 0
   NON_PROD_FIELDS.forEach((field) => {