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

export function searchmachine(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 searchgroup(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: 'PDM_组件名称_查询数据_新',
      param: '机床流水号=' + num + '=int'
    }
  })
}
export function searchTable(check1, machine, check2, groupNum, check3, num, order, pageCurrent, pageSize) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间生产管理工艺_基本件成组配套_查询数据_新',
      param: '机床流水号_check=' + check1 + '=int&机床流水号=' + machine + '=int&组件流水号_check=' + check2 + '=int&组件流水号=' + groupNum + '&名称规格型号_check=' + check3 + '&名称规格型号=' + num + '&排序=' + order + `&PageCurrent=${pageCurrent}&PageSize=${pageSize}&PageCount=1111=int=output&ItemCount=1111=int=output`
    }
  })
}
export function searchNumber(check1, machine, check2, groupNum, check3, num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间生产管理工艺_基本件成组配套_查询数据_获取入库数',
      param: '机床流水号_check=' + check1 + '=int&机床流水号=' + machine + '=int&组件流水号_check=' + check2 + '=int&组件流水号=' + groupNum + '&名称规格型号_check=' + check3 + '&名称规格型号=' + num
    }
  })
}
export function getTable(check1, machine, check2, groupNum, pageCurrent, pageSize) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间生产管理工艺_基本件成组配套_查询数据_新',
      param: '机床流水号_check=' + check1 + '=int&机床流水号=' + machine + '=int&组件流水号_check=' + check2 + '=int&组件流水号=' + groupNum + `&PageCurrent=${pageCurrent}&PageSize=${pageSize}&PageCount=1111=int=output&ItemCount=1111=int=output`
    }
  })
}
export function searchTable22(check1, machine, check2, groupNum, check3, year, check4, month, check5, time) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间生产管理工艺_基本件成组配套_查询数据_新',
      param: '机床流水号_check=' + check1 + '=int&机床流水号=' + machine + '=int&组件流水号_check=' + check2 + '=int&组件流水号=' + groupNum + '=int&年_check=' + check3 + '=int&年=' + year + '=string&月_check=' + check4 + '=int&月=' + month + '=int&入库时间_check=' + check5 + '=int&入库时间=' + time + '=string'
    }
  })
}
export function searchTable1(check1, machine, check2, groupNum, check3, num, order, pageCurrent, pageSize) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '库存管理_车间采购出库_零件查询_新',
      param: '机床流水号_check=' + check1 + '=int&机床流水号=' + machine + '=int&组件流水号_check=' + check2 + '=int&组件流水号=' + groupNum + '&名称规格型号_check=' + check3 + '&名称规格型号=' + num + '&排序=' + order,
      pagination: pageCurrent + '&' + pageSize
    }
  })
}
export function processingStatus(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间生产管理_成组配套加工进度_查询数据',
      param: '工艺计划流水号=' + num
    }
  })
}
// 查询表1标准件和外购件
export function searchTable01(...params) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '采购管理_采购部采购_查询物料_分配后_加供应商',
      param: `机床流水号_check=${params[0]}&机床流水号=${params[1]}&组件流水号_check=${params[2]}&组件流水号=${params[3]}&物料名称_check=${params[4]}&物料名称=${params[5]}&零件类型=${params[8]}&排序=${params[9]}`,
      Pagination: params[6] + '&' + params[7]
    }
  })
}
// 查询表1基本件
export function searchTable02(...params) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '采购管理_采购部采购_查询物料_基本件_分配后_加供应商_成组配套',
      param: `机床流水号_check=${params[0]}&机床流水号=${params[1]}&组件流水号_check=${params[2]}&组件流水号=${params[3]}&零件名称_check=${params[4]}&零件名称=${params[5]}&排序=${params[8]}`,
      Pagination: params[6] + '&' + params[7]
    }
  })
}
// 获取标准件采购完成数量
export function searchCount(...params) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '采购管理_采购部采购_查询物料_分配后_加供应商_完成数量',
      param: `机床流水号_check=${params[0]}&机床流水号=${params[1]}&组件流水号_check=${params[2]}&组件流水号=${params[3]}&物料名称_check=${params[4]}&物料名称=${params[5]}&零件类型=${params[8]}`,
      Pagination: params[6] + '&' + params[7]
    }
  })
}
// 获取已采购基本件数量
export function searchCount1(...params) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '采购管理_采购部采购_查询物料_基本件_分配后_加供应商_成组配套_已采购数量',
      param: `机床流水号_check=${params[0]}&机床流水号=${params[1]}&组件流水号_check=${params[2]}&组件流水号=${params[3]}&零件名称_check=${params[4]}&零件名称=${params[5]}`,
      Pagination: params[6] + '&' + params[7]
    }
  })
}
// 获取车间已采购数量
export function searchCount2(check1, machine, check2, groupNum, check3, num, pageCurrent, pageSize) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '库存管理_车间采购出库_零件查询_已采购数量',
      param: '机床流水号_check=' + check1 + '=int&机床流水号=' + machine + '=int&组件流水号_check=' + check2 + '=int&组件流水号=' + groupNum + '&名称规格型号_check=' + check3 + '&名称规格型号=' + num,
      pagination: pageCurrent + '&' + pageSize
    }
  })
}
