import request from '@/utils/request'

// 初始化机床项目
export function initProject() {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: 'PDM_项目名称_查询数据'
    }
  })
}
// 组件查询
export function searchgroup(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: 'PDM_组件名称_查询数据',
      param: '机床流水号=' + num
    }
  })
}
export function searchTable(machineNumberValue, check2, groupNumberValue, check3) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: '车间管理_基本件采购_查询数据',
      param: '机床流水号_check=' + check2 + '&机床流水号=' + machineNumberValue + '&组件流水号_check=' + check3 + '&组件流水号=' + groupNumberValue
    }
  })
}
export function searchPart(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: 'PDM_零件明细表_基本件_查询数据',
      param: '组件流水号=' + num
    }
  })
}
export function searchPart1(num, type) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: 'PDM_项目管理_零件明细表_标准件和外购件_车间采购_查询数据',
      param: '组件流水号=' + num + '&标准件类型=' + type
    }
  })
}
export function searchTable1(PurchaseOrder, check4) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: '车间管理_基本件采购_请购单_查询数据',
      param: '请购单编号=' + PurchaseOrder + '&请购单编号_check=' + check4
    }
  })
}
export function addData(num1, num2, id, time) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '车间管理_基本件采购_请购单_增加数据',
      param: '请购车间=' + num1 + '&请购人=' + num2 + '&人员编号=' + id + '&请购时间=' + time
    }
  })
}
export function editData(RequisitionList, num1, time) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '车间管理_基本件采购_请购单_编辑数据',
      param: '请购单流水号=' + RequisitionList + '&请购车间=' + num1 + '&请购时间=' + time
    }
  })
}
export function deleteData(RequisitionList) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '车间管理_基本件采购_请购单_删除数据',
      param: '请购单流水号=' + RequisitionList
    }
  })
}
export function searchDetailed(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: '车间管理_基本件采购_请购单明细_查询数据_外购件',
      param: '请购单流水号=' + num
    }
  })
}
export function searchDetailed1(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: '车间管理_基本件采购_请购单明细_查询数据_基本件',
      param: '请购单流水号=' + num
    }
  })
}
export function purchaseRequisition(RequisitionList, projectName, projectFloatValue, MachineToolNumber, machineFloatValue, groupName, groupFloatValue, BasicPartsNumber, MaterialName, PartToolNumber, Material, NumberOfParts, PartType, time, MaterialNum, ReMarks) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '车间管理_基本件采购_请购单明细_请购',
      param: '请购单流水号=' + RequisitionList + '&项目名称=' + projectName + '&项目流水号=' + projectFloatValue + '&机床图号=' + MachineToolNumber + '&机床流水号=' + machineFloatValue + '&组号=' + groupName + '&组件流水号=' + groupFloatValue + '&基本件流水号=' + BasicPartsNumber + '&物料名称=' + MaterialName + '&零件图号=' + PartToolNumber + '&材料=' + Material + '&零件数量=' + NumberOfParts + '&零件类型=' + PartType + '&物料计划到货时间=' + time + '&物料流水号=' + MaterialNum + '&备注=' + ReMarks
    }
  })
}
export function purchaseRequisition1(RequisitionList, projectName, projectFloatValue, MachineToolNumber, machineFloatValue, groupName, groupFloatValue, StandardPartsAndOutsourcing, MaterialName, MaterialCode, MaterialSpecification, MaterialModel, NumberOfParts, PartType, time, MaterialNum, ReMarks) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '车间管理_基本件采购_请购单明细_请购',
      param: '请购单流水号=' + RequisitionList + '&项目名称=' + projectName + '&项目流水号=' + projectFloatValue + '&机床图号=' + MachineToolNumber + '&机床流水号=' + machineFloatValue + '&组号=' + groupName + '&组件流水号=' + groupFloatValue + '&标准件和外购件流水号=' + StandardPartsAndOutsourcing + '&物料名称=' + MaterialName + '&物料代码=' + MaterialCode + '&物料规格=' + MaterialSpecification + '&物料型号=' + MaterialModel + '&零件数量=' + NumberOfParts + '&零件类型=' + PartType + '&物料计划到货时间=' + time + '&物料流水号=' + MaterialNum + '&备注=' + ReMarks
    }
  })
}
export function purchaseRequisition2(projectFloatValue, machineFloatValue, groupFloatValue, BasicPartsNumber, NumberOfParts, time) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '车间管理_采购部采购_基本件_传递数据',
      param: `组件流水号=${groupFloatValue}&基本件流水号组=${BasicPartsNumber}&项目流水号=${projectFloatValue}&机床流水号=${machineFloatValue}&物料计划到货时间=${time}&零件数量组=${NumberOfParts}`
    }
  })
}
export function MoveOut(num, num1) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '车间管理_基本件采购_请购单明细_移出',
      param: '请购单明细流水号=' + num + '&基本件流水号=' + num1
    }
  })
}
export function MoveOut1(num, num1) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '车间管理_基本件采购_请购单明细_移出',
      param: '请购单明细流水号=' + num + '&标准件和外购件流水号=' + num1
    }
  })
}
export function PurchasingDepartment(num, num1, time, MaterialNum, NumberOfParts, projectFloatValue, machineFloatValue) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '车间管理_车间采购_标准件和外购件_传递数据',
      param: `组件流水号=${num}&标准件和外购件流水号组=${num1}&物料计划到货时间=${time}=datetime&物料流水号组=${MaterialNum}&零件数量组=${NumberOfParts}&项目流水号=${projectFloatValue}&机床流水号=${machineFloatValue}`
    }
  })
}
export function Production(num, MaterialNum, projectFloatValue, machineFloatValue) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '车间管理_车间采购_基本件_传递数据',
      param: `组件流水号=${num}&基本件流水号组=${MaterialNum}&项目流水号=${projectFloatValue}&机床流水号=${machineFloatValue}`
    }
  })
}
export function PartCallbackInformation() {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: '采购管理_退回记录_基本件_查询数据'
    }
  })
}
export function PartCallbackInformation1() {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: '采购管理_退回记录_标准件和外购件_查询数据'
    }
  })
}
export function submit(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '采购管理_退回记录_确认数据',
      param: '基本件流水号=' + num
    }
  })
}
export function submit1(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '采购管理_退回记录_确认数据',
      param: '标准件和外购件流水号=' + num
    }
  })
}
export function Delete(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '采购管理_退回记录_删除数据',
      param: '基本件流水号=' + num
    }
  })
}
export function Delete1(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '采购管理_退回记录_删除数据',
      param: '标准件和外购件流水号=' + num
    }
  })
}
export function editStock(num, num1, num2, num3, num4) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '零件分配_标准件和外购件_使用库存',
      param: '标准件和外购件流水号=' + num + '&数量=' + num1 + '&零件数量=' + num2 + '&物料流水号=' + num3 + '&安全库存量=' + num4
    }
  })
}
export function editNum(num, num1) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '车间管理_标准件和外购件_更改数量',
      param: '请购单明细流水号=' + num + '&数量=' + num1
    }
  })
}
