fix: 修复国际进港仓库入库接口参数格式,去除主子列表选中联动,更新分单理货报告字段
- 入库接口请求体改为 {location, locationId, warehouseList} 结构
- 移除主列表与子列表之间的双向选中联动,保留全选按钮同时选中两者
- 舱单子列表理货报告字段从 lastMftStatus 改为 tallyStatus
- GjjHaWb 新增 tallyStatus 字段
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
package com.lukouguoji.gjj.holder
|
||||
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.lukouguoji.gjj.databinding.ItemIntImpStorageUseSubBinding
|
||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||
import com.lukouguoji.module_base.bean.GjcMaWb
|
||||
import com.lukouguoji.module_base.bean.GjcStorageUse
|
||||
|
||||
/**
|
||||
@@ -19,27 +17,10 @@ class IntImpStorageUseSubViewHolder(view: View) :
|
||||
binding.position = position
|
||||
binding.executePendingBindings()
|
||||
|
||||
// 单选框点击切换选择状态(反向联动主列表)
|
||||
// 单选框点击切换选择状态
|
||||
binding.ivCheckbox.setOnClickListener {
|
||||
// 切换子列表项的选择状态
|
||||
val newCheckedState = !bean.checked.get()
|
||||
bean.checked.set(newCheckedState)
|
||||
bean.checked.set(!bean.checked.get())
|
||||
binding.executePendingBindings()
|
||||
|
||||
// 反向联动主列表项(仅在勾选时联动)
|
||||
updateParentCheckState(newCheckedState)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新父列表项的选择状态
|
||||
*/
|
||||
private fun updateParentCheckState(newCheckedState: Boolean) {
|
||||
val recyclerView = itemView.parent as? RecyclerView ?: return
|
||||
val parentBean = recyclerView.tag as? GjcMaWb ?: return
|
||||
|
||||
if (newCheckedState) {
|
||||
parentBean.checked.set(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,18 +20,10 @@ class IntImpStorageUseViewHolder(view: View) :
|
||||
binding.position = position
|
||||
binding.executePendingBindings()
|
||||
|
||||
// 图标点击切换选择状态(联动子列表)
|
||||
// 图标点击切换选择状态
|
||||
binding.ivIcon.setOnClickListener {
|
||||
val newCheckedState = !bean.checked.get()
|
||||
bean.checked.set(newCheckedState)
|
||||
|
||||
// 联动勾选/取消所有子列表项
|
||||
bean.storageUseList?.forEach { storageUse ->
|
||||
storageUse.checked.set(newCheckedState)
|
||||
}
|
||||
|
||||
bean.checked.set(!bean.checked.get())
|
||||
binding.executePendingBindings()
|
||||
binding.rvSub.adapter?.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
// 展开按钮点击事件
|
||||
|
||||
@@ -230,9 +230,13 @@ class IntImpStorageUseViewModel : BasePageViewModel() {
|
||||
return
|
||||
}
|
||||
|
||||
val body = maWbListForInStorage.toRequestBody()
|
||||
val body = mapOf(
|
||||
"location" to locationName,
|
||||
"locationId" to locationId.toLongOrNull(),
|
||||
"warehouseList" to maWbListForInStorage
|
||||
).toRequestBody()
|
||||
|
||||
launchLoadingCollect({ NetApply.api.inIntImpStorage(locationName, body) }) {
|
||||
launchLoadingCollect({ NetApply.api.inIntImpStorage(body) }) {
|
||||
onSuccess = {
|
||||
showToast("入库成功")
|
||||
viewModelScope.launch {
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:text="@{bean.lastMftStatus ?? ``}"
|
||||
android:text="@{bean.tallyStatus ?? ``}"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:textSize="14sp" />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user