feat: 出港计重 特码 filter
This commit is contained in:
@@ -33,6 +33,9 @@ class GjcWeighingListActivity :
|
||||
// 初始化代理人列表(从API获取)
|
||||
viewModel.initAgentList()
|
||||
|
||||
// 初始化特码列表(从API获取)
|
||||
viewModel.initSpecialCodeList()
|
||||
|
||||
// 绑定分页逻辑
|
||||
viewModel.pageModel
|
||||
.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, getLifecycleOwner())
|
||||
|
||||
@@ -15,6 +15,7 @@ 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 com.lukouguoji.module_base.util.DictUtils
|
||||
import dev.utils.app.info.KeyValue
|
||||
|
||||
/**
|
||||
@@ -31,6 +32,7 @@ class GjcWeighingViewModel : BasePageViewModel() {
|
||||
|
||||
// 下拉列表数据源
|
||||
val agentList = MutableLiveData(listOf(KeyValue("全部", "")))
|
||||
val spCodeList = MutableLiveData<List<KeyValue>>(emptyList())
|
||||
|
||||
// 适配器配置
|
||||
val itemViewHolder = GjcWeighingViewHolder::class.java
|
||||
@@ -64,6 +66,19 @@ class GjcWeighingViewModel : BasePageViewModel() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化特码下拉列表(从API获取)
|
||||
*/
|
||||
fun initSpecialCodeList() {
|
||||
DictUtils.getSpecialCodeList(
|
||||
flag = 1, // 国际
|
||||
ieFlag = "", // 空字符串
|
||||
parentcode = "" // 无父级
|
||||
) {
|
||||
spCodeList.value = it
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 扫码输入航班号
|
||||
*/
|
||||
|
||||
@@ -63,6 +63,7 @@
|
||||
<!-- 择特码 -->
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
hint='@{"请选择特码"}'
|
||||
list="@{viewModel.spCodeList}"
|
||||
type="@{SearchLayoutType.SPINNER}"
|
||||
value="@={viewModel.spCode}"
|
||||
android:layout_width="0dp"
|
||||
|
||||
Reference in New Issue
Block a user