box.js 6.72 KB
Newer Older
huhaiqing's avatar
huhaiqing committed
1
import request from "@/utils/request";
wh's avatar
wh committed
2

wh's avatar
wh committed
3 4
// 创建出货
export function createbox(data) {
wh's avatar
wh committed
5
  return request({
huhaiqing's avatar
huhaiqing committed
6 7 8 9
    url: "/shipment/box/create",
    method: "post",
    data: data,
  });
wh's avatar
wh committed
10 11
}

wh's avatar
wh committed
12 13
// 更新出货
export function updatebox(data) {
wh's avatar
wh committed
14
  return request({
huhaiqing's avatar
huhaiqing committed
15 16 17 18
    url: "/shipment/box/update",
    method: "put",
    data: data,
  });
wh's avatar
wh committed
19 20
}

wh's avatar
wh committed
21 22
// 删除出货
export function deletebox(id) {
wh's avatar
wh committed
23
  return request({
huhaiqing's avatar
huhaiqing committed
24 25 26
    url: "/shipment/box/delete?id=" + id,
    method: "delete",
  });
wh's avatar
wh committed
27 28
}

wh's avatar
wh committed
29 30
// 获得出货
export function getbox(id) {
wh's avatar
wh committed
31
  return request({
huhaiqing's avatar
huhaiqing committed
32 33 34
    url: "/shipment/box/get?id=" + id,
    method: "get",
  });
wh's avatar
wh committed
35 36
}

wh's avatar
wh committed
37 38
// 获得出货分页
export function getboxPage(query) {
wh's avatar
wh committed
39
  return request({
huhaiqing's avatar
huhaiqing committed
40 41 42 43
    url: "/shipment/box/page",
    method: "get",
    params: query,
  });
wh's avatar
wh committed
44 45
}

wh's avatar
wh committed
46 47
// 导出出货 Excel
export function exportboxExcel(query) {
wh's avatar
wh committed
48
  return request({
huhaiqing's avatar
huhaiqing committed
49 50
    url: "/shipment/box/export-excel",
    method: "get",
wh's avatar
wh committed
51
    params: query,
52
    timeout: 5 * 60000,
huhaiqing's avatar
huhaiqing committed
53 54
    responseType: "blob",
  });
wh's avatar
wh committed
55
}
56 57 58

// 创建费用登记
export function createCost(data) {
huhaiqing's avatar
huhaiqing committed
59 60 61 62 63 64 65 66
  if (data.id) {
    return request({
      url: "/ecw/box-cost/update",
      method: "put",
      data,
    });
  }

67
  return request({
huhaiqing's avatar
huhaiqing committed
68 69 70 71
    url: "/ecw/box-cost/create",
    method: "post",
    data,
  });
72 73
}

huhaiqing's avatar
huhaiqing committed
74 75 76 77 78
// 删除费用登记
export function deleteCost(id) {
  return request({
    url: `/ecw/box-cost/delete?id=${id}`,
    method: "delete",
huhaiqing's avatar
huhaiqing committed
79
  });
huhaiqing's avatar
huhaiqing committed
80 81
}

82 83 84
// 审核详情
export function approvalDetail(data) {
  return request({
huhaiqing's avatar
huhaiqing committed
85 86
    url: "/ecw/box-approval/approvalDetail",
    method: "post",
87 88
    headers: { "Content-Type": "application/x-www-form-urlencoded" },
    data: jsonToFormData(data),
huhaiqing's avatar
huhaiqing committed
89
  });
90
}
91

huhaiqing's avatar
huhaiqing committed
92 93 94
// 出货操作日志列表
export function getLogList(params) {
  return request({
huhaiqing's avatar
huhaiqing committed
95 96 97 98
    url: "/ecw/box-op-log/list",
    method: "get",
    params,
  });
huhaiqing's avatar
huhaiqing committed
99 100 101 102 103
}

// 获得费用登记列表
export function getCostList(params) {
  return request({
huhaiqing's avatar
huhaiqing committed
104 105 106 107
    url: "/ecw/box-cost/list",
    method: "get",
    params,
  });
huhaiqing's avatar
huhaiqing committed
108 109 110 111 112
}

// 获得出货异常记录列表
export function getAbnormalList(params) {
  return request({
huhaiqing's avatar
huhaiqing committed
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
    url: "/ecw/box-abnormal/list",
    method: "get",
    params,
  });
}

// 获得制作提货单列表
export function getMakeBillList(params) {
  return request({
    url: "/shipment/make-bill-of-lading/getMakeLadingBillList",
    method: "get",
    params,
  });
}

// 制作提货单
export function makeBillService(params) {
  return request({
    url: "/shipment/make-bill-of-lading/make",
    method: "get",
    params,
  });
}

// 创建制作提货单
export function createBillService(data) {
  return request({
    url: "/shipment/make-bill-of-lading/create",
    method: "post",
    data,
  });
}

// 取消制作提货单审核
export function cancelBillService(id) {
  return request({
    url: `/shipment/make-bill-of-lading/cancel?id=${id}`,
    method: "delete",
  });
}

// 下载提货单
export function downloadBillService(params) {
  return request({
    url: "/shipment/make-bill-of-lading/download",
    method: "get",
    params,
  });
}

// 更新制作提货单
export function updateBillService(data) {
  return request({
    url: "/shipment/make-bill-of-lading/update",
    method: "put",
    data,
  });
}

// 删除制作提货单
export function deleteBillService(id) {
  return request({
    url: `/shipment/make-bill-of-lading/delete?id=${id}`,
    method: "delete",
  });
}

// 获得制作提货单
export function getBillService(params) {
  return request({
    url: "/shipment/make-bill-of-lading/get",
    method: "get",
    params,
  });
huhaiqing's avatar
huhaiqing committed
187 188
}

huhaiqing's avatar
huhaiqing committed
189 190 191 192
// 打包下载提货单
export function zipDownload(params) {
  return request({
    url: "/shipment/make-bill-of-lading/zipDownload",
193
    responseType: "blob",
huhaiqing's avatar
huhaiqing committed
194
    method: "get",
195
    timeout: 120000,
huhaiqing's avatar
huhaiqing committed
196 197 198 199
    params,
  });
}

huhaiqing's avatar
huhaiqing committed
200 201 202 203 204 205
/**
 * formData数据
 *
 * @param {*} params
 * @return {*}
 */
206 207 208 209 210 211 212
function jsonToFormData(params) {
  const formData = new FormData();
  for (const [key, value] of Object.entries(params)) {
    formData.append(key, value);
  }
  return formData;
}
213

214 215 216 217 218
// 创建制作提货单
export function getNoticeList(data) {
  return request({
    url: "/shipment/box/noticeList",
    method: "post",
huhaiqing's avatar
huhaiqing committed
219
    data,
220 221 222 223 224 225 226 227 228 229
  });
}

/**
 * 根据订单ID下载提货单
 *
 * @export
 * @param {*} orderId
 * @return {*}
 */
230 231 232 233
export function downloadByOrderId(orderId) {
  return request({
    url: "/shipment/make-bill-of-lading/downloadByOrderId",
    method: "get",
huhaiqing's avatar
huhaiqing committed
234
    params: { orderId },
235
    /* responseType: "arraybuffer", */
236
  });
237 238 239 240 241 242 243 244 245
}

// 获得出货审核
export function getBoxApproval(params) {
  return request({
    url: "/ecw/box-approval/get",
    method: "get",
    params,
  });
dragondean@qq.com's avatar
dragondean@qq.com committed
246 247 248
}

// 获得制作提货单(审核中调用)
huhaiqing's avatar
huhaiqing committed
249
export function getBillOfLandingInProcessing(params) {
dragondean@qq.com's avatar
dragondean@qq.com committed
250 251 252 253 254
  return request({
    url: "/shipment/make-bill-of-lading/getInProcessing",
    method: "get",
    params,
  });
dragondean@qq.com's avatar
dragondean@qq.com committed
255
}
256 257
// 下载agent list文件
export function downloadAgentListFiles(params) {
huhaiqing's avatar
huhaiqing committed
258
  return request({
259 260
    url: "/ecw/box-preload-goods/downloadAgentListFiles",
    method: "get",
261
    timeout: 3*60*1000,
262 263 264 265 266 267 268 269
    params,
  });
}

// 下载son cap文件
export function downloadSoncapFiles(params) {
  return request({
    url: "/ecw/box-preload-goods/downloadSoncapFiles",
huhaiqing's avatar
huhaiqing committed
270
    method: "get",
271
    timeout: 3*60*1000,
huhaiqing's avatar
huhaiqing committed
272 273 274 275 276 277 278 279 280
    params,
  });
}

// 下载报关单
export function downloadCustomFiles(params) {
  return request({
    url: "/ecw/box-preload-goods/downloadCustomFiles",
    method: "get",
281
    timeout: 3*60*1000,
huhaiqing's avatar
huhaiqing committed
282 283 284 285 286 287 288 289
    params,
  });
}

// 下载已装单
export function downloadLoadGoodsList(params) {
  return request({
    url: "/ecw/box-preload-goods/downloadLoadGoodsList",
290
    responseType: "blob",
291
    timeout: 3*60*1000,
huhaiqing's avatar
huhaiqing committed
292 293 294 295 296 297 298 299 300
    method: "get",
    params,
  });
}

// 下载预装单
export function downloadPreloadGoodsList(params) {
  return request({
    url: "/ecw/box-preload-goods/downloadPreloadGoodsList",
301
    responseType: "blob",
302
    timeout: 3*60*1000,
huhaiqing's avatar
huhaiqing committed
303 304 305 306 307 308 309 310 311
    method: "get",
    params,
  });
}

// 下载应收汇总
export function downloadReceivableList(params) {
  return request({
    url: "/ecw/box-preload-goods/downloadReceivableList",
312
    responseType: "blob",
313
    timeout: 3*60*1000,
huhaiqing's avatar
huhaiqing committed
314 315 316 317
    method: "get",
    params,
  });
}
318 319 320 321 322 323

// 下载提单copy
export function downloadLadingCopy(params) {
  return request({
    url: "/ecw/box-lading-copy/downloadLadingCopy",
    method: "get",
324
    timeout: 3*60*1000,
325 326 327
    params,
  });
}
huhaiqing's avatar
huhaiqing committed
328 329 330 331 332 333 334 335 336

// 更新异常订单状态
export function updateAbnormalOrder(data) {
  return request({
    url: "/shipment/box/updateAbnormalOrder",
    method: "post",
    data,
  });
}
337 338 339 340 341 342 343 344

// 更新提单URL
export function updateUrl(data) {
  return request({
    url: "/shipment/make-bill-of-lading/updateUrl",
    method: "put",
    data,
  });
345
}
346 347 348 349 350 351 352

export function dealCustomsSplitNotify(notifyId){
  return request({
    url: `/shipment/box/dealCustomsSplitNotify?notifyId=${notifyId}`,
    method: "get",
  })
}