fix: 修复国际进港仓库入库接口参数格式,去除主子列表选中联动,更新分单理货报告字段
- 入库接口请求体改为 {location, locationId, warehouseList} 结构
- 移除主列表与子列表之间的双向选中联动,保留全选按钮同时选中两者
- 舱单子列表理货报告字段从 lastMftStatus 改为 tallyStatus
- GjjHaWb 新增 tallyStatus 字段
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -29,7 +29,8 @@ data class GjjHaWb(
|
|||||||
var opDate: String = "",
|
var opDate: String = "",
|
||||||
var billsNo: String = "",
|
var billsNo: String = "",
|
||||||
var remark: String = "",
|
var remark: String = "",
|
||||||
var response: String = ""
|
var response: String = "",
|
||||||
|
var tallyStatus: String = ""
|
||||||
) : Serializable {
|
) : Serializable {
|
||||||
@Transient
|
@Transient
|
||||||
val checked: ObservableBoolean = ObservableBoolean(false)
|
val checked: ObservableBoolean = ObservableBoolean(false)
|
||||||
|
|||||||
@@ -963,7 +963,7 @@ interface Api {
|
|||||||
* 接口路径: /IntImpStorage/inStorage
|
* 接口路径: /IntImpStorage/inStorage
|
||||||
*/
|
*/
|
||||||
@POST("IntImpStorage/inStorage")
|
@POST("IntImpStorage/inStorage")
|
||||||
suspend fun inIntImpStorage(@Query("location") location: String, @Body data: RequestBody): BaseResultBean<Boolean>
|
suspend fun inIntImpStorage(@Body data: RequestBody): BaseResultBean<Boolean>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际进港提取记录-分页查询
|
* 国际进港提取记录-分页查询
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
package com.lukouguoji.gjj.holder
|
package com.lukouguoji.gjj.holder
|
||||||
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
|
||||||
import com.lukouguoji.gjj.databinding.ItemIntImpStorageUseSubBinding
|
import com.lukouguoji.gjj.databinding.ItemIntImpStorageUseSubBinding
|
||||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||||
import com.lukouguoji.module_base.bean.GjcMaWb
|
|
||||||
import com.lukouguoji.module_base.bean.GjcStorageUse
|
import com.lukouguoji.module_base.bean.GjcStorageUse
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -19,27 +17,10 @@ class IntImpStorageUseSubViewHolder(view: View) :
|
|||||||
binding.position = position
|
binding.position = position
|
||||||
binding.executePendingBindings()
|
binding.executePendingBindings()
|
||||||
|
|
||||||
// 单选框点击切换选择状态(反向联动主列表)
|
// 单选框点击切换选择状态
|
||||||
binding.ivCheckbox.setOnClickListener {
|
binding.ivCheckbox.setOnClickListener {
|
||||||
// 切换子列表项的选择状态
|
bean.checked.set(!bean.checked.get())
|
||||||
val newCheckedState = !bean.checked.get()
|
|
||||||
bean.checked.set(newCheckedState)
|
|
||||||
binding.executePendingBindings()
|
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.position = position
|
||||||
binding.executePendingBindings()
|
binding.executePendingBindings()
|
||||||
|
|
||||||
// 图标点击切换选择状态(联动子列表)
|
// 图标点击切换选择状态
|
||||||
binding.ivIcon.setOnClickListener {
|
binding.ivIcon.setOnClickListener {
|
||||||
val newCheckedState = !bean.checked.get()
|
bean.checked.set(!bean.checked.get())
|
||||||
bean.checked.set(newCheckedState)
|
|
||||||
|
|
||||||
// 联动勾选/取消所有子列表项
|
|
||||||
bean.storageUseList?.forEach { storageUse ->
|
|
||||||
storageUse.checked.set(newCheckedState)
|
|
||||||
}
|
|
||||||
|
|
||||||
binding.executePendingBindings()
|
binding.executePendingBindings()
|
||||||
binding.rvSub.adapter?.notifyDataSetChanged()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 展开按钮点击事件
|
// 展开按钮点击事件
|
||||||
|
|||||||
@@ -230,9 +230,13 @@ class IntImpStorageUseViewModel : BasePageViewModel() {
|
|||||||
return
|
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 = {
|
onSuccess = {
|
||||||
showToast("入库成功")
|
showToast("入库成功")
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
|
|||||||
@@ -104,7 +104,7 @@
|
|||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:text="@{bean.lastMftStatus ?? ``}"
|
android:text="@{bean.tallyStatus ?? ``}"
|
||||||
android:textColor="@color/colorPrimary"
|
android:textColor="@color/colorPrimary"
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user