import request from '@/utils/request'
import state from '@/store'
import router from '@/router'
// 查询零件入库情况
export function searchTable(partnumber) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: 'MES_机加工MES_库存管理_入库模块_零件基础信息查询_根据零件图号',
      param: '工艺计划流水号=' + partnumber
    }
  })
}
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 CraftNumber(partnumber) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '库存管理_基本件入库_工艺计划流水号',
      param: '零件图号=' + partnumber
    }
  })
}
// 仓库查询
export function getinventory() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '库存管理_货位主文件_仓库查询'
    }
  })
}
// 货位查询
export function getlocate() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '库存管理_货位主文件_查询数据_查询全部'
    }
  })
}
// 修改入库数量
export function insertOne(num0, num1, people, num4, num5, num6, num7) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: 'MES_机加工MES_库存管理_入库模块_增加入库信息_修改入库数量',
      param: '工艺计划流水号=' + num0 + '=int&入库数量=' + num1 + '=int&收件人员编号=' + people + '=int&送件人员编号=1001' + '&漆塑=' + num4 + '&仓库流水号=' + num5 + '&货位流水号=' + num6 + '&备注=' + num7
    }
  })
}
// 更新零件状态
export function FinishPart(num0) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: 'MES_机加工MES_库存管理_入库模块_更新零件状态',
      param: '工艺计划流水号组=' + num0
    }
  })
}
// 获取跟单号
export function searchNumber(part) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间生产管理_自制件跟单号_查询数据',
      param: '零件图号=' + part
    }
  })
}
