/*
 * @Date: 2022-12-02 09:49:15
 * @LastEditors: 陈禹琨 cyk910622@163.com
 * @LastEditTime: 2022-12-07 16:57:22
 * @FilePath: \upcloud-wms-henanyiyao-web\src\views\kzyWMS\outBound\billRePrint\api.js
 * @Description: cyk
 */
import axios from "@/utils/request";
import { upcloud_base_wh_outbound, upcloud_base_common } from "@/config/serviceSettings";
import request from "@/utils/request";
const baseUrl = upcloud_base_wh_outbound;
// 列表页
export const listRemoteUrl = {
  url: baseUrl + "/picktask/queryPrintList",
  method: "post",
}
// 承运商列表
export const carrierUrl = {
  url: upcloud_base_common + "/dict/page",
  method: "post",
}
export const print = (data) => {
  return axios.post(baseUrl + "/picktask/queryOutboundPrintList", data);
}

// 获取字典
export const getDictionary = (dicttypeCodes) => {
  return axios.post(upcloud_base_common + `/dict/listbytype?dicttypeCodes=${dicttypeCodes}`).then((res) => {
    return res.success ? res.data.map((_) => ({ ..._, label: _.dictName, value: _.dictCode })) : [];
  });
};

export function taskPrint(params) {
  return request({
    url: upcloud_base_wh_outbound + "/picktask/v1/print/again/task",
    method: "post",
    data: params,
  });
}

export function billPrint(params) {
  return request({
    url: upcloud_base_wh_outbound + "/picktask/v1/print/again/bill",
    method: "post",
    data: params,
  });
}
export function wholeLabels(params) {
  return request({
    url: upcloud_base_wh_outbound + "/picktask/v1/print/again/wholeLabels",
    method: "post",
    data: params,
  });
}
// 单据补打-拼箱明细
//
export function bulkdetail(params) {
  return request({
    url: upcloud_base_wh_outbound + "/picktask/v1/print/again/task-list/bulk/detail",
    method: "post",
    data: params,
  });
}
//   单据补打-打印拼箱数据
//
export function lclPrint(params) {
  return request({
    url: upcloud_base_wh_outbound + "/picktask/v1/print/again/lcl/print",
    method: "post",
    data: params,
  });
}
// 单据补打-整散合一明细
//
export function wholeBulkdetail(params) {
  return request({
    url: upcloud_base_wh_outbound + "/picktask/v1/print/again/task-list/wholeBulk/detail",
    method: "post",
    data: params,
  });
}
//
//：单据补打-打印整散合一纸单
export function printPaperslip(params) {
  return request({
    url: upcloud_base_wh_outbound + "/picktask/v1/print/again/print-paperslip",
    method: "post",
    data: params,
  });
}
//
//：获取打印信息
export function printAll(params) {
  return request({
    url: upcloud_base_wh_outbound + "/picktask/v1/print/again/all",
    method: "post",
    data: params,
  });
}
// 获取typeId
export function getDicttype(params) {
  return request({
    url: upcloud_base_common + "/dicttype/page",
    method: "get",
    params,
  });
}
// 取消
export function cancelDoBillH(params) {
  return request({
    url: upcloud_base_wh_outbound + "/faceOrder/v1/cancel",
    method: "post",
    data: params,
  });
}
// 修改承运商
export function changeCarrier(params) {
  return request({
    url: upcloud_base_wh_outbound + "/faceOrder/v1/convert/carrier",
    method: "post",
    data: params,
  });
}

// 打印
export function printInfo(url,data) {
  return axios({
    url: url,
    method: "post",
    data,
  });
}