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

// 获取零件工序信息（零件号表中）
export function getprocedure(processPlan, single) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间生产管理工艺_零件工序_查询数据_根据工艺计划流水号_工艺名称简称_新',
      param: '工艺计划流水号=' + processPlan + '=int&单件是否外协=' + single + '=int'
    }
  })
}
// 查询外协零件
export function searchTable(check, supplierNameValue, check1, MaterialsValue, check2, time1, time2, check3, Machine, check4, group, token, ID, 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 + '&外协状态=' + MaterialsValue + '&时间_check=' + check2 + '&开始时间=' + time1 + '&结束时间=' + time2 + '&机床_check=' + check3 + '&机床=' + Machine + '&组号_check=' + check4 + '&组号=' + group + '&角色编号=' + token + '&人员编号=' + ID + `&PageCurrent=${pageCurrent}&PageSize=${pageSize}&PageCount=1111=int=output&ItemCount=1111=int=output`
    }
  })
}
// 查询外协零件
export function getExport(check, supplierNameValue, check1, MaterialsValue, check2, time1, time2, 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 + '&外协状态=' + MaterialsValue + '&时间_check=' + check2 + '&开始时间=' + time1 + '&结束时间=' + time2
    }
  })
}
export function search1() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间生产管理_外协厂家效率图表_查询'
    }
  })
}
// 机床名称
export function getMachines(num, num1) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '机床_查询_营销筛选',
      param: '角色编号=' + num + '&人员编号=' + num1
    }
  })
}
// 组件查询
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
    }
  })
}
