guhongwei há 4 anos atrás
pai
commit
9dc9a2839a

+ 1 - 0
src/layout/enterpriseProduct/enterpriseProduct.vue

@@ -130,6 +130,7 @@ export default {
       this.$emit('handleDelete', data.id);
     },
     handleCurrentChange(currentPage) {
+      console.log(currentPage);
       this.search(currentPage);
       // this.$emit('handleCurrentChange', { skip: (currentPage - 1) * this.pageSize, limit: this.pageSize, currentPage });
     },

+ 9 - 0
src/store/user.js

@@ -4,6 +4,7 @@ import _ from 'lodash';
 Vue.use(Vuex);
 const api = {
   interface: `/api/market/user`,
+  userinterface: `/api/market/user/hwsxg`,
 };
 const state = () => ({});
 const mutations = {};
@@ -13,6 +14,14 @@ const actions = {
     const res = await this.$axios.$get(api.interface, { skip, limit, ...info });
     return res;
   },
+  async userquery({ commit }, { skip = 0, limit = undefined, ...info } = {}) {
+    const res = await this.$axios.$get(api.userinterface, {
+      skip,
+      limit,
+      ...info,
+    });
+    return res;
+  },
   async create({ commit }, payload) {
     const res = await this.$axios.$post(`${api.interface}`, payload);
     return res;

+ 11 - 18
src/views/user/index.vue

@@ -55,28 +55,21 @@ export default {
     this.search();
   },
   methods: {
-    ...users(['query', 'delete', 'update']),
+    ...users(['query', 'delete', 'update', 'userquery']),
     ...exportuser({ exportuserQuery: 'query' }),
-    async search({ ...info } = {}) {
+    async search({ skip = 0, limit = 10, pid = '', ...info } = {}) {
       if (this.user.code.length == 3) {
-        const res = await this.query({ ...info });
-        const resTwo = await this.exportuserQuery({ ...info });
-        var newData = res.data.concat(resTwo.data);
-        if (this.$checkRes(newData)) {
-          var arr = newData.filter(item => item.pid == undefined && item.status != '3');
-          console.log(arr);
-          this.$set(this, `list`, arr);
-          this.$set(this, `total`, arr.length);
+        const res = await this.userquery({ skip, limit, pid, ...info });
+        if (this.$checkRes(res)) {
+          console.log(res);
+          this.$set(this, `list`, res.data);
+          this.$set(this, `total`, res.total);
         }
       } else {
-        const res = await this.query({ code: this.user.code, ...info });
-        const resTwo = await this.exportuserQuery({ code: this.user.code, ...info });
-        var newData = res.data.concat(resTwo.data);
-        if (this.$checkRes(newData)) {
-          var arr = newData.filter(item => item.pid == undefined && item.status != '3');
-          console.log(arr);
-          this.$set(this, `list`, arr);
-          this.$set(this, `total`, arr.length);
+        const res = await this.userquery({ skip, limit, pid, code: this.user.code, ...info });
+        if (this.$checkRes(res)) {
+          this.$set(this, `list`, res.data);
+          this.$set(this, `total`, res.total);
         }
       }
     },