import request from '@/config/axios'

// 查询列表
export const getSignPage = async (params) => {
  return await request.get({ url: '/admin-api/crm/sign/page', params })
}

// 查询详情
export const getSign = async (id) => {
  return await request.get({ url: '/admin-api/crm/sign/get?id=' + id })
}

// 新增
export const createSign = async (data) => {
  return await request.post({ url: '/admin-api/crm/sign/create', data: data, isSubmitForm: true })
}

// 取消登记
export const cancelDeal = async (id) => {
  return await request.delete({ url: '/admin-api/crm/sign/delete?id=' + id })
}

// 新增支出
export const signAddPay = async (data) => {
  return await request.post({ url: '/admin-api/crm/sign/extra-pay/save', data: data })
}

// 查询支出
export const getSignExtraPayList = async (params) => {
  return await request.get({ url: '/admin-api/crm/sign/extra-pay/get', params })
}

// 安装状态修改
export const updateInstallStatus = (signIdList, installStatus) => {
  const data = {
    signIdList,
    installStatus
  }
  return request.post({ url: '/admin-api/crm/sign/install-status/batchSave', data: data })
}

// 修改生产状态
export const updateProduceStatus = (data) => {
  return request.put({ url: '/admin-api/crm/sign-prodcut/update', data: data })
}

export const updateProduceSort = (data) => {
  return request.post({ url: '/admin-api/crm/sign-prodcut/adjust/sort', data: data })
}

export const getSignProfit = (params) => {
  return request.get({ url: '/admin-api/crm/sign/profit', params })
}
