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

export function orderBaseImport(data) {
  return handleImport('/order/base/import', data.formdata, data.id || '')
}

export function orderBaseSettleNormConfirm(data) {
  return request({
    url: `/order/base/settle/norm/confirm`,
    method: 'post',
    data
  })
}

export function orderBaseCancel(params) {
  return request({
    url: `/order/base/cancel`,
    method: 'post',
    params
  })
}

export function orderBaseSettleNormDetail(params) {
  return request({
    url: `/order/base/settle/norm/detail`,
    method: 'post',
    params
  })
}

export function enginMaterialCancel(params) {
  return request({
    url: `/engin/material/cancel`,
    method: 'post',
    params
  })
}

export function enginMaterialDetailWorker(params) {
  return request({
    url: `/engin/material/detailWorker`,
    method: 'post',
    params
  })
}

export function changeOrderGetOrderList(params) {
  return request({
    url: `/changeOrder/getOrderList`,
    method: 'post',
    params
  })
}

export function changeOrderProductDetail(params) {
  return request({
    url: `/changeOrder/productDetail`,
    method: 'post',
    params
  })
}

export function changeOrderGetOrderProduct(params) {
  return request({
    url: `/changeOrder/getOrderProduct`,
    method: 'post',
    params
  })
}

export function orderBaseLogAdd(data) {
  return request({
    url: `/order/base/log/add`,
    method: 'post',
    data
  })
}

export function changeOrderChangeWorker(data) {
  return request({
    url: `/changeOrder/changeWorker`,
    method: 'post',
    data
  })
}

export function changeOrderChangeAppointmentTime(data) {
  return request({
    url: `/changeOrder/changeAppointmentTime`,
    method: 'post',
    data
  })
}

export function orderBaseFlag(params) {
  return request({
    url: `/order/base/flag`,
    method: 'post',
    params
  })
}

export function orderBaseSave(data) {
  return request({
    url: `/order/base/save`,
    method: 'post',
    data
  })
}

export function orderBaseProductList(params) {
  return request({
    url: `/order/base/product/list`,
    method: 'post',
    params
  })
}

export function orderBaseProductAdd(data) {
  return request({
    url: `/order/base/product/add`,
    method: 'post',
    data
  })
}

export function orderBaseProductUpdate(data) {
  return request({
    url: `/order/base/product/update`,
    method: 'post',
    data
  })
}

export function orderBaseProductDelete(params) {
  return request({
    url: `/order/base/product/delete`,
    method: 'post',
    params
  })
}

export function orderBaseList(data) {
  return request({
    url: `/order/base/list?moduleId=${data.moduleId}`,
    method: 'post',
    data
  })
}

export function orderBaseList2(data) {
  return request({
    url: `/order/base/list2?moduleId=${data.moduleId}`,
    method: 'post',
    data
  })
}

export function orderBaseListExport(data, name) {
  return postBlob({
    url: '/order/base/list/export',
    data,
    name
  })
}

export function orderBaseStatusCount(params) {
  return request({
    url: `/order/base/status/count`,
    method: 'post',
    params
  })
}

export function orderBaseStatusCount2(params) {
  return request({
    url: `/order/base/status/count2`,
    method: 'post',
    params
  })
}

export function orderBaseLogList(params) {
  return request({
    url: `/order/base/log/list`,
    method: 'post',
    params
  })
}

export function orderBaseDetail(params) {
  return request({
    url: `/order/base/detail`,
    method: 'post',
    params
  })
}

export function settleNormInstallQuery(params) {
  return request({
    url: `/settle/norm/install/query`,
    method: 'post',
    params
  })
}

export function settleNormOtherQuery(params) {
  return request({
    url: `/settle/norm/other/query`,
    method: 'post',
    params
  })
}

export function orderBaseSettleNormReset(data) {
  return request({
    url: `/order/base/settle/norm/reset`,
    method: 'post',
    data
  })
}

export function orderBaseReject(params) {
  return request({
    url: `/order/base/reject`,
    method: 'post',
    params
  })
}

export function orderBaseSettleNormDetail2(params) {
  return request({
    url: `/order/base/settle/norm/detail2`,
    method: 'post',
    params
  })
}

export function orderBaseActive(params) {
  return request({
    url: `/order/base/active`,
    method: 'post',
    params
  })
}
