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

export function searchTableData(num, pageCurrent, pageSize) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '库存管理_原材料库存管理_查询',
      param: '原材料名称=' + num,
      Pagination: pageCurrent + '&' + pageSize
    }
  })
}
export function addData(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '库存管理_原材料库存管理_新增',
      param: '原材料名称=' + num
    }
  })
}
export function editData(num1, num2) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '库存管理_原材料库存管理_编辑',
      param: '原材料流水号=' + num1 + '&原材料名称=' + num2
    }
  })
}
export function deleteCategory(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '库存管理_原材料库存管理_删除',
      param: '原材料流水号=' + num
    }
  })
}
