import request from '@/config/axios'

// 物资属性项查询参数
export interface PropertyQuery {
  current: number
  size: number
  propertyName?: string
  propertyCode?: string
  status?: number
}

// 物资属性项表单对象
export interface PropertyVO {
  propertyId?: number
  propertyName: string
  propertyCode: string
  propertyType: string
  propertyUnit?: string
  status: number
  remark?: string
  createTime?: Date
}

// 查询物资属性项列表
export const PropertyPage = async (params: PropertyQuery) => {
  return await request.get({ url: '/iscs/materials-property/getMaterialsPropertyPage', params })
}

// 查询物资属性项详情
export const selectPropertyById = async (id: number) => {
  return await request.get({
    url: '/iscs/materials-property/selectMaterialsPropertyById',
    params: { id: id }
  })
}

// 新增物资属性项
export const addProperty = async (data: PropertyVO) => {
  return await request.post({ url: '/iscs/materials-property/insertMaterialsProperty', data })
}

// 修改物资属性项
export const updateProperty = async (data: PropertyVO) => {
  return await request.put({ url: '/iscs/materials-property/updateMaterialsProperty', data })
}

// 删除物资属性项
export const deleteProperty = async (ids: number) => {
  return await request.delete({
    url: '/iscs/materials-property/deleteMaterialsPropertyList?ids='+ids,

  })
}
