Bläddra i källkod

关联样品名称回显

duy 2 år sedan
förälder
incheckning
69daef1f9c

+ 8 - 0
src/api/modules/tentative/detect/test.js

@@ -201,4 +201,12 @@ export default {
             params: form
         }, msg);
     },
+    //关联工程部位信息获取数据接口
+    async recordprojectPositiongetData(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-business/detection/self/record-projectPosition/getData',
+            method: 'post',
+            params: form
+        }, msg);
+    },
 }

+ 1 - 1
src/api/modules/tentative/index.js

@@ -38,4 +38,4 @@ export const getSampleInfo = (form, msg = true) => httpApi({
     url: '/api/blade-business/device/use/submit/getSampleInfo',
     method: 'get',
     params: form
-}, msg);
+}, msg);

+ 33 - 10
src/views/tentative/detect/components/ListItem.vue

@@ -286,7 +286,7 @@ const setFormDataNum = (datas) => {
     }
     formData.value = newArr
 }
-
+const sampledata=ref([])
 //展开事件
 const ActiveKey = ref('')
 const formKeyIds = ref('')
@@ -398,17 +398,37 @@ const setTableFormBlurReg = (pkeyId, event, key, reg, val, msg, item, index) =>
     }
 }
 //关联取样成功改变所有表格取样名称数据
-const changeSimpleInput=(infodata,id)=>{
-     formData.value.forEach((item)=>{
-         if(item.pkeyId==id){
-            for(let i in infodata){
-            item[i]=infodata[i]
-            }  
-         }
+// const changeSimpleInput=(infodata,id)=>{
+//      formData.value.forEach((item)=>{
+//          if(item.pkeyId==id){
+//             for(let i in infodata){
+//             item[i]=infodata[i]
+//             }  
+//          }
         
          
-     })
-     console.log(  formData.value,'  formData.value');
+//      })
+//      console.log(  formData.value,'  formData.value');
+// }
+const getsampleData=()=>{
+    console.log(sampledata.value,'sampledata.value');
+      if(sampledata.value.length>0){
+                   formData.value.forEach((ele)=>{
+                        sampledata.value.forEach((item)=>{
+                            if(item.tabPKeyId===ele.pkeyId){
+                                for(let i in item){
+                                    ele[i]=item[i]
+                                } 
+                            }
+                        })
+                    })
+     }
+}
+const changeSimpleInput=(infodata,id)=>{
+    sampledata.value=infodata
+
+    getsampleData()
+   
 }
 
 
@@ -431,6 +451,7 @@ const getBussDataInfo = async (item, index) => {
                         ...item,
                         isCollapseLoad: true
             }
+             getsampleData()
         }else{
             console.log(2222222222);
             data.forEach((item1)=>{
@@ -442,11 +463,13 @@ const getBussDataInfo = async (item, index) => {
                         ...resData, ...InitObj,
                         isCollapseLoad: true
                     }
+                      getsampleData()
                 }else {
                     formData.value[index] = {
                         ...getFormDataInit(item),
                         isCollapseLoad: true
                     }
+                       getsampleData()
                 }
             })
  

+ 3 - 2
src/views/tentative/detect/test-form.vue

@@ -14,7 +14,7 @@
             <template #extra>
                 <el-button type="primary" hc-btn @click="linksRelateModalClick" :disabled="listItemData.length <= 0">关联工程用途及部位</el-button>
                 <el-button :type="isMixRatioTestIds ? 'primary' : ''" hc-btn :disabled="!isMixRatioTestIds" @click="linksRawModalClick">关联原材检测报告</el-button>
-                <el-button type="primary" hc-btn @click="linksSampleModalClick" :disabled="iscanclick">关联取样</el-button>
+                <el-button type="primary" hc-btn @click="linksSampleModalClick" >关联取样</el-button>
             </template>
             <template #search>
                 <div class="flex-1">
@@ -779,8 +779,9 @@ const linksSampleModalSave =async () => {
 //获取关联取样信息key值
 const getrecordsamplegetData = async() => {
     const { error, code, data } = await dataApi.recordsamplegetData({
-        tabPKeyId: checkTabId.value,
         sampleIds:   listItemBaseData.value.sampleIds,
+        nodePKeyId:routerQuery?.nodeId,
+        contractId:contractId.value
         
     })
     return data