Selaa lähdekoodia

质检表单保存自动展开

ZaiZai 1 vuosi sitten
vanhempi
commit
779b6587d9
2 muutettua tiedostoa jossa 40 lisäystä ja 20 poistoa
  1. 20 15
      src/views/data-fill/collapse-form/index.vue
  2. 20 5
      src/views/data-fill/wbs.vue

+ 20 - 15
src/views/data-fill/collapse-form/index.vue

@@ -68,7 +68,7 @@
                             </HcTooltip>
                             <HcTooltip keys="wbs_upload_table">
                                 <el-button
-                                   
+
                                     :type="item.tabFileType === 2 ? 'success' : 'primary'" plain
                                     @click.stop="uploadClick(item, index)"
                                 >
@@ -627,6 +627,10 @@ const CollapseChange = (name) => {
     }
 }
 
+const setCollapseKey = (key) => {
+    CollapseChange(key)
+}
+
 //初始设置
 const setFormDataNum = (datas) => {
     itemRefs.value = []
@@ -670,8 +674,8 @@ const setTableFormMenu = (info) => {
         newArr.push({ label: '清除数据', key: 'clear' })
     }
     console.log(treenodeDataInfo.value, 'treenodeDataInfo')
-   
-  
+
+
     tableFormMenu.value = newArr
 }
 
@@ -715,7 +719,7 @@ const handleMenuSelect = async ({ key }) => {
                         DragModalTableForm.value[draindex].isTableRender = false
                     }
                     await refs?.getTableFormInfo(pkeyId)
-              
+
                    nextTick(async ()=>{
                     listDatas.value[index].isTableRender = true
                     listDatas.value[index].isTableForm = true
@@ -723,16 +727,16 @@ const handleMenuSelect = async ({ key }) => {
                         let draindex = arrIndex( DragModalTableForm.value, 'pkeyId', pkeyId)
                         DragModalTableForm.value[draindex].isTableForm = true
                         DragModalTableForm.value[draindex].isTableRender = true
-                        listDatas.value[index].isWindow = false 
+                        listDatas.value[index].isWindow = false
                         DragModalTableForm.value.splice(draindex, 1)
                         await refs?.getTableFormInfo(pkeyId)
                         windowClick( listDatas.value[index], index)
-                     
+
                     }
                     window.$message.success(msg)
                    })
-                  
-                 
+
+
                 } else {
                     window.$message.error(msg)
                 }
@@ -746,7 +750,7 @@ const handleMenuSelect = async ({ key }) => {
 
     } else if (key === 'water') {
         console.log('含水率')
-      
+
         const { pkeyId } = tableFormItemNode.value
         const refs = await getFormRef(pkeyId)
         const formData = refs?.getFormData()
@@ -757,7 +761,7 @@ const handleMenuSelect = async ({ key }) => {
         } else {
             window.$message.warning('请先选择设计强度')
         }
-       
+
     }
 }
 
@@ -1267,8 +1271,8 @@ const uploadClick = (items, index) => {
                 }
                    //获取文件列表
                 getBussFileList(pkeyId)
-            }   
-           
+            }
+
         } else if (!isTableForm) {
             window?.$message?.warning('暂无表单数据')
         }
@@ -1371,7 +1375,7 @@ const getBussPdfInfo = async ({ pkeyId }, dragItem = null, showTip = true) => {
 
 //通知数据更新
 const renewData = () => {
-    emit('renew')
+    emit('renew', ActiveKey.value)
     ActiveKey.value = ''
 }
 
@@ -1605,9 +1609,9 @@ const HcUploadFileSuccess = async (res) => {
    if (resData) {
     refs?.setFormData(resData)
    }
-  
+
     dataHcUploadFileRef.value[0]?.setModalShow(false)
- 
+
 }
 const downloadLoading = ref(false)
 const getdownloadExcel = async (pKeyId)=>{
@@ -1668,6 +1672,7 @@ defineExpose({
     getFormRegExpJson,
     getActiveKey,
     setActiveKey,
+    setCollapseKey,
 })
 </script>
 

+ 20 - 5
src/views/data-fill/wbs.vue

@@ -689,7 +689,16 @@ import NodeTree from './components/nodeTree/index.vue'
 import HcTreeNode from './components/HcTreeNode.vue'
 import { getTokenHeader } from '~src/api/request/header'
 import { getStoreValue, setStoreValue } from '~src/utils/storage'
-import { deepClone, formValidate, getArrValue, getObjVal, getObjValue, isString, setCopyText } from 'js-fast-way'
+import {
+    deepClone,
+    formValidate,
+    getArrValue,
+    getObjVal,
+    getObjValue,
+    isNullES,
+    isString,
+    setCopyText,
+} from 'js-fast-way'
 import { eVisaTaskCheckApi, getDictionary } from '~api/other'
 import wbsApi from '~api/data-fill/wbs'
 import queryApi from '~api/data-fill/query'
@@ -855,16 +864,22 @@ const setContractType = (contractType) => {
     setElTreeMenu(contractType)
 }
 
-const getTableDataAll = () => {
-    searchNodeAllTable()
-    queryNodeStatus()
+const getTableDataAll = async (key) => {
+    await searchNodeAllTable()
+    await queryNodeStatus()
 //     wbstree.value.resetNode().then((res)=>{
 //         if(res){
 //             searchNodeAllTable()
 //             queryNodeStatus()
 //         }
-
 //  })
+    //保存后自动展开到当前表单
+    if (!isNullES(key)) {
+        console.log(key)
+        await nextTick(() => {
+            ListItemRef.value?.setCollapseKey(key)
+        })
+    }
 }
 
 //结构类型tab数据和相关处理