feat: 国际出港开始组装板型下拉对接后端板型接口
进入页面调用 /typeCode/bordType 取全量板型,选中待组装运单后 以航班号前两位作 carrier 重新加载覆盖下拉数据源;后端 carrier 必填,无承运人时传空串。替换原 BOARDTYPE 字典实现。 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -574,6 +574,14 @@ interface Api {
|
|||||||
@POST("typeCode/assembleCompany")
|
@POST("typeCode/assembleCompany")
|
||||||
suspend fun getAssembleCompanyList(): BaseResultBean<List<AssembleCompanyBean>>
|
suspend fun getAssembleCompanyList(): BaseResultBean<List<AssembleCompanyBean>>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取板型下拉列表(国际出港组装-开始组装)
|
||||||
|
* 接口路径: /typeCode/bordType(后端路径即为 bordType,非 boardType,2026-09-11 实测 boardType 返回 404)
|
||||||
|
* @param carrier 承运人二字码(取待组装运单航班号前两位);该参数后端必填(缺省返回 400),进入页面时传空串
|
||||||
|
*/
|
||||||
|
@POST("typeCode/bordType")
|
||||||
|
suspend fun getBoardTypeList(@Query("carrier") carrier: String): DictListBean
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际出港板箱过磅-分页搜索
|
* 国际出港板箱过磅-分页搜索
|
||||||
* 接口路径: /IntExpWeighting/pageQuery
|
* 接口路径: /IntExpWeighting/pageQuery
|
||||||
|
|||||||
@@ -627,15 +627,16 @@ object DictUtils {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 板型列表(国际出港组装-开始组装)
|
* 板型列表(国际出港组装-开始组装)
|
||||||
* 字典 code:BOARDTYPE;显示与提交均使用 value 字段
|
* 接口 /typeCode/bordType
|
||||||
|
* @param carrier 承运人二字码(运单航班号前两位);为空时传空串(后端该参数必填,不传返回 400)
|
||||||
*/
|
*/
|
||||||
fun getBoardTypeList(callBack: (List<KeyValue>) -> Unit) {
|
fun getBoardTypeList(carrier: String? = null, callBack: (List<KeyValue>) -> Unit) {
|
||||||
launchCollect({
|
launchCollect({
|
||||||
NetApply.api
|
NetApply.api
|
||||||
.getDictList("BOARDTYPE")
|
.getBoardTypeList(carrier?.trim() ?: "")
|
||||||
}) {
|
}) {
|
||||||
onSuccess = {
|
onSuccess = {
|
||||||
callBack((it.data ?: emptyList()).map { b -> KeyValue(b.value, b.value) })
|
callBack(it.data?.map { b -> b.toKeyValue() } ?: emptyList())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -271,6 +271,9 @@ class IntExpAssembleStartViewModel : BaseViewModel() {
|
|||||||
assembleWeight = previousAssembleWeight
|
assembleWeight = previousAssembleWeight
|
||||||
operator = previousOperator // 从operator LiveData获取的值
|
operator = previousOperator // 从operator LiveData获取的值
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 按该运单航班号前两位(承运人)重新加载板型选项,覆盖下拉数据源
|
||||||
|
loadBoardTypeList(selectedWaybill.fno.trim().take(2))
|
||||||
}
|
}
|
||||||
|
|
||||||
// 刷新列表
|
// 刷新列表
|
||||||
@@ -415,10 +418,11 @@ class IntExpAssembleStartViewModel : BaseViewModel() {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加载板型选项列表(字典)
|
* 加载板型选项列表
|
||||||
|
* @param carrier 承运人二字码(待组装运单航班号前两位);进入页面时不传,选中运单后按承运人重新加载并覆盖数据源
|
||||||
*/
|
*/
|
||||||
fun loadBoardTypeList() {
|
fun loadBoardTypeList(carrier: String? = null) {
|
||||||
DictUtils.getBoardTypeList { boardTypeList.value = it }
|
DictUtils.getBoardTypeList(carrier) { boardTypeList.value = it }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user