修复了消耗值为空字符串时重量不显示的问题
修复了相机未初始化或已关闭时调用拍照报错问题 调整了未确认列表允许收货 调整了重量大于1kg时显示kg
This commit is contained in:
@@ -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 {
|
||||
"千克"
|
||||
|
||||
Reference in New Issue
Block a user