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

export function searchPerson() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间管理_其他数据_查询数据_人员'
    }
  })
}
export function fetchDate(month) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间管理_其他数据_查询数据',
      param: '月份=' + month
    }
  })
}
export function saveDate(num, partNum, procedure, num3, number, time1, time) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '车间管理_其他数据_增加数据',
      param: '操作工流水号=' + num + '&零件图号=' + partNum + '&工序=' + procedure + '&录入人流水号=' + num3 + '&数量=' + number + '&单件工时=' + time1 + '&加工日期=' + time
    }
  })
}
export function editDate(ID, num, partNum, procedure, num3, number, time1, time) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '车间管理_其他数据_编辑数据',
      param: 'ID=' + ID + '&操作工流水号=' + num + '&零件图号=' + partNum + '&工序=' + procedure + '&录入人流水号=' + num3 + '&数量=' + number + '&单件工时=' + time1 + '&加工日期=' + time
    }
  })
}
export function deleteDate(ID) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '车间管理_其他数据_删除数据',
      param: 'ID=' + ID
    }
  })
}
