Browse Source

修改app表单

ZaiZai 1 year ago
parent
commit
8b55b608e5

+ 10 - 0
public/plugins/app.js

@@ -63,3 +63,13 @@ function delFormTap()
         data: {},
     })
 }
+
+//日志填报,更新关联工序
+function linkIdsTap(data)
+{
+    window?.postMessage({
+        type: 'linkIds',
+        source: 'app',
+        data: data,
+    })
+}

+ 8 - 8
src/views/ledger/components/table-form.vue

@@ -130,15 +130,15 @@
                     :default-expanded-keys="defaultExpanded" :load="ElTreeLoadNode" :props="processTreeProps"
                     check-strictly
                     class="my-tree" lazy node-key="primaryKeyId"
-                    show-checkbox 
+                    show-checkbox
                 /> -->
-                <HcLazyTree 
+                <HcLazyTree
                     ref="processElTree"
-               
+
                     :h-props="processTreeProps"
-                    :auto-expand-keys="defaultExpanded" 
-                    check-strictly show-checkbox 
-                    :default-checked-keys="defaultChecked" 
+                    :auto-expand-keys="defaultExpanded"
+                    check-strictly show-checkbox
+                    :default-checked-keys="defaultChecked"
                     @load="ElTreeLoadNode"
                 />
             </div>
@@ -488,7 +488,7 @@ const processNodeClick = () => {
         let pathArr = []
         let node = processElTree.value.treeRef.getNode(keys[index])
         getPathName(node, pathArr)
-        
+
         linkTabIds.push({
             path: pathArr.join('/'),
             primaryKeyId: keys[index],
@@ -613,7 +613,7 @@ const queryCurrentLogSelectProcessList = async (bid) => {
             let linkTabIds = getArrValue(data)
             formLogDataList.value[formIndex]['linkTabIds'] = linkTabIds
             processDataList.value = linkTabIds
-        
+
         } else {
             processDataList.value = []
             defaultChecked.value = []

+ 16 - 1
src/views/uni-app/components/log-form.vue

@@ -64,6 +64,9 @@ const setMessage = ({ data, type }) => {
         addTableFormClick()
     } else if (type === 'delForm') {
         delTableFormClick()
+    } else if (type === 'linkIds') {
+        let ids = data ? JSON.parse(data) : []
+        linkTableFormClick(ids)
     }
 }
 
@@ -181,7 +184,6 @@ const addTableFormClick = () => {
     getBussDataInfo(index)
 }
 
-
 //删除当前页
 const delTableFormClick = () => {
     const index = formLogIndex.value
@@ -201,6 +203,19 @@ const setFormLength = () => {
     })
 }
 
+//更新关联工序
+const linkTableFormClick = (data) => {
+    const index = formLogIndex.value
+    const formLog = formLogDataList.value
+    const info = getObjValue(formLog[index])
+    info.linkTabIds = data
+    formLogDataList.value[index] = info
+    tableFormInfo.value.linkTabIds = data
+
+    console.log('formLogDataList', formLogDataList.value)
+    console.log('tableFormInfo', tableFormInfo.value)
+}
+
 //切换显示模式
 const tableWidth = ref(0)
 const editTypeClick = (type) => {