import request, { postBlob } from '@/utils/request'

export function getLoginFrockList(params) {
  return request({
    url: `/trade/login/order/work/list?moduleId=${params.moduleId}`,
    method: 'post',
    data: params
  })
}

export function exportLoginFrock(data, name) {
  return postBlob({
    url: '/trade/login/order/work/list/export',
    data,
    name
  })
}

export function addLoginFrock(params) {
  return request({
    url: `/trade/login/order/work-add`,
    method: 'post',
    data: params
  })
}

export function editLoginFrock(params) {
  return request({
    url: `/trade/login/order/work-edit`,
    method: 'post',
    data: params
  })
}

export function examineLoginFrock(params) {
  return request({
    url: `/trade/login/order/work-examine`,
    method: 'post',
    data: params
  })
}

export function submitLoginFrock(params) {
  return request({
    url: `/trade/login/order/work-submit`,
    method: 'post',
    data: params
  })
}

export function getCommercialEngineeringDetail(params) {
  return request({
    url: `/trade/login/order/detail`,
    method: 'post',
    params
  })
}

// 商用工程登录单-替换业务员
export function replaceService(params) {
  return request({
    url: `/trade/login/order/replace-service`,
    method: 'post',
    data: params
  })
}
// 商用工程登录单-一键更新
export function batchUpdate(params) {
  return request({
    url: `/trade/login/order/batch-update`,
    method: 'post',
    data: params
  })
}
//  商用工程登录单-申请修改
export function applyUpdate(params) {
  return request({
    url: `/trade/login/order/apply-update`,
    method: 'post',
    data: params
  })
}

// 商用工程登录单-申请修改查询
export function applyUpdateQuery(params) {
  return request({
    url: `/trade/login/order/apply-update/query`,
    method: 'post',
    params
  })
}

// 商用工程登录单-删除
export function delOrder(params) {
  return request({
    url: `/trade/login/order/del`,
    method: 'post',
    data: params
  })
}

// 商用工程登录单-审核确认
export function examineUpdate(params) {
  return request({
    url: `/trade/login/order/examine-update`,
    method: 'post',
    data: params
  })
}

// 商用工程登录单-操作记录
export function getOperationRecord(params) {
  return request({
    url: `/trade/login/order/operation/record`,
    method: 'post',
    params
  })
}

// 商用工程登录单-附近项目
export function getPositionProject(params) {
  return request({
    url: `/trade/login/order/position/project`,
    method: 'post',
    params
  })
}

// 商用工程登录单-经销商填写历史
export function getHistory(params) {
  return request({
    url: `/trade/login/order/customer/history`,
    method: 'post',
    params
  })
}

// 商用工程登录单-检查登录额
export function checkTradeLoginLimit(params) {
  return request({
    url: `/trade/login/order/check/limit`,
    method: 'post',
    data: params
  })
}
