diff --git a/module_gjj/src/main/java/com/lukouguoji/gjj/viewModel/IntImpStorageUseViewModel.kt b/module_gjj/src/main/java/com/lukouguoji/gjj/viewModel/IntImpStorageUseViewModel.kt index 5f8e803..e3ab16e 100644 --- a/module_gjj/src/main/java/com/lukouguoji/gjj/viewModel/IntImpStorageUseViewModel.kt +++ b/module_gjj/src/main/java/com/lukouguoji/gjj/viewModel/IntImpStorageUseViewModel.kt @@ -18,7 +18,6 @@ import com.lukouguoji.module_base.ktx.noNull 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 import kotlinx.coroutines.launch @@ -47,27 +46,10 @@ class IntImpStorageUseViewModel : BasePageViewModel() { // 筛选弹层显隐 val filterVisible = MutableLiveData(false) - // 筛选条件(fdep 为接口入参;其余 5 项为后端未定义入参,预留传参,见接口问题清单 #25) - val fdep = MutableLiveData("") // 始发站 - val agentId = MutableLiveData("") // 代理(agentCode,预留) - val spCode = MutableLiveData("") // 特码(预留) - val awbType = MutableLiveData("") // 运单类型(预留) - val businessType = MutableLiveData("") // 业务类型(预留) - val goodsCn = MutableLiveData("") // 品名(中)(预留) + // 筛选弹层与平板端查询参数保持一致(后端确认):航班日期 / 航班号 / 库位 / 清仓结果,运单号/航班号走顶部搜索框。 + // 始发站/代理/特码/运单类型/业务类型/品名 后端不支持(内网实测 fdep/agentCode 被忽略),已移除 - // 筛选下拉字典(initPhoneExtras 加载,平板不请求) - val agentList = MutableLiveData(listOf(KeyValue("全部", ""))) - val specialCodeList = MutableLiveData>(emptyList()) - val awbTypeList = MutableLiveData>(emptyList()) - val businessTypeList = MutableLiveData( - listOf( - KeyValue("全部", ""), - KeyValue("普货", "1"), - KeyValue("特货", "2") - ) - ) - - // 三格统计:未清仓 / 已清仓(复用 pageQueryTotal 按 clearNormal=0/1 各查一次) + // 三格统计:未清仓 / 已清仓,直接取 pageQueryTotal 出参 notClearNumber / clearNumber val unclearedCount = MutableLiveData("0") val clearedCount = MutableLiveData("0") @@ -79,18 +61,6 @@ class IntImpStorageUseViewModel : BasePageViewModel() { */ fun initPhoneExtras() { phoneExtrasEnabled = true - // 代理(国际进港口径) - DictUtils.getIntImpAgentList(addAll = false) { list -> - agentList.postValue(listOf(KeyValue("全部", "")) + list) - } - // 特码:flag=1 国际;ieFlag 必须留空 - DictUtils.getSpecialCodeList(addAll = false, flag = 1, ieFlag = "") { list -> - specialCodeList.postValue(listOf(KeyValue("全部", "")) + list) - } - // 运单类型(type=II 国际进港) - DictUtils.getWaybillTypeList(type = Constant.businessType.II, addAll = true) { - awbTypeList.postValue(it) - } } /** @@ -129,12 +99,8 @@ class IntImpStorageUseViewModel : BasePageViewModel() { fun resetFilter() { flightDate.value = "" flightNo.value = "" - fdep.value = "" - agentId.value = "" - spCode.value = "" - awbType.value = "" - businessType.value = "" - goodsCn.value = "" + location.value = "" + clearResult.value = "" } /** 确认筛选 - 关闭面板并刷新 */ @@ -354,20 +320,13 @@ class IntImpStorageUseViewModel : BasePageViewModel() { } override fun getData() { - // 手机专属 6 项平板恒为空,不进请求;agentCode/spCode/awbType/businessType/goodsCn - // 为 pageQuery 未定义入参(后端静默忽略,补齐后自动生效,见接口问题清单 #25) + // 查询条件与平板端一致 val filterParams = mapOf( "fdate" to flightDate.value?.ifEmpty { null }, "fno" to flightNo.value?.ifEmpty { null }, "wbNo" to wbNo.value?.ifEmpty { null }, "location" to location.value?.ifEmpty { null }, - "clearNormal" to clearResult.value?.ifEmpty { null }, - "fdep" to fdep.value?.ifEmpty { null }, - "agentCode" to agentId.value?.ifEmpty { null }, - "spCode" to spCode.value?.ifEmpty { null }, - "awbType" to awbType.value?.ifEmpty { null }, - "businessType" to businessType.value?.ifEmpty { null }, - "goodsCn" to goodsCn.value?.ifEmpty { null } + "clearNormal" to clearResult.value?.ifEmpty { null } ) val listParams = (filterParams + mapOf( @@ -391,18 +350,9 @@ class IntImpStorageUseViewModel : BasePageViewModel() { totalWbNumber.value = (data?.wbNumber ?: 0).toString() totalPc.value = (data?.totalPc ?: 0).toString() totalWeight.value = (data?.totalWeight ?: 0.0).toString() - } - } - - // 手机专属:未清仓/已清仓分项统计(同条件 + clearNormal=0/1 各查一次,平板不发) - if (phoneExtrasEnabled) { - val unclearedParams = (filterParams + mapOf("clearNormal" to "0")).toRequestBody() - launchCollect({ NetApply.api.getIntImpStorageUseTotal(unclearedParams) }) { - onSuccess = { unclearedCount.value = (it.data?.wbNumber ?: 0).toString() } - } - val clearedParams = (filterParams + mapOf("clearNormal" to "1")).toRequestBody() - launchCollect({ NetApply.api.getIntImpStorageUseTotal(clearedParams) }) { - onSuccess = { clearedCount.value = (it.data?.wbNumber ?: 0).toString() } + // 手机三格统计分项(平板布局不绑定,无影响) + unclearedCount.value = (data?.notClearNumber ?: 0).toString() + clearedCount.value = (data?.clearNumber ?: 0).toString() } } } diff --git a/module_gjj/src/main/res/layout/activity_int_imp_storage_use.xml b/module_gjj/src/main/res/layout/activity_int_imp_storage_use.xml index b9df685..12432a5 100644 --- a/module_gjj/src/main/res/layout/activity_int_imp_storage_use.xml +++ b/module_gjj/src/main/res/layout/activity_int_imp_storage_use.xml @@ -11,7 +11,7 @@ · 平板独有的 checkIcon(底部全选)手机版不提供,Binding 基类中自动变 @Nullable 交互差异(均复用既有 IntExpStorageUseViewModel 字段与接口): - · 平板 5 个横排搜索条 → 手机顶部搜索框(运单号)+ 底部筛选弹层 8 项 + · 平板 5 个横排搜索条 → 手机顶部搜索框(运单号)+ 底部筛选弹层 4 项(航班日期/航班号/库位/清仓结果,与平板查询参数一致) (设计稿弹层无「库位号/清仓结果」两项,对应平板字段保持空值不参与请求) · 三格统计(总票数/未清仓/已清仓),后两格为手机专属统计请求(initPhoneExtras 开启, 复用 pageQueryTotal 按 clearNormal=0/1 各查一次) @@ -235,7 +235,7 @@ - + - + - - - - - - + value="@={viewModel.location}" /> - + - - - - - - + value="@={viewModel.clearResult}" /> diff --git a/module_gjj/src/main/res/layout/fragment_int_imp_query_waybill.xml b/module_gjj/src/main/res/layout/fragment_int_imp_query_waybill.xml index 0bd2ca5..626e03a 100644 --- a/module_gjj/src/main/res/layout/fragment_int_imp_query_waybill.xml +++ b/module_gjj/src/main/res/layout/fragment_int_imp_query_waybill.xml @@ -12,8 +12,8 @@ 数据全部来自既有 viewModel.maWbData(IntImpSearch/detail 的 maWb Map), 取值统一走 viewModel.str()/dec() 帮助方法(空值兜底 "-")。 字段 key 以平板变体既有绑定为准(awbPc/awbWeight/cashWeight/inPc/inWeight/lockStateText/ - mftStatus/tallyStatus/command);始发站/中转站/目的站/UN编号/入库时间为设计稿新增展示, - key(dep/dest1/dest/unNumber/opDate)按出港同名字段推断,实机核对后如缺失记入问题清单。 + mftStatus/tallyStatus/command);后端确认按平板端展示(问题清单 #27): + 航程 range(无经停站,替代始发站/中转站/目的站)、UN编号 unNumber、出库时间 dlvTime。 --> @@ -121,7 +121,7 @@ - + - - - - - - - - - + title='@{"航程"}' + value='@{viewModel.str(viewModel.maWbData, "range")}' /> - + + title='@{"出库时间"}' + value='@{viewModel.str(viewModel.maWbData, "dlvTime")}' />