step3.vue
3.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<template>
<div>
<Row>
<Tabs>
<Tab-pane label="自己联系物流">
<layout-filter ref="filter">
<Row>
<filter-item label="快递公司">
<Select v-model.trim="orderInfo.expressId" clearable>
<Option v-for="option in logisticsList" :key="option.id" :value="option.id">
{{ option.companyName }}
</Option>
</Select>
</filter-item>
</Row>
<Row>
<filter-item label="快递单号">
<Input v-model.trim="orderInfo.expressNumber" />
</filter-item>
</Row>
<filter-item>
<Button
type="success"
:loading="showExpressLoading"
:disabled="orderInfo.orderStatus >= 600 ? true : false"
@click="confirmExpress"
>
确认快递单
</Button>
<Button
type="primary"
:loading="showDeliverLoading"
:disabled="orderInfo.orderStatus >= 600 ? true : false"
@click="confirmDeliver"
>
确认发货
</Button>
<Button type="default" @click="cancel">取消</Button>
</filter-item>
</layout-filter>
</Tab-pane>
</Tabs>
</Row>
</div>
</template>
<script>
import LogisticsService from 'services/logistics/logistics-service';
import OrderService from 'services/order/order-service';
import _ from 'lodash';
export default {
props: ['current', 'orderCode', 'orderInfo'],
data() {
return {
logisticsList: [],
showExpressLoading: false,
showDeliverLoading: false,
showNoExpressLoading: false,
};
},
created() {
this.LogisticsService = new LogisticsService();
this.OrderService = new OrderService();
this.$emit('nextStep', 2);
this.getLogisticsList();
},
methods: {
//获取物流公司列表
getLogisticsList() {
this.LogisticsService.logisticsList().then(ret => {
this.logisticsList = _.get(ret, 'data', []);
});
},
//确认快递
confirmExpress() {
this.showExpressLoading = true;
this.OrderService.confirmExpress({
orderCode: +this.orderCode,
expressId: +this.orderInfo.expressId,
expressNumber: this.orderInfo.expressNumber,
}).then(ret => {
this.showExpressLoading = false;
if (ret.code === 200) {
this.$Message.info(ret.message);
this.$router.go(0);
} else {
this.$Message.error(ret.message);
}
});
},
//确认发货
confirmDeliver() {
this.showDeliverLoading = true;
this.LogisticsService.proxyOutStorage({
orderCode: +this.orderCode,
expressId: +this.orderInfo.expressId,
expressNumber: this.orderInfo.expressNumber,
}).then(ret => {
if (ret.code === 200) {
this.$Message.info(ret.message);
this.$router.go(0);
} else {
this.$Message.error(ret.message);
}
});
},
//确认发货无需物流
confirmDeliverNoExpress() {
this.LogisticsService.proxyOutStorage({}).then(ret => {
if (ret.code === 200) {
this.$Message.info(ret.message);
} else {
this.$Message.error(ret.message);
}
});
},
//取消操作
cancel() {
this.$router.push({
name: 'order.detail',
params: {},
query: {
orderCode: this.orderCode,
},
});
},
},
};
</script>