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

// 初始化 工艺员A
export function initCraftmen() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '人事档案管理_人员_部门与人员_查询数据_根据部门编号',
      param: '考核部门编号=9'
    }
  })
}
// 查询机床
export function searchMachine(num1) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间装配管理_机床编号_查询数据_根据定额',
      param: '是否定额=' + num1
    }
  })
}
// 查询组件工艺
export function searchDetail(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间装配管理_组件工艺_查询数据',
      param: '机床流水号=' + num
    }
  })
}
// 查询工序
export function searchProcess(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间装配管理_装配工序_查询数据',
      param: '组件工艺流水号=' + num
    }
  })
}
// 编辑工时
export function update(num, num1) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '车间装配管理_装配工序工时_编辑数据',
      param: '装配工序流水号=' + num + '&工艺工时=' + num1
    }
  })
}
// 保存
export function saveApprove(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      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
    }
  })
}
