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

export function searchPartNumber(partnumber) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '库存管理_基本件入库_零件图号',
      param: '工艺计划流水号=' + partnumber
    }
  })
}
// 机床名称
export function getMachines() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间生产管理工艺_传递后_机床名称_根据机床查询',
      param: '是否传递=2=int&考核状态=6=int&工艺任务分配状态=2=int&定额任务分配状态=2=int&单件是否外协=1=int'
    }
  })
}
// 获取组号
export function getGroups(stepNumber) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间生产管理工艺_传递后_组件名称_查询数据_查询所有组',
      param: '机床流水号=' + stepNumber + '=int'
    }
  })
}
export function getTable(checkbox_Machine, Machine, checkbox_Group, Group, checkbox_number, number, k, m, pageCurrent, pageSize) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间生产管理工艺_零件工序_查询数据_已编制工序的全部零件及工序_横向赋值新建存储过程_新',
      param: '项目流水号_check=0=string&机床流水号_check=' + checkbox_Machine + '=string&机床流水号=' + Machine + '=string&组件流水号_check=' + checkbox_Group + '=string&组件流水号=' + Group + '=string&零件图号_check=' + checkbox_number + '=string&零件图号=' + number + '=string&是否查询全部数据=1=string&单件是否外协=1=string&考核状态=6=int&开始时间_check=0&开始时间=' + k + '&结束时间_check=0&结束时间=' + m,
      Pagination: pageCurrent + '&' + pageSize
    }
  })
}
// 获取组号
export function gettabledata1(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间生产管理工艺_加工进度查询_查询_New',
      param: '工艺计划流水号=' + num + '=int'
    }
  })
}
export function submitEdit(Number1, processSerialNumber) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: 2,
      name: '车间生产管理工艺_零件工序_修改数据_工作者_根据人员编号',
      param: '人员编号=' + Number1 + '=string&工序流水号=' + processSerialNumber + '=string'
    }
  })
}
