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

// 机床查询
export function getMachines(check, num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: 'PDM_机床名称_查询数据',
      param: '项目流水号_check=' + check + '=int&项目流水号=' + num
    }
  })
}
// 分组查询
export function getGroups(machineNumber) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: 'PDM_组件名称_查询数据',
      param: '机床流水号=' + machineNumber
    }
  })
}
// 主表查询
export function getTable(num1, num2, num3, num4, num5, num6, num7, num8, num9, pageCurrent, pageSize) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间生产管理工艺_库存管理_基本件库存查询',
      param: '机床流水号_check=' + num1 + '&机床流水号=' + num2 + '&组件流水号_check=' + num3 + '&组件流水号=' + num4 + '&零件图号_check=' + num5 + '&零件图号=' + num6 + '&时间_check=' + num7 + '&开始时间=' + num8 + '&结束时间=' + num9 + `&PageCurrent=${pageCurrent}&PageSize=${pageSize}&PageCount=1111=int=output&ItemCount=1111=int=output`
    }
  })
}
export function getTable1(num1, num2, num3, num4, num5, num6, num7, num8, num9, pageCurrent, pageSize) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间生产管理工艺_库存管理_基本件出库记录查询',
      param: '机床流水号_check=' + num1 + '&机床流水号=' + num2 + '&组件流水号_check=' + num3 + '&组件流水号=' + num4 + '&零件图号_check=' + num5 + '&零件图号=' + num6 + '&时间_check=' + num7 + '&开始时间=' + num8 + '&结束时间=' + num9,
      Pagination: pageCurrent + '&' + pageSize
    }
  })
}
