|
@@ -26,49 +26,16 @@
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="shop"> <i class="el-icon-s-shop"></i>{{ shop.name }}</el-col>
|
|
|
- <el-col v-if="info.type == '1' || info.type == '2' || info.type == '3'">
|
|
|
- <el-col :span="24" class="goods">
|
|
|
- <el-col :span="6"><el-image class="image" :src="file"></el-image></el-col>
|
|
|
- <el-col :span="18">
|
|
|
- <el-col :span="12">
|
|
|
- <p>{{ goods.name }}</p>
|
|
|
- <p>规格:{{ good.name }}</p>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12" class="money">
|
|
|
- <p>¥{{ good.sell_money }}</p>
|
|
|
- <p>X{{ good.buy_num }}</p>
|
|
|
- </el-col>
|
|
|
+ <el-col :span="24" class="goods">
|
|
|
+ <el-col :span="6"><el-image class="image" :src="file"></el-image></el-col>
|
|
|
+ <el-col :span="18">
|
|
|
+ <el-col :span="12">
|
|
|
+ <p>{{ goods.name }}</p>
|
|
|
+ <p>规格:{{ spec.name }}</p>
|
|
|
</el-col>
|
|
|
- </el-col>
|
|
|
- </el-col>
|
|
|
- <el-col v-if="info.type == '4' || info.type == '5'">
|
|
|
- <el-col :span="24" v-for="(item, index) in list" :key="index">
|
|
|
- <el-col :span="24" class="goods bode">
|
|
|
- <el-col :span="6" v-if="item.goods.file"><el-image class="image" :src="item.goods.file[0].url"></el-image></el-col>
|
|
|
- <el-col :span="6" v-else-if="item.url"><el-image class="image" :src="item.url"></el-image></el-col>
|
|
|
- <el-col :span="18">
|
|
|
- <el-col :span="12">
|
|
|
- <el-col>
|
|
|
- <p>{{ item.goods.name }}</p>
|
|
|
- </el-col>
|
|
|
- <el-col>
|
|
|
- <p>规格:{{ item.name }}</p>
|
|
|
- </el-col>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12" class="money">
|
|
|
- <el-col>
|
|
|
- <p>¥{{ item.sell_money }}</p>
|
|
|
- </el-col>
|
|
|
- <el-col>
|
|
|
- <p>X{{ item.buy_num }}</p>
|
|
|
- </el-col>
|
|
|
- </el-col>
|
|
|
- </el-col>
|
|
|
- </el-col>
|
|
|
- <el-col :span="24" class="bode">
|
|
|
- <el-col :span="6">运费</el-col>
|
|
|
- <el-col :span="18" class="other" v-if="!item.goods.freight == '0'">{{ item.goods.freight }}</el-col>
|
|
|
- <el-col :span="18" class="other" v-else>包邮</el-col>
|
|
|
+ <el-col :span="12" class="money">
|
|
|
+ <p style="color: red">¥{{ spec.price }}</p>
|
|
|
+ <p>X{{ spec.num }}</p>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
@@ -86,7 +53,7 @@
|
|
|
</el-col>
|
|
|
<el-col :span="24" v-if="info.type == '1' || info.type == '2' || info.type == '4' || info.type == '5'">
|
|
|
<el-col :span="6">退款金额</el-col>
|
|
|
- <el-col :span="18" class="other">{{ info.money || '' }}</el-col>
|
|
|
+ <el-col :span="18" class="other" style="color: red">{{ info.money || '' }}</el-col>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-col :span="6">售后状态</el-col>
|
|
@@ -150,8 +117,7 @@ const moment = require('moment');
|
|
|
import { mapState, mapGetters, createNamespacedHelpers } from 'vuex';
|
|
|
const { mapActions } = createNamespacedHelpers('groupAfterSale');
|
|
|
const { mapActions: dictData } = createNamespacedHelpers('dictData');
|
|
|
-const { mapActions: sot } = createNamespacedHelpers('sot');
|
|
|
-const { mapActions: getTransportInfo } = createNamespacedHelpers('getTransportInfo');
|
|
|
+const { mapActions: salesTransport } = createNamespacedHelpers('salesTransport');
|
|
|
|
|
|
export default {
|
|
|
name: 'form-1',
|
|
@@ -174,7 +140,7 @@ export default {
|
|
|
// 商品
|
|
|
goods: {},
|
|
|
// 规格
|
|
|
- good: {},
|
|
|
+ spec: {},
|
|
|
// 地址
|
|
|
address: {},
|
|
|
// 购买人
|
|
@@ -201,9 +167,8 @@ export default {
|
|
|
await this.search();
|
|
|
},
|
|
|
methods: {
|
|
|
- ...sot({ sotFetch: 'fetch' }),
|
|
|
...dictData({ dictQuery: 'query' }),
|
|
|
- ...getTransportInfo({ getFetch: 'fetch' }),
|
|
|
+ ...salesTransport({ getCreate: 'create' }),
|
|
|
...mapActions(['fetch', 'create', 'update']),
|
|
|
// 查询
|
|
|
async search() {
|
|
@@ -215,20 +180,12 @@ export default {
|
|
|
if (status) res.data.zhStatus = status.label;
|
|
|
this.$set(this, `info`, res.data);
|
|
|
this.$set(this, `shop`, res.data.shop);
|
|
|
- this.$set(this, `address`, res.data.order_detail.address);
|
|
|
- this.$set(this, `customers`, res.data.order_detail.customer);
|
|
|
- if (res.data.type == '4' || res.data.type == '5') this.$set(this, `list`, res.data.order_detail.goods); // 商品
|
|
|
- else if (res.data.type == '1' || res.data.type == '2' || res.data.type == '3') {
|
|
|
- if (res.data.transport) this.$set(this, `transport`, res.data.transport);
|
|
|
- // 图片
|
|
|
- if (res.data.goods.file && res.data.goods.file.length != 0) this.$set(this, `file`, res.data.goods.file[0].url);
|
|
|
- else if (res.data.goods.goods.file) this.$set(this, `file`, res.data.goods.goods.file[0].url);
|
|
|
- else this.$set(this, `file`, res.data.goods.url);
|
|
|
- // 商品
|
|
|
- this.$set(this, `goods`, res.data.goods.goods);
|
|
|
- // 规格
|
|
|
- this.$set(this, `good`, res.data.goods);
|
|
|
- }
|
|
|
+ this.$set(this, `address`, res.data.address);
|
|
|
+ this.$set(this, `customers`, res.data.customer);
|
|
|
+ this.$set(this, `goods`, res.data.goods);
|
|
|
+ this.$set(this, `spec`, res.data.goodsSpec);
|
|
|
+ if (res.data.goodsSpec.file && res.data.goodsSpec.file.length != 0) this.$set(this, `file`, res.data.goodsSpec.file[0].url);
|
|
|
+ else if (res.data.goods.file) this.$set(this, `file`, res.data.goods.file[0].url);
|
|
|
// 仅退款
|
|
|
if (res.data.status == '-1') this.$set(this, `active`, 3);
|
|
|
else if (res.data.status == '!1') this.$set(this, `active`, 4);
|
|
@@ -281,31 +238,33 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
// 显示物流
|
|
|
- let res = await this.getFetch(this.id);
|
|
|
+ let sales = { id: this.id };
|
|
|
+ let res = await this.getCreate(sales);
|
|
|
if (this.$checkRes(res)) {
|
|
|
- if (res.errcode == '0') {
|
|
|
- if (res.data.customer) {
|
|
|
+ if (res.data.customer) {
|
|
|
+ if (res.data.customer.list) {
|
|
|
let customer = res.data.customer.list;
|
|
|
this.$set(this, `customer`, customer);
|
|
|
customer[0].color = '#0bbd87';
|
|
|
- if (res.data.customer.is_check == '已签收' && this.info.status == '3') this.$set(this, `active`, 3);
|
|
|
- if (res.data.customer.is_check == '已签收' && this.info.status == '2') this.$set(this, `active`, 3);
|
|
|
}
|
|
|
- if (res.data.shop) {
|
|
|
- if (this.info.status == '3') this.$set(this, `active`, 4);
|
|
|
+ if (res.data.customer.is_check == '已签收' && this.info.status == '3') this.$set(this, `active`, 3);
|
|
|
+ if (res.data.customer.is_check == '已签收' && this.info.status == '2') this.$set(this, `active`, 3);
|
|
|
+ }
|
|
|
+ if (res.data.shop) {
|
|
|
+ if (this.info.status == '3') this.$set(this, `active`, 4);
|
|
|
+ if (res.data.shop.list) {
|
|
|
let shopList = res.data.shop.list;
|
|
|
this.$set(this, `shopList`, shopList);
|
|
|
shopList[0].color = '#0bbd87';
|
|
|
- if (res.data.shop.is_check == '已签收' && this.info.status == '3') this.$set(this, `active`, 5);
|
|
|
}
|
|
|
- this.$set(this, `activit`, res.data);
|
|
|
+ if (res.data.shop.is_check == '已签收' && this.info.status == '3') this.$set(this, `active`, 5);
|
|
|
}
|
|
|
+ this.$set(this, `activit`, res.data);
|
|
|
}
|
|
|
},
|
|
|
// 审核
|
|
|
async exam(status, form) {
|
|
|
- let info = this.info;
|
|
|
- info.status = status;
|
|
|
+ let info = { _id: this.info._id, status: status };
|
|
|
if (status == '-2' && info.transport) info.transport.shop_receive = true;
|
|
|
else if (status == '-2' && !info.transport) {
|
|
|
let transport = {};
|
|
@@ -325,7 +284,7 @@ export default {
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning',
|
|
|
}).then(async () => {
|
|
|
- if (info.id) res = await this.update(info);
|
|
|
+ if (info._id) res = await this.update(info);
|
|
|
if (this.$checkRes(res)) {
|
|
|
this.$message({ type: `success`, message: `维护信息成功` });
|
|
|
this.search();
|
|
@@ -333,15 +292,14 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
async exam_one(status) {
|
|
|
- let info = this.info;
|
|
|
- info.status = status;
|
|
|
- let res;
|
|
|
this.$confirm('是否确认不填写单号修改售后状态', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning',
|
|
|
}).then(async () => {
|
|
|
- if (info.id) res = await this.update(info);
|
|
|
+ let info = { _id: this.info._id, status: status };
|
|
|
+ let res;
|
|
|
+ if (info._id) res = await this.update(info);
|
|
|
if (this.$checkRes(res)) {
|
|
|
this.$message({ type: `success`, message: `维护信息成功` });
|
|
|
this.search();
|
|
@@ -375,15 +333,16 @@ export default {
|
|
|
},
|
|
|
// 保存
|
|
|
async onSubmit(val) {
|
|
|
- let info = this.info;
|
|
|
+ let form = this.info;
|
|
|
+ let info = { _id: this.info._id };
|
|
|
let res;
|
|
|
- if (info.transport) {
|
|
|
- info.transport = { ...info.transport, shop_transport_no: val.shop_transport_no, shop_transport_type: val.shop_transport_type, shop_receive: true };
|
|
|
+ if (form.transport) {
|
|
|
+ info.transport = { ...form.transport, shop_transport_no: val.shop_transport_no, shop_transport_type: val.shop_transport_type, shop_receive: true };
|
|
|
} else {
|
|
|
let transport = { shop_transport_no: val.shop_transport_no, shop_transport_type: val.shop_transport_type, shop_receive: true };
|
|
|
info.transport = transport;
|
|
|
}
|
|
|
- if (info.id) res = await this.update(info);
|
|
|
+ if (info._id) res = await this.update(info);
|
|
|
if (this.$checkRes(res)) {
|
|
|
this.$message({ type: `success`, message: `维护信息成功` });
|
|
|
this.search();
|