Procházet zdrojové kódy

🐞 fix(ruido): 修复瑞都日报上传绑定id和platformWell

Zimo před 1 měsícem
rodič
revize
88dfc18c55
1 změnil soubory, kde provedl 15 přidání a 5 odebrání
  1. 15 5
      pages/ruiDu/compontents/report-form.vue

+ 15 - 5
pages/ruiDu/compontents/report-form.vue

@@ -1,12 +1,12 @@
 <script setup>
   import { useDataDictStore } from '@/store/modules/dataDict';
-import { onMounted, reactive, ref, computed, getCurrentInstance, watch } from 'vue';
+  import { onMounted, reactive, ref, computed, getCurrentInstance, watch } from 'vue';
 
   import tpfTimeRange from '@/components/tpf-time-range/tpf-time-range.vue';
-import deviceTransfer from '@/components/device-transfer/index.vue';
+  import deviceTransfer from '@/components/device-transfer/index.vue';
 
   import { updateRuiDuReportBatch, getRuiDuReportAttrs } from '@/api/ruiDu.js';
-import config from '@/utils/config';
+  import config from '@/utils/config';
 
   import { getTenantId, getAccessToken } from '@/utils/auth.js';
 
@@ -151,16 +151,26 @@ import config from '@/utils/config';
           attr.actualValue = Number(attr.actualValue);
         }
       });
+
+      let platformWell = props.reportData.platformWell;
+
+      if (platformWell === 1) {
+        platformWell = id === props.reportData.id ? 1 : 2;
+      }
+
       const data = {
         id,
         timeRange: ['1970-01-01T00:00:00.008Z', '1970-01-01T00:00:00.008Z'],
         projectDepartment: '',
         costCenter: '',
         dynamicFields: {},
-        platformWell: props.reportData.platformWell,
+        platformWell,
         companyId: props.reportData.companyId,
         deptId: props.reportData.deptId,
-        attachments: formDataCopy.attachments,
+        attachments: formDataCopy.attachments.map(item => {
+          item.bizId = id;
+          return item;
+        }),
         deviceIds: formDataCopy.deviceIds,
         startTime: formDataCopy.startTime,
         endTime: formDataCopy.endTime,