guhongwei 4 år sedan
förälder
incheckning
11d0641a6a

+ 5 - 7
src/views/adminCenter/applyInfo/index.vue

@@ -134,16 +134,14 @@ export default {
     this.search();
   },
   methods: {
-    ...dock(['query', 'delete', 'update', 'delete', 'updateGood']),
+    ...dock(['fetch', 'query', 'delete', 'update', 'delete', 'updateGood']),
     ...apply({ applyUpdate: 'update' }),
     async search() {
-      let res = await this.query({ uid: this.user.uid });
+      let res = await this.fetch(this.user.uid);
       if (this.$checkRes(res)) {
-        for (const val of res.data) {
-          this.$set(this, `applyList`, val.apply);
-          this.$set(this, `dock_id`, val.id);
-          this.$set(this, `total`, val.apply.length);
-        }
+        this.$set(this, `applyList`, res.data.apply);
+        this.$set(this, `dock_id`, res.data.id);
+        this.$set(this, `total`, res.data.apply.length);
       }
     },
     searchPage(page = 1) {

+ 2 - 4
src/views/adminCenter/basicInfo/index.vue

@@ -47,11 +47,9 @@ export default {
     ...authUser({ authUserFetch: 'fetch', authUserUpdate: 'update' }),
     async searchInfo() {
       if (this.user.uid) {
-        let res = await this.dockQuery({ uid: this.user.uid });
+        let res = await this.dockFetch(this.user.uid);
         if (this.$checkRes(res)) {
-          for (const val of res.data) {
-            this.$set(this, `form`, val);
-          }
+          this.$set(this, `form`, res.data);
         }
       }
     },

+ 4 - 6
src/views/adminCenter/dockInfo/index.vue

@@ -33,13 +33,11 @@ export default {
     this.search();
   },
   methods: {
-    ...dock(['query', 'delete', 'update', 'fetch']),
+    ...dock(['fetch', 'query', 'delete', 'update', 'fetch']),
     ...authUser({ authUserFetch: 'fetch', authUserUpdate: 'update', authUserDelete: 'delete' }),
-    async search({ skip = 0, limit = 10, ...info } = {}) {
-      let res = await this.query({ skip, limit, uid: this.user.uid });
-      for (const val of res.data) {
-        this.$set(this, `form`, val);
-      }
+    async search() {
+      let res = await this.fetch(this.user.uid);
+      this.$set(this, `form`, res.data);
     },
     // 展会信息修改
     async submitForm({ data }) {

+ 4 - 6
src/views/adminCenter/dynamicInfo/index.vue

@@ -53,12 +53,10 @@ export default {
   },
   methods: {
     ...transactions({ transactionsfetch: 'fetch', transactionslist: 'query', transactiondetele: 'detele', transactionupdate: 'update' }),
-    ...dock({ dockQuery: 'query' }),
-    async searchInfo({ skip = 0, limit = 10, ...info } = {}) {
-      let res = await this.dockQuery({ skip, limit, uid: this.user.uid });
-      for (const val of res.data) {
-        this.$set(this, `dock_id`, val.id);
-      }
+    ...dock({ dockQuery: 'query', dockFetch: 'fetch' }),
+    async searchInfo() {
+      let res = await this.dockFetch(this.user.uid);
+      this.$set(this, `dock_id`, res.data.id);
       let arr = await this.transactionslist({ skip, limit, dockid: this.dock_id, ...info });
       var zzqt = arr.data.filter(item => item.status === '0');
       var dcyx = arr.data.filter(item => item.status === '1');

+ 3 - 3
src/views/adminCenter/statisInfo/parts/achievements.vue

@@ -111,9 +111,9 @@ export default {
   },
   methods: {
     ...dock(['query', 'delete', 'update', 'fetch']),
-    async search({ skip = 0, limit = 10, ...info } = {}) {
-      let res = await this.query({ skip, limit, uid: this.user.uid, ...info });
-      let arr = res.data.map(item => item.apply.map(apply => apply.goodsList));
+    async search() {
+      let res = await this.fetch(this.user.uid);
+      let arr = res.data.apply.map(item => item.goodsList);
       arr = _.flattenDeep(arr);
       var newArr = arr.filter(item => item.totaltype === '1');
       this.$set(this, `applyList`, newArr);

+ 3 - 3
src/views/adminCenter/statisInfo/parts/technology.vue

@@ -111,9 +111,9 @@ export default {
   },
   methods: {
     ...dock(['query', 'delete', 'update', 'fetch']),
-    async search({ skip = 0, limit = 10, ...info } = {}) {
-      let res = await this.query({ skip, limit, uid: this.user.uid, ...info });
-      let arr = res.data.map(item => item.apply.map(apply => apply.goodsList));
+    async search() {
+      let res = await this.fetch(this.user.uid);
+      let arr = res.data.apply.map(item => item.goodsList);
       arr = _.flattenDeep(arr);
       var newArr = arr.filter(item => item.totaltype === '0');
       this.$set(this, `applyList`, newArr);

+ 6 - 9
src/views/adminCenter/transaction/index.vue

@@ -59,15 +59,12 @@ export default {
     ...productpact({ transactionQuery: 'query', productpactFetch: 'findpact', productpactUpdate: 'update' }),
     ...tranaudit({ tranauditList: 'query', tranauditListupdate: 'update' }),
     ...transactions({ transactionsfetch: 'fetch', transactionslist: 'query', transactiondetele: 'detele', transactionupdate: 'update' }),
-    ...dock({ dockQuery: 'query' }),
-    async search({ skip = 0, limit = 10, ...info } = {}) {
-      skip = this.skip;
-      let docklist = await this.dockQuery({ uid: this.user.uid });
-      for (const dock of docklist.data) {
-        const res = await this.transactionslist({ skip, dockid: dock.id, limit, ...info });
-        this.$set(this, `recruitInfo`, res.data);
-        this.$set(this, `total`, res.total);
-      }
+    ...dock({ dockQuery: 'query', dockFetch: 'fetch' }),
+    async search() {
+      const res = await this.dockFetch(this.user.uid);
+      const arr = await this.transactionslist({ skip, dockid: res.data.id, limit, ...info });
+      this.$set(this, `recruitInfo`, arr.data);
+      this.$set(this, `total`, arr.total);
     },
 
     async handleCurrentChange({ skip, limit, currentPage }) {

+ 4 - 6
src/views/adminCenter/vipInfo/index.vue

@@ -98,13 +98,11 @@ export default {
     ...apply({ applyUpdate: 'update' }),
     ...authUser({ authUserQuery: 'query', authUserCreate: 'create', authUserUpdate: 'update' }),
     async search() {
-      let res = await this.dockquery({ uid: this.user.uid });
+      let res = await this.dockFetch(this.user.uid);
       if (this.$checkRes(res)) {
-        for (const val of res.data) {
-          this.$set(this, `vipuserList`, val.vipuser);
-          this.$set(this, `dock_id`, val.id);
-          this.$set(this, `total`, val.vipuser.length);
-        }
+        this.$set(this, `vipuserList`, res.data.vipuser);
+        this.$set(this, `dock_id`, res.data.id);
+        this.$set(this, `total`, res.data.vipuser.length);
       }
     },
     searchvip(page = 1) {

+ 4 - 6
src/views/vipCenter/dynamicInfo/index.vue

@@ -53,12 +53,10 @@ export default {
   },
   methods: {
     ...transactions({ transactionsfetch: 'fetch', transactionslist: 'query', transactiondetele: 'detele', transactionupdate: 'update' }),
-    ...dock({ dockQuery: 'query' }),
-    async searchInfo({ skip = 0, limit = 10, ...info } = {}) {
-      let res = await this.dockQuery({ skip, limit, uid: this.user.uid });
-      for (const val of res.data) {
-        this.$set(this, `dock_id`, val.id);
-      }
+    ...dock({ dockQuery: 'query', dockFetch: 'fetch' }),
+    async searchInfo() {
+      let res = await this.dockFetch(this.user.uid);
+      this.$set(this, `dock_id`, res.data.id);
       let arr = await this.transactionslist({ skip, limit, dockid: this.dock_id, ...info });
       var zzqt = arr.data.filter(item => item.status === '0');
       var dcyx = arr.data.filter(item => item.status === '1');

+ 3 - 3
src/views/vipCenter/statisInfo/parts/achievements.vue

@@ -111,9 +111,9 @@ export default {
   },
   methods: {
     ...dock(['query', 'delete', 'update', 'fetch']),
-    async search({ skip = 0, limit = 10, ...info } = {}) {
-      let res = await this.query({ skip, limit, uid: this.user.uid, ...info });
-      let arr = res.data.map(item => item.apply.map(apply => apply.goodsList));
+    async search() {
+      let res = await this.fetch(this.user.uid);
+      let arr = res.data.apply.map(item => item.goodsList);
       arr = _.flattenDeep(arr);
       var newArr = arr.filter(item => item.totaltype === '1');
       this.$set(this, `applyList`, newArr);

+ 3 - 3
src/views/vipCenter/statisInfo/parts/technology.vue

@@ -111,9 +111,9 @@ export default {
   },
   methods: {
     ...dock(['query', 'delete', 'update', 'fetch']),
-    async search({ skip = 0, limit = 10, ...info } = {}) {
-      let res = await this.query({ skip, limit, uid: this.user.uid, ...info });
-      let arr = res.data.map(item => item.apply.map(apply => apply.goodsList));
+    async search() {
+      let res = await this.fetch(this.user.uid);
+      let arr = res.data.apply.map(item => item.goodsList);
       arr = _.flattenDeep(arr);
       var newArr = arr.filter(item => item.totaltype === '0');
       this.$set(this, `applyList`, newArr);