import request from '@/utils/request'

// 获取销售合同列表
export function getSalesContractManagementList(params) {
  return request({
    url: '/salesContractManagement/list',
    method: 'get',
    params
  })
}

// 获取列表状态
export function getStatus(params) {
  return request({
    url: '/dictionary/do_findByParentCode',
    method: 'get',
    params
  })
}

// 获取项目信息
export function getCreditProject(params) {
  return request({
    url: '/salesContractManagement/getCreditProject',
    method: 'get',
    params
  })
}

// 新建销售合同提交
export function doAddSalesContractManagement(data) {
  return request({
    url: '/salesContractManagement/doCreate',
    method: 'post',
    data
  })
}

// 新建销售合同获取详情
export function getDeatail(params) {
  return request({
    url: '/salesContractManagement/create',
    method: 'get',
    params
  })
}

// 销售合同录入获取基础信息详情
export function getInformationDeatail(params) {
  return request({
    url: '/salesContractManagement/getProjectBasicInfo',
    method: 'get',
    params
  })
}

// 销售合同录入下载模板
export const downloadFile = (params) => (
  request({
    url: '/salesContractManagement/downloadFile',
    method: 'get',
    params,
    responseType: 'arraybuffer'
  })
)

// 销售合同录入模板导入
export const doImportGoodsInfo = (data) => (
  request({
    url: '/salesContractManagement/doImportGoodsInfo',
    method: 'post',
    data
  })
)

// 销售合同录入提交
export const salesContractManagementDoEnter = (data) => (
  request({
    url: '/salesContractManagement/doEnter',
    method: 'post',
    data
  })
)

// 销售合同暂存获取详情
export const salesContractManagementgetDetail = (params) => (
  request({
    url: '/salesContractManagement/getDetail',
    method: 'get',
    params
  })
)

// 销售合同变更创建获取详情
export const salesContractChangeAdd = (params) => (
  request({
    url: '/salesContract/change/add',
    method: 'get',
    params
  })
)

// 销售合同变更创建提交
export const salesContractChangeDoadd = (data) => (
  request({
    url: '/salesContract/change/doAdd',
    method: 'post',
    data
  })
)

// 销售合同变更录入详情
export const salesContractChangeEnter = (params) => (
  request({
    url: '/salesContract/change/enter',
    method: 'get',
    params
  })
)

// 销售合同变更录入提交
export const salesContractChangeDoEnter = (data) => (
  request({
    url: '/salesContract/change/doEnter',
    method: 'post',
    data
  })
)

// 签署确认详情
export const salesContractManagementSign = (params) => (
  request({
    url: '/salesContractManagement/sign',
    method: 'get',
    params
  })
)

// 变更签署确认详情
export const salesContractChangeSign = (params) => (
  request({
    url: '/salesContract/change/sign',
    method: 'get',
    params
  })
)

// 签署确认刷新认证状态
export const salesContractManagementGetAuthStatus = (params) => (
  request({
    url: '/salesContractManagement/getAuthStatus',
    method: 'get',
    params
  })
)

// 签署确认刷新签署状态
export const salesContractManagementSignType = (params) => (
  request({
    url: '/salesContractManagement/signType',
    method: 'get',
    params
  })
)

// 签署确认提交
export const salesContractManagementDoSign = (data) => (
  request({
    url: '/salesContractManagement/doSign',
    method: 'post',
    data
  })
)

// 变更签署确认提交
export const salesContractChangeDoSign = (data) => (
  request({
    url: '/salesContract/change/doSign',
    method: 'post',
    data
  })
)

// 销售合同查看
export const salesContractManagementGetView = (params) => (
  request({
    url: '/businessProcessingTask/doBusinessCHistoryView',
    method: 'get',
    params
  })
)
