Browse Source

新增子节点加载树更改

duy 2 năm trước cách đây
mục cha
commit
a878977a03

+ 2 - 3
src/api/modules/data-fill/wbs.js

@@ -81,11 +81,10 @@ export default {
             params: form
         },msg);
     },
-    //根据id获取合同段树
     async queryWbsTreeContractByContractIdAndId(form, msg = true) {
         return httpApi({
-            url: '/api/blade-business/informationWriteQuery/queryWbsTreeContractByContractIdAndId',
-            method: 'post',
+            url: '/api/blade-manager/contractInfo/tree',
+            method: 'get',
             params: form
         },msg);
     },

+ 12 - 4
src/views/data-fill/components/HcTreeNode.vue

@@ -51,6 +51,10 @@ const props = defineProps({
         type: Boolean,
         default: false
     },
+    wbsId:{
+        type: [String, Number],
+        default: ''
+    }
 })
 
 //变量
@@ -58,6 +62,7 @@ const ElTreeRef = ref(null)
 const projectId = ref(props.projectId)
 const contractId = ref(props.contractId)
 const isStrictly = ref(props.strictly)
+const wbsId=ref(props.wbsId)
 const ElTreeProps = ref({label: 'title', children: 'children', isLeaf: 'notExsitChild'})
 const  isElTreeLoadNode=ref(false)
 
@@ -65,11 +70,14 @@ const  isElTreeLoadNode=ref(false)
 watch(() => [
     props.projectId,
     props.strictly,
-    props.contractId
-], ([pid, strictly,cid]) => {
+    props.contractId,
+    props.wbsId
+], ([pid, strictly,cid,wid]) => {
     projectId.value = pid
     contractId.value = cid
     isStrictly.value = strictly
+    wbsId.value=wid
+
 })
 
 //渲染完成
@@ -85,8 +93,8 @@ const ElTreeData = ref([])
 const ElTreeLoadNode = async () => {
     isElTreeLoadNode.value=true
     let nodeId = props.oldId || props.nodeId || ''
-    const {error, code, data} = await wbsApi.queryWbsTreePrivateByProjectIdAndId({
-        id: nodeId,
+    const {error, code, data} = await wbsApi.queryWbsTreeContractByContractIdAndId({
+        wbsId: wbsId.value,
         contractId: contractId.value,
         projectId: projectId.value,
     })

+ 2 - 2
src/views/data-fill/wbs.vue

@@ -429,9 +429,9 @@
                   widths="720px" @close="addNodeModal = false">
             <el-alert :closable="false" title="双击节点,可编辑节点名称,编辑完成后,请按回车或输入框消失后,再点提交"
                       type="warning"/>
-            <HcTreeNode v-if="addTreeNodeType === '1'" :nodeId="addTreeNodeId" :oldId="addTreeNodeOldId"   :contractId="contractId"
+            <HcTreeNode v-if="addTreeNodeType === '1'" :nodeId="addTreeNodeId" :oldId="addTreeNodeOldId"   :contractId="contractId" :wbsId="projectInfo.referenceWbsTemplateId"
                         :projectId="projectId" @check-change="addTreeNodeCheckChange"/>
-            <HcTreeNode v-if="addTreeNodeType === '2'" :nodeId="addTreeNodeId" :oldId="addTreeNodeOldId"    :contractId="contractId"
+            <HcTreeNode v-if="addTreeNodeType === '2'" :nodeId="addTreeNodeId" :oldId="addTreeNodeOldId"    :contractId="contractId" :wbsId="projectInfo.referenceWbsTemplateId"
                         :projectId="projectId"
                         strictly @check-change="addTreeNodeCheckChange"/>
             <template #footer>