import { request, Upload, uploadMultipleFiles } from "./request";
const api = "/worn/outboundBill/";
// 新建:出库单
const addStockOut = (params) => {
  return request(api + "add", params, "POST");
};
// 列表
const stockOutList = (params) => {
  return request(api + "list", params, "get");
};

// 详情
const stockOutDetail = (params) => {
  return request("/worn/outboundItem/getByBillNo", params, "post");
};
// 编辑
const stockOutUpdate = (params) => {
  return request("/worn/outboundItem/update", params, "post");
};
// 出库
const outBoundFinish = (params) => {
  return request("/worn/outboundBill/complete", params, "post");
};
// 添加技术鉴定表
const addWithFiles = (params) => {
  return request("/worn/appraisal/addWithFiles", params, "post");
};
// 技术鉴定表
const myList = (params) => {
  return request("/worn/appraisal/myList", params, "get");
};

// 技术鉴定表
const deleteAppraisal = (params) => {
  console.log(params,params);
  
  return request(`/worn/appraisal/${params.id}`, params, "delete");
};
// 上传图片
const uploadTechnicalFile = (files, formData) => {
  return uploadMultipleFiles(
    "/worn/technicalFile/upload",
    files,
    formData,
    true,
  );
};

export {
  addStockOut,
  stockOutList,
  stockOutDetail,
  stockOutUpdate,
  outBoundFinish,
  addWithFiles,
  uploadTechnicalFile,
  myList,
  deleteAppraisal,
};
