import request from '@/utils/request'
import state from '@/store'
import router from '@/router'

// 初始化获取工艺
export function getTechnology() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间生产管理工艺_基础表_工艺名称_查询数据',
      param: '工艺分类流水号_check=0'
    }
  })
}
// 查询表格数据
export function searchtable(pageCurrent, pageSize, num1, ManufacturerNumber) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '设备管理_设备加工能力_查询数据_设备维护',
      param: '设备名称_check=' + num1 + '&设备名称=' + ManufacturerNumber,
      Pagination: pageCurrent + '&' + pageSize
    }
  })
}
// 增加
export function edittype(ManufacturerNumber, ManufacturerName, ManufacturerAbbreviation, address, phNumber, Fax, Remarks, category, attention, EquipmentCondition) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '设备管理_设备加工能力_增加数据_设备维护New',
      param: '设备名称=' + ManufacturerNumber + '&设备型号=' + ManufacturerName + '&设备性能指标=' + ManufacturerAbbreviation + '&设备工时系数=' + address + '&工艺编号=' + phNumber + '&班次类型=' + Fax + '&设备加工能力工时=' + Remarks + '&整改工时系数=' + category + '&设备编号=' + attention + '&预留工时系数=' + EquipmentCondition
    }
  })
}
// 编辑
export function handlechange(num, ManufacturerNumber, ManufacturerName, ManufacturerAbbreviation, address, phNumber, Fax, Remarks, category, attention, EquipmentCondition) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '设备管理_设备加工能力_修改数据_设备维护New',
      param: '设备流水号=' + num + '&设备名称=' + ManufacturerNumber + '&设备型号=' + ManufacturerName + '&设备性能指标=' + ManufacturerAbbreviation + '&设备工时系数=' + address + '&工艺属性代码=' + phNumber + '&班次类型=' + Fax + '&设备加工能力工时=' + Remarks + '&整改工时系数=' + category + '&设备编号=' + attention + '&预留工时系数=' + EquipmentCondition
    }
  })
}
// 删除
export function handledelete(CoManufacturerFlowNumber) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '设备管理_设备加工能力_删除数据_设备维护',
      param: '设备流水号=' + CoManufacturerFlowNumber
    }
  })
}
