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 searchSubstituted() {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: '库存管理_离线外购件_出库查询'
    }
  })
}
// 替换单查询
export function searchSubstitutedCard() {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: '库存管理_替换件_替换单查询'
    }
  })
}
// 替换单修改
export function editSubstitutedCard(data1, data2, data3, data4) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '库存管理_替换件_替换单修改',
      param: '替换单流水号=' + data1 + '&替换单编号=' + data2 + '&替换数量=' + data3 + '&备注=' + data4
    }
  })
}

// 替换单删除
export function deleteSubstitutedCard(data1) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '库存管理_替换件_替换单删除',
      param: '替换单流水号=' + data1
    }
  })
}
// 增加替换件
export function addSubstitutepart(data1, data2, data3, data4, data55, data5, data6, data7, data8) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '库存管理_替换件_零件替换',
      param: '离线合同明细流水号=' + data1 + '&替换件采购合同明细流水号=' + data2 + '&替换单编号=' + data3 + '&替换件名称=' + data4 + '&被替换件货位流水号=' + data55 + '&被替换件名称=' + data5 + '&申请人=' + data6 + '&替换数量=' + data7 + '&备注=' + data8
    }
  })
}
