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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
import util from '@/utils/util.js'
const jsonType = {'content-type': 'application/json'}
const formType = {'content-type': 'application/x-www-form-urlencoded'}
const dataType = {'content-type': 'multipart/form-data'}
let orderApiFun = function(vm){
// 接口公共前缀
const prefix = '/wxh-worker-rest/rest/'
let order = '/wxh-worker-rest/rest/order/'
let settle = '/wxh-worker-rest/rest/settle/'
let listByRecommendOrder = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/recommend/order', params);
/**
* 工单数量查询接口
*/
let listOrderCount = async (params = {}) => await vm.$u.get(prefix + vm.vuex_token + '/wokerOrder/queryOrdersCount/V2', params);
/**
* 订单管理工单数量查询接口
*/
let manageOrderCount = async (params = {}) => await vm.$u.get(prefix + vm.vuex_token + '/wokerOrder/countOrderByTimeRange', params);
/**
* 根据订单id数组获取订单列表
*/
let listOrderByIds = async (string) => await vm.$u.get('/wxh-worker-rest/rest/order/revision/listOrderByIds' + string);
/**
* 工单列表接口
*/
let listOrder = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/order/revision/' + vm.vuex_token + '/list', params);
/**
* 订单管理工单列表接口
*/
let manageOrderList = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/order/revision/listOrderByTimeRange', params);
/**
* 获取师傅的预约日历
*/
let workerCalendar = async (params = {}) => await vm.$u.get(prefix + vm.vuex_token + '/wokerOrder/appointment/calendar', params);
/**
* 师傅预约
*/
let workerAppointment = async (params = {}, orderId) => await vm.$u.post('/wxh-worker-rest/rest/order/traceAndAppointment/trace/V2/' + vm.vuex_token + '/'+orderId, params)
// 联系顾客时间更新接口,暂时没有
/**
* 师傅签到接口
*/
let maintainWorkerCheckin = async (params = {},orderId) => await vm.$u.post(prefix + vm.vuex_token + '/order/'+orderId+'/maintainWorkerCheckin', params,formType);
/**
* 订单详情查询
*/
let orderDetail = async (params = {},orderId) => await vm.$u.get('/wxh-worker-rest/rest/order/revision/'+ vm.vuex_token+'/'+orderId, params);
/**
* 结算详情查询
*/
let querySettleByOrder = async (params = {},orderId) => await vm.$u.get('/wxh-worker-rest/rest/settle/'+ vm.vuex_token+'/querySettleByOrder/'+orderId, params);
/* 过程反馈查询接口 */
let feedbackConfig = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/order/v2/getFeedBack/' + vm.vuex_token, params)
/* 预约+过程反馈 接口 */
let traceAndAppointment = async (params = {}, orderId) => await vm.$u.post('/wxh-worker-rest/rest/order/traceAndAppointment/trace/V2/' + vm.vuex_token + `/`+orderId, params)
/* 师傅拒单 */
let rejectOrder = async (params = {}, orderId) => await vm.$u.post(prefix + vm.vuex_token + `/order/${orderId}/workerReject/V2`, params, formType)
/**
* 查询工单操作记录列表接口
*/
let listOrderRecord = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/order/record/'+ vm.vuex_token+'/listOrderRecord/V2/'+params.orderId, params);
/**
* 接单
*/
let orderAccept = async (params = {},orderId) => await vm.$u.post(prefix + vm.vuex_token+'/order/'+orderId+'/accept', params, formType);
/**
* 抢单
*/
let orderGan = async (params = {},orderId) => await vm.$u.post('/wxh-worker-rest/rest/order/revision/applets/'+ vm.vuex_token+'/order/acceptAppletsOrder', params,formType);
/**
* 获取拍照标准
*/
let orderStandard = async (params = {}) => await vm.$u.get(prefix + vm.vuex_token+'/photo/standard', params);
/**
* 获取拍照标准单独项目
*/
let orderStandardItem = async (params = {}) => await vm.$u.get(prefix + vm.vuex_token+'/photo/standard/only', params);
/**
* 保存图片信息
*/
let saveImage = async (params = {},orderId) => await vm.$u.post(prefix + vm.vuex_token + '/order/'+orderId+'/maintain/saveImage', params);
/**
* 获取师傅水印 or 默认水印
*/
let getWatermark = async (params = {}) => await vm.$u.get(prefix + vm.vuex_token + '/photo/watermark', params);
/**
* 保存师傅水印
*/
let saveWatermark = async (params = {}) => await vm.$u.post(prefix + vm.vuex_token + '/photo/watermark', params);
/**
* 获取师傅开放可选时间段
*/
let openTimerange = async (params = {}) => await vm.$u.get(prefix + vm.vuex_token + '/wokerOrder/appointment/timerange', params);
/**
* 联系时间接口
*/
let contactTime = async (params = {},orderId) => await vm.$u.get('/wxh-worker-rest/rest/order/record/'+ vm.vuex_token+'/contact/'+orderId, params);
/**
* 检查是否可以拒单
*/
let checkRejectable = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/'+ vm.vuex_token+'/wokerOrder/checkRejectable', params);
/**
* 获取签到距离
*/
let getSignDistance = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/' + vm.vuex_token + `/wokerOrder/sign/distance`, params)
/**
* 获取订单的完工项目(配置+数据)
*/
let getCompleteConfigAndData= async (orderId) => await vm.$u.get(prefix + vm.vuex_token+'/order/'+ orderId +'/maintain/info');
/**
* 完工项阶段下一步
*/
let completeNextStep= async (params = {}, orderId) => await vm.$u.post(prefix + vm.vuex_token+'/order/'+ orderId +'/maintain/nextStep', params);
/**
* 查询措施
*/
let getMeasure= async (params = {}) => await vm.$u.get('wxh-worker-rest/rest/service/'+ vm.vuex_token+'/measure/queryMeasureItems', params);
let getMeasureV2= async (params = {}) => await vm.$u.get('wxh-worker-rest/rest/service/'+ vm.vuex_token+'/measure/queryMeasureItems/V2', params);
/**
* 查询工单材信息
*/
let getOrderMaterial= async (orderId) => await vm.$u.get('/wxh-cloud-rest/rest/thirdparty/shzhida/material/' + orderId);
/**
* 保存售后记录
*/
let saveCompleteData = async (params = {},orderId) => await vm.$u.post(prefix + vm.vuex_token+'/order/'+ orderId +'/maintain/saveMaintainInfoV3', params);
/**
* 保内工单完工
*/
let inOrderFinish = async (orderId) => await vm.$u.post(prefix + vm.vuex_token+'/order/'+ orderId +'/finishedAndConfirm',{}, formType);
/**
* 保外工单完工
*/
let outOrderFinish = async (params = {},orderId) => await vm.$u.post(prefix + vm.vuex_token+'/order/'+ orderId +'/v1/finishedAndConfirmOutGuaranteePeriod', params, formType);
/**
* 获取工单联系人经纬度
*/
let addressToCoordinate= async (orderId) => await vm.$u.get(prefix+'order/specialfee/'+ vm.vuex_token +'/address/coordinate/'+orderId);
/**
* 我的库存明细(物料)
*/
let listBystock= async () => await vm.$u.get(prefix + vm.vuex_token +'/myinfo/stock', {}, jsonType);
/**
* 我的出入库流水
*/
let listAccessHistory= async (params = {}) => await vm.$u.get(prefix + vm.vuex_token +'/myinfo/access/history', params, jsonType);
// 获取我的钱包-资产信息
let getAssets = async (params = {}) => await vm.$u.get(settle + vm.vuex_token + '/v3/total', params);
// 获取我的钱包-收入流水
let listStatement = async (params = {}) => await vm.$u.get(settle + vm.vuex_token + '/v2/statement', params);
// 获取我的钱包-收入流水
let listStatementDetails = async (params = {}) => await vm.$u.get(settle + vm.vuex_token + '/queryStatementByPayableNo', params);
// 获取我的钱包-支付单一览
let payableRecord = async (params = {}) => await vm.$u.post(settle + vm.vuex_token + '/payable/v2/queryPayableRecord', params, formType);
// 获取我的钱包-支付单一览版本3
let listPayableRecordByPayTime = async (params = {}) => await vm.$u.post(settle + vm.vuex_token + '/payable/listPayableRecordByPayTime', params, formType);
// 获取我的钱包-师傅提现
let workerApplyPay = async () => await vm.$u.get(prefix + vm.vuex_token + '/applypay/batch/workerApplyPay');
// 是否有特殊登录权限
let allowLogin = async (params = {}) => await vm.$u.get(prefix + 'other/auth/' + vm.vuex_token + '/allow/login', params);
// 特殊登录切换师傅
let otherUser = async (params = {}) => await vm.$u.get(prefix + 'other/auth/' + vm.vuex_token + '/other/user', params);
// 是否添加客服
let checkAddCustomer = async (params = {}) => await vm.$u.get(prefix + 'order/revision/' + vm.vuex_token + '/checkAddCustomer', params);
// 工单文件标签
let fileLabel = async (params = {}) => await vm.$u.get(prefix + 'config/' + vm.vuex_token + '/finish/file/lable/', params);
// 工单文件列表
let fileList = async (params = {}) => await vm.$u.get(prefix + 'config/' + vm.vuex_token + '/finish/file', params);
// 订单配件列表
let applyList = async (params = {}) => await vm.$u.get(prefix + 'parts/' + vm.vuex_token + '/orders', params);
// 返件列表
let returnedParts = async (params = {}) => await vm.$u.get(prefix + 'parts/' + vm.vuex_token + '/return', params);
// 物料仓列表
let reserveList = async (params = {}) => await vm.$u.get(prefix + 'parts/' + vm.vuex_token + '/items/reserve', params);
// 配件物流
let getLogistics = async (orderId) => await vm.$u.get(prefix + 'parts/' + vm.vuex_token + '/orders/'+ orderId +'/express',{}, formType);
// 配件申请单-数量统计
let getOrderPartsSum = async (orderId) => await vm.$u.get(prefix + 'parts/' + vm.vuex_token + '/orders/' + orderId +'/sum',{}, formType);
// 配件申请单-签收
let receiveParts = async (partOrderId) => await vm.$u.put(prefix + 'parts/' + vm.vuex_token + '/orders/' + partOrderId +'/receive',{}, formType);
// 配件申请单-取消申请
let cancelParts = async (partOrderId) => await vm.$u.put(prefix + 'parts/' + vm.vuex_token + '/orders/'+ partOrderId +'/cancel',{}, formType);
// 点击了异常单去处理
let workerDealWithError = async (orderId, params = {}) => await vm.$u.post( prefix + vm.vuex_token + '/order/' + orderId + '/workerDealWithError', params)
// 工单搜索联想
let association = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/order/revision/association', params);
const orderApi = {
listByRecommendOrder,
listOrderCount,
manageOrderCount,
listOrderByIds,
listOrder,
manageOrderList,
workerCalendar,
workerAppointment,
maintainWorkerCheckin,
orderDetail,
querySettleByOrder,
listOrderRecord,
orderAccept,
orderGan,
feedbackConfig,
traceAndAppointment,
rejectOrder,
orderStandard,
orderStandardItem,
saveImage,
getWatermark,
saveWatermark,
openTimerange,
contactTime,
checkRejectable,
getSignDistance,
getCompleteConfigAndData,
getMeasure,
getMeasureV2,
getOrderMaterial,
saveCompleteData,
inOrderFinish,
outOrderFinish,
addressToCoordinate,
listBystock,
listAccessHistory,
getAssets,
listStatement,
payableRecord,
listPayableRecordByPayTime,
listStatementDetails,
workerApplyPay,
allowLogin,
otherUser,
checkAddCustomer,
fileLabel,
fileList,
completeNextStep,
applyList,
returnedParts,
reserveList,
getLogistics,
getOrderPartsSum,
receiveParts,
cancelParts,
workerDealWithError,
association
}
return orderApi
}
module.exports = {
orderApiFun
}