duy 2 сар өмнө
parent
commit
ff19daaa58

+ 17 - 0
src/api/modules/basic/code.js

@@ -103,5 +103,22 @@ export default {
             params: form,
         })
     },
+    //根据委托单id获取样品信息
+    
+   async getTrialSampleInfoByEntrustId(form) {
+        return HcApi({
+            url: '/api/blade-business/detection/self/getTrialSampleInfoByEntrustId',
+            method: 'get',
+            params: form,
+        })
+    },
+        //根据样品id获取样品关联的委托单信息
+      async getEntrustInfoBySampleId(form) {
+        return HcApi({
+            url: '/api/blade-business/detection/self/getEntrustInfoBySampleId',
+            method: 'get',
+            params: form,
+        })
+    },
 }
 

+ 36 - 1
src/views/tentative/detect/components/basicInfo.vue

@@ -483,7 +483,7 @@ const linksSampleModalSave = () => {
     if (tableSampleCheckedKeys.value.length > 0) {
       basicInfoData.value.trialSampleInfo = tableSampleCheckedKeys.value[0]
         basicInfoData.value.sampleIds = tableSampleCheckedKeys.value[0].id
-
+        getCommissionByYo(basicInfoData.value.sampleIds)
 
     }
     
@@ -515,9 +515,44 @@ console.log(id, data)
 
     basicInfoData.value.entrustNo = entrustNo
      basicInfoData.value.entrustId = id
+     getYPbyCommission(id)
 
    
 }
+//根据委托单id获取样品信息
+const getYPbyCommission = async (id)=>{
+     
+    const { error, code, data } = await codeApi.getTrialSampleInfoByEntrustId({
+       entrustId: id,
+      
+    })
+    //处理数据
+ 
+    if (!error && code === 200) {
+        console.log(data, 'data')
+        basicInfoData.value.trialSampleInfo = getObjValue(data)    
+    }
+}
+//根据样品信息获取委托单信息
+
+    
+const getCommissionByYo = async (id)=>{
+      
+    const { error, code, data } = await codeApi.getEntrustInfoBySampleId({
+       sampleId: id,
+      
+    })
+    //处理数据
+ 
+    if (!error && code === 200) {
+        console.log(data, 'data')
+        basicInfoData.value.entrustNo = data.entrustNo
+
+        // basicInfoData.value.trialSampleInfo = getObjValue(data)    
+    }
+}
+
+
 
 //关联设备
 //关联设备数据