feat: 国际进港仓库清仓弹框新增备注并在列表第三行显示
清仓时备注同时通过 clearRemark query 参数和运单字段发送,兼容服务端两种取值方式; 列表项新增独占一行的备注展示,与国际出港仓库保持一致。 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -983,7 +983,11 @@ interface Api {
|
||||
* 接口路径: /IntImpStorage/updateClear
|
||||
*/
|
||||
@POST("IntImpStorage/updateClear")
|
||||
suspend fun clearIntImpStorage(@Query("clearNormal") clearNormal: String, @Body data: RequestBody): BaseResultBean<Boolean>
|
||||
suspend fun clearIntImpStorage(
|
||||
@Query("clearNormal") clearNormal: String,
|
||||
@Query("clearRemark") clearRemark: String?,
|
||||
@Body data: RequestBody
|
||||
): BaseResultBean<Boolean>
|
||||
|
||||
/**
|
||||
* 国际进港库位操作-修改库位
|
||||
|
||||
@@ -78,7 +78,8 @@ class IntImpStorageUseActivity :
|
||||
|
||||
IntImpMoveClearDialogModel { dialog ->
|
||||
val clearNormal = dialog.clearNormal.value ?: ""
|
||||
viewModel.performClear(clearNormal, maWbListForClear)
|
||||
val clearRemark = dialog.clearRemark.value ?: ""
|
||||
viewModel.performClear(clearNormal, clearRemark, maWbListForClear)
|
||||
}.show(this)
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,9 @@ class IntImpMoveClearDialogModel(
|
||||
// 清仓正常(存储的是 code:"0" 或 "1")
|
||||
val clearNormal = MutableLiveData("")
|
||||
|
||||
// 清仓备注(选填)
|
||||
val clearRemark = MutableLiveData("")
|
||||
|
||||
// 清仓正常选项列表
|
||||
val clearNormalList = MutableLiveData<List<KeyValue>>().apply {
|
||||
value = listOf(
|
||||
|
||||
@@ -117,16 +117,22 @@ class IntImpStorageUseViewModel : BasePageViewModel() {
|
||||
|
||||
/**
|
||||
* 执行清仓操作
|
||||
* @param clearNormal 清仓正常("0"或"1")
|
||||
* @param clearRemark 清仓备注(选填)
|
||||
* @param maWbListForClear 包含选中子列表项的主列表数据
|
||||
*/
|
||||
fun performClear(clearNormal: String, maWbListForClear: List<GjcMaWb>) {
|
||||
fun performClear(clearNormal: String, clearRemark: String, maWbListForClear: List<GjcMaWb>) {
|
||||
if (maWbListForClear.isEmpty()) {
|
||||
showToast("请至少选择一个库位")
|
||||
return
|
||||
}
|
||||
|
||||
// 备注同时通过 query 参数和主单字段传递,兼容服务端两种取值方式
|
||||
val remark = clearRemark.ifEmpty { null }
|
||||
maWbListForClear.forEach { it.clearRemark = remark }
|
||||
val body = maWbListForClear.toRequestBody()
|
||||
|
||||
launchLoadingCollect({ NetApply.api.clearIntImpStorage(clearNormal, body) }) {
|
||||
launchLoadingCollect({ NetApply.api.clearIntImpStorage(clearNormal, remark, body) }) {
|
||||
onSuccess = {
|
||||
showToast("清仓成功")
|
||||
viewModelScope.launch {
|
||||
|
||||
@@ -61,6 +61,32 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 备注 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
completeSpace="@{5}"
|
||||
android:text="备注:"
|
||||
android:textColor="@color/text_normal"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
hint='@{"请输入备注"}'
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={model.clearRemark}" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 底部按钮 -->
|
||||
|
||||
@@ -303,6 +303,29 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 第三行:清仓备注(独占整行) -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
completeSpace="@{4}"
|
||||
android:text="备注:"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@{bean.clearRemark}"
|
||||
android:textSize="15sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
Reference in New Issue
Block a user