添加物品消耗单位输入

This commit is contained in:
zxj
2025-08-21 17:01:52 +08:00
parent 7a80a6053b
commit b44e1a35bb
13 changed files with 171 additions and 32 deletions
@@ -56,7 +56,11 @@ data class GoodsAddParam(
/**
* 图片url
*/
var relativeUrl: String? = null
var relativeUrl: String? = null,
/**
* 库存与克的转换值
*/
val consumeValue: String = ""
) {
val goodNameSr: String
@@ -138,6 +142,9 @@ data class GoodsAddParam(
if (purchasePrice == null || purchasePrice!!.toFloat() <= 0) {
return "请输入单价"
}
if (consumeValue.isEmpty()) {
return "请输入库存单位对应的消耗值"
}
return null
}
}
@@ -7,8 +7,21 @@ data class GoodsPurchaseUnitParam(
val purchaseUnit: Int = 0, // 采购单位 integer ,
val unitId: Int = 0, // 库存单位id integer,
val purchaseValue: Float = 0f, // 单位转换值 float
/**
* 库存与克的转换值
*/
var consumeValue: String = "",
val consumeValueTemp: String = "",
) {
val consumeValueTempValue: String
get() {
if (consumeValue.isNotEmpty()) {
return consumeValue
}
return consumeValueTemp
}
val unitIdStr: String
get() {
if (unitId == 0) return ""
@@ -35,6 +48,10 @@ data class GoodsPurchaseUnitParam(
if (purchaseValue == null || purchaseValue == 0f) {
return "请输入采购单位对应的库存数量"
}
if (consumeValueTemp.isEmpty()) {
return "请输入库存单位对应的消耗值"
}
consumeValue = consumeValueTemp
return null
}
}
@@ -68,7 +68,9 @@ data class PurchaseWarehouseParam(
// 搜索的物品单位列表
var unitList: List<UnitVo>? = null,
// 选中的采购单位
var selectUnitType: UnitVo? = null
var selectUnitType: UnitVo? = null,
// 库存单位与克的转换值
val consumeValue: String = ""
) : Parcelable {
val warehouseNameStr: String
@@ -53,6 +53,12 @@ data class SearchGoodsInfo(
*/
@SerializedName("kcUnitName")
val kcUnitName: String? = "",
/**
* 库存与克的转换值
*/
val consumeValue: String? = "",
@SerializedName("specification")
val specification: String? = "",
@SerializedName("typeId")
@@ -63,7 +69,7 @@ data class SearchGoodsInfo(
* 采购单位列表
*/
@SerializedName("unitVoList")
val unitVoList: List<UnitVo>? = null,
val unitVoList: List<UnitVo>? = listOf(),
@SerializedName("zjmCode")
val zjmCode: String? = ""
) : Parcelable {