feat: 开始组装 opt
This commit is contained in:
@@ -100,6 +100,36 @@ class IntExpAssembleStartViewModel : BaseViewModel() {
|
||||
assemblePositionList.value = list
|
||||
}
|
||||
|
||||
/**
|
||||
* 运单点击(单选切换)
|
||||
*/
|
||||
fun onWaybillItemClick(position: Int) {
|
||||
val list = waybillList.value ?: return
|
||||
|
||||
// 取消所有运单的选中状态
|
||||
list.forEach { it.isSelected.set(false) }
|
||||
|
||||
// 选中当前运单
|
||||
if (position in list.indices) {
|
||||
val selectedWaybill = list[position]
|
||||
selectedWaybill.isSelected.set(true)
|
||||
|
||||
// 同步运单信息到表单
|
||||
waybillInfo.value = WaybillInfoBean().apply {
|
||||
waybillNo = selectedWaybill.waybillNo
|
||||
waybillPieces = selectedWaybill.pieces
|
||||
waybillWeight = selectedWaybill.weight
|
||||
// 保留当前的组装件数、组装重量、组装人
|
||||
assembleCount = waybillInfo.value?.assembleCount ?: ""
|
||||
assembleWeight = waybillInfo.value?.assembleWeight ?: ""
|
||||
operator = waybillInfo.value?.operator ?: ""
|
||||
}
|
||||
}
|
||||
|
||||
// 刷新列表
|
||||
waybillList.value = list
|
||||
}
|
||||
|
||||
/**
|
||||
* 扫码运单
|
||||
*/
|
||||
@@ -126,7 +156,7 @@ class IntExpAssembleStartViewModel : BaseViewModel() {
|
||||
val warehouseList = result.data ?: mutableListOf()
|
||||
val waybillBeanList = warehouseList.map { warehouse ->
|
||||
AssembleWaybillBean().apply {
|
||||
waybillNo = warehouse.no
|
||||
waybillNo = warehouse.wbNo
|
||||
pieces = warehouse.pc.toString()
|
||||
weight = String.format("%.1f", warehouse.weight)
|
||||
flight = warehouse.flight
|
||||
|
||||
Reference in New Issue
Block a user