Bläddra i källkod

修改售后查询

YY 2 år sedan
förälder
incheckning
ddee0a9a38
2 ändrade filer med 26 tillägg och 8 borttagningar
  1. 13 4
      src/views/platmanag/sales/index.vue
  2. 13 4
      src/views/selfShop/sales/index.vue

+ 13 - 4
src/views/platmanag/sales/index.vue

@@ -11,10 +11,10 @@
         <span v-show="view === 'list'">
           <el-col :span="24" class="one"> <span>售后管理</span> </el-col>
           <el-col :span="24" class="two">
-            <search-1 :form="searchForm" :statusList="statusList" :typeList="typeList" @onSubmit="search" @toReset="toClose"> </search-1>
+            <search-1 :form="searchForm" :statusList="statusList" :typeList="typeList" @onSubmit="toSearch" @toReset="toClose"> </search-1>
           </el-col>
           <el-col :span="24" class="four">
-            <data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @exam="toExam"> </data-table>
+            <data-table ref="dataTable" :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @exam="toExam"> </data-table>
           </el-col>
         </span>
         <detail v-if="view === 'order'" :id="id" @toBack="toBack"></detail>
@@ -74,6 +74,7 @@ export default {
       typeList: [],
       statusList: [],
       id: '',
+      searchQuery: {},
     };
   },
   async created() {
@@ -83,13 +84,20 @@ export default {
   methods: {
     ...dictData({ dictQuery: 'query' }),
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
+    toSearch() {
+      this.$refs.dataTable.resetPage();
+      let res = this.$refs.dataTable.getPageConfig();
+      this.search(res);
+    },
     // 查询
     async search({ skip = 0, limit = this.$limit, ...info } = {}) {
-      let condition = _.cloneDeep(this.searchForm);
-      let res = await this.query({ skip, limit, ...condition, ...info });
+      let query = { skip, limit, ...info };
+      if (Object.keys(this.searchForm).length > 0) query = { ...query, ...this.searchForm };
+      let res = await this.query(query);
       if (this.$checkRes(res)) {
         this.$set(this, 'list', res.data);
         this.$set(this, 'total', res.total);
+        this.$set(this, `searchQuery`, query);
       }
       this.loadings = false;
     },
@@ -99,6 +107,7 @@ export default {
     },
     toBack() {
       this.view = 'list';
+      this.search(this.searchQuery);
     },
     toClose() {
       this.searchForm = {};

+ 13 - 4
src/views/selfShop/sales/index.vue

@@ -11,10 +11,10 @@
         <span v-show="view === 'list'">
           <el-col :span="24" class="one"> <span>售后管理</span> </el-col>
           <el-col :span="24" class="two">
-            <search-1 :form="searchForm" :statusList="statusList" :typeList="typeList" @onSubmit="search" @toReset="toClose"> </search-1>
+            <search-1 :form="searchForm" :statusList="statusList" :typeList="typeList" @onSubmit="toSearch" @toReset="toClose"> </search-1>
           </el-col>
           <el-col :span="24" class="four">
-            <data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @exam="toExam"> </data-table>
+            <data-table ref="dataTable" :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @exam="toExam"> </data-table>
           </el-col>
         </span>
         <detail v-if="view === 'order'" :id="id" @toBack="toBack"></detail>
@@ -74,6 +74,7 @@ export default {
       typeList: [],
       statusList: [],
       id: '',
+      searchQuery: {},
     };
   },
   async created() {
@@ -83,14 +84,21 @@ export default {
   methods: {
     ...dictData({ dictQuery: 'query' }),
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
+    toSearch() {
+      this.$refs.dataTable.resetPage();
+      let res = this.$refs.dataTable.getPageConfig();
+      this.search(res);
+    },
     // 查询
     async search({ skip = 0, limit = this.$limit, ...info } = {}) {
       info.shop = this.user.shop.id;
-      let condition = _.cloneDeep(this.searchForm);
-      let res = await this.query({ skip, limit, ...condition, ...info });
+      let query = { skip, limit, ...info };
+      if (Object.keys(this.searchForm).length > 0) query = { ...query, ...this.searchForm };
+      let res = await this.query(query);
       if (this.$checkRes(res)) {
         this.$set(this, 'list', res.data);
         this.$set(this, 'total', res.total);
+        this.$set(this, `searchQuery`, query);
       }
       this.loadings = false;
     },
@@ -100,6 +108,7 @@ export default {
     },
     toBack() {
       this.view = 'list';
+      this.search(this.searchQuery);
     },
     toClose() {
       this.searchForm = {};