feat: 国际出港 出港仓库 opt filter
This commit is contained in:
@@ -1,25 +1,21 @@
|
||||
package com.lukouguoji.gjc.viewModel
|
||||
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.lukouguoji.gjc.R
|
||||
import com.lukouguoji.gjc.holder.IntExpStorageUseViewHolder
|
||||
import com.lukouguoji.module_base.base.BasePageViewModel
|
||||
import com.lukouguoji.module_base.bean.GjcMaWb
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.common.ConstantEvent
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.impl.FlowBus
|
||||
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||
import com.lukouguoji.module_base.ktx.formatDate
|
||||
import com.lukouguoji.module_base.ktx.launchCollect
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.ktx.showToast
|
||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||
import com.lukouguoji.module_base.model.ScanModel
|
||||
import dev.utils.app.info.KeyValue
|
||||
import kotlinx.coroutines.launch
|
||||
import java.util.Date
|
||||
import com.lukouguoji.module_base.ktx.formatDate
|
||||
|
||||
/**
|
||||
* 国际出港-仓库 ViewModel
|
||||
@@ -32,7 +28,7 @@ class IntExpStorageUseViewModel : BasePageViewModel() {
|
||||
val clearResult = MutableLiveData("") // 清仓综合结果
|
||||
val clearResultList = MutableLiveData<List<KeyValue>>() // 清仓综合结果列表
|
||||
val wbNo = MutableLiveData("") // 运单号
|
||||
val storageCode = MutableLiveData("") // 库位号
|
||||
val location = MutableLiveData("") // 库位号
|
||||
|
||||
// ========== 统计信息 ==========
|
||||
val totalWbNumber = MutableLiveData("0") // 总票数
|
||||
@@ -60,7 +56,8 @@ class IntExpStorageUseViewModel : BasePageViewModel() {
|
||||
|
||||
// 监听全选状态,自动更新所有列表项
|
||||
isAllChecked.observeForever { checked ->
|
||||
val list = pageModel.rv?.commonAdapter()?.items as? List<GjcMaWb> ?: return@observeForever
|
||||
val list =
|
||||
pageModel.rv?.commonAdapter()?.items as? List<GjcMaWb> ?: return@observeForever
|
||||
list.forEach { it.checked.set(checked) }
|
||||
pageModel.rv?.commonAdapter()?.notifyDataSetChanged()
|
||||
}
|
||||
@@ -192,7 +189,7 @@ class IntExpStorageUseViewModel : BasePageViewModel() {
|
||||
"fdate" to flightDate.value?.ifEmpty { null },
|
||||
"fno" to flightNo.value?.ifEmpty { null },
|
||||
"wbNo" to wbNo.value?.ifEmpty { null },
|
||||
"storageCode" to storageCode.value?.ifEmpty { null }
|
||||
"location" to location.value?.ifEmpty { null }
|
||||
)
|
||||
|
||||
// 列表参数 (含分页)
|
||||
|
||||
@@ -44,9 +44,9 @@
|
||||
<!-- 航班号 -->
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请输入航班号"}'
|
||||
setUpperCaseAlphanumeric="@{true}"
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={viewModel.flightNo}"
|
||||
setUpperCaseAlphanumeric="@{true}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
@@ -63,17 +63,17 @@
|
||||
|
||||
<!-- 运单号 -->
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
autoQueryEnabled="@{true}"
|
||||
autoQueryMaxLength="@{8}"
|
||||
autoQueryMinLength="@{4}"
|
||||
autoQueryParamKey="@{`wbNo`}"
|
||||
autoQueryTitle="@{`选择运单号`}"
|
||||
autoQueryUrl="@{`/IntExpStorageUse/queryWbNoList`}"
|
||||
hint='@{"请输入运单号"}'
|
||||
icon="@{@drawable/img_scan}"
|
||||
setOnIconClickListener="@{(v)-> viewModel.scanWbNo()}"
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={viewModel.wbNo}"
|
||||
autoQueryEnabled="@{true}"
|
||||
autoQueryUrl="@{`/IntExpStorageUse/queryWbNoList`}"
|
||||
autoQueryParamKey="@{`wbNo`}"
|
||||
autoQueryMinLength="@{4}"
|
||||
autoQueryMaxLength="@{8}"
|
||||
autoQueryTitle="@{`选择运单号`}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
@@ -82,7 +82,7 @@
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请输入库位号"}'
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={viewModel.storageCode}"
|
||||
value="@={viewModel.location}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
@@ -104,14 +104,14 @@
|
||||
|
||||
<!-- 全局展开/收起按钮 -->
|
||||
<ImageView
|
||||
loadImage="@{viewModel.isAllExpanded ? R.mipmap.img_up : R.mipmap.img_down}"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:contentDescription="展开/收起全部子列表"
|
||||
android:onClick="@{()-> viewModel.toggleAllExpand()}"
|
||||
android:padding="2dp"
|
||||
android:scaleType="fitCenter"
|
||||
loadImage="@{viewModel.isAllExpanded ? R.mipmap.img_up : R.mipmap.img_down}"
|
||||
android:contentDescription="展开/收起全部子列表" />
|
||||
android:scaleType="fitCenter" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user