import request from '@/utils/request'

// 初始化项目
export function initProject() {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: 'PDM_项目名称_查询数据_按时间排序'
    }
  })
}
// 机床查询
export function searchmachine(check, num) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: 'PDM_机床名称_查询数据',
      param: '项目流水号_check=' + check + '=int&项目流水号=' + num
    }
  })
}
// 分组查询
export function searchTeam(machineNumber) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: 'PDM_组件名称_查询数据',
      param: '机床流水号=' + machineNumber
    }
  })
}
// 外购件、标准件查询
export function searchPurchasePart(pageCurrent, pageSize, project_check, project, machine_check, machine, group_check, group) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: '库存管理_外购件出库_零件查询',
      param: '项目流水号_check=' + project_check + '&项目流水号=' + project + '&机床流水号_check=' + machine_check + '&机床流水号=' + machine + '&组件流水号_check=' + group_check + '&组件流水号=' + group,
      Pagination: pageCurrent + '&' + pageSize
    }
  })
}
// 基本件、通用件查询
export function searchBasicPart(pageCurrent, pageSize, project_check, project, machine_check, machine, group_check, group) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: '库存管理_基本件出库_零件查询',
      param: '项目流水号_check=' + project_check + '&项目流水号=' + project + '&机床流水号_check=' + machine_check + '&机床流水号=' + machine + '&组件流水号_check=' + group_check + '&组件流水号=' + group,
      Pagination: pageCurrent + '&' + pageSize
    }
  })
}
// 车间采购件查询
export function searchHoursePart(pageCurrent, pageSize, project_check, project, machine_check, machine, group_check, group) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: '库存管理_车间采购出库_零件查询',
      param: '项目流水号_check=' + project_check + '&项目流水号=' + project + '&机床流水号_check=' + machine_check + '&机床流水号=' + machine + '&组件流水号_check=' + group_check + '&组件流水号=' + group,
      Pagination: pageCurrent + '&' + pageSize
    }
  })
}
// 领料单查询
export function searchList(pageCurrent, pageSize, listNumber_check, listNumber) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: '车间装配管理_领料单_领料单查询',
      param: '领料单编号_check=' + listNumber_check + '&领料单编号=' + listNumber,
      Pagination: pageCurrent + '&' + pageSize
    }
  })
}

// 领料单明细查询
export function searchListDetail(listNumber) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: '车间装配管理_领料单_领料单明细查询',
      param: '领料单流水号=' + listNumber
    }
  })
}
// 创建领料单
export function addList(peopleNumber) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '车间装配管理_领料单_领料单增加',
      param: '领料人流水号=' + peopleNumber
    }
  })
}
// 删除领料单
export function dropList(PickingListNumberx) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '车间装配管理_领料单_领料单删除',
      param: '领料单流水号=' + PickingListNumberx
    }
  })
}
// 删除领料单明细
export function dropListDetail(DetailNumberx) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '车间装配管理_领料单_领料单明细删除',
      param: '领料单明细流水号=' + DetailNumberx
    }
  })
}
// 增加领料单明细
export function addListDetail(PickingListNumberx, projectnumber, machinenumber, teamNumber, outNumber, partType, Note, data1, data2, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '车间装配管理_领料单_领料单明细增加',
      param: '领料单流水号=' + PickingListNumberx + '&项目流水号=' + projectnumber + '&机床流水号=' + machinenumber + '&组件流水号=' + teamNumber + '&出库数量=' + outNumber + '&零件类型=' + partType + '&备注=' + Note + '&工艺计划流水号=' + data1 + '&收件信息ID=' + data2 + '&采购合同明细流水号=' + data4 + '&请购单明细流水号=' + data5 + '&货位流水号=' + data6 + '&出库类型=' + data7 + '&物料与货位对照流水号=' + data8 + '&名称=' + data9 + '&物料规格=' + data10 + '&物料型号=' + data11 + '&零件图号=' + data12 + '&材料=' + data13
    }
  })
}
