import request from '@/config/axios'

// 物资属性值查询参数
export interface PropertyValueQuery {
  current: number
  size: number
  propertyId?: number
  propertyValue?: string
  status?: number
}

// 物资属性值表单对象
export interface PropertyValueVO {
  recordId?: number
  propertyId: number
  propertyName: string
  propertyValue: string
  propertyUnit?: string
  status: number
  remark?: string
  createTime?: Date
}

// 查询物资属性值列表
export const PropertyValuePage = async (params: PropertyValueQuery) => {
  return await request.get({ url: '/iscs/materials-property-value/getMaterialsPropertyValuePage', params })
}

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

// 新增物资属性值
export const addPropertyValue = async (data: PropertyValueVO) => {
  return await request.post({ url: '/iscs/materials-property-value/insertMaterialsPropertyValue', data })
}

// 修改物资属性值
export const updatePropertyValue = async (data: PropertyValueVO) => {
  return await request.put({ url: '/iscs/materials-property-value/updateMaterialsPropertyValue', data })
}

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

  })
}
