duy vor 2 Jahren
Ursprung
Commit
aa8175451b
2 geänderte Dateien mit 7 neuen und 5 gelöschten Zeilen
  1. 3 2
      src/views/tentative/detect/test-form.vue
  2. 4 3
      src/views/tentative/detect/test.vue

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

@@ -180,9 +180,10 @@ const isaddType = routerQuery?.isaddType || false;
 const dayDate = dayjs().format('YYYY-MM-DD')
 const testTreeItem = ref(getStoreData('testTreeItem'));
 const isMixRatioTestIds = ref(false);
-
+const tabTypeKey = ref('')
 //渲染完成
 onMounted(() => {
+    tabTypeKey.value= routerQuery?.tabTypeKey || '1'
     const { title, mixRatioTestIds} = getObjValue(testTreeItem.value);
      const info = getStoreData('test-form') || {}
     isMixRatioTestIds.value = !(!mixRatioTestIds || mixRatioTestIds <= 0);
@@ -211,7 +212,7 @@ const authBtnTabClick = (val) => {
 }
 
 //类型tab数据和相关处理
-const tabTypeKey = ref('1')
+
 const tabTypeTab = ref([
     {key:'1',  name: '记录表'},
     {key:'2', name: '报告单'},

+ 4 - 3
src/views/tentative/detect/test.vue

@@ -92,10 +92,10 @@
                 </template>
                 <HcTable ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" isCheck @selection-change="tableSelection">
                     <template #recordNo="{row}">
-                        <span class="text-link" @click="tableRowEdit(row)">{{row?.recordNo}}</span>
+                        <span class="text-link" @click="tableRowEdit(row,'1')">{{row?.recordNo}}</span>
                     </template>
                     <template #reportNo="{row}">
-                        <span class="text-link" @click="tableRowEdit(row)">{{row?.reportNo}}</span>
+                        <span class="text-link" @click="tableRowEdit(row,'2')">{{row?.reportNo}}</span>
                     </template>
                     <template #trialProjectName="{row}">
                         <span class="text-link font-bold" @click="tableRowPdf(row)">{{row?.trialProjectName}}</span>
@@ -368,7 +368,7 @@ const addFormModalClick = () => {
 }
 
 //编辑
-const tableRowEdit = (row) => {
+const tableRowEdit = (row,tabTypeKey) => {
     setStoreData('test-form', row)
     setStoreData('prenodeDataInfo', nodeDataInfo.value)
     console.log(JSON.stringify(nodeDataInfo.value),'JSON.stringify(nodeDataInfo.value)');
@@ -378,6 +378,7 @@ const tableRowEdit = (row) => {
             id: row.id,
             nodeId: row.nodeId,
             dataType: row.type,
+            tabTypeKey:tabTypeKey
             // prenodeDataInfo:JSON.stringify(nodeDataInfo.value)
 
         }