瀏覽代碼

瑞恒注气量判断

Co-authored-by: Copilot <copilot@github.com>
Zimo 4 天之前
父節點
當前提交
d20815bb37
共有 2 個文件被更改,包括 16 次插入3 次删除
  1. 1 0
      src/api/pms/iotopeationfill/index.ts
  2. 15 3
      src/views/pms/iotopeationfill/index1.vue

+ 1 - 0
src/api/pms/iotopeationfill/index.ts

@@ -39,6 +39,7 @@ export interface IotOpeationFillVO {
   isCollection: any
   description: any
   wellNamePair: any
+  noGasTasks: any
 }
 
 // 运行记录填报 API

+ 15 - 3
src/views/pms/iotopeationfill/index1.vue

@@ -59,7 +59,11 @@
                   </span>
                 </el-form-item>
                 <el-form-item
-                  v-if="deviceItem.deviceName === '生产日报' && (companyName !== 'ry' && companyName !== 'rh')"
+                  v-if="
+                    deviceItem.deviceName === '生产日报' &&
+                    companyName !== 'ry' &&
+                    companyName !== 'rh'
+                  "
                   label="井号"
                   class="custom-label1"
                 >
@@ -737,7 +741,8 @@ const rules = reactive<FormRules>({
   dailyGasInjection: [
     {
       validator: (_rule, value, callback) => {
-        if (companyName.value !== 'rh') return callback()
+        if (companyName.value !== 'rh' || !taskId.value || noGasTasks.value.includes(taskId.value))
+          return callback()
 
         const dailyInjectGasTime =
           attrList.value.find((item) => item.description === 'dailyInjectGasTime')?.fillContent || 0
@@ -815,6 +820,8 @@ const showComponent = () => {
   }
 }
 
+const noGasTasks = ref<number[]>([])
+
 /** 查询列表 */
 const getList = async () => {
   loading.value = true
@@ -834,13 +841,18 @@ const getList = async () => {
     }
     await getAttrList()
 
-    const daily = list.value.find((item) => item.deviceName === '生产日报') ?? { wellNamePair: {} }
+    const daily = list.value.find((item) => item.deviceName === '生产日报') ?? {
+      wellNamePair: {},
+      noGasTasks: []
+    }
 
     taskOptions.value = Object.keys(daily.wellNamePair ?? {}).map((key) => ({
       label: daily.wellNamePair[key],
       value: Number(key)
     }))
 
+    noGasTasks.value = (daily.noGasTasks ?? []).map(Number)
+
     taskId.value = taskOptions.value[0]?.value
 
     IotOpeationFillApi.getReportDetails(deptId.split(',')[3]).then((res) => {