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

// // 初始化项目名称
// export function initProject() {
//   return request({
//     url: '',
//     method: 'post',
//     data: {
//       type: '1',
//       name: 'PDM_项目名称_查询数据_按时间排序'
//     }
//   })
// }
// 用项目查机床
export function searchMachine() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: 'PDM_项目名称_查询数据'
    }
  })
}
// 用机床查组件名称/号
export function searchGroupNum(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: 'PDM_零件明细表_组件流水号_查询数据_根据机床',
      param: '机床流水号=' + num
    }
  })
}
export function searchTable(entryValue, machineValue, check2, GroupNumValue, check3, PartDrawingNumber, pageCurrent, pageSize) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间生产管理工艺_传递后_零件报废补投_查询数据_综合查询',
      param: '项目流水号_check=0&项目流水号=' + entryValue + '&机床流水号_check=1&机床流水号=' + machineValue + '&组件流水号_check=' + check2 + '&组件流水号=' + GroupNumValue + '&组件零件基本件流水号_check=0&工艺计划流水号_check=0&工艺计划流水号_补投前_check=0&零件图号_check=' + check3 + '&零件图号=' + PartDrawingNumber,
      pagination: pageCurrent + '&' + pageSize
    }
  })
}
export function searchTable1(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间生产管理工艺_零件工序_查询数据_根据工艺计划流水号',
      param: '工艺计划流水号=' + num
    }
  })
}
export function searchTable2(check1, machineNameValue, check2, time1, time2, pageCurrent1, pageSize1) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间生产管理工艺_传递后_零件报废补投_查询数据_按机床查询',
      param: '机床流水号_check=' + check1 + '&机床流水号=' + machineNameValue + '&报废日期_check=' + check2 + '&开始时间=' + time1 + '&结束时间=' + time2,
      pagination: pageCurrent1 + '&' + pageSize1
    }
  })
}
export function TableDta2Select(CutCode) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间生产管理工艺_零件工艺计划_报废零件记录_查询工序',
      param: '补投流水号=' + CutCode
    }
  })
}
