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

export function featchMaterial(num1, pageCurrent, pageSize) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间生产管理工艺_材质表_查询数据_根据材料名称',
      param: '材料名称=' + num1,
      pagination: pageCurrent + '&' + pageSize
    }
  })
}
export function addMaterial(num1) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '车间生产管理工艺_材质表_增加数据',
      param: '材料=' + num1
    }
  })
}
export function delMaterial(num1) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '车间生产管理工艺_材质表_删除数据',
      param: '材料流水号=' + num1
    }
  })
}
export function editMaterial(num1, num2) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '车间生产管理工艺_材质表_修改数据',
      param: '材料流水号=' + num1 + '=int&材料=' + num2
    }
  })
}
