/**
 * 物资类型管理页面 API
 */
import request from '@/utils/request'

/** 物资类型树查询 */
export const queryMaTypeTreeListApi = (data) => {
  return request.get('/base/maType/getMaTypeList', {
    params: data
  })
}

/** 树形下物资查询 */
export const queryMaListApi = (data) => {
  return request.get('/base/maType/getListByMaType', {
    params: data
  })
}

/** 计量单位下拉查询 */
export const queryMeterListApi = (data) => {
  return request.get('/base/tree/getUnitName', {
    params: data
  })
}

/** 新增时查询id */
export const queryIdWhenAddMa = (data) => {
  return request.get('/base/maType/addMaType', {
    params: data
  })
}

/** 修改时查询回显数据 */
export const queryInfoWhenEditMa = (data) => {
  return request.get('/base/maType/selectById', {
    params: data
  })
}

/** 提交物资添加表单 */
export const submitAddForm = (data) => {
  return request.post('/base/maType/add', data)
}

/** 提交物资编辑表单 */
export const submitEditForm = (data) => {
  return request.post('/base/maType/update', data)
}

/** 删除单个物资 */
export const delSingleMa = (id) => {
  return request.delete(`/base/maType/${id}` )
}

