|
@@ -1,11 +1,12 @@
|
|
<template>
|
|
<template>
|
|
<div id="card-1">
|
|
<div id="card-1">
|
|
<el-row>
|
|
<el-row>
|
|
- <el-col :span="24" class="main">
|
|
|
|
|
|
+ <el-col :span="24" class="main" v-loading="loadings" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading">
|
|
<el-col :span="24" class="one">
|
|
<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="search" @querySearch="querySearch" @toReset="toClose" :shopList="shopList"> </search-1>
|
|
</el-col>
|
|
</el-col>
|
|
- <data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @detail="toDetail" @sales="toSales"> </data-table>
|
|
|
|
|
|
+ <data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @detail="toDetail" @sales="toSales" @confirm="toConfirm">
|
|
|
|
+ </data-table>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
</div>
|
|
</div>
|
|
@@ -23,12 +24,14 @@ export default {
|
|
components: { search1: () => import('./search-1.vue') },
|
|
components: { search1: () => import('./search-1.vue') },
|
|
data: function () {
|
|
data: function () {
|
|
return {
|
|
return {
|
|
|
|
+ loadings: true,
|
|
searchForm: {},
|
|
searchForm: {},
|
|
list: [],
|
|
list: [],
|
|
total: 0,
|
|
total: 0,
|
|
opera: [
|
|
opera: [
|
|
{ label: '详情', method: 'detail' },
|
|
{ label: '详情', method: 'detail' },
|
|
{ label: '售后', method: 'sales', type: 'danger' },
|
|
{ label: '售后', method: 'sales', type: 'danger' },
|
|
|
|
+ { label: '确认收货', method: 'confirm', type: 'warning' },
|
|
],
|
|
],
|
|
fields: [
|
|
fields: [
|
|
{ label: '订单号', model: 'no', showTip: false },
|
|
{ label: '订单号', model: 'no', showTip: false },
|
|
@@ -40,7 +43,6 @@ export default {
|
|
{ label: '是否售后', model: 'is_afterSale', format: (i) => (i === true ? '该订单有商品申请售后' : '未申请售后') },
|
|
{ label: '是否售后', model: 'is_afterSale', format: (i) => (i === true ? '该订单有商品申请售后' : '未申请售后') },
|
|
],
|
|
],
|
|
shopList: [],
|
|
shopList: [],
|
|
- skip: 0,
|
|
|
|
};
|
|
};
|
|
},
|
|
},
|
|
async created() {
|
|
async created() {
|
|
@@ -50,7 +52,7 @@ export default {
|
|
...shop({ shopQuery: 'query' }),
|
|
...shop({ shopQuery: 'query' }),
|
|
...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
|
|
...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
|
|
// 查询
|
|
// 查询
|
|
- async search({ skip = this.skip, limit = this.$limit, ...info } = {}) {
|
|
|
|
|
|
+ async search({ skip = 0, 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);
|
|
@@ -60,10 +62,10 @@ export default {
|
|
info.status = '2';
|
|
info.status = '2';
|
|
let res = await this.query({ skip, limit, ...condition, ...info });
|
|
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);
|
|
}
|
|
}
|
|
|
|
+ this.loadings = false;
|
|
},
|
|
},
|
|
getAddress(i) {
|
|
getAddress(i) {
|
|
let name = i.name + ',' + i.phone;
|
|
let name = i.name + ',' + i.phone;
|
|
@@ -72,6 +74,21 @@ export default {
|
|
toDetail({ data }) {
|
|
toDetail({ data }) {
|
|
this.$emit('toDetails', data._id);
|
|
this.$emit('toDetails', data._id);
|
|
},
|
|
},
|
|
|
|
+ toConfirm({ data }) {
|
|
|
|
+ this.$confirm('是否确认收货', '提示', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ }).then(async () => {
|
|
|
|
+ let res;
|
|
|
|
+ data.status = '3';
|
|
|
|
+ if (data._id) res = await this.update(data);
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$message({ type: `success`, message: `确认收货成功` });
|
|
|
|
+ this.search();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
toSales({ data }) {
|
|
toSales({ data }) {
|
|
this.$emit('toSaless', { id: data._id, status: '2' });
|
|
this.$emit('toSaless', { id: data._id, status: '2' });
|
|
},
|
|
},
|