import request from '@/utils/request'
import state from '@/store'
import router from '@/router'

// 查询供应商
export function searchSupplier(check1, value1, check2, value2, check3, value3, check4, value4, check5, value5, check6, value6, check7, value7, check8, value8, check9, value9, check10, value10, check11, value11, check12, value12) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '采购管理_供应商_查询数据_根据条件',
      param: '供应商名称_check=' + check1 + '&供应商名称=' + value1 + '&企业性质_check=' + check2 + '&企业性质=' + value2 + '&创立日期_check=' + check3 + '&创立日期=' + value3 + '&注册资本_check=' + check4 + '&注册资本=' + value4 + '&税号_check=' + check5 + '&税号=' + value5 + '&电子信箱_check=' + check6 + '&电子信箱=' + value6 + '&地址_check=' + check7 + '&地址=' + value7 + '&帐号_check=' + check8 + '&帐号=' + value8 + '&开户行_check=' + check9 + '&开户行=' + value9 + '&电话号码_check=' + check10 + '&电话号码=' + value10 + '&传真_check=' + check11 + '&传真=' + value11 + '&货期_check=' + check12 + '&货期=' + value12
    }
  })
}
// 查询备料
export function searchTable(check, supplierNameValue, check1, partNumber, check2, MaterialsValue, check3, starttime, endtime, ordername, order, check4, machineValue, check5, groupValue, role, personnel, pageSize, pageCurrent) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '备料管理_外购备料_综合查询数据',
      param: '供应商流水号_check=' + check + '&供应商流水号=' + supplierNameValue + '&零件图号_check=' + check1 + '&零件图号=' + partNumber + '&备料状态_check=' + check2 + '&备料状态=' + MaterialsValue +
      '&下单时间_check=' + check3 + '&开始时间=' + starttime + '&结束时间=' + endtime + '&排序名称=' + ordername + '&排序方式=' + order + '&机床图号_check=' + check4 + '&机床图号=' + machineValue + '&组号_check=' + check5 + '&组号=' + groupValue + '&角色编号=' + role + '&人员编号=' + personnel + `&PageCurrent=${pageCurrent}&PageSize=${pageSize}&PageCount=1111=int=output&ItemCount=1111=int=output`
    }
  })
}
// 导出
export function searchTablesheet(check, supplierNameValue, check1, partNumber, check2, MaterialsValue, check3, starttime, endtime, ordername, order) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '备料管理_外购备料_综合查询数据',
      param: '供应商流水号_check=' + check + '&供应商流水号=' + supplierNameValue + '&零件图号_check=' + check1 + '&零件图号=' + partNumber + '&备料状态_check=' + check2 + '&备料状态=' + MaterialsValue +
      '&下单时间_check=' + check3 + '&开始时间=' + starttime + '&结束时间=' + endtime + '&排序名称=' + ordername + '&排序方式=' + order
    }
  })
}
export function HandleNumber() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '备料管理_外购备料_处理已完成未修改数据'
    }
  })
}
// 查询外购备料数量
export function searchPurchaseCount(check, supplierNameValue, check1, partNumber, check2, MaterialsValue, check3, starttime, endtime, check4, machineValue, check5, groupValue, role, personnel) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '备料管理_外购备料_综合查询数据_查询采购数量',
      param: '供应商流水号_check=' + check + '&供应商流水号=' + supplierNameValue + '&零件图号_check=' + check1 + '&零件图号=' + partNumber + '&备料状态_check=' + check2 + '&备料状态=' + MaterialsValue +
        '&下单时间_check=' + check3 + '&开始时间=' + starttime + '&结束时间=' + endtime + '&机床图号_check=' + check4 + '&机床图号=' + machineValue + '&组号_check=' + check5 + '&组号=' + groupValue + '&角色编号=' + role + '&人员编号=' + personnel
    }
  })
}
// 查询自家备料数量
export function searchHomeCount(check, supplierNameValue, check1, partNumber, check2, MaterialsValue, check3, starttime, endtime, check4, machineValue, check5, groupValue, role, personnel) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '备料管理_外购备料_综合查询数据_查询自家数量',
      param: '供应商流水号_check=' + check + '&供应商流水号=' + supplierNameValue + '&零件图号_check=' + check1 + '&零件图号=' + partNumber + '&备料状态_check=' + check2 + '&备料状态=' + MaterialsValue +
        '&下单时间_check=' + check3 + '&开始时间=' + starttime + '&结束时间=' + endtime + '&机床图号_check=' + check4 + '&机床图号=' + machineValue + '&组号_check=' + check5 + '&组号=' + groupValue + '&角色编号=' + role + '&人员编号=' + personnel
    }
  })
}
// 查询未分配数量
export function searchUnallocatedCount(check, supplierNameValue, check1, partNumber, check2, MaterialsValue, check3, starttime, endtime, check4, machineValue, check5, groupValue, role, personnel) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '备料管理_外购备料_综合查询数据_查询未分配数量',
      param: '供应商流水号_check=' + check + '&供应商流水号=' + supplierNameValue + '&零件图号_check=' + check1 + '&零件图号=' + partNumber + '&备料状态_check=' + check2 + '&备料状态=' + MaterialsValue +
        '&下单时间_check=' + check3 + '&开始时间=' + starttime + '&结束时间=' + endtime + '&机床图号_check=' + check4 + '&机床图号=' + machineValue + '&组号_check=' + check5 + '&组号=' + groupValue + '&角色编号=' + role + '&人员编号=' + personnel
    }
  })
}
export function getMachine(role, personnel) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '备料管理_外购备料_查询机床数据',
      param: '角色编号=' + role + '&人员编号=' + personnel
    }
  })
}
export function getgroup(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '备料管理_外购备料_查询组件数据',
      param: '机床图号=' + num
    }
  })
}
