box.js 7.56 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: 20 * 60000,
huhaiqing's avatar
huhaiqing committed
53 54
    responseType: "blob",
  });
wh's avatar
wh committed
55
}
56

57 58 59 60 61 62 63 64 65
// 导出预装单-异步
export function exportPreloadGoodsList(query) {
    return request({
        url: "/ecw/box-preload-goods/downloadPreloadGoodsList",
        method: "get",
        params: query
    });
}

66 67
// 创建费用登记
export function createCost(data) {
huhaiqing's avatar
huhaiqing committed
68 69 70 71 72 73 74 75
  if (data.id) {
    return request({
      url: "/ecw/box-cost/update",
      method: "put",
      data,
    });
  }

76
  return request({
huhaiqing's avatar
huhaiqing committed
77 78 79 80
    url: "/ecw/box-cost/create",
    method: "post",
    data,
  });
81 82
}

huhaiqing's avatar
huhaiqing committed
83 84 85 86 87
// 删除费用登记
export function deleteCost(id) {
  return request({
    url: `/ecw/box-cost/delete?id=${id}`,
    method: "delete",
huhaiqing's avatar
huhaiqing committed
88
  });
huhaiqing's avatar
huhaiqing committed
89 90
}

91 92 93
// 审核详情
export function approvalDetail(data) {
  return request({
huhaiqing's avatar
huhaiqing committed
94 95
    url: "/ecw/box-approval/approvalDetail",
    method: "post",
96 97
    headers: { "Content-Type": "application/x-www-form-urlencoded" },
    data: jsonToFormData(data),
huhaiqing's avatar
huhaiqing committed
98
  });
99
}
100

huhaiqing's avatar
huhaiqing committed
101 102 103
// 出货操作日志列表
export function getLogList(params) {
  return request({
huhaiqing's avatar
huhaiqing committed
104 105 106 107
    url: "/ecw/box-op-log/list",
    method: "get",
    params,
  });
huhaiqing's avatar
huhaiqing committed
108 109 110 111 112
}

// 获得费用登记列表
export function getCostList(params) {
  return request({
huhaiqing's avatar
huhaiqing committed
113 114 115 116
    url: "/ecw/box-cost/list",
    method: "get",
    params,
  });
huhaiqing's avatar
huhaiqing committed
117 118 119 120 121
}

// 获得出货异常记录列表
export function getAbnormalList(params) {
  return request({
huhaiqing's avatar
huhaiqing committed
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
    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
196 197
}

huhaiqing's avatar
huhaiqing committed
198 199 200 201 202
// 打包下载提货单
export function zipDownload(params) {
  return request({
    url: "/shipment/make-bill-of-lading/zipDownload",
    method: "get",
203
    timeout: 120000,
huhaiqing's avatar
huhaiqing committed
204 205 206 207
    params,
  });
}

huhaiqing's avatar
huhaiqing committed
208 209 210 211 212 213
/**
 * formData数据
 *
 * @param {*} params
 * @return {*}
 */
214 215 216 217 218 219 220
function jsonToFormData(params) {
  const formData = new FormData();
  for (const [key, value] of Object.entries(params)) {
    formData.append(key, value);
  }
  return formData;
}
221

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

231 232 233 234 235 236 237 238 239
// 空运出货提示
export function getAirNoticeList(data) {
  return request({
    url: "/shipment/box/airNoticeList",
    method: "post",
    data,
  });
}

240 241 242 243 244 245 246
/**
 * 根据订单ID下载提货单
 *
 * @export
 * @param {*} orderId
 * @return {*}
 */
247 248 249 250
export function downloadByOrderId(orderId) {
  return request({
    url: "/shipment/make-bill-of-lading/downloadByOrderId",
    method: "get",
huhaiqing's avatar
huhaiqing committed
251
    params: { orderId },
252
    /* responseType: "arraybuffer", */
253
  });
254 255 256 257 258 259 260 261 262
}

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

// 获得制作提货单(审核中调用)
huhaiqing's avatar
huhaiqing committed
266
export function getBillOfLandingInProcessing(params) {
dragondean@qq.com's avatar
dragondean@qq.com committed
267 268 269 270 271
  return request({
    url: "/shipment/make-bill-of-lading/getInProcessing",
    method: "get",
    params,
  });
dragondean@qq.com's avatar
dragondean@qq.com committed
272
}
273 274
// 下载agent list文件
export function downloadAgentListFiles(params) {
huhaiqing's avatar
huhaiqing committed
275
  return request({
276 277
    url: "/ecw/box-preload-goods/downloadAgentListFiles",
    method: "get",
278
    timeout: 3*60*1000,
279 280 281 282 283 284 285 286
    params,
  });
}

// 下载son cap文件
export function downloadSoncapFiles(params) {
  return request({
    url: "/ecw/box-preload-goods/downloadSoncapFiles",
huhaiqing's avatar
huhaiqing committed
287
    method: "get",
288
    timeout: 3*60*1000,
huhaiqing's avatar
huhaiqing committed
289 290 291 292 293 294 295 296 297
    params,
  });
}

// 下载报关单
export function downloadCustomFiles(params) {
  return request({
    url: "/ecw/box-preload-goods/downloadCustomFiles",
    method: "get",
298
    timeout: 3*60*1000,
huhaiqing's avatar
huhaiqing committed
299 300 301 302 303 304 305 306
    params,
  });
}

// 下载已装单
export function downloadLoadGoodsList(params) {
  return request({
    url: "/ecw/box-preload-goods/downloadLoadGoodsList",
307
    timeout: 3*60*1000,
huhaiqing's avatar
huhaiqing committed
308 309 310 311 312 313 314 315 316
    method: "get",
    params,
  });
}

// 下载预装单
export function downloadPreloadGoodsList(params) {
  return request({
    url: "/ecw/box-preload-goods/downloadPreloadGoodsList",
317
    responseType: "blob",
318
    timeout: 3*60*1000,
huhaiqing's avatar
huhaiqing committed
319 320 321 322 323 324 325 326 327
    method: "get",
    params,
  });
}

// 下载应收汇总
export function downloadReceivableList(params) {
  return request({
    url: "/ecw/box-preload-goods/downloadReceivableList",
328
    timeout: 3*60*1000,
huhaiqing's avatar
huhaiqing committed
329 330 331 332
    method: "get",
    params,
  });
}
333

334 335 336 337 338 339 340 341 342
// 空运的应收汇总下载
export function downloadAirReceivableList(params) {
  return request({
    url: "/ecw/box-preload-goods/downloadAirBillReceivable",
    method: "get",
    params,
  });
}

343 344 345 346 347
// 下载提单copy
export function downloadLadingCopy(params) {
  return request({
    url: "/ecw/box-lading-copy/downloadLadingCopy",
    method: "get",
348
    timeout: 3*60*1000,
349 350 351
    params,
  });
}
huhaiqing's avatar
huhaiqing committed
352 353 354 355 356 357 358 359 360

// 更新异常订单状态
export function updateAbnormalOrder(data) {
  return request({
    url: "/shipment/box/updateAbnormalOrder",
    method: "post",
    data,
  });
}
361 362 363 364 365 366 367 368

// 更新提单URL
export function updateUrl(data) {
  return request({
    url: "/shipment/make-bill-of-lading/updateUrl",
    method: "put",
    data,
  });
369
}
370 371 372 373 374 375 376

export function dealCustomsSplitNotify(notifyId){
  return request({
    url: `/shipment/box/dealCustomsSplitNotify?notifyId=${notifyId}`,
    method: "get",
  })
}
377 378 379 380 381 382 383 384 385

// 自编号报表分页
export function boxSettlementPage(params) {
  return request({
    url: "/shipment/box/pageSettlement",
    method: "get",
    params,
  });
}
386 387 388 389 390 391 392 393 394

// 导出自编号汇总excel
export function exportSettlementExcel(params) {
  return request({
    url: "/shipment/box/export-shipment-summary",
    method: "get",
    params,
  });
}