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

// 初始化 项目名称
export function initProject() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: 'PDM_项目名称_查询数据_总计划'
    }
  })
}
// 查询机床
export function initMachine(projectNum) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: 'PDM_机床名称_查询数据2',
      param: `项目流水号=${projectNum}`
    }
  })
}
// 查询总计划
export function searchtable(projectNum, machineValue) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '项目计划管理_项目总计划_查询数据',
      param: '项目流水号_check=1&项目流水号=' + projectNum + '&机床流水号_check=1&机床流水号=' + machineValue
    }
  })
}
// 查询分计划
export function searchtable2(machineValue, type) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '项目计划管理_项目详细计划_查询数据',
      param: '机床流水号=' + machineValue + '&计划类型=' + type
    }
  })
}
export function searchtable5(num1, num2, num3, num4, num5, num6, num7, num8, num9, num10, num11, num12, 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 + '&交货期_check=' + num10 + '&交货期开始时间=' + num11 + '&交货期结束时间=' + num12,
      Pagination: pageCurrent + '&' + pageSize
    }
  })
}
// 查询项目总信息
export function searchAll(num1, num2) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '项目计划查询_项目总查询',
      param: '项目流水号_check=' + num1 + '&项目流水号=' + num2
    }
  })
}
