const http = uni.$u.http

// 登录
export const login = (params, config = {custom:{auth:false}}) => http.post('/auth/login', params, config)
// 查询最新版本信息
export const getSysVersion = (params, config = {custom:{auth:false}}) => http.post('/sysVersion/getLatest', params, config)
// 退出
export const logout = (data) => http.get('/auth/logout', data)
// 用户信息
export const getUserInfo = (data) => http.get('/user/userInfo', data)
// 供应商 
export const supplierList = (params, config = {}) => http.post('/supplier/queryList', params, config)
// 散件入库类型 
export const sparePartsPutTypeList = (params, config = {}) => http.post('/sparePartsPutType/queryList', params, config)
// 散件入库保存
export const sparePartsPurSave = (params, config = {}) => http.post('/sparePartsPur/save', params, config)
// 散件入库详细
export const sparePartsPurDetail = (data) => http.get(`/sparePartsPur/findBySn/${data.sn}`, data)
// 散件入库列表
export const sparePartsPurList = (params, config = {}) => http.post(`/sparePartsPur/queryPage/${params.pageNo}/${params.pageSize}`, params, config)
// 散件入库供应商对应可选产品
export const dealerProductQueryForSparePartsPur = (params, config = {}) => http.post(`/dealerProduct/queryPageForSparePartsPur/${params.pageNo}/${params.pageSize}`, params, config)
// 散件入库明细添加
export const sparePartsPurDetailSave = (params, config = {}) => http.post('/sparePartsPur/detail/save', params, config)
// 散件入库明细列表
export const sparePartsPurDetailList = (params, config = {}) => http.post(`/sparePartsPur/detail/queryPage/${params.pageNo}/${params.pageSize}`, params, config)
// 散件入库统计
export const sparePartsQueryCount = (params, config = {}) => http.post('/sparePartsPur/detail/queryCount', params, config)
// 散件入库明细删除 
export const sparePartsPurDetailDel = (data) => http.get(`/sparePartsPur/detail/delete/${data.sn}`, data)
// 散件入库清空明细
export const sparePartsPurDetailDelAll = (data) => http.get(`/sparePartsPur/detail/deleteAll/${data.sn}`, data)
// 散件入库提交
export const sparePartsPurSubmitPut = (params, config = {}) => http.post('/sparePartsPur/hand/submitPut', params, config)
// 散件入库确认入库
export const sparePartsPurPut = (params, config = {}) => http.post('/sparePartsPur/put', params, config)
// 仓库仓位列表
export const warehouseCascadeList = (params, config = {}) => http.post('/warehouse/queryListWithExt', params, config)

// 盘点仓库列表
export const checkWarehouseList = (params, config = {}) => http.post('/checkWarehouse/queryWarehouseList', params, config)
// 新建盘点单
export const checkWarehouseSave = (params, config = {}) => http.post('/checkWarehouse/save', params, config)
// 库存盘点  删除
export const checkWarehouseDel = (params, config = {}) => http.post('/checkWarehouse/delete', params, config)
// 库存盘点列表
export const checkWarehouseQueryList = (params, config = {}) => http.post(`/checkWarehouse/queryPage/${params.pageNo}/${params.pageSize}`, params, config)
//  库存盘点  自选盘点 选择产品  列表  分页
export const checkWarehouseDetailStockList = (params, config = {}) => http.post(`/checkWarehouse/queryStockPage/${params.pageNo}/${params.pageSize}`, params, config)
// 库存盘点详情添加产品
export const checkWarehouseDetailSave = (params, config = {}) => http.post('/checkWarehouse/detail/save', params, config)
// 库存盘点详情删除产品
export const checkWarehouseDetailDel = (params, config = {}) => http.post('/checkWarehouse/detail/delete', params, config)
//  库存盘点  详情  列表  分页
export const checkWarehouseDetailList = (params, config = {}) => http.post(`/checkWarehouse/detail/queryPage/${params.pageNo}/${params.pageSize}`, params, config)
//  库存盘点  详情  合计
export const checkWarehouseDetailCount = (params, config = {}) => http.post('/checkWarehouse/detail/queryPageCount', params, config)
// 库存盘点提交
export const checkWarehouseSubmit = (params, config = {}) => http.post('/checkWarehouse/hand/submitAuditInventory', params, config)
// 库存盘点  详情信息
export const checkWarehouseDetailBySn = (data) => http.get(`/checkWarehouse/queryBySn/${data.sn}`, data)
// 重盘
export const checkWarehouseReInventory = (params, config = {}) => http.post('/checkWarehouse/reInventory', params, config)

//  销售 列表  有分页
export const salesQueryList = (params, config = {}) => http.post(`/sales/queryPage/${params.pageNo}/${params.pageSize}`, params, config)
// 销售单详情
export const salesDetail = (params, config = {}) => http.post('/sales/findBySn', params, config)
// 销售明细列表
export const salesDetailList = (params, config = {}) => http.post(`/salesDetail/queryPage/${params.pageNo}/${params.pageSize}`, params, config)
// 销售捡货
export const salesPick = (params, config = {}) => http.post('/salesDetail/pick', params, config)
//  销售 拣货出库
export const salesWriteStockOut = (data, config) => http.get(`/sales/stockOutPick/${data.salesBillSn}`, data, config)

// 连锁调拨调出 列表  分页
export const allocLinkageOutList = (params, config = {}) => http.post(`/allocLinkageOut/queryPage/${params.pageNo}/${params.pageSize}`, params, config)
// 详情
export const allocLinkageOutDetail = (data) => http.get(`/allocLinkageOut/findBySn/${data.sn}`, data)
// 明细列表
export const allocLinkageOutDetailList = (params, config = {}) => http.post(`/allocLinkageOut/detail/queryPage/${params.pageNo}/${params.pageSize}`, params, config)
// 连锁调拨捡货
export const allocLinkageOutPick = (params, config = {}) => http.post('/allocLinkageOut/detail/pick', params, config)
// 连锁调拨调出
export const allocLinkageOutStock = (data) => http.get(`/allocLinkageOut/outStockPick/${data.sn}`, data)
// 连锁调拨调出  详情  合计
export const allocLinkageOutDetailCount = (params, config = {}) => http.post('/allocLinkageOut/detail/queryCount', params, config)

//  店内调出 列表  分页
export const storeCallOutList = (params, config = {}) => http.post(`/storeCallOut/queryPage/${params.pageNo}/${params.pageSize}`, params, config)
// 详情
export const storeCallOutDetail = (data) => http.get(`/storeCallOut/findBySn/${data.sn}`, data)
// 明细列表
export const storeCallOutDetailList = (params, config = {}) => http.post(`/storeCallOut/detail/queryPage/${params.pageNo}/${params.pageSize}`, params, config)
// 店内调出捡货
export const storeCallOutPick = (params, config = {}) => http.post('/storeCallOut/detail/pick', params, config)
//  店内调出 出库
export const storeCallOutOut = (params, config = {}) => http.post(`/storeCallOut/outPick`, params, config)
// 详情  合计
export const storeCallOutDetailCount = (params, config = {}) => http.post('/storeCallOut/detail/queryCount', params, config)

// 产品维护
export const dealerProductList = (params, config = {}) => http.post(`/dealerProduct/queryPage/${params.pageNo}/${params.pageSize}`, params, config)
export const dealerProductSave = (params, config = {}) => http.post('/dealerProduct/save', params, config)
