refactor: 国际出港查询筛选面板去掉出库状态筛选项
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -44,15 +44,6 @@ class GjcQueryViewModel : BasePageViewModel() {
|
|||||||
// 代理下拉列表(从API获取)
|
// 代理下拉列表(从API获取)
|
||||||
val agentList = MutableLiveData(listOf(KeyValue("全部", "")))
|
val agentList = MutableLiveData(listOf(KeyValue("全部", "")))
|
||||||
|
|
||||||
// 出库状态下拉列表
|
|
||||||
val outStatusList = MutableLiveData(
|
|
||||||
listOf(
|
|
||||||
KeyValue("全部", ""),
|
|
||||||
KeyValue("未出库", "0"),
|
|
||||||
KeyValue("已出库", "1")
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
// ==================== 适配器配置 ====================
|
// ==================== 适配器配置 ====================
|
||||||
val itemViewHolder = GjcQueryViewHolder::class.java
|
val itemViewHolder = GjcQueryViewHolder::class.java
|
||||||
val itemLayoutId = R.layout.item_gjc_query
|
val itemLayoutId = R.layout.item_gjc_query
|
||||||
@@ -80,7 +71,6 @@ class GjcQueryViewModel : BasePageViewModel() {
|
|||||||
|
|
||||||
// ==================== 筛选条件 ====================
|
// ==================== 筛选条件 ====================
|
||||||
val spCode = MutableLiveData("") // 特码
|
val spCode = MutableLiveData("") // 特码
|
||||||
val outStatus = MutableLiveData("") // 出库状态
|
|
||||||
val dest = MutableLiveData("") // 目的港
|
val dest = MutableLiveData("") // 目的港
|
||||||
val awbType = MutableLiveData("") // 运单类型
|
val awbType = MutableLiveData("") // 运单类型
|
||||||
val businessType = MutableLiveData("") // 业务类型
|
val businessType = MutableLiveData("") // 业务类型
|
||||||
@@ -89,11 +79,10 @@ class GjcQueryViewModel : BasePageViewModel() {
|
|||||||
// 是否有筛选条件(任意一个非空则为 true,用于筛选按钮红点)
|
// 是否有筛选条件(任意一个非空则为 true,用于筛选按钮红点)
|
||||||
val hasFilter: MediatorLiveData<Boolean> = MediatorLiveData<Boolean>().apply {
|
val hasFilter: MediatorLiveData<Boolean> = MediatorLiveData<Boolean>().apply {
|
||||||
val update = { _: Any? ->
|
val update = { _: Any? ->
|
||||||
value = listOf(spCode, outStatus, dest, awbType, businessType, goodsCn)
|
value = listOf(spCode, dest, awbType, businessType, goodsCn)
|
||||||
.any { !it.value.isNullOrEmpty() }
|
.any { !it.value.isNullOrEmpty() }
|
||||||
}
|
}
|
||||||
addSource(spCode, update)
|
addSource(spCode, update)
|
||||||
addSource(outStatus, update)
|
|
||||||
addSource(dest, update)
|
addSource(dest, update)
|
||||||
addSource(awbType, update)
|
addSource(awbType, update)
|
||||||
addSource(businessType, update)
|
addSource(businessType, update)
|
||||||
@@ -137,7 +126,6 @@ class GjcQueryViewModel : BasePageViewModel() {
|
|||||||
*/
|
*/
|
||||||
fun resetFilter() {
|
fun resetFilter() {
|
||||||
spCode.value = ""
|
spCode.value = ""
|
||||||
outStatus.value = ""
|
|
||||||
dest.value = ""
|
dest.value = ""
|
||||||
awbType.value = ""
|
awbType.value = ""
|
||||||
businessType.value = ""
|
businessType.value = ""
|
||||||
@@ -181,7 +169,6 @@ class GjcQueryViewModel : BasePageViewModel() {
|
|||||||
"wbNo" to waybillNo.value?.ifEmpty { null },
|
"wbNo" to waybillNo.value?.ifEmpty { null },
|
||||||
// 筛选面板条件
|
// 筛选面板条件
|
||||||
"spCode" to spCode.value?.ifEmpty { null },
|
"spCode" to spCode.value?.ifEmpty { null },
|
||||||
"outState" to outStatus.value?.ifEmpty { null }?.toIntOrNull(),
|
|
||||||
"dest" to dest.value?.ifEmpty { null },
|
"dest" to dest.value?.ifEmpty { null },
|
||||||
"awbType" to awbType.value?.ifEmpty { null },
|
"awbType" to awbType.value?.ifEmpty { null },
|
||||||
"businessType" to businessType.value?.ifEmpty { null },
|
"businessType" to businessType.value?.ifEmpty { null },
|
||||||
|
|||||||
@@ -67,18 +67,6 @@
|
|||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.INPUT}"
|
||||||
value='@={viewModel.spCode}' />
|
value='@={viewModel.spCode}' />
|
||||||
|
|
||||||
<!-- 出库状态 -->
|
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="10dp"
|
|
||||||
hint='@{"请选择出库状态"}'
|
|
||||||
list="@{viewModel.outStatusList}"
|
|
||||||
title='@{"出库状态"}'
|
|
||||||
titleLength="@{4}"
|
|
||||||
type="@{DataLayoutType.SPINNER}"
|
|
||||||
value='@={viewModel.outStatus}' />
|
|
||||||
|
|
||||||
<!-- 目的港 -->
|
<!-- 目的港 -->
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
android:id="@+id/filter_dest"
|
android:id="@+id/filter_dest"
|
||||||
|
|||||||
Reference in New Issue
Block a user