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