wuhongyu 5 年之前
父节点
当前提交
cec7c42441
共有 1 个文件被更改,包括 55 次插入60 次删除
  1. 55 60
      src/views/enterprise/enterprisedg.vue

+ 55 - 60
src/views/enterprise/enterprisedg.vue

@@ -55,11 +55,14 @@ export default {
     dinggou2: [],
     dinggou3: [],
     skip: '',
+    skip1: '',
+    skip1: '',
+    skip2: '',
   }),
   created() {
-    this.jiaoyi1();
-    this.jiaoyi2();
-    this.jiaoyi3();
+    // this.jiaoyi1();
+    // this.jiaoyi2();
+    // this.jiaoyi3();
     this.faqijiaoyi();
   },
   computed: {
@@ -73,70 +76,58 @@ export default {
     async faqijiaoyi({ skip = 0, limit = 3, ...info } = {}) {
       let status = 0;
       let market_userid = this.user.uid;
-      skip = this.skip;
       if (this.user.role == '2' || this.user.role == '3') {
+        skip = this.skip1;
         const res = await this.transactionList({ skip, limit, market_userid, status, ...info });
         if (this.$checkRes(res)) {
           this.$set(this, `faqilist`, res.data);
           this.$set(this, `totalfaqi`, res.total);
         }
-      } else if (this.role == '6') {
-        const res = await this.expertsauditList({ skip, limit, market_userid, status, ...info });
-        if (this.$checkRes(res)) {
-          this.$set(this, `faqilist`, res.data);
-          this.$set(this, `totalfaqi`, res.total);
+        //
+        skip = this.skip;
+        const quanbures = await this.transactionList({ skip, limit, market_userid, ...info });
+        if (this.$checkRes(quanbures)) {
+          this.$set(this, `dinggou3`, quanbures.data);
+          this.$set(this, `total3`, quanbures.total);
         }
-      }
-    },
-    async jiaoyi1({ skip = 0, limit = 3, ...info } = {}) {
-      let status = 1;
-      let market_userid = this.user.uid;
-      skip = this.skip;
-      if (this.user.role == '2' || this.user.role == '3') {
-        const res = await this.transactionList({ skip, limit, market_userid, status, ...info });
-        if (this.$checkRes(res)) {
-          this.$set(this, `dinggou1`, res.data);
-          this.$set(this, `total1`, res.total);
+        //1
+        skip = this.skip2;
+        const ress = await this.transactionList({ skip, limit, market_userid, status: 1, ...info });
+        if (this.$checkRes(ress)) {
+          this.$set(this, `dinggou1`, ress.data);
+          this.$set(this, `total1`, ress.total);
         }
-      } else if (this.role == '6') {
-        const res = await this.expertsauditList({ skip, limit, market_userid, status, ...info });
-        if (this.$checkRes(res)) {
-          this.$set(this, `faqilist`, res.data);
-          this.$set(this, `totalfaqi`, res.total);
-        }
-      }
-    },
-    async jiaoyi2({ skip = 0, limit = 3, ...info } = {}) {
-      let status = 2;
-      let market_userid = this.user.uid;
-      skip = this.skip;
-      if (this.user.role == '2' || this.user.role == '3') {
-        const res = await this.transactionList({ skip, limit, market_userid, status, ...info });
-        if (this.$checkRes(res)) {
-          this.$set(this, `dinggou2`, res.data);
-          this.$set(this, `total2`, res.total);
+        //2
+        skip = this.skip3;
+        const resss = await this.transactionList({ skip, limit, market_userid, status: 2, ...info });
+        if (this.$checkRes(resss)) {
+          this.$set(this, `dinggou2`, resss.data);
+          this.$set(this, `total2`, resss.total);
         }
       } else if (this.role == '6') {
+        skip = this.skip1;
         const res = await this.expertsauditList({ skip, limit, market_userid, status, ...info });
         if (this.$checkRes(res)) {
           this.$set(this, `faqilist`, res.data);
           this.$set(this, `totalfaqi`, res.total);
         }
-      }
-    },
-    async jiaoyi3({ skip = 0, limit = 3, ...info } = {}) {
-      skip = this.skip;
-      if (this.user.role == '2' || this.user.role == '3') {
-        const res = await this.transactionList({ skip, limit, ...info });
-        if (this.$checkRes(res)) {
-          this.$set(this, `dinggou3`, res.data);
-          this.$set(this, `total3`, res.total);
+        skip = this.skip2;
+        const acc = await this.expertsauditList({ skip, limit, market_userid, status: 1, ...info });
+        if (this.$checkRes(acc)) {
+          this.$set(this, `dinggou1`, acc.data);
+          this.$set(this, `total1`, acc.total);
         }
-      } else if (this.role == '6') {
-        const res = await this.expertsauditList({ skip, limit, market_userid, status, ...info });
-        if (this.$checkRes(res)) {
-          this.$set(this, `faqilist`, res.data);
-          this.$set(this, `totalfaqi`, res.total);
+        skip = this.skip3;
+        const add = await this.expertsauditList({ skip, limit, market_userid, status: 2, ...info });
+        if (this.$checkRes(add)) {
+          this.$set(this, `dinggou2`, add.data);
+          this.$set(this, `total2`, add.total);
+        }
+        skip = this.skip;
+        const aff = await this.expertsauditList({ skip, limit, market_userid, ...info });
+        if (this.$checkRes(aff)) {
+          this.$set(this, `dinggou3`, aff.data);
+          this.$set(this, `total3`, aff.total);
         }
       }
     },
@@ -145,37 +136,41 @@ export default {
     async jiaoyisuccess({ item }) {
       item.status = '1';
       let res = await this.shenheupdate(item);
-      this.jiaoyi1();
+      this.faqijiaoyi();
       this.$checkRes(res, '同意成功', '审核失败');
     },
     async shibai({ item }) {
       item.status = '3';
       let res = await this.shenheupdate(item);
       this.$checkRes(res, '审核成功', '审核失败');
-      this.jiaoyi3();
+      this.faqijiaoyi();
     },
     async success({ item }) {
       item.status = '2';
       let res = await this.shenheupdate(item);
       this.$checkRes(res, '审核成功', '审核失败');
-      this.jiaoyi2();
+      this.faqijiaoyi();
     },
     //分页
     async handleCurrentChangefaqi({ skip, limit, currentPage }) {
-      this.$set(this, `skip`, skip);
+      //0
+      this.$set(this, `skip1`, skip);
       this.faqijiaoyi();
     },
     async change1({ skip, limit, currentPage }) {
-      this.$set(this, `skip`, skip);
-      this.jiaoyi1();
+      //1
+      this.$set(this, `skip2`, skip);
+      this.faqijiaoyi();
     },
     async change2({ skip, limit, currentPage }) {
-      this.$set(this, `skip`, skip);
-      this.jiaoyi2();
+      //3
+      this.$set(this, `skip3`, skip);
+      this.faqijiaoyi();
     },
     async change3({ skip, limit, currentPage }) {
+      //全部
       this.$set(this, `skip`, skip);
-      this.jiaoyi3();
+      this.faqijiaoyi();
     },
     async deleteData({ item }) {
       const res = await this.transactiondtetle(item.id);