Przeglądaj źródła

关联取样回填信息

duy 2 lat temu
rodzic
commit
a170f476e8

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

@@ -193,4 +193,12 @@ export default {
             data: form
         }, msg);
     },
+    //获取当前样品信息对应到表字段关系接口
+    async recordsamplegetData(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-business/detection/self/record-sample/getData',
+            method: 'post',
+            params: form
+        }, msg);
+    },
 }

+ 12 - 9
src/views/tentative/detect/components/ListItem.vue

@@ -304,7 +304,8 @@ const CollapseChange = async (name) => {
         getOffsetTop(name)
         const index = names[1]
         let item = listDatas.value[index]
-          emit('upcheckTableId', item.id)
+          emit('upcheckTableId', item.pKeyId)
+           emit('changeIscanclick', item.pKeyId)
         formKeyIds.value = getValString(item.pKeyId)
         console.log(alllistDataval.value,'alllistDataval');
         alllistDataval.value.forEach((item1)=>{
@@ -397,14 +398,16 @@ const setTableFormBlurReg = (pkeyId, event, key, reg, val, msg, item, index) =>
     }
 }
 //关联取样成功改变所有表格取样名称数据
-const changeSimpleInput=()=>{
-    // let bussDataInfoTrialData={key_31__2_1: "55555555555"}
-    //  formData.value.forEach((item)=>{
-    //      for(let i in bussDataInfoTrialData){
-    //         item[i]=bussDataInfoTrialData[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');
 }
 
@@ -1108,7 +1111,7 @@ const specialNodeClick = async () => {
 }
 
 //事件
-const emit = defineEmits(['renew','offsetTop','updeviceUseIds','upcheckTableId','changesdate','chageorinData'])
+const emit = defineEmits(['renew','offsetTop','updeviceUseIds','upcheckTableId','changesdate','chageorinData','changeIscanclick'])
 
 //被点击
 const getOffsetTop = (key = '') => {

+ 20 - 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">关联取样</el-button>
+                <el-button type="primary" hc-btn @click="linksSampleModalClick" :disabled="iscanclick">关联取样</el-button>
             </template>
             <template #search>
                 <div class="flex-1">
@@ -48,6 +48,7 @@
                 :tabTypeKey="tabTypeKey"
                  @updeviceUseIds="updeviceUseIds"
                  @upcheckTableId="upcheckTableId"
+                 @changeIscanclick="changeIscanclick"
                  :nodeIdvalue="nodeIdvalue"
                  :alllistData="alllistData"
                  @changesdate="changeorinsdate"
@@ -453,6 +454,10 @@ const checkTabId=ref('')
 const upcheckTableId = (val) => {
     checkTabId.value=val
 }
+const  iscanclick=ref(true)
+const changeIscanclick=(id)=>{
+     iscanclick.value=false
+}
 //关联工程用途及部位 树
 const linksRelateModal = ref(false)
 const linksRelateModalClick = () => {
@@ -659,6 +664,7 @@ const linksSampleModal = ref(false)
 const linksSampleModalClick = () => {
     linksSampleTableData.value = [];
     linksSampleModal.value = true
+    
 }
 
 //搜索表单
@@ -750,11 +756,23 @@ const linksSampleModalSave =async () => {
         listItemBaseData.value.sampleIds = rowsToId(rows) || '';
         window.$message?.success('操作成功')
         isopersampleIds.value=true
-        ListItemRef.value.changeSimpleInput()
+         let infodata= await getrecordsamplegetData()
+        ListItemRef.value.changeSimpleInput(infodata,checkTabId.value)
         tableSampleCheckedKeys.value = [];
+       
         linksSampleModal.value = false
     
 }
+//获取关联取样信息key值
+const getrecordsamplegetData = async() => {
+    const { error, code, data } = await dataApi.recordsamplegetData({
+        tabPKeyId: checkTabId.value,
+        sampleIds:   listItemBaseData.value.sampleIds,
+        
+    })
+    return data
+}
+
 
 //关闭关联取样
 const linksSampleModalClose = () => {