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 basicPartsData(project_check, project, machine_check, machine, group_check, group, pageSize, pageCurrent) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: 'PDM_零件明细表_基本件_查询数据_综合gj',
      param: `项目流水号_check=${project_check}&项目流水号=${project}&机床流水号_check=${machine_check}&机床流水号=${machine}&组件流水号_check=${group_check}&组件流水号=${group}`,
      Pagination: pageCurrent + '&' + pageSize
    }
  })
}
export function purchasePartsData(num, type, pageCurrent, pageSize) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: 'PDM_零件明细表_标准件和外购件_查询数据',
      param: `组件流水号=${num}&标准件类型=${type}`,
      pagination: pageCurrent + '&' + pageSize
    }
  })
}
export function deleteBasicParts(basicNum) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: 'PDM_零件明细表_基本件_删除数据',
      param: `基本件流水号=${basicNum}`
    }
  })
}
export function deletePurchaseData(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: 'PDM_零件明细表_标准件和外购件_删除数据',
      param: '标准件和外购件流水号=' + num + '=int'
    }
  })
}
