From 15e13e8e12d82764a23b41078842c45a057676e4 Mon Sep 17 00:00:00 2001 From: YANGJIANKUAN Date: Mon, 9 Mar 2026 10:32:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9B=BD=E9=99=85=E8=BF=9B=E6=B8=AF?= =?UTF-8?q?=E5=8E=9F=E5=A7=8B=E8=88=B1=E5=8D=95=E5=88=97=E8=A1=A8=E9=A1=B5?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 运单号搜索支持输入4位自动查询,带航班日期和航班号额外参数 - 自动查询框架扩展extraParamsProvider,向后兼容旧业务 - 展开按钮移入白色卡片内部,统一为单卡片四圆角 - 子列表品名字段支持goodsCn为空时fallback到goods - 子列表调整列宽,品名列加大,其余列缩小并支持省略号截断 Co-Authored-By: Claude Opus 4.6 --- .../ui/weight/data/layout/AutoQueryConfig.kt | 6 +- .../ui/weight/data/layout/AutoQueryManager.kt | 8 +- .../layout/manager/SearchAutoQueryManager.kt | 8 +- .../gjj/activity/IntArrAirManifestActivity.kt | 7 + .../layout/activity_int_arr_air_manifest.xml | 11 +- .../res/layout/item_int_arr_air_manifest.xml | 486 +++++++++--------- .../layout/item_int_arr_air_manifest_sub.xml | 20 +- 7 files changed, 290 insertions(+), 256 deletions(-) diff --git a/module_base/src/main/java/com/lukouguoji/module_base/ui/weight/data/layout/AutoQueryConfig.kt b/module_base/src/main/java/com/lukouguoji/module_base/ui/weight/data/layout/AutoQueryConfig.kt index f764c49..c785786 100644 --- a/module_base/src/main/java/com/lukouguoji/module_base/ui/weight/data/layout/AutoQueryConfig.kt +++ b/module_base/src/main/java/com/lukouguoji/module_base/ui/weight/data/layout/AutoQueryConfig.kt @@ -36,7 +36,11 @@ data class AutoQueryConfig( var title: String = "请选择", /** 防抖延迟(毫秒,默认 300ms) */ - var debounceMillis: Long = 300L + var debounceMillis: Long = 300L, + + /** 额外参数提供者(查询时动态获取额外参数,如航班日期、航班号等) */ + @Transient + var extraParamsProvider: (() -> Map)? = null ) { /** * 验证配置是否有效 diff --git a/module_base/src/main/java/com/lukouguoji/module_base/ui/weight/data/layout/AutoQueryManager.kt b/module_base/src/main/java/com/lukouguoji/module_base/ui/weight/data/layout/AutoQueryManager.kt index f95b662..74d2cc4 100644 --- a/module_base/src/main/java/com/lukouguoji/module_base/ui/weight/data/layout/AutoQueryManager.kt +++ b/module_base/src/main/java/com/lukouguoji/module_base/ui/weight/data/layout/AutoQueryManager.kt @@ -113,8 +113,12 @@ class AutoQueryManager( } lastQueriedValue = value - // 构建查询参数 - val params = mapOf(config.paramKey to value).toRequestBody() + // 构建查询参数(合并额外参数) + val baseParams = mutableMapOf(config.paramKey to value) + config.extraParamsProvider?.invoke()?.forEach { (key, v) -> + if (!v.isNullOrEmpty()) baseParams[key] = v + } + val params = baseParams.toRequestBody() // 发起网络请求 scope?.launchCollect({ NetApply.api.getWbNoList(config.url, params) }) { diff --git a/module_base/src/main/java/com/lukouguoji/module_base/ui/weight/search/layout/manager/SearchAutoQueryManager.kt b/module_base/src/main/java/com/lukouguoji/module_base/ui/weight/search/layout/manager/SearchAutoQueryManager.kt index fd8c0d4..f912fa9 100644 --- a/module_base/src/main/java/com/lukouguoji/module_base/ui/weight/search/layout/manager/SearchAutoQueryManager.kt +++ b/module_base/src/main/java/com/lukouguoji/module_base/ui/weight/search/layout/manager/SearchAutoQueryManager.kt @@ -119,8 +119,12 @@ class SearchAutoQueryManager( } lastQueriedValue = value - // 构建查询参数 - val params = mapOf(config.paramKey to value).toRequestBody() + // 构建查询参数(合并额外参数) + val baseParams = mutableMapOf(config.paramKey to value) + config.extraParamsProvider?.invoke()?.forEach { (key, v) -> + if (!v.isNullOrEmpty()) baseParams[key] = v + } + val params = baseParams.toRequestBody() // 发起网络请求 scope?.launchCollect({ NetApply.api.getWbNoList(config.url, params) }) { diff --git a/module_gjj/src/main/java/com/lukouguoji/gjj/activity/IntArrAirManifestActivity.kt b/module_gjj/src/main/java/com/lukouguoji/gjj/activity/IntArrAirManifestActivity.kt index 859ba0d..ca52faf 100644 --- a/module_gjj/src/main/java/com/lukouguoji/gjj/activity/IntArrAirManifestActivity.kt +++ b/module_gjj/src/main/java/com/lukouguoji/gjj/activity/IntArrAirManifestActivity.kt @@ -45,6 +45,13 @@ class IntArrAirManifestActivity : viewModel.refresh() } + // 设置运单号自动查询的额外参数(航班日期、航班号) + binding.pslWaybillNo.autoQueryConfig.extraParamsProvider = { + mapOf( + "fdate" to viewModel.flightDate.value, + "fno" to viewModel.flightNo.value + ) + } } override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { diff --git a/module_gjj/src/main/res/layout/activity_int_arr_air_manifest.xml b/module_gjj/src/main/res/layout/activity_int_arr_air_manifest.xml index d684fae..95662ef 100644 --- a/module_gjj/src/main/res/layout/activity_int_arr_air_manifest.xml +++ b/module_gjj/src/main/res/layout/activity_int_arr_air_manifest.xml @@ -49,8 +49,9 @@ value="@={viewModel.flightNo}" setUpperCaseAlphanumeric="@{true}" /> - + + value="@={viewModel.waybillNo}" + autoQueryEnabled="@{true}" + autoQueryUrl="@{`/IntImpAirManifest/queryWbNoList`}" + autoQueryParamKey="@{`wbNo`}" + autoQueryMinLength="@{4}" + autoQueryMaxLength="@{8}" + autoQueryTitle="@{`选择运单号`}" /> - + + android:orientation="vertical"> - - - - - + + android:orientation="horizontal" + android:padding="10dp"> - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + android:layout_marginLeft="10dp" + android:layout_weight="1" + android:orientation="vertical"> - + + android:layout_width="match_parent" + android:layout_height="wrap_content"> - + + android:layout_weight="1.0" + android:gravity="center_vertical"> - + + + + + + + + android:layout_weight="0.8" + android:gravity="center_vertical"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + android:layout_marginTop="10dp"> - + + android:layout_weight="1.0" + android:gravity="center_vertical"> - + + + + + + + + android:layout_weight="0.8" + android:gravity="center_vertical"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - + + android:id="@+id/iv_show" + android:layout_width="match_parent" + android:layout_height="20dp" + android:padding="5dp" + android:src="@mipmap/img_down" + visible="@{bean.haWbList != null && !bean.haWbList.empty}" /> - - - @@ -90,7 +92,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="center_vertical" - android:layout_weight="0.8" + android:layout_weight="0.5" android:gravity="center" android:text="@{String.valueOf((int)bean.mftSCount)}" android:textColor="@color/text_normal" @@ -101,7 +103,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="center_vertical" - android:layout_weight="0.8" + android:layout_weight="0.5" android:gravity="center" android:text="@{String.valueOf(bean.mftSRate)}" android:textColor="@color/text_normal" @@ -112,7 +114,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="center_vertical" - android:layout_weight="0.8" + android:layout_weight="0.5" android:gravity="center" android:text="@{String.valueOf((int)bean.mftDCount)}" android:textColor="@color/text_normal" @@ -123,7 +125,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="center_vertical" - android:layout_weight="0.8" + android:layout_weight="0.5" android:gravity="center" android:text="@{String.valueOf(bean.mftDRate)}" android:textColor="@color/text_normal"