feat: 国际出港仓库入库/出库支持填写件数重量
- 入库弹窗新增件数、重量输入,默认取选中运单件数重量 - 出库改用自定义弹窗(替换 AlertDialog),新增件数、重量输入,默认取库位入库件数重量 - 出库接口请求体由数组改为对象,选中库位放入 storageUseList - 库位子列表新增入库件数/重量、出库件数/重量四列 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.lukouguoji.module_base.ktx.toPlainText
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Date
|
||||
import java.util.Locale
|
||||
@@ -320,12 +321,21 @@ data class GjcStorageUse(
|
||||
var outDate: String? = null, // 出库时间
|
||||
var outOpId: String? = null, // 出库人
|
||||
var outId: String? = null, // 出库人(兼容字段)
|
||||
var cargoStatus: String? = null // 货物状态
|
||||
var cargoStatus: String? = null, // 货物状态
|
||||
var inPc: Long? = null, // 入库件数
|
||||
var inWeight: Double? = null, // 入库重量
|
||||
var outPc: Long? = null, // 出库件数
|
||||
var outWeight: Double? = null // 出库重量
|
||||
) {
|
||||
// ==================== UI扩展字段 ====================
|
||||
@Transient
|
||||
val checked: ObservableBoolean = ObservableBoolean(false) // 选中状态
|
||||
|
||||
val inPcText: String get() = inPc?.toString() ?: ""
|
||||
val inWeightText: String get() = inWeight?.toPlainText() ?: ""
|
||||
val outPcText: String get() = outPc?.toString() ?: ""
|
||||
val outWeightText: String get() = outWeight?.toPlainText() ?: ""
|
||||
|
||||
// 兼容现有API的isSelected属性
|
||||
var isSelected: Boolean
|
||||
get() = checked.get()
|
||||
|
||||
@@ -14,3 +14,9 @@ fun Number.limit(count: Int = 2): String {
|
||||
}
|
||||
return DecimalFormat(pattern.toString()).format(this)
|
||||
}
|
||||
|
||||
/**
|
||||
* 去掉无意义的小数位:12.0 -> "12",12.50 -> "12.5"
|
||||
*/
|
||||
fun Double.toPlainText(): String =
|
||||
if (this % 1.0 == 0.0) toLong().toString() else toBigDecimal().stripTrailingZeros().toPlainString()
|
||||
|
||||
Reference in New Issue
Block a user