Przeglądaj źródła

fix:订单页面点击部门搜索优化

刘恒 2 lat temu
rodzic
commit
2e4d1f889a

+ 1 - 1
src/components/tree/tree.vue

@@ -61,7 +61,7 @@ export default {
     onExpand(expandedKeys) {
       this.expandedKeys = expandedKeys;
       //expandedKeys
-      this.autoExpandParent = true;
+      this.autoExpandParent = false;
     },
     setExpandKys(item) {
       this.$nextTick(() => {

+ 8 - 1
src/pages/quote/quote.vue

@@ -4,7 +4,7 @@
       <div><h2>部门所属</h2></div>
       <div>
         <!-- <a-tree  :tree-data="treeData" /> -->
-        <tree @getList="getVerification"></tree>
+        <tree @getList="chooseTree"></tree>
       </div>
     </div>
     <div class="back-line-main">
@@ -254,6 +254,7 @@ export default {
         { title: "Tree Node", key: "2", isLeaf: true },
       ],
       BigOrder: {},
+      deptId: undefined,
     };
   },
   mounted() {
@@ -262,6 +263,10 @@ export default {
     // }, 1000);
   },
   methods: {
+    chooseTree(val) {
+      this.deptId = val;
+      this.getVerification();
+    },
     getList() {
       this.pagination.current = 1;
       this.pagination.defaultPageSize = 10;
@@ -298,6 +303,7 @@ export default {
           pageNum: this.pagination.current,
           pageSize: this.pagination.defaultPageSize,
           ...this.formState,
+          deptId: this.deptId,
         })
         .then((res) => {
           if (res.data.code === 200) {
@@ -315,6 +321,7 @@ export default {
           // pageNum: this.pagination.current,
           // pageSize: this.pagination.defaultPageSize,
           ...this.formState,
+          deptId: this.deptId,
         })
         .then((res) => {
           if (res.data.code === 200) {

+ 7 - 1
src/pages/quote/smallorders/quote.vue

@@ -4,7 +4,7 @@
       <div><h2>部门所属</h2></div>
       <div>
         <!-- <a-tree  :tree-data="treeData" /> -->
-        <tree @getList="getVerification"></tree>
+        <tree @getList="chooseTree"></tree>
       </div>
     </div>
     <div class="back-line-main">
@@ -205,6 +205,7 @@ export default {
         { title: "Expand to load", key: "1" },
         { title: "Tree Node", key: "2", isLeaf: true },
       ],
+      deptId: undefined,
     };
   },
   mounted() {
@@ -213,6 +214,10 @@ export default {
     // }, 1000);
   },
   methods: {
+    chooseTree(val) {
+      this.deptId = val;
+      this.getVerification();
+    },
     onLoadData(treeNode) {
       return new Promise((resolve) => {
         if (treeNode.dataRef.children) {
@@ -262,6 +267,7 @@ export default {
           dateType: this.formState.dateType,
           beginDate: this.formState.beginDate,
           endDate: this.formState.endDate,
+          deptId: this.deptId,
         })
         .then((res) => {
           if (res.data.code === 200) {