|
@@ -27,9 +27,9 @@
|
|
|
</el-col>
|
|
|
<el-col :span="24" v-else-if="activeName != '1'">
|
|
|
<el-col :span="24" class="one">
|
|
|
- <search-1 :form="searchForm" @onSubmit="search" @querySearch="querySearch" @toReset="toClose" :shopList="shopList"> </search-1>
|
|
|
+ <search-1 :form="searchForm" @onSubmit="toSearch" @querySearch="querySearch" @toReset="toClose" :shopList="shopList"> </search-1>
|
|
|
</el-col>
|
|
|
- <data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @detail="toDetails" @sales="toSaless">
|
|
|
+ <data-table ref="dataTable" :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @detail="toDetails" @sales="toSaless">
|
|
|
<template #is_afterSale="{ row }">
|
|
|
<span :style="{ color: row.is_afterSale === true ? 'red' : '' }">
|
|
|
{{ row.is_afterSale === true ? '该订单有商品申请售后' : '未申请售后' }}
|
|
@@ -96,6 +96,8 @@ export default {
|
|
|
{ label: '商品数量', model: 'buy_num_total' },
|
|
|
{ label: '是否售后', model: 'is_afterSale', format: (i) => (i === true ? '该订单有商品申请售后' : '未申请售后'), custom: true },
|
|
|
],
|
|
|
+ // 查询条件
|
|
|
+ searchQuery: {},
|
|
|
};
|
|
|
},
|
|
|
async created() {
|
|
@@ -106,6 +108,11 @@ export default {
|
|
|
...dictData({ dictQuery: 'query' }),
|
|
|
...shop({ shopQuery: '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);
|
|
@@ -122,10 +129,13 @@ export default {
|
|
|
else if (this.activeName == '7') info.status = '-2';
|
|
|
else if (this.activeName == '8') info.status = '-3';
|
|
|
else if (this.activeName == '9') info.status = '-4';
|
|
|
- let res = await this.query({ skip, limit, ...condition, ...info });
|
|
|
+ let query = { skip, limit, ...info };
|
|
|
+ if (Object.keys(condition).length > 0) query = { ...query, ...condition };
|
|
|
+ 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;
|
|
|
},
|
|
@@ -154,6 +164,7 @@ export default {
|
|
|
},
|
|
|
toBack() {
|
|
|
this.view = 'list';
|
|
|
+ this.search(this.searchQuery);
|
|
|
},
|
|
|
getAddress(i) {
|
|
|
let name = i.name + ',' + i.phone;
|