import { Mattress, SoftBed } from "@/api/interface/index";
import { PORT1 } from "@/api/config/servicePort";
import http from "@/api";

/**
 * @name 床垫报价保存
 */
export const SaveMattress = (params: Mattress.ReqSaveMattress) => {
  return http.post<Mattress.ResSaveMattress>(PORT1 + `/SaveMattress`, params);
};

/**
 * @name 床垫报价副规格保存
 */
export const SaveMattressSubSpecs = (params: Mattress.ReqSaveMattress) => {
  return http.post<Mattress.ResSaveMattress>(PORT1 + `/SaveMattressSubSpecs`, params);
};

/**
 * @name 床垫报价：业务下单/取消/审核
 */
export const SaveMattressAuditing = (params: Mattress.ReqMultiMattress) => {
  return http.post(PORT1 + `/SaveMattressAuditing`, params);
};

/**
 * @name 床垫报价：删除
 */
export const DelMattress = (params: Mattress.ReqMultiMattress) => {
  return http.post(PORT1 + `/DelMattress`, params);
};

/**
 * @name 床垫报价：已审批复制
 */
export const CopyMattressAudited = (params: Mattress.ReqMultiMattressBcp) => {
  return http.post(PORT1 + `/CopyMattressAudited`, params);
};

/**
 * @name 床垫报价：未审批重算
 */
export const ReCalculateNoAudit = (params: Mattress.ReqMultiMattressBcp) => {
  return http.post(PORT1 + `/ReCalculateNoAudit`, params);
};

/**
 * @name 半成品报价保存
 */
export const SaveMattressBcp = (params: Mattress.ReqSaveMattress) => {
  return http.post<Mattress.ResSaveMattressBcp>(PORT1 + `/SaveMattressBcp`, params);
};

/**
 * @name 半成品报价：审核
 */
export const AuditMattressBcp = (params: Mattress.ReqMultiMattressBcp) => {
  return http.post(PORT1 + `/AuditMattressBcp`, params);
};

/**
 * @name 半成品报价：删除
 */
export const DeleteMattressBcp = (params: Mattress.ReqMultiMattressBcp) => {
  return http.post(PORT1 + `/DeleteMattressBcp`, params);
};

/**
 * @name 床网报价：保存
 */
export const SaveBedNet = (params: Mattress.ReqSaveBedNet) => {
  return http.post<Mattress.ResSaveBedNet>(PORT1 + `/SaveBedNet`, params);
};

/**
 * @name 床网报价：审核
 */
export const AuditBedNet = (params: Mattress.ReqMultiMattressBcp) => {
  return http.post(PORT1 + `/AuditBedNet`, params);
};

/**
 * @name 床网报价：删除
 */
export const DeleteBedNet = (params: Mattress.ReqMultiMattressBcp) => {
  return http.post(PORT1 + `/DeleteBedNet`, params);
};

/**
 * @name 床垫报价：计算
 */
export const GetComputeMattress = (params: Mattress.ReqSaveMattress) => {
  return http.post<Mattress.ResComputeMattress>(PORT1 + `/GetComputeMattress`, params);
};

/**
 * @name 床网报价：计算
 */
export const GetComputeBednet = (params: Mattress.ReqSaveBedNet) => {
  return http.post<Mattress.ResComputeBednet>(PORT1 + `/GetComputeBednet`, params);
};

/**
 * @name 床网报价：计算，弹簧排列个数
 */
export const GetComputeSpring = (params: Mattress.ReqSaveBedNet) => {
  return http.post<Mattress.ResComputeBednet>(PORT1 + `/GetComputeSpring`, params);
};

/**
 * @name 床网报价：未审批重算
 */
export const ReCalculateBedNetNoAudit = (params: Mattress.ReqMultiMattressBcp) => {
  return http.post(PORT1 + `/ReCalculateBedNetNoAudit`, params);
};

/**
 * @name 床垫清单：业务审核
 */
export const MattressYWAudit = (params: Mattress.ReqMultiMattressBcp) => {
  return http.post(PORT1 + `/MattressYWAudit`, params);
};

/**
 * @name 床垫清单：产品补充审核
 */
export const MattressJSAudit = (params: Mattress.ReqMultiMattressBcp) => {
  return http.post(PORT1 + `/MattressJSAudit`, params);
};

/**
 * @name 床垫清单：清单补充审核
 */
export const MattressJS2Audit = (params: Mattress.ReqMultiMattressBcp) => {
  return http.post(PORT1 + `/MattressJS2Audit`, params);
};

/**
 * @name 床垫清单：刷新配置
 */
export const RefreshMattressInterface = (params: Mattress.ReqRefreshMattressInterface) => {
  return http.post<Mattress.ResRefreshMattressInterface>(PORT1 + `/RefreshMattressInterface`, params);
};

/**
 * @name 床垫清单：刷新清单
 */
export const RefreshMattressInterfaceQd = (params: Mattress.ReqRefreshMattressInterface) => {
  return http.post<Mattress.ResRefreshMattressInterface>(PORT1 + `/RefreshMattressInterfaceQd`, params);
};

/**
 * @name 床垫清单：覆盖配置到副规格产品
 */
export const CoverMattressInterface = (params: Mattress.ReqMultiMattressBcp) => {
  return http.post(PORT1 + `/CoverMattressInterface`, params);
};

/**
 * @name 床垫清单：获取清单
 */
export const GetMattressInterfaceList = (params: Mattress.ReqRefreshMattressInterface) => {
  return http.post<Mattress.ResGetMattressInterfaceList>(PORT1 + `/GetMattressInterfaceList`, params);
};

/**
 * @name 床垫清单：保存清单
 */
export const SaveMattressInterface = (params: Mattress.ReqSaveMattressInterface) => {
  return http.post<Mattress.ResSaveMattressBcp>(PORT1 + `/SaveMattressInterface`, params);
};

/*
 * @name 床垫报价：wf_import_dw_2
 */
export const GetMattressImportDW2 = (params: Mattress.ReqMattressImport) => {
  return http.post<Mattress.ResMattressImport>(PORT1 + `/GetMattressImportDW2`, params);
};

/**
 * @name 床垫报价：wf_import_bz
 */
export const GetMattressPackagMx = (params: Mattress.ReqMattressImport) => {
  return http.post<Mattress.ResMattressImport>(PORT1 + `/GetMattressPackagMx`, params);
};

/**
 * @name 床垫报价：主副规格
 */
export const GetMattressSubspecs = (params: Mattress.ReqRefreshMattressInterface) => {
  return http.post<Mattress.ResMattressSubspecs>(PORT1 + `/GetMattressSubspecs`, params);
};

/**
 * @name 床垫报价：主副规格
 */
export const GetResetWiptype = (params: Mattress.ReqGetResetWiptype) => {
  return http.post<Mattress.ReqGetResetWiptype>(PORT1 + `/GetResetWiptype`, params);
};

/**
 * @name 同步L1基础信息
 */
export const UpdateL1Basicinfo = () => {
  return http.post<Mattress.ResUpdateL1Basicinfo>(PORT1 + `/UpdateL1Basicinfo`, {});
};

/**
 * @name 床垫报价：重算ERP成本
 */
export const ReCalculateERPCost = (params: Mattress.ReqMultiMattressBcp) => {
  return http.post<Mattress.ResUpdateL1Basicinfo>(PORT1 + `/ReCalculateERPCost`, params);
};

/**
 * @name 床垫报价：获取报价清单
 */
export const GetComputeMattressById = (params: Mattress.ReqGetComputeMattressById) => {
  return http.post<Mattress.ResGetComputeMattressById>(PORT1 + `/GetComputeMattressById`, params);
};

/**
 * @name 床网清单：刷新配置
 */
export const RefreshBedNetInterface = (params: Mattress.ReqRefreshMattressInterface) => {
  return http.post<Mattress.ResRefreshMattressInterface>(PORT1 + `/RefreshBedNetInterface`, params);
};

/**
 * @name 床网清单：刷新清单
 */
export const RefreshBedNetInterfaceQd = (params: Mattress.ReqRefreshMattressInterface) => {
  return http.post<Mattress.ResRefreshMattressInterface>(PORT1 + `/RefreshBedNetInterfaceQd`, params);
};

/**
 * @name 床网清单：获取清单
 */
export const GetBedNetInterfaceList = (params: Mattress.ReqRefreshMattressInterface) => {
  return http.post<Mattress.ResGetMattressInterfaceList>(PORT1 + `/GetBedNetInterfaceList`, params);
};

/**
 * @name 床网清单：保存清单
 */
export const SaveBedNetInterface = (params: Mattress.ReqSaveMattressInterface) => {
  return http.post<Mattress.ResSaveMattressBcp>(PORT1 + `/SaveBedNetInterface`, params);
};

/**
 * @name 软床报价：保存/修改
 */
export const SaveSoftBedQuote = (params: SoftBed.ReqSoftBed) => {
  return http.post<SoftBed.ResSoftBed>(PORT1 + `/SaveSoftBedQuote`, params);
};

/**
 * @name 软床报价：删除
 */
export const DeleteSoftBedQuote = (params: SoftBed.ReqSoftBedCommonOperate) => {
  return http.post(PORT1 + `/DeleteSoftBedQuote`, params);
};

/**
 * @name 软床报价：审核
 */
export const AuditSoftBedQuote = (params: SoftBed.ReqSoftBedCommonOperate) => {
  return http.post(PORT1 + `/AuditSoftBedQuote`, params);
};

/**
 * @name 软床报价：查看历史报价
 */
export const ViewHisSoftBedQuote = (params: Mattress.ReqSaveMattressInterface) => {
  return http.post<Mattress.ResSaveMattressBcp>(PORT1 + `/ViewHisSoftBedQuote`, params);
};

/**
 * @name 软床报价：显示公式
 */
export const ShowSoftBedQuoteFml = (params: Mattress.ReqSaveMattressInterface) => {
  return http.post<Mattress.ResSaveMattressBcp>(PORT1 + `/ShowSoftBedQuoteFml`, params);
};

/**
 * @name 软床报价：显示公式
 */
export const GetSoftBedMxList = (params: SoftBed.ResGetSoftBedMxList) => {
  return http.post<SoftBed.ResSoftBed>(PORT1 + `/GetSoftBedMxList`, params);
};

/**
 * @name 软床报价：获取软床报价部件选配
 */
export const GetSoftBedConfigureList = (params: SoftBed.ReqSoftBed) => {
  return http.post<SoftBed.ResGetSoftBedConfigureList>(PORT1 + `/GetSoftBedConfigureList`, params);
};

/**
 * @name 软床报价：获取软床报价部件选配清单
 */
export const GetChangeSoftBedMxList = (params: SoftBed.ReqGetChangeSoftBedMxList) => {
  return http.post<SoftBed.ResSoftBed>(PORT1 + `/GetChangeSoftBedMxList`, params);
};
