order-deliver.js
1.88 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
export default function () {
return {
namespaced: true,
state: {
appraiseAddress: {},
appraiseAddressCodes: []
},
mutations: {
SET_APPRAISE_ADDRESS(state, { orderCode, data }) {
let addr = {
[orderCode]: data
};
state.appraiseAddressCodes.push(orderCode);
if (state.appraiseAddressCodes.length > 5) {
state.appraiseAddressCodes.shift()
}
state.appraiseAddressCodes.forEach(code => {
if (state.appraiseAddress[code]) {
addr[code] = state.appraiseAddress[code];
}
});
state.appraiseAddress = addr;
}
},
actions: {
/**
* @param {
* skup skup
* orderCode 订单编码
* }
*/
async fetchAppraiseAddress({ commit }, { skup, orderCode } = {}) {
const res = await this.$api.get('/api/order/appraiseAddress', {
skup,
orderCode: orderCode + '',
});
if (res.code === 200) {
commit('SET_APPRAISE_ADDRESS', {
orderCode,
data: res.data
});
}
return res;
},
/**
* @param {
* orderCode 订单编码
* }
*/
async fetchAppraiseAddressChangeNotice({ commit }, { orderCode } = {}) {
return await this.$api.get('/api/order/noticeAppraiseAddressChanged', {
orderCode: orderCode + '',
});
},
/**
* @param {
* orderCode 订单编码
* wayBillCode 物流快递号
* depotNum 鉴定中心id
* }
*/
async deliverOrderToDepot({ commit }, { orderCode, wayBillCode, depotNum } = {}) {
return await this.$api.post('/api/order/deliverToDepot', {
expressCompanyId: 23,
orderCode: orderCode + '',
wayBillCode,
depotNum
});
}
},
};
}