修复了消耗值为空字符串时重量不显示的问题

修复了相机未初始化或已关闭时调用拍照报错问题
调整了未确认列表允许收货
调整了重量大于1kg时显示kg
This commit is contained in:
zxj
2025-08-22 14:51:43 +08:00
parent d7536e75af
commit 3cda898756
7 changed files with 43 additions and 14 deletions
@@ -118,6 +118,14 @@ data class GoodsInfo(
return receivedNum?.toSafeString(unitName) ?: "-"
}
val receivedNumCount: String
get() {
if (receivedNum == null || receivedNum == 0f)
return "0"
return receivedNum?.toSafeString(unitName) ?: "0"
}
val dualCountStr: String
get() {
return if (receivedNum != null && receivedNum != 0f && receiveCount != null && receiveCount != 0f) {
@@ -188,7 +196,7 @@ data class GoodsInfo(
if (goodsWeight == null) return ""
// 小于10 kg 显示 g
if (goodsWeight!!.toInt() < 10) {
if (goodsWeight!!.toInt() < 1) {
return goodsWeight!!.multiply(BigDecimal(1000)).toString()
}
return goodsWeight?.toFormattedString() ?: ""
@@ -196,7 +204,7 @@ data class GoodsInfo(
val goodsWeightUnitStr: String
get() {
return if (goodsWeight == null || goodsWeight!!.toInt() < 10) {
return if (goodsWeight == null || goodsWeight!!.toInt() < 1) {
""
} else {
"千克"