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

// 人员111
export function getPerson() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '人事档案管理_人员_部门与人员_查询数据_根据部门编号',
      param: '考核部门编号=20'
    }
  })
}
// 查询 项目
export function getProject(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间采购管理工艺_零件定额计划_项目查询',
      param: '是否制定定额=' + num
    }
  })
}
// 查询 机床
export function getMachine(num, num1) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间采购管理工艺_零件定额计划_机床查询',
      param: '项目流水号=' + num1 + '&是否制定定额=' + num
    }
  })
}
// 查询 组号
export function getGroup(num, num1) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间采购管理工艺_零件定额计划_组号查询',
      param: '机床流水号=' + num1 + '&是否制定定额=' + num
    }
  })
}
// 查询 零件号
export function getPartnames1(num, num1, num2, pageCurrent, pageSize) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间采购管理工艺_零件定额计划_零件查询',
      param: '组件流水号=' + num1 + '&是否制定定额=' + num + '&组件类别=' + num2,
      Pagination: pageCurrent + '&' + pageSize
    }
  })
}
// 查询 零件工序
export function getProcedure(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间采购管理工艺_零件工序_查询工序信息',
      param: '工艺流水号=' + num
    }
  })
}
// 定额状态修改
export function returnEdit(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '车间采购管理工艺_工艺调整_修改定额',
      param: '工艺流水号=' + num
    }
  })
}
// 零件定额修改
export function update(num, num1, num2) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '车间采购管理工艺_零件定额计划_修改定额',
      param: '外购件工序流水号=' + num + '&单件定额工时=' + num1 + '&准结定额工时=' + num2
    }
  })
}
// 保存
export function saveApprove(num0, num1) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '车间采购管理工艺_零件工序_修改定额计划',
      param: '工艺流水号=' + num0 + '&定额人员编号=' + num1
    }
  })
}
