import request from '@/utils/request'

export function projectSelect() {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: 'PDM_项目名称_查询数据_按时间排序'
    }
  })
}

export function machineSelect(projectValue) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: 'PDM_机床名称_查询数据2',
      param: `项目流水号=${projectValue}`
    }
  })
}

export function groupSelect(machineValue) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: 'PDM_零件明细表_组件流水号_查询数据_根据机床',
      param: `机床流水号=${machineValue}`
    }
  })
}
export function searchTable5(projectCheck, project, machineCheck, machine, groupCheck, group) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: 'PDM_零件明细表_外购件和标准件_临时表数据查询',
      param: `项目名字_check=${projectCheck}&项目名字=${project}&机床名字_check=${machineCheck}&机床名字=${machine}&组号_check=${groupCheck}&组号=${group}`
    }
  })
}
export function searchTable6(projectCheck, project, machineCheck, machine, groupCheck, group) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: 'PDM_零件明细表_基本件_临时表数据查询',
      param: `项目名字_check=${projectCheck}&项目名字=${project}&机床名字_check=${machineCheck}&机床名字=${machine}&组号_check=${groupCheck}&组号=${group}`
    }
  })
}
export function searchTable7(pageCurrent, pageSize, projectCheck, project, machineCheck, machine, groupCheck, group) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: 'PDM_零件明细表_外购件_临时表数据查询',
      param: `项目名字_check=${projectCheck}&项目名字=${project}&机床名字_check=${machineCheck}&机床名字=${machine}&组号_check=${groupCheck}&组号=${group}`,
      Pagination: pageCurrent + '&' + pageSize
    }
  })
}
export function basicPartsData(project_check, project, machine_check, machine, group_check, group) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: 'PDM_零件明细表_基本件_查询数据_综合gj',
      param: `项目流水号_check=${project_check}&项目流水号=${project}&机床流水号_check=${machine_check}&机床流水号=${machine}&组件流水号_check=${group_check}&组件流水号=${group}`
    }
  })
}
export function purchasePartsData(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: 'PDM_零件明细表_标准件和外购件_查询数据',
      param: `组件流水号=${num}`
    }
  })
}
export function deleteBasicParts(basicNum) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: 'PDM_零件明细表_基本件_删除数据',
      param: `基本件流水号=${basicNum}`
    }
  })
}
export function alldelete(basicNum) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: 'PDM_零件明细表_基本件_删除数据_根据组件流水号',
      param: `组件流水号=${basicNum}`
    }
  })
}
export function deleteBasicParts5(basicNum) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: 'PDM_零件明细表_外购件和标准件_临时表_删除',
      param: `id=${basicNum}`
    }
  })
}
export function alldeleteBasicParts5(project, machine, group) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: 'PDM_零件明细表_外购件和标准件_临时表_全部删除',
      param: `项目=${project}&机床=${machine}&组号=${group}`
    }
  })
}
export function deleteBasicParts6(basicNum) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: 'PDM_零件明细表_基本件_临时表_删除',
      param: `id=${basicNum}`
    }
  })
}
export function alldeleteBasicParts6(project, machine, group) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: 'PDM_零件明细表_基本件_临时表_全部删除',
      param: `项目=${project}&机床=${machine}&组号=${group}`
    }
  })
}
export function deletePurchaseData(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: 'PDM_零件明细表_标准件和外购件_删除数据',
      param: '标准件和外购件流水号=' + num + '=int'
    }
  })
}
export function alldeleteWB(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: 'PDM_零件明细表_标准件和外购件_删除数据_根据组件流水号',
      param: '组件流水号=' + num + '=int'
    }
  })
}
export function editPurchaseData(num, num1) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: 'PDM_零件明细表_标准件和外购件_修改数据',
      param: '标准件和外购件流水号=' + num + '&零件数量=' + num1
    }
  })
}
export function editBasicParts(num, num1) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: 'PDM_零件明细表_基本件_编辑数据',
      param: '基本件流水号=' + num + '&零件数量=' + num1
    }
  })
}
export function getTable(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: '车间生产管理工艺_零件工艺计划_已投产_按组查',
      param: '组件流水号=' + num + '=int'
    }
  })
}
export function editProductNum(num, num1) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: 'MRP_计划订单_组件零件清单_基本件_编辑数据',
      param: '组件零件基本件流水号=' + num + '&数量=' + num1
    }
  })
}
export function getTable1(num, a, b, c, d, e, f, g) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: '车间生产管理工艺_新排产算法_能力平衡_查询数据_要平衡的零件',
      param: '项目流水号_check=' + num + '=string&项目流水号=' + a + '=int&机床流水号_check=' + b + '=string&机床流水号=' + c + '=int&组件流水号_check=' + d + '=string&组件流水号=' + e + '=int&零件图号_check=' + f + '=string&零件图号=' + g + '=string&是否查询全部数据=1=string&单件是否外协=1=int&考核状态=5=int'
    }
  })
}
export function editProduceNum(num, num1) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '车间生产管理工艺_零件工艺计划_修改数据',
      param: '工艺计划流水号=' + num + '&零件数量=' + num1
    }
  })
}
// 查询表1标准件和外购件
export function searchTable1(...params) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: '采购管理_采购部采购_查询物料_数量维护',
      param: `项目流水号_check=${params[0]}&项目流水号=${params[1]}&机床流水号_check=${params[2]}&机床流水号=${params[3]}&组件流水号_check=${params[4]}&组件流水号=${params[5]}&物料状态=1`
    }
  })
}
// 查询表1基本件
export function searchTable2(...params) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: '采购管理_采购部采购_查询物料_基本件_数量维护',
      param: `项目流水号_check=${params[0]}&项目流水号=${params[1]}&机床流水号_check=${params[2]}&机床流水号=${params[3]}&组件流水号_check=${params[4]}&组件流水号=${params[5]}&物料状态=1`
    }
  })
}
export function editGroupPartNum(num, num1) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: 'MRP_计划订单_组件零件清单_编辑数据',
      param: '组件零件流水号=' + num + '&零件数量=' + num1
    }
  })
}
export function editGroupBasicPartNum(num, num1) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: 'MRP_计划订单_组件零件清单_基本件_采购_编辑数据',
      param: '组件零件基本件流水号=' + num + '&零件数量=' + num1
    }
  })
}
