浏览代码

监理合同段新增参数

duy 2 年之前
父节点
当前提交
f22cb63464
共有 1 个文件被更改,包括 17 次插入3 次删除
  1. 17 3
      src/views/other-file/components/WbsTree.vue

+ 17 - 3
src/views/other-file/components/WbsTree.vue

@@ -22,6 +22,7 @@ import {ref, nextTick, watch} from "vue";
 import {queryTreeList} from '~api/ledger';
 import {getTreeNodeType} from '~uti/utils';
 import {isItem, getArrValue, getObjValue} from "vue-utils-plus"
+import {useAppStore} from "~src/store";
 //参数
 const props = defineProps({
     projectId: {
@@ -56,11 +57,13 @@ const ElTreeProps = ref({
     children: 'children',
     isLeaf: 'notExsitChild'
 })
-
+const useAppState = useAppStore()
 const isAutoKeys = ref(props.isAutoKeys)
 const TreeExpandKey = ref(props.autoExpandKeys)
 const projectId = ref(props.projectId);
 const contractId = ref(props.contractId);
+const contractInfo = ref(useAppState.getContractInfo);
+
 
 //监听
 watch(() => [
@@ -74,7 +77,15 @@ watch(() => [
     projectId.value = UserProjectId
     contractId.value = UserContractId
 })
-
+//获取合同段类型
+const getContractTypeKey = () => {
+    const { contractType } = contractInfo.value;
+    if (contractType === 2 || contractType === 3) {
+        return '2' ?? '1'
+    } else {
+        return null
+    }
+}
 //树形结构异步加载数据
 const defaultExpandedCids = ref([])
 const ElTreeLoadNode = async (node, resolve) => {
@@ -86,11 +97,14 @@ const ElTreeLoadNode = async (node, resolve) => {
         parentId = nodeData?.id ?? ''
     }
     //获取数据
+      const classifyType = getContractTypeKey();
+      console.log(classifyType,'classifyType');
     const {error, code, data} = await queryTreeList({
         contractId: contractId.value || '',
         contractIdRelation,
         primaryKeyId,
-        parentId
+        parentId,
+        classifyType:classifyType
     })
     //处理数据
     if (!error && code === 200) {