屏蔽自采购清空
This commit is contained in:
@@ -84,6 +84,9 @@ class SelfProcurementViewModel @Inject constructor(
|
||||
_globalWarehouse.value = dictType
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始称重
|
||||
*/
|
||||
fun startSensorScale() {
|
||||
Timber.d("开始称重")
|
||||
SensorScaleUtils.startScale(callback = { weight ->
|
||||
@@ -111,18 +114,18 @@ class SelfProcurementViewModel @Inject constructor(
|
||||
Timber.d("startSensorScale goodsUnitPrice = ${info.goodsUnitPrice}, goodsPrice = ${info.goodsPrice} ")
|
||||
// 计算单价 金额不为空,数量也不为空, 不是数量输入 也不是单价输入
|
||||
val finalPrice =
|
||||
if (count == 0.0) {
|
||||
if (finalCount == 0.0) {
|
||||
0.0
|
||||
} else if (_amountUserInput.value && !_priceUserInput.value) {
|
||||
info.goodsPrice.div(count).toSafeDouble()
|
||||
info.goodsPrice.div(finalCount).toSafeDouble()
|
||||
} else 0.0
|
||||
|
||||
// 计算金额 单价不为空,不是数量输入 也不是金额输入
|
||||
val finalAmount =
|
||||
if (count == 0.0) {
|
||||
if (finalCount == 0.0) {
|
||||
0.0
|
||||
} else if (_priceUserInput.value && !_amountUserInput.value) {
|
||||
count.times(info.goodsUnitPrice).toSafeDouble()
|
||||
finalCount.times(info.goodsUnitPrice).toSafeDouble()
|
||||
} else 0.0
|
||||
Timber.d("startSensorScale finalPrice = $finalPrice, finalAmount = $finalAmount ")
|
||||
_selectedItem.value = info.copy(
|
||||
|
||||
Reference in New Issue
Block a user