feat: 出港计重 已计重
This commit is contained in:
@@ -12,6 +12,8 @@ import com.lukouguoji.module_base.ktx.launchCollect
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
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
|
||||
|
||||
/**
|
||||
* 国际出港计重记录 ViewModel
|
||||
@@ -25,6 +27,10 @@ class GjcWeighingRecordViewModel : BasePageViewModel() {
|
||||
val spCode = MutableLiveData("") // 特码
|
||||
val waybillNo = MutableLiveData("") // 运单号
|
||||
|
||||
// 下拉列表数据源
|
||||
val agentList = MutableLiveData(listOf(KeyValue("全部", "")))
|
||||
val spCodeList = MutableLiveData<List<KeyValue>>(emptyList())
|
||||
|
||||
// 适配器配置
|
||||
val itemViewHolder = GjcWeighingRecordViewHolder::class.java
|
||||
val itemLayoutId = R.layout.item_gjc_weighing_record
|
||||
@@ -39,6 +45,36 @@ class GjcWeighingRecordViewModel : BasePageViewModel() {
|
||||
// 方法区
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* 初始化代理人列表
|
||||
*/
|
||||
fun initAgentList() {
|
||||
launchCollect({
|
||||
NetApply.api.getIntExpAgentList()
|
||||
}) {
|
||||
onSuccess = { result ->
|
||||
val list = mutableListOf(KeyValue("全部", ""))
|
||||
result.data?.forEach {
|
||||
list.add(KeyValue(it.name ?: "", it.code ?: ""))
|
||||
}
|
||||
agentList.value = list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化特码列表
|
||||
*/
|
||||
fun initSpecialCodeList() {
|
||||
DictUtils.getSpecialCodeList(
|
||||
flag = 1, // 国际
|
||||
ieFlag = "", // 空字符串
|
||||
parentcode = "" // 无父级
|
||||
) {
|
||||
spCodeList.value = it
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 扫码输入航班号
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user