Authored by lzhy

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

@@ -2,5 +2,6 @@ import orderGoodsInfo from './order-goods-info'; @@ -2,5 +2,6 @@ import orderGoodsInfo from './order-goods-info';
2 import orderUserInfo from './order-user-info'; 2 import orderUserInfo from './order-user-info';
3 import orderListTable from './order-list-table'; 3 import orderListTable from './order-list-table';
4 import orderBaseInfo from './order-base-info'; 4 import orderBaseInfo from './order-base-info';
  5 +import orderExpressInfo from './order-express-info.vue';
5 6
6 -export { orderGoodsInfo, orderUserInfo, orderListTable, orderBaseInfo }; 7 +export { orderGoodsInfo, orderUserInfo, orderListTable, orderBaseInfo, orderExpressInfo };
  1 +<template>
  2 + <Modal v-model="showModal" :title="title" width="700">
  3 + <div class="content">
  4 + <Table border :columns="tableCols" :data="expressList"></Table>
  5 + </div>
  6 + <div slot="footer">
  7 + <Button type="text" size="large" @click="hide">关闭</Button>
  8 + </div>
  9 + </Modal>
  10 +</template>
  11 +<script>
  12 +import timeFormat from 'filters/time-format';
  13 +export default {
  14 + name: 'OrderExpressInfo',
  15 + props: [],
  16 + data() {
  17 + return {
  18 + title: '订单物流轨迹',
  19 + showModal: false,
  20 + expressList: [],
  21 + tableCols: [
  22 + {
  23 + title: '轨迹',
  24 + key: 'acceptRemark',
  25 + align: 'center',
  26 + width: 500,
  27 + },
  28 + {
  29 + title: '创建时间',
  30 + align: 'center',
  31 + render: (h, params) => {
  32 + return (
  33 + <div>
  34 + <span>{timeFormat(params.row.createTime)}</span>
  35 + </div>
  36 + );
  37 + },
  38 + },
  39 + ],
  40 + };
  41 + },
  42 + methods: {
  43 + show(info) {
  44 + this.showModal = true;
  45 + this.expressList = info;
  46 + },
  47 + hide() {
  48 + this.showModal = false;
  49 + },
  50 + },
  51 +};
  52 +</script>
@@ -25,27 +25,36 @@ @@ -25,27 +25,36 @@
25 <template v-for="(item, index) in logisticsList"> 25 <template v-for="(item, index) in logisticsList">
26 <span v-if="item.id == orderInfo.expressId" :key="index">{{ item.companyName }}</span> 26 <span v-if="item.id == orderInfo.expressId" :key="index">{{ item.companyName }}</span>
27 </template> 27 </template>
  28 + <template v-if="orderInfo.expressNumber > 0">
  29 + <a style="margin-left:20px;" @click="showExpressInfo()">查看物流信息</a>
  30 + </template>
28 </i-col> 31 </i-col>
29 </Row> 32 </Row>
30 <Row v-if="isShowExpress"> 33 <Row v-if="isShowExpress">
31 <i-col span="24">运单号:{{ orderInfo.expressNumber > 0 ? orderInfo.expressNumber : '' }} </i-col> 34 <i-col span="24">运单号:{{ orderInfo.expressNumber > 0 ? orderInfo.expressNumber : '' }} </i-col>
32 </Row> 35 </Row>
33 </div> 36 </div>
  37 + <order-express-info ref="showOrderExpressInfo" :show="showOrderExpressInfo"></order-express-info>
34 </div> 38 </div>
35 </template> 39 </template>
36 <script> 40 <script>
37 import _ from 'lodash'; 41 import _ from 'lodash';
38 import LogisticsService from 'services/logistics/logistics-service'; 42 import LogisticsService from 'services/logistics/logistics-service';
  43 +import { OrderService } from 'services/order';
  44 +import orderExpressInfo from './order-express-info.vue';
39 export default { 45 export default {
40 name: 'OrderUserInfo', 46 name: 'OrderUserInfo',
  47 + components: { orderExpressInfo },
41 props: ['orderInfo', 'isShowExpress'], 48 props: ['orderInfo', 'isShowExpress'],
42 data() { 49 data() {
43 return { 50 return {
44 logisticsList: [], 51 logisticsList: [],
  52 + showOrderExpressInfo: false,
45 }; 53 };
46 }, 54 },
47 created() { 55 created() {
48 this.LogisticsService = new LogisticsService(); 56 this.LogisticsService = new LogisticsService();
  57 + this.OrderService = new OrderService();
49 this.getLogisticsList(); 58 this.getLogisticsList();
50 }, 59 },
51 methods: { 60 methods: {
@@ -55,6 +64,13 @@ export default { @@ -55,6 +64,13 @@ export default {
55 this.logisticsList = _.get(ret, 'data', []); 64 this.logisticsList = _.get(ret, 'data', []);
56 }); 65 });
57 }, 66 },
  67 + //获取订单物流轨迹
  68 + showExpressInfo() {
  69 + this.OrderService.queryOrderExpressInfo({ orderCode: this.orderInfo.orderCode }).then(ret => {
  70 + const info = _.get(ret, 'data', []);
  71 + this.$refs.showOrderExpressInfo.show(info);
  72 + });
  73 + },
58 }, 74 },
59 }; 75 };
60 </script> 76 </script>
@@ -56,16 +56,28 @@ export default { @@ -56,16 +56,28 @@ export default {
56 showExpressLoading: false, 56 showExpressLoading: false,
57 showDeliverLoading: false, 57 showDeliverLoading: false,
58 showNoExpressLoading: false, 58 showNoExpressLoading: false,
  59 + oldRouterName: 'order.detail',
59 }; 60 };
60 }, 61 },
  62 + watch: {
  63 + orderInfo: {
  64 + handler(newValue) {
  65 + this.orderInfo.expressNumber = +newValue.expressNumber > 0 ? newValue.expressNumber : '';
  66 + },
  67 + deep: true,
  68 + },
  69 + },
61 created() { 70 created() {
62 this.LogisticsService = new LogisticsService(); 71 this.LogisticsService = new LogisticsService();
63 this.OrderService = new OrderService(); 72 this.OrderService = new OrderService();
64 this.$emit('nextStep', 2); 73 this.$emit('nextStep', 2);
65 this.getLogisticsList(); 74 this.getLogisticsList();
66 - this.orderInfo.expressNumber = +this.orderInfo.expressNumber > 0 ? this.orderInfo.expressNumber : '';  
67 }, 75 },
68 - 76 + beforeRouteEnter(to, from, next) {
  77 + next(vm => {
  78 + vm.oldRouterName = from.name;
  79 + });
  80 + },
69 methods: { 81 methods: {
70 //获取物流公司列表 82 //获取物流公司列表
71 getLogisticsList() { 83 getLogisticsList() {
@@ -84,7 +96,7 @@ export default { @@ -84,7 +96,7 @@ export default {
84 this.showExpressLoading = false; 96 this.showExpressLoading = false;
85 if (ret.code === 200) { 97 if (ret.code === 200) {
86 this.$Message.info(ret.message); 98 this.$Message.info(ret.message);
87 - this.$router.go(0); 99 + this.goBefore();
88 } else { 100 } else {
89 this.$Message.error(ret.message); 101 this.$Message.error(ret.message);
90 } 102 }
@@ -100,7 +112,7 @@ export default { @@ -100,7 +112,7 @@ export default {
100 }).then(ret => { 112 }).then(ret => {
101 if (ret.code === 200) { 113 if (ret.code === 200) {
102 this.$Message.info(ret.message); 114 this.$Message.info(ret.message);
103 - this.$router.go(0); 115 + this.goBefore();
104 } else { 116 } else {
105 this.$Message.error(ret.message); 117 this.$Message.error(ret.message);
106 } 118 }
@@ -118,13 +130,22 @@ export default { @@ -118,13 +130,22 @@ export default {
118 }, 130 },
119 //取消操作 131 //取消操作
120 cancel() { 132 cancel() {
121 - this.$router.push({  
122 - name: 'order.detail',  
123 - params: {},  
124 - query: {  
125 - orderCode: this.orderCode,  
126 - },  
127 - }); 133 + this.goBefore();
  134 + },
  135 + goBefore() {
  136 + if (this.oldRouterName === 'order.detail') {
  137 + this.$router.push({
  138 + name: 'order.detail',
  139 + params: {},
  140 + query: {
  141 + orderCode: this.orderCode,
  142 + },
  143 + });
  144 + } else {
  145 + this.$router.push({
  146 + name: 'order.list',
  147 + });
  148 + }
128 }, 149 },
129 }, 150 },
130 }; 151 };
@@ -5,11 +5,18 @@ @@ -5,11 +5,18 @@
5 <p slot="title" style="height: 35px"> 5 <p slot="title" style="height: 35px">
6 当前订单状态:{{ orderStatus[orderInfo.orderStatus] }} 6 当前订单状态:{{ orderStatus[orderInfo.orderStatus] }}
7 <template v-if="orderInfo.orderStatus >= 100 && orderInfo.orderStatus < 600"> 7 <template v-if="orderInfo.orderStatus >= 100 && orderInfo.orderStatus < 600">
8 - <i-button size="large" type="success" style="margin-left: 50px;" @click="deliver(orderCode)">发货</i-button> 8 + <i-button
  9 + size="large"
  10 + type="success"
  11 + style="margin-left: 50px;"
  12 + @click="deliver(orderCode, orderInfo.orderStatus)"
  13 + >
  14 + 发货
  15 + </i-button>
9 </template> 16 </template>
10 </p> 17 </p>
11 </div> 18 </div>
12 - <div class="ivu-card-body"> 19 + <div v-if="orderInfo.orderStatus >= 100 && orderInfo.orderStatus < 600" class="ivu-card-body">
13 若订单一直未发货,买家会有投诉风险,建议您及时点击发货 查看未发货超时规则 <br /> 20 若订单一直未发货,买家会有投诉风险,建议您及时点击发货 查看未发货超时规则 <br />
14 若买家存在恶意购买行为,您可以联系平台处理 21 若买家存在恶意购买行为,您可以联系平台处理
15 </div> 22 </div>
@@ -63,9 +70,10 @@ export default { @@ -63,9 +70,10 @@ export default {
63 this.getOrderPromos(); 70 this.getOrderPromos();
64 }, 71 },
65 methods: { 72 methods: {
66 - deliver(code) { 73 + deliver(code, status) {
  74 + const routerName = status === 200 ? 'order.deliver.step1' : 'order.deliver.step3';
67 this.$router.push({ 75 this.$router.push({
68 - name: 'order.deliver.step1', 76 + name: routerName,
69 params: {}, 77 params: {},
70 query: { 78 query: {
71 orderCode: code, 79 orderCode: code,
@@ -12,7 +12,6 @@ @@ -12,7 +12,6 @@
12 <tr :key="tindex"> 12 <tr :key="tindex">
13 <td colspan="12" style="text-align: left"> 13 <td colspan="12" style="text-align: left">
14 <span>订单号:{{ item.orderCode }}</span> 14 <span>订单号:{{ item.orderCode }}</span>
15 - <span>父订单号:{{ item.parentOrderCode }}</span>  
16 <span>创建时间:{{ item.createTime | timeFormat }}</span> 15 <span>创建时间:{{ item.createTime | timeFormat }}</span>
17 </td> 16 </td>
18 </tr> 17 </tr>
@@ -36,6 +35,11 @@ @@ -36,6 +35,11 @@
36 <td :rowspan="item.goodsList.length">{{ orderStatusArr[item.orderStatus] }}</td> 35 <td :rowspan="item.goodsList.length">{{ orderStatusArr[item.orderStatus] }}</td>
37 <td :rowspan="item.goodsList.length"> 36 <td :rowspan="item.goodsList.length">
38 <i-button type="default" size="small" @click="goToDetail(item.orderCode)">查看订单</i-button> 37 <i-button type="default" size="small" @click="goToDetail(item.orderCode)">查看订单</i-button>
  38 + <template v-if="item.orderStatus == 100 || item.orderStatus == 200">
  39 + <i-button type="success" size="small" @click="deliver(item.orderCode, item.orderStatus)">
  40 + 发货
  41 + </i-button>
  42 + </template>
39 </td> 43 </td>
40 </template> 44 </template>
41 </tr> 45 </tr>
@@ -71,7 +75,7 @@ export default { @@ -71,7 +75,7 @@ export default {
71 { title: 'SKU', width: '5%' }, 75 { title: 'SKU', width: '5%' },
72 { title: '收货人', width: '5%' }, 76 { title: '收货人', width: '5%' },
73 { title: '支付状态', width: '5%' }, 77 { title: '支付状态', width: '5%' },
74 - { title: '实金额', width: '5%' }, 78 + { title: '实金额', width: '5%' },
75 { title: '订单状态', width: '5%' }, 79 { title: '订单状态', width: '5%' },
76 { title: '操作', width: '10%' }, 80 { title: '操作', width: '10%' },
77 ], 81 ],
@@ -88,6 +92,16 @@ export default { @@ -88,6 +92,16 @@ export default {
88 }); 92 });
89 }, 93 },
90 prodImage, 94 prodImage,
  95 + deliver(code, status) {
  96 + const routerName = status === 200 ? 'order.deliver.step1' : 'order.deliver.step3';
  97 + this.$router.push({
  98 + name: routerName,
  99 + params: {},
  100 + query: {
  101 + orderCode: code,
  102 + },
  103 + });
  104 + },
91 }, 105 },
92 }; 106 };
93 </script> 107 </script>
@@ -12,7 +12,6 @@ @@ -12,7 +12,6 @@
12 <tr :key="index"> 12 <tr :key="index">
13 <td colspan="12" style="text-align: left"> 13 <td colspan="12" style="text-align: left">
14 <span>订单号:{{ item.orderCode }}</span> 14 <span>订单号:{{ item.orderCode }}</span>
15 - <span>父订单号:{{ item.parentOrderCode }}</span>  
16 <span>创建时间:{{ item.createTime | timeFormat }}</span> 15 <span>创建时间:{{ item.createTime | timeFormat }}</span>
17 </td> 16 </td>
18 </tr> 17 </tr>
@@ -8,6 +8,7 @@ const apiUrl = { @@ -8,6 +8,7 @@ const apiUrl = {
8 orderCoupons: '/erp/queryOrderCoupons', 8 orderCoupons: '/erp/queryOrderCoupons',
9 orderPromos: '/erp/queryOrderPromos', 9 orderPromos: '/erp/queryOrderPromos',
10 confirmExpress: '/erp/confirmExpress', 10 confirmExpress: '/erp/confirmExpress',
  11 + orderExpressInfo: '/erp/orderExpressInfo',
11 }; 12 };
12 13
13 class OrderService extends Service { 14 class OrderService extends Service {
@@ -69,6 +70,15 @@ class OrderService extends Service { @@ -69,6 +70,15 @@ class OrderService extends Service {
69 confirmExpress(params) { 70 confirmExpress(params) {
70 return this.post(apiUrl.confirmExpress, params); 71 return this.post(apiUrl.confirmExpress, params);
71 } 72 }
  73 +
  74 + /**
  75 + * 获取订单物流轨迹
  76 + * @param params
  77 + * @return {*}
  78 + */
  79 + queryOrderExpressInfo(params) {
  80 + return this.post(apiUrl.orderExpressInfo, params);
  81 + }
72 } 82 }
73 83
74 OrderService.exportOrdersByStatus = '/Api/erp/exportOrdersByStatus'; 84 OrderService.exportOrdersByStatus = '/Api/erp/exportOrdersByStatus';
1 { 1 {
2 "name": "yoho-shop-manage", 2 "name": "yoho-shop-manage",
3 - "version": "6.9.24-beta12", 3 + "version": "6.9.24-beta13",
4 "description": "", 4 "description": "",
5 "main": "app.js", 5 "main": "app.js",
6 "scripts": { 6 "scripts": {
@@ -101,6 +101,7 @@ const domainApis = { @@ -101,6 +101,7 @@ const domainApis = {
101 queryOrderPromos: '/erp-gateway-web/cs/order/promotions', //获取订单促销 101 queryOrderPromos: '/erp-gateway-web/cs/order/promotions', //获取订单促销
102 confirmExpress: '/erp-gateway-web/shop/orders/ordersUpdateExpress', //订单确认物流 102 confirmExpress: '/erp-gateway-web/shop/orders/ordersUpdateExpress', //订单确认物流
103 exportOrdersByStatus: '/erp-gateway-web/shop/export/exportOrdersByStatus', //导出订单列表 103 exportOrdersByStatus: '/erp-gateway-web/shop/export/exportOrdersByStatus', //导出订单列表
  104 + orderExpressInfo: '/erp-gateway-web/cs/order/query_logistics_trace', // 订单物流轨迹
104 105
105 //物流接口 106 //物流接口
106 queryLogisticsList: '/erp-gateway-web/shop/logistics_company/list', //获取物流公司列表 107 queryLogisticsList: '/erp-gateway-web/shop/logistics_company/list', //获取物流公司列表