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

//  对账单管理 列表  分页
export const verifyAcountBillList = (params) => {
  const url = `/verifyAccountBill/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent('列表查询')
    }
  })
}
// 对账单-待选单据列表
export const verifyAccountBillQueryWaitSelectList = (params) => {
  const url = `/verifyAccountBillDetail/queryWaitSelectPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent('对账单待选单据列表查询')
    }
  })
}

// 创建对账单
export const verifyAccountBillCreate = params => {
  return axios({
    url: '/verifyAccountBill/create',
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent('创建对账单')
    }
  })
}
// 对账单修改
export const verifyAccountBillModify = params => {
  return axios({
    url: '/verifyAccountBill/modify',
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent('对账单修改')
    }
  })
}

// 查找最后一次单据  备注
export const findLastBillRemarks = params => {
  return axios({
    url: `/verifyAccountBill/findLastBill/${params.sn}`,
    data: {},
    method: 'get',
    headers: {
      'module': encodeURIComponent('查找经销商最后一次对账单据备注')
    }
  })
}

// 对账单管理  删除
export const verifyAcountBillDel = params => {
  return axios({
    url: `/verifyAccountBill/delete/${params.sn}`,
    data: {},
    method: 'get',
    headers: {
      'module': encodeURIComponent('删除对账单')
    }
  })
}
// 对账单管理  详情
export const verifyAcountBillDetail = params => {
  return axios({
    url: `/verifyAccountBill/findBySn/${params.sn}`,
    data: {},
    method: 'get',
    headers: {
      'module': encodeURIComponent('查看对账单详情')
    }
  })
}
// 对账单 提交前
export const verifyAcountBillSubmitCheck = params => {
  return axios({
    url: `/verifyAccountBill/submitCheck/${params.sn}`,
    data: {},
    method: 'get',
    headers: {
      'module': encodeURIComponent('对账单提交前')
    }
  })
}
// 对账单管理  提交
export const verifyAcountBillSubmit = params => {
  return axios({
    url: `/verifyAccountBill/submit`,
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent('对账单提交')
    }
  })
}

// 对账单 对单前校验
export const verifyAcountBillConfirmCheck = params => {
  return axios({
    url: `/verifyAccountBill/confirmCheck/${params.sn}`,
    data: {},
    method: 'get',
    headers: {
      'module': encodeURIComponent('对单前校验')
    }
  })
}
// 对账单 对单
export const verifyAcountBillConfirm = params => {
  return axios({
    url: `/verifyAccountBill/confirm`,
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent('对单')
    }
  })
}
// 对账单同步
export const verifyAcountBillSyncBill = params => {
  return axios({
    url: `/verifyAccountBill/syncBill/${params.sn}`,
    data: {},
    method: 'get',
    headers: {
      'module': encodeURIComponent('对账单同步')
    }
  })
}
// 对账单管理  对账
export const verifyAcountBillVerify = params => {
  return axios({
    url: `/verifyAccountBill/verify/${params.sn}`,
    data: {},
    method: 'get',
    headers: {
      'module': encodeURIComponent('对账')
    }
  })
}

// 调账插入对账单明细
export const verifyAccountChangeInsert = params => {
  return axios({
    url: '/verifyAccountBillDetail/insertChange',
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent('调账插入对账单明细')
    }
  })
}
 
//  对账单管理  明细 列表  分页
export const verifyAcountBillDetailList = (params) => {
  const url = `/verifyAccountBillDetail/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent('明细列表查询')
    }
  })
}
//  对账单管理  明细 列表  不分页
export const verifyAcountBillDetailQueryList = (params) => {
  const url = `/verifyAccountBillDetail/queryList`
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent('明细不分页列表查询')
    }
  })
}
// 对账单管理  详情  统计信息
export const verifyAcountBillDetailQueryCount = params => {
  return axios({
    url: `/verifyAccountBillDetail/queryCount`,
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent('对账单单据详情统计信息')
    }
  })
} 
// 对账单管理  详情  批量删除
export const verifyAcountBillDetailDel = params => {
  return axios({
    url: `/verifyAccountBillDetail/deleteBatch`,
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent('对账单单据详情列表批量删除')
    }
  })
} 
// 对账单管理  详情 批量添加
export const verifyAcountBillDetailSave = params => {
  return axios({
    url: '/verifyAccountBillDetail/insertBatch',
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent('对账单单据详情列表批量添加')
    }
  })
} 
// 对账单管理  详情 修改
export const verifyAcountBillDetailModify = params => {
  return axios({
    url: '/verifyAccountBillDetail/modify',
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent('对账单单据详情列表备注修改')
    }
  })
} 