|
@@ -3,25 +3,19 @@
|
|
|
<el-row>
|
|
|
<el-col :span="24" class="main animate__animated animate__backInRight">
|
|
|
<el-col :span="24" class="one"> <span>订单管理</span> </el-col>
|
|
|
- <el-col :span="24" class="two">
|
|
|
- <search-1 :form="searchForm" :statusList="statusList" @onSubmit="search" @toReset="toClose" :total="total"></search-1>
|
|
|
- </el-col>
|
|
|
- <el-col :span="24" class="thr">
|
|
|
- <el-button type="primary" size="mini" @click="toAdd()">新增</el-button>
|
|
|
- </el-col>
|
|
|
<el-col :span="24" class="four">
|
|
|
<el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
|
|
|
<el-tab-pane label="待付款" name="1">
|
|
|
- <card-1 :list="list" :toEdit="toEdit" :toDel="toDel" :total="total" :statusList="statusList"></card-1>
|
|
|
+ <card-1 @toEdit="toEdit" @toDel="toDel" :statusList="statusList"></card-1>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="待发货" name="2">
|
|
|
- <card-2 :list="list" :toEdit="toEdit" :toDel="toDel" :total="total" :statusList="statusList"></card-2>
|
|
|
+ <card-2 @toEdit="toEdit" @toDel="toDel" :statusList="statusList"></card-2>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="待收货" name="3">
|
|
|
- <card-3 :list="list" :toEdit="toEdit" :toDel="toDel" :total="total" :statusList="statusList"></card-3>
|
|
|
+ <card-3 @toEdit="toEdit" @toDel="toDel" :statusList="statusList"></card-3>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="已收货" name="4">
|
|
|
- <card-4 :list="list" :toEdit="toEdit" :toDel="toDel" :total="total" :statusList="statusList"></card-4>
|
|
|
+ <card-4 @toEdit="toEdit" @toDel="toDel" :statusList="statusList"></card-4>
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</el-col>
|
|
@@ -41,7 +35,6 @@ export default {
|
|
|
name: 'index',
|
|
|
props: {},
|
|
|
components: {
|
|
|
- search1: () => import('./parts/search-1.vue'),
|
|
|
card1: () => import('./parts/card-1.vue'),
|
|
|
card2: () => import('./parts/card-2.vue'),
|
|
|
card3: () => import('./parts/card-3.vue'),
|
|
@@ -50,9 +43,7 @@ export default {
|
|
|
data: function () {
|
|
|
const that = this;
|
|
|
return {
|
|
|
- activeName: '2',
|
|
|
- list: [],
|
|
|
- total: 0,
|
|
|
+ activeName: '1',
|
|
|
// 查询
|
|
|
searchForm: {},
|
|
|
// 多选值
|
|
@@ -63,58 +54,20 @@ export default {
|
|
|
},
|
|
|
async created() {
|
|
|
await this.searchOther();
|
|
|
- await this.search();
|
|
|
},
|
|
|
methods: {
|
|
|
...dictData({ dictQuery: 'query' }),
|
|
|
- ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
|
|
|
- ...orderDetail({ orderQuery: 'query', orderFetch: 'fetch', orderCreate: 'create', orderUpdate: 'update', orderDelete: 'delete' }),
|
|
|
- // 查询
|
|
|
- async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
|
- const condition = _.cloneDeep(this.searchForm);
|
|
|
- if (this.activeName == '1') {
|
|
|
- info.status = '0';
|
|
|
- let res = await this.query({ skip, limit, ...condition, ...info });
|
|
|
- if (this.$checkRes(res)) {
|
|
|
- this.$set(this, 'list', res.data);
|
|
|
- this.$set(this, 'total', res.total);
|
|
|
- }
|
|
|
- } else if (this.activeName == '2') {
|
|
|
- info.status = '1';
|
|
|
- let res = await this.orderQuery({ skip, limit, ...condition, ...info });
|
|
|
- if (this.$checkRes(res)) {
|
|
|
- this.$set(this, 'list', res.data);
|
|
|
- this.$set(this, 'total', res.total);
|
|
|
- }
|
|
|
- } else if (this.activeName == '3') {
|
|
|
- info.status = '2';
|
|
|
- let res = await this.orderQuery({ skip, limit, ...condition, ...info });
|
|
|
- if (this.$checkRes(res)) {
|
|
|
- this.$set(this, 'list', res.data);
|
|
|
- this.$set(this, 'total', res.total);
|
|
|
- }
|
|
|
- } else if (this.activeName == '4') {
|
|
|
- info.status = '3';
|
|
|
- let res = await this.orderQuery({ skip, limit, ...condition, ...info });
|
|
|
- if (this.$checkRes(res)) {
|
|
|
- this.$set(this, 'list', res.data);
|
|
|
- this.$set(this, 'total', res.total);
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
handleClick(tab, event) {
|
|
|
this.search();
|
|
|
},
|
|
|
// 新增
|
|
|
toAdd() {},
|
|
|
// 修改
|
|
|
- async toEdit({ data }) {},
|
|
|
+ async toEdit({ data }) {
|
|
|
+ console.log(data);
|
|
|
+ },
|
|
|
async toDel({ data }) {
|
|
|
- let res = await this.delete(data._id);
|
|
|
- if (this.$checkRes(res)) {
|
|
|
- this.$message({ type: `success`, message: `刪除信息成功` });
|
|
|
- this.search();
|
|
|
- }
|
|
|
+ console.log(data);
|
|
|
},
|
|
|
toClose() {
|
|
|
this.searchForm = {};
|