import request from '@/utils/request'
/* 获取公司列表 */
export function getPage(params) {
    return request({
      url: '/admin/erp/company/getPage',
      method: 'get',
      loaidng: false,
      params
    })
  }
  /* 创建公司 */
  export function addCompany(parmas) {
    return request({
      url: `/admin/erp/company/createCompany`,
      method: 'post',
      headers: { 'Content-Type': 'application/json' },
      data: parmas,
      needToken: false,
    })
  }

  /*编辑公司*/

export function editCompany(id,parmas) {
  return request({
    url: `/admin/erp/company/updateCompany/${id}`,
    method: 'post',
    headers: { 'Content-Type': 'application/json' },
    data: parmas
  })
}

/* 套餐续费  */

export function renewCompany(id,packageId) {
  return request({
    url: `/admin/erp/company/renewCompany/${id}/${packageId}`,
    method: 'post',
    headers: { 'Content-Type': 'application/json' },
  })
}
/* 计算差价 */
export function difference(id,parmas) {
  return request({
    url: `/admin/erp/company/renewCompany/difference/${id}`,
    method: 'post',
    headers: { 'Content-Type': 'application/json' },
    data: parmas
  })
}
/* 获取套餐详情 */
export function companyPackage(id) {
  return request({
    url: `/admin/erp/companyPackage/${id}`,
    method: 'get',
    loaidng: false,
  })
}

/* 获取公司详情 /admin/erp/company/getOne/{id} */

export function getOne(id) {
  return request({
    url: `/admin/erp/company/getOne/${id}`,
    method: 'get',
  })
}

/* 校验营业执照 */
export function checkLicense(parmas) {
  return request({
    url: `/admin/erp/company/createCompany/checkLicense`,
    method: 'post',
    headers: { 'Content-Type': 'application/json' },
    data: parmas,
    needToken: false,
  })
}

/* 校验身份证 */
export function checkIdCardOpposite(parmas,type) {
  return request({
    url: `/admin/erp/company/createCompany/checkIdCardOpposite/${type}`,
    method: 'post',
    headers: { 'Content-Type': 'application/json' },
    data: parmas,
    needToken: false,
  })
}

/* 获取模版树状图 GET
 */

export function getSendNumByCompany(params) {
  return request({
    url: `/admin/erp/SmsMailTemplate/getSendNumByCompany`,
    method: 'get',
    params
  })
}

/* 选中的模版 */
export function updateSelectMsg(parmas) {
  return request({
    url: `/admin/erp/SmsMailTemplate/updateSelectMsg`,
    method: 'post',
    headers: { 'Content-Type': 'application/json' },
    data: parmas
  })
}

/* 获取自己的所有消息 */
export function getSysMsgByOwn(type) {
  return request({
    url: `/admin/erp/SmsMailTemplate/getSysMsgByOwn/${type}`,
    method: 'get'
  })
}
/* 获取自己未读的消息 */
export function countNotReadSys() {
  return request({
    url: `/admin/erp/SmsMailTemplate/countNotReadSys`,
    method: 'get'
  })
}

/* 手机号验证码 */
export function loginGetCheckCode(phone) {
  return request({
    url: `/admin/systems/admin-users/loginGetCheckCode?phone=${phone}`,
    method: 'get',
    needToken: false,
  })
}

/* 公司审核  */

export function superUpdateStatus(parmas,id) {
  return request({
    url: `/admin/erp/company/superUpdateStatus/${id}`,
    method: 'post',
    headers: { 'Content-Type': 'application/json' },
    data: parmas
  })
}