黄梓星 1 жил өмнө
parent
commit
ae05ef3901

+ 19 - 10
src/views/material/classify/index.vue

@@ -7,7 +7,7 @@
         <div>
           <el-button type="primary" size="mini" plain @click="addClassify">新增</el-button>
           <el-button type="primary" size="mini" plain @click="editClassify">修改</el-button>
-          <el-button type="primary" size="mini" plain @click="refreshData">{{refreshName == '2'? '查询启用': '查询停用'}}</el-button>
+          <el-button type="primary" size="mini" plain @click="refreshData">{{refreshName ? '全部分类': '过滤停用'}}</el-button>
           <el-button type="primary" size="mini" plain @click="deleteClassify">删除</el-button>
         </div>
       </el-row>
@@ -207,7 +207,8 @@ export default {
       // 判断是新增还是修改
       isAdd: true,
       defaultExpanded: [],
-      refreshName: '0'
+      // 是否过滤停用
+      refreshName: false
     };
   },
   watch: {
@@ -216,7 +217,7 @@ export default {
     },
   },
   created() {
-    this.getTreeData(this.refreshName);
+    this.getTreeData();
     //
   },
   mounted() {},
@@ -224,8 +225,7 @@ export default {
     // 获取树形结构
     getTreeData(isEnable) {
       this.loading = true;
-      getTree({isEnable: isEnable})
-        .then((res) => {
+      getTree({}).then((res) => {
           let { code, rows } = res;
           if (code === 200) {
             this.data = rows;
@@ -389,12 +389,21 @@ export default {
     },
     // 启用停用
     refreshData() {
-      if(this.refreshName == '0') {
-        this.refreshName = '2'
-        this.getTreeData(this.refreshName);
+      if(this.refreshName == false) {
+        this.refreshName = true
+        this.loading = true;
+        getTree({isEnable: '0'}).then((res) => {
+          let { code, rows } = res;
+          if (code === 200) {
+            this.data = rows;
+          }
+        })
+        .finally(() => {
+          this.loading = false;
+        });
       } else {
-        this.refreshName = '0'
-        this.getTreeData(this.refreshName);
+        this.refreshName = false
+        this.getTreeData();
       }
     },
   },

+ 1 - 0
src/views/purchase/contract/add/index.vue

@@ -109,6 +109,7 @@ export default {
     },
     //
     async changePaymentAgreement(prop) {
+      console.log('合同参数', prop)
       const {
         selectData: { code },
       } = prop;