Procházet zdrojové kódy

基础信息回显修改

duy před 2 měsíci
rodič
revize
df285131f3
1 změnil soubory, kde provedl 24 přidání a 10 odebrání
  1. 24 10
      src/views/tentative/detect/components/basicInfo.vue

+ 24 - 10
src/views/tentative/detect/components/basicInfo.vue

@@ -83,6 +83,7 @@
                                         v-model="standardId"
                                         placeholder="请选择"
                                         style="width: 100%"
+                                        @change="changeStandard"
                                     >
                                         <el-option
                                             v-for="item in basicInfoData.standardVos"
@@ -287,28 +288,40 @@ const standardId = ref('')
 const ypList = ref([]) // 确保 ypList 已定义
 const ypLoad = ref(false)
 const getYpList = async (id)=>{
+    if (!id) {
+        return
+    }
         ypLoad.value = true
     const { error, code, data } = await codeApi.getStandardInfoByStandardId({
         standardId: id,
+
     })
     //处理数据
     ypLoad.value = false
     if (!error && code === 200) {
         ypList.value = getArrValue(data)
         console.log(ypList.value, 'ypList')
-        
-       
+            //   let idsArr = basicInfoData.value.standardInfoIds.split(',')
+            //   ypList.value.forEach((ele, index)=>{
+            //     ele.value = idsArr[index]
+            //   })
+               
+   
+   
     } else {
         ypList.value = []
     }
 }
 // 监听 standardId 的变化
-watch(standardId, async (newVal, oldVal) => {
-    if (newVal !== oldVal) {
-        getYpList(newVal)
-
-    }
-})
+// watch(standardId, async (newVal, oldVal) => {
+//     if (newVal !== oldVal) {
+//         getYpList(newVal)
+
+//     }
+// })
+const changeStandard = (val) => {
+     getYpList(val)
+}
 
 //监听
 watch(() => [
@@ -370,10 +383,11 @@ infoLoad.value = false
       console.log(data, '基础信息数据')
         basicInfoData.value = getObjValue(data)
         standardId.value = data?.standardId
-
+ 
         oldRecordNumber.value = data?.recordNo
         oldReportNumber.value = data?.reportNo
-   
+   ypList.value = basicInfoData.value.standardInfos
+       
 
 
         const { trialSampleInfo, trailDeviceUseInfoDTOS } = basicInfoData.value