import request from '@/utils/request'

export function getData(check, equipmentName, pageCurrent, pageSize) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: '设备管理_设备加工能力_查询数据_设备维护NEW',
      param: '设备名称_check=' + check + '=int&设备名称=' + equipmentName,
      pagination: pageCurrent + '&' + pageSize
    }
  })
}
export function initProcessing(a = '') {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: '车间生产管理工艺_基础表_工艺名称_查询数据',
      param: '工艺分类流水号_check=0=int&工艺分类流水号=' + a
    }
  })
}
export function addTable(equipmentName, equipmentModel, performance, processingCapacity, workingTimeFactor, processName, processNumber, shift, reorganizationTimeFactor, equipmentNumber, reservedTimeFactor) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '设备管理_设备加工能力_增加数据_设备维护New',
      param: '设备名称=' + equipmentName + '&设备型号=' + equipmentModel + '&设备性能指标=' + performance + '&设备加工能力工时=' + processingCapacity + '&设备工时系数=' + workingTimeFactor + '&工艺名称简称=' + processName + '&工艺编号=' + processNumber + '&班次类型=' + shift + '&整改工时系数=' + reorganizationTimeFactor + '&设备编号=' + equipmentNumber + '&预留工时系数=' + reservedTimeFactor
    }
  })
}
export function editTable(equipmentSerialNumber, equipmentName, equipmentModel, performance, processingCapacity, workingTimeFactor, shift, processCode, reorganizationTimeFactor, equipmentNumber, reservedTimeFactor) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '设备管理_设备加工能力_修改数据_设备维护New',
      param: '设备流水号=' + equipmentSerialNumber + '=int&设备名称=' + equipmentName + '=string&设备型号=' + equipmentModel + '=string&设备性能指标=' + performance + '= string&设备加工能力工时=' + processingCapacity + '=string&设备工时系数=' + workingTimeFactor + '=string&班次类型=' + shift + '=int&工艺属性代码=' + processCode + '=string&整改工时系数=' + reorganizationTimeFactor + '=string&设备编号=' + equipmentNumber + '=string&预留工时系数=' + reservedTimeFactor
    }
  })
}
export function deleteTable(number) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '设备管理_设备加工能力_删除数据_设备维护',
      param: '设备流水号=' + number + '=int'
    }
  })
}
export function setUp(time) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '车间生产管理工艺_新排产算法_设备能力_系数有效时间设定',
      param: '系数有效时间=' + time
    }
  })
}
export function generate() {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '车间生产管理工艺_新排产算法_设备加工能力_生成设备能力表'
    }
  })
}
