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

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

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

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

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

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

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

// 获得出货异常记录列表
export function getAbnormalList(params) {
  return request({
huhaiqing's avatar
huhaiqing committed
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
    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",
157
    responseType: "blob",
huhaiqing's avatar
huhaiqing committed
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
    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 195 196 197 198
    method: "get",
    params,
  });
}

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

213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229
// 创建制作提货单
export function getNoticeList(data) {
  return request({
    url: "/shipment/box/noticeList",
    method: "post",
    headers: { "Content-Type": "application/x-www-form-urlencoded" },
    data: jsonToFormData(data),
  });
}

/**
 * 根据订单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 235
    params: { orderId },
    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 249 250 251 252 253 254
}

// 获得制作提货单(审核中调用)
export function getBillOfLandingInProcessing(params){
  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 261 262 263 264 265 266 267 268
    url: "/ecw/box-preload-goods/downloadAgentListFiles",
    method: "get",
    params,
  });
}

// 下载son cap文件
export function downloadSoncapFiles(params) {
  return request({
    url: "/ecw/box-preload-goods/downloadSoncapFiles",
huhaiqing's avatar
huhaiqing committed
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286
    method: "get",
    params,
  });
}

// 下载报关单
export function downloadCustomFiles(params) {
  return request({
    url: "/ecw/box-preload-goods/downloadCustomFiles",
    method: "get",
    params,
  });
}

// 下载已装单
export function downloadLoadGoodsList(params) {
  return request({
    url: "/ecw/box-preload-goods/downloadLoadGoodsList",
287
    responseType: "blob",
huhaiqing's avatar
huhaiqing committed
288 289 290 291 292 293 294 295 296
    method: "get",
    params,
  });
}

// 下载预装单
export function downloadPreloadGoodsList(params) {
  return request({
    url: "/ecw/box-preload-goods/downloadPreloadGoodsList",
297
    responseType: "blob",
huhaiqing's avatar
huhaiqing committed
298 299 300 301 302 303 304 305 306
    method: "get",
    params,
  });
}

// 下载应收汇总
export function downloadReceivableList(params) {
  return request({
    url: "/ecw/box-preload-goods/downloadReceivableList",
307
    responseType: "blob",
huhaiqing's avatar
huhaiqing committed
308 309 310 311
    method: "get",
    params,
  });
}
312 313 314 315 316 317 318 319 320

// 下载提单copy
export function downloadLadingCopy(params) {
  return request({
    url: "/ecw/box-lading-copy/downloadLadingCopy",
    method: "get",
    params,
  });
}
huhaiqing's avatar
huhaiqing committed
321 322 323 324 325 326 327 328 329

// 更新异常订单状态
export function updateAbnormalOrder(data) {
  return request({
    url: "/shipment/box/updateAbnormalOrder",
    method: "post",
    data,
  });
}