|
@@ -3,7 +3,7 @@
|
|
<el-row>
|
|
<el-row>
|
|
<el-col :span="24" class="main">
|
|
<el-col :span="24" class="main">
|
|
<el-col :span="24" class="one">
|
|
<el-col :span="24" class="one">
|
|
- <search-1 :form="searchForm" :statusList="statusList" @onSubmit="search" @toReset="toClose" :total="total"></search-1>
|
|
|
|
|
|
+ <search-1 :form="searchForm" :statusList="statusList" @onSubmit="search" @toReset="toClose" :total="total"> </search-1>
|
|
</el-col>
|
|
</el-col>
|
|
<data-table
|
|
<data-table
|
|
:select="true"
|
|
:select="true"
|
|
@@ -30,7 +30,7 @@ const { mapActions } = createNamespacedHelpers('order');
|
|
export default {
|
|
export default {
|
|
name: 'card-1',
|
|
name: 'card-1',
|
|
// props: { list: { type: Array }, total: { type: Number }, statusList: { type: Array } },
|
|
// props: { list: { type: Array }, total: { type: Number }, statusList: { type: Array } },
|
|
- props: { statusList: { type: Array } },
|
|
|
|
|
|
+ props: { statusList: { type: Array }, shop: { type: Object } },
|
|
components: { search1: () => import('./search-1.vue') },
|
|
components: { search1: () => import('./search-1.vue') },
|
|
data: function () {
|
|
data: function () {
|
|
return {
|
|
return {
|
|
@@ -42,16 +42,13 @@ export default {
|
|
{ label: '删除', method: 'del', confirm: true, type: 'danger' },
|
|
{ label: '删除', method: 'del', confirm: true, type: 'danger' },
|
|
],
|
|
],
|
|
fields: [
|
|
fields: [
|
|
- { label: '店铺名称', model: 'goods[0].shop_name' },
|
|
|
|
- { label: '支付金额', model: 'pay.pay_money' },
|
|
|
|
|
|
+ { label: '订单号', model: 'no' },
|
|
|
|
+ { label: '下单时间', model: 'buy_time' },
|
|
|
|
+ { label: '顾客', model: 'customer.name' },
|
|
{
|
|
{
|
|
- label: '订单状态',
|
|
|
|
- model: 'status',
|
|
|
|
- format: (i) => {
|
|
|
|
- let data = this.statusList.find((f) => f.value == i);
|
|
|
|
- if (data) return data.label;
|
|
|
|
- else return '暂无';
|
|
|
|
- },
|
|
|
|
|
|
+ label: '需支付金额',
|
|
|
|
+ model: 'total_detail',
|
|
|
|
+ format: (i) => this.computedNeedPay(i),
|
|
},
|
|
},
|
|
],
|
|
],
|
|
// 多选值
|
|
// 多选值
|
|
@@ -63,11 +60,23 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
|
|
...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
|
|
|
|
+ computedNeedPay(details) {
|
|
|
|
+ let total = 0;
|
|
|
|
+ for (const key in details) {
|
|
|
|
+ total += details[key];
|
|
|
|
+ }
|
|
|
|
+ return _.floor(total, 2);
|
|
|
|
+ },
|
|
// 查询
|
|
// 查询
|
|
async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
- const condition = _.cloneDeep(this.searchForm);
|
|
|
|
|
|
+ let condition = _.cloneDeep(this.searchForm);
|
|
|
|
+ if (condition.buy_time) {
|
|
|
|
+ condition[`buy_time@start`] = _.head(condition.buy_time);
|
|
|
|
+ condition[`buy_time@end`] = _.last(condition.buy_time);
|
|
|
|
+ delete condition.buy_time;
|
|
|
|
+ }
|
|
info.status = '0';
|
|
info.status = '0';
|
|
- let res = await this.query({ skip, limit, ...condition, ...info });
|
|
|
|
|
|
+ let res = await this.query({ skip, limit, ...condition, ...info, shop: _.get(this.shop, '_id') });
|
|
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);
|