import { axios } from '@/utils/request'

//  销售详情 列表  分页
export const salesDetailList = (params) => {
  const url = `/salesDetail/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
//  销售详情 新增配件
export const salesDetailInsert = (params) => {
  return axios({
    url: '/salesDetail/insert',
    data: params,
    method: 'post'
  })
}
//  销售详情 修改价格
export const salesDetailUpdatePrice = (params) => {
  return axios({
    url: '/salesDetail/updatePrice',
    data: params,
    method: 'post'
  })
}
//  销售详情 修改数量
export const salesDetailUpdateQty = (params) => {
  return axios({
    url: '/salesDetail/updateQty',
    data: params,
    method: 'post'
  })
}
//  销售详情 删除
export const salesDetailDel = (params) => {
  return axios({
    url: `/salesDetail/delete/${params.id}`,
    method: 'get'
  })
}
//  销售详情 整单删除
export const salesDetailDelAll = (params) => {
  return axios({
    url: `/salesDetail/deleteBySalesBillSn/${params.salesBillSn}`,
    data: params,
    method: 'post'
  })
}

// 销售记录
export const salesRecordlList = (params) => {
  const url = `/salesDetail/querySalesRecord/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}