Bladeren bron

业务所属公司

zhuangyunsheng 1 jaar geleden
bovenliggende
commit
30e9c1448f

+ 1 - 1
src/components/scChengTou/purchase/apply.vue

@@ -147,7 +147,7 @@
 					planName: null,
 					name: null,
 					deptId: this.$TOOL.data.get("USER_INFO").deptId,
-					belongDeptId: this.$TOOL.data.get("USER_INFO").deptId,
+					belongDeptId: null,
 					type: null,
                     specialFeeType: null,
 					purchaseType: null,

+ 1 - 1
src/components/scChengTou/purchase/plan.vue

@@ -158,7 +158,7 @@
 					contractPlanCode: null,
 					planName: null,
 					deptId: this.$TOOL.data.get("USER_INFO").deptId,
-					belongDeptId: this.$TOOL.data.get("USER_INFO").deptId,
+					belongDeptId: null,
 					type: null,
 					createId: this.$TOOL.data.get("USER_INFO").id,
 					createName: this.$TOOL.data.get("USER_INFO").nickName,

+ 8 - 7
src/components/scChengTou/treeSelect.vue

@@ -9,7 +9,7 @@
 
 <template>
 	<div class="sc-tree-select">
-		<el-tree-select v-model="defaultValue" :props="defaultProps" lazy :load="loadNode" :cache-data="cacheData" v-bind="$attrs" @node-click="nodeClick"></el-tree-select>
+		<el-tree-select v-model="defaultValue" :props="defaultProps" filterable default-expand-all lazy :load="loadNode" v-bind="$attrs" @node-click="nodeClick"></el-tree-select>
 	</div>
 </template>
 
@@ -31,7 +31,6 @@
 			return {
 				defaultValue: null,
 				treeList: [],
-				cacheData: [],
 				defaultProps: {
 					label: config.props.label,
 					value: config.props.value,
@@ -43,7 +42,6 @@
 		watch: {
 			modelValue(val) {
 				this.defaultValue = val;
-				this.cacheData = this.treeList.filter(t => t[this.defaultProps.value] == this.modelValue);
 			}
 		},
 
@@ -57,11 +55,14 @@
 			async loadNode({ level, data }, resolve) {
 				if (this.apiObj) {
 					if (level == 0) {
-						const res = await this.apiObj[this.apiKey]();
+                        const params = this.isAllDept && { deptType: "控股公司" } || {};
+                        const res = await this.apiObj[this.apiKey](params);
 						this.treeList = config.parseData(res) || [];
-						this.cacheData = this.treeList.filter(t => t[this.defaultProps.value] == this.modelValue);
-						if (this.isDept && !this.isAllDept) resolve(this.treeList.filter(t => t.deptId == this.$TOOL.data.get("USER_INFO").deptId));
-						else resolve(this.treeList.filter(t => t.pid == 0));
+                        
+						if (this.isDept) {
+                            if (this.isAllDept) resolve(this.treeList.filter(t => t.pid == 1));
+                            else resolve(this.treeList.filter(t => t.deptId == this.$TOOL.data.get("USER_INFO").deptId));
+                        } else resolve(this.treeList.filter(t => t.pid == 0));
 						this.$emit("finished");
 					} else resolve(this.treeList.filter(t => t.pid == data[this.defaultProps.value]));
 				} else resolve([]);