box.js 8.13 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 68 69 70 71 72 73 74
// 导出海运预装单,上面的预装单是空运的
export function exportSeaPreloadGoodsList(query) {
  return request({
      url: "/ecw/box-preload-goods/downloadSeaPreloadGoodsList",
      method: "get",
      params: query
  });
}

75 76
// 创建费用登记
export function createCost(data) {
huhaiqing's avatar
huhaiqing committed
77 78 79 80 81 82 83 84
  if (data.id) {
    return request({
      url: "/ecw/box-cost/update",
      method: "put",
      data,
    });
  }

85
  return request({
huhaiqing's avatar
huhaiqing committed
86 87 88 89
    url: "/ecw/box-cost/create",
    method: "post",
    data,
  });
90 91
}

huhaiqing's avatar
huhaiqing committed
92 93 94 95 96
// 删除费用登记
export function deleteCost(id) {
  return request({
    url: `/ecw/box-cost/delete?id=${id}`,
    method: "delete",
huhaiqing's avatar
huhaiqing committed
97
  });
huhaiqing's avatar
huhaiqing committed
98 99
}

100 101 102
// 审核详情
export function approvalDetail(data) {
  return request({
huhaiqing's avatar
huhaiqing committed
103 104
    url: "/ecw/box-approval/approvalDetail",
    method: "post",
105 106
    headers: { "Content-Type": "application/x-www-form-urlencoded" },
    data: jsonToFormData(data),
huhaiqing's avatar
huhaiqing committed
107
  });
108
}
109

huhaiqing's avatar
huhaiqing committed
110 111 112
// 出货操作日志列表
export function getLogList(params) {
  return request({
huhaiqing's avatar
huhaiqing committed
113 114 115 116
    url: "/ecw/box-op-log/list",
    method: "get",
    params,
  });
huhaiqing's avatar
huhaiqing committed
117 118 119 120 121
}

// 获得费用登记列表
export function getCostList(params) {
  return request({
huhaiqing's avatar
huhaiqing committed
122 123 124 125
    url: "/ecw/box-cost/list",
    method: "get",
    params,
  });
huhaiqing's avatar
huhaiqing committed
126 127 128 129 130
}

// 获得出货异常记录列表
export function getAbnormalList(params) {
  return request({
huhaiqing's avatar
huhaiqing committed
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
    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,
  });
}

155 156 157 158 159 160 161 162 163
// 空运制作提单
export function makeAirBillService(params) {
  return request({
    url: "/shipment/make-bill-of-lading/airMake",
    method: "get",
    params,
  });
}

huhaiqing's avatar
huhaiqing committed
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
// 创建制作提货单
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
214 215
}

huhaiqing's avatar
huhaiqing committed
216 217 218 219 220
// 打包下载提货单
export function zipDownload(params) {
  return request({
    url: "/shipment/make-bill-of-lading/zipDownload",
    method: "get",
221
    timeout: 120000,
huhaiqing's avatar
huhaiqing committed
222 223 224 225
    params,
  });
}

huhaiqing's avatar
huhaiqing committed
226 227 228 229 230 231
/**
 * formData数据
 *
 * @param {*} params
 * @return {*}
 */
232 233 234 235 236 237 238
function jsonToFormData(params) {
  const formData = new FormData();
  for (const [key, value] of Object.entries(params)) {
    formData.append(key, value);
  }
  return formData;
}
239

240 241 242 243 244
// 创建制作提货单
export function getNoticeList(data) {
  return request({
    url: "/shipment/box/noticeList",
    method: "post",
huhaiqing's avatar
huhaiqing committed
245
    data,
246 247 248
  });
}

249 250 251 252 253 254 255 256 257
// 空运出货提示
export function getAirNoticeList(data) {
  return request({
    url: "/shipment/box/airNoticeList",
    method: "post",
    data,
  });
}

258 259 260 261 262 263 264
/**
 * 根据订单ID下载提货单
 *
 * @export
 * @param {*} orderId
 * @return {*}
 */
265 266 267 268
export function downloadByOrderId(orderId) {
  return request({
    url: "/shipment/make-bill-of-lading/downloadByOrderId",
    method: "get",
huhaiqing's avatar
huhaiqing committed
269
    params: { orderId },
270
    /* responseType: "arraybuffer", */
271
  });
272 273 274 275 276 277 278 279 280
}

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

// 获得制作提货单(审核中调用)
huhaiqing's avatar
huhaiqing committed
284
export function getBillOfLandingInProcessing(params) {
dragondean@qq.com's avatar
dragondean@qq.com committed
285 286 287 288 289
  return request({
    url: "/shipment/make-bill-of-lading/getInProcessing",
    method: "get",
    params,
  });
dragondean@qq.com's avatar
dragondean@qq.com committed
290
}
291 292
// 下载agent list文件
export function downloadAgentListFiles(params) {
huhaiqing's avatar
huhaiqing committed
293
  return request({
294 295
    url: "/ecw/box-preload-goods/downloadAgentListFiles",
    method: "get",
296
    timeout: 3*60*1000,
297 298 299 300 301 302 303 304
    params,
  });
}

// 下载son cap文件
export function downloadSoncapFiles(params) {
  return request({
    url: "/ecw/box-preload-goods/downloadSoncapFiles",
huhaiqing's avatar
huhaiqing committed
305
    method: "get",
306
    timeout: 3*60*1000,
huhaiqing's avatar
huhaiqing committed
307 308 309 310 311 312 313 314 315
    params,
  });
}

// 下载报关单
export function downloadCustomFiles(params) {
  return request({
    url: "/ecw/box-preload-goods/downloadCustomFiles",
    method: "get",
316
    timeout: 3*60*1000,
huhaiqing's avatar
huhaiqing committed
317 318 319 320 321 322 323 324
    params,
  });
}

// 下载已装单
export function downloadLoadGoodsList(params) {
  return request({
    url: "/ecw/box-preload-goods/downloadLoadGoodsList",
325
    timeout: 3*60*1000,
huhaiqing's avatar
huhaiqing committed
326 327 328 329 330 331 332 333 334
    method: "get",
    params,
  });
}

// 下载预装单
export function downloadPreloadGoodsList(params) {
  return request({
    url: "/ecw/box-preload-goods/downloadPreloadGoodsList",
335
    responseType: "blob",
336
    timeout: 3*60*1000,
huhaiqing's avatar
huhaiqing committed
337 338 339 340 341 342 343 344 345
    method: "get",
    params,
  });
}

// 下载应收汇总
export function downloadReceivableList(params) {
  return request({
    url: "/ecw/box-preload-goods/downloadReceivableList",
346
    timeout: 3*60*1000,
huhaiqing's avatar
huhaiqing committed
347 348 349 350
    method: "get",
    params,
  });
}
351

352 353 354 355 356 357 358 359 360
// 空运的应收汇总下载
export function downloadAirReceivableList(params) {
  return request({
    url: "/ecw/box-preload-goods/downloadAirBillReceivable",
    method: "get",
    params,
  });
}

361 362 363 364 365
// 下载提单copy
export function downloadLadingCopy(params) {
  return request({
    url: "/ecw/box-lading-copy/downloadLadingCopy",
    method: "get",
366
    timeout: 3*60*1000,
367 368 369
    params,
  });
}
huhaiqing's avatar
huhaiqing committed
370 371 372 373 374 375 376 377 378

// 更新异常订单状态
export function updateAbnormalOrder(data) {
  return request({
    url: "/shipment/box/updateAbnormalOrder",
    method: "post",
    data,
  });
}
379 380 381 382 383 384 385 386

// 更新提单URL
export function updateUrl(data) {
  return request({
    url: "/shipment/make-bill-of-lading/updateUrl",
    method: "put",
    data,
  });
387
}
388 389 390 391 392 393 394

export function dealCustomsSplitNotify(notifyId){
  return request({
    url: `/shipment/box/dealCustomsSplitNotify?notifyId=${notifyId}`,
    method: "get",
  })
}
395 396 397 398 399 400 401 402 403

// 自编号报表分页
export function boxSettlementPage(params) {
  return request({
    url: "/shipment/box/pageSettlement",
    method: "get",
    params,
  });
}
404 405 406 407 408 409 410 411 412

// 导出自编号汇总excel
export function exportSettlementExcel(params) {
  return request({
    url: "/shipment/box/export-shipment-summary",
    method: "get",
    params,
  });
}
413 414 415 416 417 418 419 420

// 刷新空运提单
export function updateAirBill(id) {
  return request({
    url: "/shipment/make-bill-of-lading/updateAirBill?ids=" + id,
    method: "get"
  });
}