|
@@ -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" @onSubmit="search" @toReset="toClose"> </search-1>
|
|
|
|
|
|
+ <search-1 :form="searchForm" @onSubmit="search" @querySearch="querySearch" @toReset="toClose" :shopList="shopList"> </search-1>
|
|
</el-col>
|
|
</el-col>
|
|
<data-table
|
|
<data-table
|
|
:select="true"
|
|
:select="true"
|
|
@@ -27,6 +27,7 @@
|
|
const _ = require('lodash');
|
|
const _ = require('lodash');
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
const { mapActions } = createNamespacedHelpers('order');
|
|
const { mapActions } = createNamespacedHelpers('order');
|
|
|
|
+const { mapActions: shop } = createNamespacedHelpers('shop');
|
|
export default {
|
|
export default {
|
|
name: 'card-1',
|
|
name: 'card-1',
|
|
props: { statusList: { type: Array } },
|
|
props: { statusList: { type: Array } },
|
|
@@ -44,20 +45,24 @@ export default {
|
|
{ label: '订单号', model: 'no' },
|
|
{ label: '订单号', model: 'no' },
|
|
{ label: '下单时间', model: 'buy_time' },
|
|
{ label: '下单时间', model: 'buy_time' },
|
|
{ label: '顾客', model: 'customer.name' },
|
|
{ label: '顾客', model: 'customer.name' },
|
|
|
|
+ { label: '店铺名称', model: 'goods', format: (i) => this.getShopName(i) },
|
|
{ label: '需支付金额', model: 'real_pay' },
|
|
{ label: '需支付金额', model: 'real_pay' },
|
|
{ label: '商品数量', model: 'buy_num_total' },
|
|
{ label: '商品数量', model: 'buy_num_total' },
|
|
],
|
|
],
|
|
// 多选值
|
|
// 多选值
|
|
selected: [],
|
|
selected: [],
|
|
|
|
+ shopList: [],
|
|
|
|
+ skip: 0,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
async created() {
|
|
async created() {
|
|
await this.search();
|
|
await this.search();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ ...shop({ shopQuery: 'query' }),
|
|
...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
|
|
...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
|
|
// 查询
|
|
// 查询
|
|
- async search({ skip = 0, limit = this.$limit, ...info } = {}) {
|
|
|
|
|
|
+ async search({ skip = this.skip, limit = this.$limit, ...info } = {}) {
|
|
let condition = _.cloneDeep(this.searchForm);
|
|
let condition = _.cloneDeep(this.searchForm);
|
|
if (condition.buy_time) {
|
|
if (condition.buy_time) {
|
|
condition[`buy_time@start`] = _.head(condition.buy_time);
|
|
condition[`buy_time@start`] = _.head(condition.buy_time);
|
|
@@ -65,18 +70,27 @@ export default {
|
|
delete condition.buy_time;
|
|
delete condition.buy_time;
|
|
}
|
|
}
|
|
info.status = '0';
|
|
info.status = '0';
|
|
- let res = await this.query({ skip, limit, ...condition, ...info, shop: this.user.shop.id });
|
|
|
|
|
|
+ info.shop = this.user.shop.id;
|
|
|
|
+ let res = await this.query({ skip, limit, ...condition, ...info });
|
|
if (this.$checkRes(res)) {
|
|
if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `skip`, skip);
|
|
this.$set(this, 'list', res.data);
|
|
this.$set(this, 'list', res.data);
|
|
this.$set(this, 'total', res.total);
|
|
this.$set(this, 'total', res.total);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 店铺名称
|
|
|
|
+ getShopName(i) {
|
|
|
|
+ let shopname = i.map((e) => e.shop_name);
|
|
|
|
+ return shopname.join(',');
|
|
|
|
+ },
|
|
|
|
+ // 详情
|
|
toDetail({ data }) {
|
|
toDetail({ data }) {
|
|
- this.$router.push({ path: '/selfShop/order/detail_order', query: { id: data.id } });
|
|
|
|
|
|
+ this.$emit('toDetail', data._id);
|
|
},
|
|
},
|
|
toSales({ data }) {
|
|
toSales({ data }) {
|
|
- this.$router.push({ path: '/selfShop/order/detail_sales_order', query: { id: data.id } });
|
|
|
|
|
|
+ this.$emit('toSales', data._id);
|
|
},
|
|
},
|
|
|
|
+ // 重置
|
|
toClose() {
|
|
toClose() {
|
|
this.searchForm = {};
|
|
this.searchForm = {};
|
|
this.search();
|
|
this.search();
|
|
@@ -85,6 +99,13 @@ export default {
|
|
handleSelect(data) {
|
|
handleSelect(data) {
|
|
this.$emit('handleSelect');
|
|
this.$emit('handleSelect');
|
|
},
|
|
},
|
|
|
|
+ // 店铺名称远程查询
|
|
|
|
+ async querySearch(value) {
|
|
|
|
+ let res = await this.shopQuery({ name: value });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, 'shopList', res.data);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
...mapState(['user']),
|
|
...mapState(['user']),
|