|
@@ -27,14 +27,14 @@
|
|
:form="searchForm"
|
|
:form="searchForm"
|
|
:shopList="shopList"
|
|
:shopList="shopList"
|
|
:goodsList="goodsList"
|
|
:goodsList="goodsList"
|
|
- @onSubmit="search"
|
|
|
|
|
|
+ @onSubmit="toSearch"
|
|
@querySearch="querySearch"
|
|
@querySearch="querySearch"
|
|
@toReset="toClose"
|
|
@toReset="toClose"
|
|
@goodsSearch="goodsSearch"
|
|
@goodsSearch="goodsSearch"
|
|
>
|
|
>
|
|
</search-1>
|
|
</search-1>
|
|
</el-col>
|
|
</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 }">
|
|
<template #is_afterSale="{ row }">
|
|
<span :style="{ color: row.is_afterSale === true ? 'red' : '' }">
|
|
<span :style="{ color: row.is_afterSale === true ? 'red' : '' }">
|
|
{{ row.is_afterSale === true ? '该订单有商品申请售后' : '未申请售后' }}
|
|
{{ row.is_afterSale === true ? '该订单有商品申请售后' : '未申请售后' }}
|
|
@@ -102,6 +102,8 @@ export default {
|
|
{ label: '购买数量', model: 'num' },
|
|
{ label: '购买数量', model: 'num' },
|
|
{ label: '是否售后', model: 'is_afterSale', format: (i) => (i === true ? '该订单有商品申请售后' : '未申请售后'), custom: true },
|
|
{ label: '是否售后', model: 'is_afterSale', format: (i) => (i === true ? '该订单有商品申请售后' : '未申请售后'), custom: true },
|
|
],
|
|
],
|
|
|
|
+ // 查询条件
|
|
|
|
+ searchQuery: {},
|
|
};
|
|
};
|
|
},
|
|
},
|
|
async created() {
|
|
async created() {
|
|
@@ -113,6 +115,11 @@ export default {
|
|
...shop({ shopQuery: 'query' }),
|
|
...shop({ shopQuery: 'query' }),
|
|
...goods({ goodsQuery: 'query' }),
|
|
...goods({ goodsQuery: 'query' }),
|
|
...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
|
|
...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 } = {}) {
|
|
async search({ skip = 0, limit = this.$limit, ...info } = {}) {
|
|
let condition = _.cloneDeep(this.searchForm);
|
|
let condition = _.cloneDeep(this.searchForm);
|
|
@@ -126,10 +133,13 @@ export default {
|
|
else if (this.activeName == '3') info.status = '2';
|
|
else if (this.activeName == '3') info.status = '2';
|
|
else if (this.activeName == '4') info.status = '3';
|
|
else if (this.activeName == '4') info.status = '3';
|
|
else if (this.activeName == '5') info.status = '-1';
|
|
else if (this.activeName == '5') info.status = '-1';
|
|
- 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)) {
|
|
if (this.$checkRes(res)) {
|
|
this.$set(this, 'list', res.data);
|
|
this.$set(this, 'list', res.data);
|
|
this.$set(this, 'total', res.total);
|
|
this.$set(this, 'total', res.total);
|
|
|
|
+ this.$set(this, `searchQuery`, query);
|
|
}
|
|
}
|
|
this.loadings = false;
|
|
this.loadings = false;
|
|
},
|
|
},
|