Authored by lzhy

Merge branch 'feature/shop-order' into release/6.9.24

... ... @@ -2,5 +2,6 @@ import orderGoodsInfo from './order-goods-info';
import orderUserInfo from './order-user-info';
import orderListTable from './order-list-table';
import orderBaseInfo from './order-base-info';
import orderExpressInfo from './order-express-info.vue';
export { orderGoodsInfo, orderUserInfo, orderListTable, orderBaseInfo };
export { orderGoodsInfo, orderUserInfo, orderListTable, orderBaseInfo, orderExpressInfo };
... ...
<template>
<Modal v-model="showModal" :title="title" width="700">
<div class="content">
<Table border :columns="tableCols" :data="expressList"></Table>
</div>
<div slot="footer">
<Button type="text" size="large" @click="hide">关闭</Button>
</div>
</Modal>
</template>
<script>
import timeFormat from 'filters/time-format';
export default {
name: 'OrderExpressInfo',
props: [],
data() {
return {
title: '订单物流轨迹',
showModal: false,
expressList: [],
tableCols: [
{
title: '轨迹',
key: 'acceptRemark',
align: 'center',
width: 500,
},
{
title: '创建时间',
align: 'center',
render: (h, params) => {
return (
<div>
<span>{timeFormat(params.row.createTime)}</span>
</div>
);
},
},
],
};
},
methods: {
show(info) {
this.showModal = true;
this.expressList = info;
},
hide() {
this.showModal = false;
},
},
};
</script>
... ...
... ... @@ -25,27 +25,36 @@
<template v-for="(item, index) in logisticsList">
<span v-if="item.id == orderInfo.expressId" :key="index">{{ item.companyName }}</span>
</template>
<template v-if="orderInfo.expressNumber > 0">
<a style="margin-left:20px;" @click="showExpressInfo()">查看物流信息</a>
</template>
</i-col>
</Row>
<Row v-if="isShowExpress">
<i-col span="24">运单号:{{ orderInfo.expressNumber > 0 ? orderInfo.expressNumber : '' }} </i-col>
</Row>
</div>
<order-express-info ref="showOrderExpressInfo" :show="showOrderExpressInfo"></order-express-info>
</div>
</template>
<script>
import _ from 'lodash';
import LogisticsService from 'services/logistics/logistics-service';
import { OrderService } from 'services/order';
import orderExpressInfo from './order-express-info.vue';
export default {
name: 'OrderUserInfo',
components: { orderExpressInfo },
props: ['orderInfo', 'isShowExpress'],
data() {
return {
logisticsList: [],
showOrderExpressInfo: false,
};
},
created() {
this.LogisticsService = new LogisticsService();
this.OrderService = new OrderService();
this.getLogisticsList();
},
methods: {
... ... @@ -55,6 +64,13 @@ export default {
this.logisticsList = _.get(ret, 'data', []);
});
},
//获取订单物流轨迹
showExpressInfo() {
this.OrderService.queryOrderExpressInfo({ orderCode: this.orderInfo.orderCode }).then(ret => {
const info = _.get(ret, 'data', []);
this.$refs.showOrderExpressInfo.show(info);
});
},
},
};
</script>
... ...
... ... @@ -56,16 +56,28 @@ export default {
showExpressLoading: false,
showDeliverLoading: false,
showNoExpressLoading: false,
oldRouterName: 'order.detail',
};
},
watch: {
orderInfo: {
handler(newValue) {
this.orderInfo.expressNumber = +newValue.expressNumber > 0 ? newValue.expressNumber : '';
},
deep: true,
},
},
created() {
this.LogisticsService = new LogisticsService();
this.OrderService = new OrderService();
this.$emit('nextStep', 2);
this.getLogisticsList();
this.orderInfo.expressNumber = +this.orderInfo.expressNumber > 0 ? this.orderInfo.expressNumber : '';
},
beforeRouteEnter(to, from, next) {
next(vm => {
vm.oldRouterName = from.name;
});
},
methods: {
//获取物流公司列表
getLogisticsList() {
... ... @@ -84,7 +96,7 @@ export default {
this.showExpressLoading = false;
if (ret.code === 200) {
this.$Message.info(ret.message);
this.$router.go(0);
this.goBefore();
} else {
this.$Message.error(ret.message);
}
... ... @@ -100,7 +112,7 @@ export default {
}).then(ret => {
if (ret.code === 200) {
this.$Message.info(ret.message);
this.$router.go(0);
this.goBefore();
} else {
this.$Message.error(ret.message);
}
... ... @@ -118,13 +130,22 @@ export default {
},
//取消操作
cancel() {
this.$router.push({
name: 'order.detail',
params: {},
query: {
orderCode: this.orderCode,
},
});
this.goBefore();
},
goBefore() {
if (this.oldRouterName === 'order.detail') {
this.$router.push({
name: 'order.detail',
params: {},
query: {
orderCode: this.orderCode,
},
});
} else {
this.$router.push({
name: 'order.list',
});
}
},
},
};
... ...
... ... @@ -5,11 +5,18 @@
<p slot="title" style="height: 35px">
当前订单状态:{{ orderStatus[orderInfo.orderStatus] }}
<template v-if="orderInfo.orderStatus >= 100 && orderInfo.orderStatus < 600">
<i-button size="large" type="success" style="margin-left: 50px;" @click="deliver(orderCode)">发货</i-button>
<i-button
size="large"
type="success"
style="margin-left: 50px;"
@click="deliver(orderCode, orderInfo.orderStatus)"
>
发货
</i-button>
</template>
</p>
</div>
<div class="ivu-card-body">
<div v-if="orderInfo.orderStatus >= 100 && orderInfo.orderStatus < 600" class="ivu-card-body">
若订单一直未发货,买家会有投诉风险,建议您及时点击发货 查看未发货超时规则 <br />
若买家存在恶意购买行为,您可以联系平台处理
</div>
... ... @@ -63,9 +70,10 @@ export default {
this.getOrderPromos();
},
methods: {
deliver(code) {
deliver(code, status) {
const routerName = status === 200 ? 'order.deliver.step1' : 'order.deliver.step3';
this.$router.push({
name: 'order.deliver.step1',
name: routerName,
params: {},
query: {
orderCode: code,
... ...
... ... @@ -12,7 +12,6 @@
<tr :key="tindex">
<td colspan="12" style="text-align: left">
<span>订单号:{{ item.orderCode }}</span>
<span>父订单号:{{ item.parentOrderCode }}</span>
<span>创建时间:{{ item.createTime | timeFormat }}</span>
</td>
</tr>
... ... @@ -36,6 +35,11 @@
<td :rowspan="item.goodsList.length">{{ orderStatusArr[item.orderStatus] }}</td>
<td :rowspan="item.goodsList.length">
<i-button type="default" size="small" @click="goToDetail(item.orderCode)">查看订单</i-button>
<template v-if="item.orderStatus == 100 || item.orderStatus == 200">
<i-button type="success" size="small" @click="deliver(item.orderCode, item.orderStatus)">
发货
</i-button>
</template>
</td>
</template>
</tr>
... ... @@ -71,7 +75,7 @@ export default {
{ title: 'SKU', width: '5%' },
{ title: '收货人', width: '5%' },
{ title: '支付状态', width: '5%' },
{ title: '实金额', width: '5%' },
{ title: '实金额', width: '5%' },
{ title: '订单状态', width: '5%' },
{ title: '操作', width: '10%' },
],
... ... @@ -88,6 +92,16 @@ export default {
});
},
prodImage,
deliver(code, status) {
const routerName = status === 200 ? 'order.deliver.step1' : 'order.deliver.step3';
this.$router.push({
name: routerName,
params: {},
query: {
orderCode: code,
},
});
},
},
};
</script>
... ...
... ... @@ -12,7 +12,6 @@
<tr :key="index">
<td colspan="12" style="text-align: left">
<span>订单号:{{ item.orderCode }}</span>
<span>父订单号:{{ item.parentOrderCode }}</span>
<span>创建时间:{{ item.createTime | timeFormat }}</span>
</td>
</tr>
... ...
... ... @@ -8,6 +8,7 @@ const apiUrl = {
orderCoupons: '/erp/queryOrderCoupons',
orderPromos: '/erp/queryOrderPromos',
confirmExpress: '/erp/confirmExpress',
orderExpressInfo: '/erp/orderExpressInfo',
};
class OrderService extends Service {
... ... @@ -69,6 +70,15 @@ class OrderService extends Service {
confirmExpress(params) {
return this.post(apiUrl.confirmExpress, params);
}
/**
* 获取订单物流轨迹
* @param params
* @return {*}
*/
queryOrderExpressInfo(params) {
return this.post(apiUrl.orderExpressInfo, params);
}
}
OrderService.exportOrdersByStatus = '/Api/erp/exportOrdersByStatus';
... ...
{
"name": "yoho-shop-manage",
"version": "6.9.24-beta12",
"version": "6.9.24-beta13",
"description": "",
"main": "app.js",
"scripts": {
... ...
... ... @@ -101,6 +101,7 @@ const domainApis = {
queryOrderPromos: '/erp-gateway-web/cs/order/promotions', //获取订单促销
confirmExpress: '/erp-gateway-web/shop/orders/ordersUpdateExpress', //订单确认物流
exportOrdersByStatus: '/erp-gateway-web/shop/export/exportOrdersByStatus', //导出订单列表
orderExpressInfo: '/erp-gateway-web/cs/order/query_logistics_trace', // 订单物流轨迹
//物流接口
queryLogisticsList: '/erp-gateway-web/shop/logistics_company/list', //获取物流公司列表
... ...