Pārlūkot izejas kodu

新增生成表单

duy 2 gadi atpakaļ
vecāks
revīzija
1de413f252
1 mainītis faili ar 18 papildinājumiem un 6 dzēšanām
  1. 18 6
      src/views/tentative/detect/test-form.vue

+ 18 - 6
src/views/tentative/detect/test-form.vue

@@ -387,7 +387,7 @@ const getSearchNodeTables = async () => {
     } else {
         queryNodeStatus()//查询按钮状态
         const {error, code, data} = await dataApi.searchNodeTables({
-            id: dataId,
+            id: dataId.length > 0 ? dataId : nodeIdvalue.value,
             projectId: projectId.value,
             contractId: contractId.value,
             primaryKeyId: nodeId,
@@ -990,14 +990,18 @@ const tableFormSaveClick = async () => {
 
         if (isaddType) { //新增
             if (setTypes.length > 1) {
+                console.log(setTypes.length,'setTypes.length222222');
                 FormData = alllistData.value;
                 listItemBaseData.value.tableType = "1,2"
             } else {
-
+                console.log(setTypes.length,'setTypes.length22222255555');
+                console.log(afterAdd.value,'afterAdd.value5');
                 // FormData = alllistData.value.filter(e => e.type == type);
                 if (!afterAdd.value) {
                     FormData = alllistData.value.filter(e => e.type == type);
-                } else {
+                } 
+          
+                else {
                     let filterType = type ? type : tabTypeKey.value
                     //   FormData =alllistData.value.filter(e => e.type == type);
                     FormData = alllistData.value.filter(e => e.type == filterType);
@@ -1029,8 +1033,11 @@ const tableFormSaveClick = async () => {
             FormData = alllistData.value;
 
             const info = getStoreValue('test-form')
-            let recordNo = info.recordNo
-            let reportNo = info.reportNo
+           
+      
+            let recordNo = info?.recordNo|| tabTypeKey.value==1?listItemBaseData.value.id:''
+            
+            let reportNo = info?.reportNo|| tabTypeKey.value==2?listItemBaseData.value.id:''
 
             //组装type
             if (recordNo === '' && reportNo !== '') {
@@ -1156,7 +1163,7 @@ const tableFormSaveClick = async () => {
                     // alllistData.value.forEach(e => e.oper = false)
                     alllistData.value = []
                     if (!isaddType) {
-                        bussPdfsClick(router.currentRoute.value.query.id)
+                        bussPdfsClick(router.currentRoute.value.query.id|| listItemBaseData.value.id)
                         //   toBackClick()
                         getSearchNodeTables()
                         getSearchNodeTablesall(1)
@@ -1168,6 +1175,11 @@ const tableFormSaveClick = async () => {
                         getSearchNodeTablesall(1)
                         getSearchNodeTablesall(2)
                         afterAdd.value = true
+                        isaddType=false
+              
+                  
+                        
+                    
                         // toBackClick()
                         //  setTimeout(() => {
                         //         window?.location?.reload()  //刷新页面