feat: 国际进港原始舱单列表页优化
- 运单号搜索支持输入4位自动查询,带航班日期和航班号额外参数 - 自动查询框架扩展extraParamsProvider,向后兼容旧业务 - 展开按钮移入白色卡片内部,统一为单卡片四圆角 - 子列表品名字段支持goodsCn为空时fallback到goods - 子列表调整列宽,品名列加大,其余列缩小并支持省略号截断 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -36,7 +36,11 @@ data class AutoQueryConfig(
|
|||||||
var title: String = "请选择",
|
var title: String = "请选择",
|
||||||
|
|
||||||
/** 防抖延迟(毫秒,默认 300ms) */
|
/** 防抖延迟(毫秒,默认 300ms) */
|
||||||
var debounceMillis: Long = 300L
|
var debounceMillis: Long = 300L,
|
||||||
|
|
||||||
|
/** 额外参数提供者(查询时动态获取额外参数,如航班日期、航班号等) */
|
||||||
|
@Transient
|
||||||
|
var extraParamsProvider: (() -> Map<String, String?>)? = null
|
||||||
) {
|
) {
|
||||||
/**
|
/**
|
||||||
* 验证配置是否有效
|
* 验证配置是否有效
|
||||||
|
|||||||
@@ -113,8 +113,12 @@ class AutoQueryManager(
|
|||||||
}
|
}
|
||||||
lastQueriedValue = value
|
lastQueriedValue = value
|
||||||
|
|
||||||
// 构建查询参数
|
// 构建查询参数(合并额外参数)
|
||||||
val params = mapOf(config.paramKey to value).toRequestBody()
|
val baseParams = mutableMapOf<String, Any?>(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) }) {
|
scope?.launchCollect({ NetApply.api.getWbNoList(config.url, params) }) {
|
||||||
|
|||||||
@@ -119,8 +119,12 @@ class SearchAutoQueryManager(
|
|||||||
}
|
}
|
||||||
lastQueriedValue = value
|
lastQueriedValue = value
|
||||||
|
|
||||||
// 构建查询参数
|
// 构建查询参数(合并额外参数)
|
||||||
val params = mapOf(config.paramKey to value).toRequestBody()
|
val baseParams = mutableMapOf<String, Any?>(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) }) {
|
scope?.launchCollect({ NetApply.api.getWbNoList(config.url, params) }) {
|
||||||
|
|||||||
@@ -45,6 +45,13 @@ class IntArrAirManifestActivity :
|
|||||||
viewModel.refresh()
|
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?) {
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||||
|
|||||||
@@ -49,8 +49,9 @@
|
|||||||
value="@={viewModel.flightNo}"
|
value="@={viewModel.flightNo}"
|
||||||
setUpperCaseAlphanumeric="@{true}" />
|
setUpperCaseAlphanumeric="@{true}" />
|
||||||
|
|
||||||
<!-- 运单号 (带扫码) -->
|
<!-- 运单号 (带扫码+自动查询) -->
|
||||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||||
|
android:id="@+id/psl_waybill_no"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
@@ -58,7 +59,13 @@
|
|||||||
icon="@{@drawable/img_scan}"
|
icon="@{@drawable/img_scan}"
|
||||||
setOnIconClickListener="@{(v)-> viewModel.scanWaybill()}"
|
setOnIconClickListener="@{(v)-> viewModel.scanWaybill()}"
|
||||||
type="@{SearchLayoutType.INPUT}"
|
type="@{SearchLayoutType.INPUT}"
|
||||||
value="@={viewModel.waybillNo}" />
|
value="@={viewModel.waybillNo}"
|
||||||
|
autoQueryEnabled="@{true}"
|
||||||
|
autoQueryUrl="@{`/IntImpAirManifest/queryWbNoList`}"
|
||||||
|
autoQueryParamKey="@{`wbNo`}"
|
||||||
|
autoQueryMinLength="@{4}"
|
||||||
|
autoQueryMaxLength="@{8}"
|
||||||
|
autoQueryTitle="@{`选择运单号`}" />
|
||||||
|
|
||||||
<!-- 分单号 (带扫码) -->
|
<!-- 分单号 (带扫码) -->
|
||||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||||
|
|||||||
@@ -27,12 +27,18 @@
|
|||||||
android:layout_marginVertical="5dp"
|
android:layout_marginVertical="5dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<!-- 白色卡片主要内容区域 -->
|
<!-- 白色卡片(包含内容区域 + 展开按钮,统一圆角) -->
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/bg_item"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!-- 主内容行 -->
|
||||||
<androidx.appcompat.widget.LinearLayoutCompat
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
android:id="@+id/ll"
|
android:id="@+id/ll"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/bg_item"
|
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:padding="10dp">
|
android:padding="10dp">
|
||||||
|
|
||||||
@@ -282,17 +288,17 @@
|
|||||||
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
<!-- 展开/折叠按钮(仅当有分单时显示) -->
|
<!-- 展开/折叠按钮(卡片内部底部) -->
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_show"
|
android:id="@+id/iv_show"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_marginBottom="5dp"
|
|
||||||
android:padding="5dp"
|
android:padding="5dp"
|
||||||
android:src="@mipmap/img_down"
|
android:src="@mipmap/img_down"
|
||||||
visible="@{bean.haWbList != null && !bean.haWbList.empty}" />
|
visible="@{bean.haWbList != null && !bean.haWbList.empty}" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
<!-- 分单子列表容器(淡绿色背景) -->
|
<!-- 分单子列表容器(淡绿色背景) -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
visible="@{bean.showMore}"
|
visible="@{bean.showMore}"
|
||||||
@@ -334,7 +340,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="0.8"
|
android:layout_weight="0.5"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="件数"
|
android:text="件数"
|
||||||
android:textColor="@color/text_normal"
|
android:textColor="@color/text_normal"
|
||||||
@@ -344,7 +350,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="0.8"
|
android:layout_weight="0.5"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="重量"
|
android:text="重量"
|
||||||
android:textColor="@color/text_normal"
|
android:textColor="@color/text_normal"
|
||||||
@@ -354,7 +360,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="0.8"
|
android:layout_weight="0.5"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="申报状态"
|
android:text="申报状态"
|
||||||
android:textColor="@color/text_normal"
|
android:textColor="@color/text_normal"
|
||||||
@@ -364,7 +370,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1.0"
|
android:layout_weight="2.0"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="品名(中)"
|
android:text="品名(中)"
|
||||||
android:textColor="@color/text_normal"
|
android:textColor="@color/text_normal"
|
||||||
@@ -374,7 +380,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="0.8"
|
android:layout_weight="0.5"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="申报次数"
|
android:text="申报次数"
|
||||||
android:textColor="@color/text_normal"
|
android:textColor="@color/text_normal"
|
||||||
@@ -384,7 +390,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="0.8"
|
android:layout_weight="0.5"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="申报费率"
|
android:text="申报费率"
|
||||||
android:textColor="@color/text_normal"
|
android:textColor="@color/text_normal"
|
||||||
@@ -394,7 +400,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="0.8"
|
android:layout_weight="0.5"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="删除次数"
|
android:text="删除次数"
|
||||||
android:textColor="@color/text_normal"
|
android:textColor="@color/text_normal"
|
||||||
@@ -404,7 +410,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="0.8"
|
android:layout_weight="0.5"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="删除费率"
|
android:text="删除费率"
|
||||||
android:textColor="@color/text_normal"
|
android:textColor="@color/text_normal"
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_weight="0.8"
|
android:layout_weight="0.5"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@{String.valueOf((int)bean.pc)}"
|
android:text="@{String.valueOf((int)bean.pc)}"
|
||||||
android:textColor="@color/text_normal"
|
android:textColor="@color/text_normal"
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_weight="0.8"
|
android:layout_weight="0.5"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@{String.valueOf((int)bean.weight)}"
|
android:text="@{String.valueOf((int)bean.weight)}"
|
||||||
android:textColor="@color/text_normal"
|
android:textColor="@color/text_normal"
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_weight="0.8"
|
android:layout_weight="0.5"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@{bean.mftStatus ?? ``}"
|
android:text="@{bean.mftStatus ?? ``}"
|
||||||
android:textColor="@color/colorPrimary"
|
android:textColor="@color/colorPrimary"
|
||||||
@@ -79,9 +79,11 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_weight="1.0"
|
android:layout_weight="2.0"
|
||||||
|
android:ellipsize="end"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@{bean.goodsCn ?? ``}"
|
android:maxLines="1"
|
||||||
|
android:text="@{bean.goodsCn != null && !bean.goodsCn.isEmpty() ? bean.goodsCn : (bean.goods ?? ``)}"
|
||||||
android:textColor="@color/text_normal"
|
android:textColor="@color/text_normal"
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp" />
|
||||||
|
|
||||||
@@ -90,7 +92,7 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_weight="0.8"
|
android:layout_weight="0.5"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@{String.valueOf((int)bean.mftSCount)}"
|
android:text="@{String.valueOf((int)bean.mftSCount)}"
|
||||||
android:textColor="@color/text_normal"
|
android:textColor="@color/text_normal"
|
||||||
@@ -101,7 +103,7 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_weight="0.8"
|
android:layout_weight="0.5"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@{String.valueOf(bean.mftSRate)}"
|
android:text="@{String.valueOf(bean.mftSRate)}"
|
||||||
android:textColor="@color/text_normal"
|
android:textColor="@color/text_normal"
|
||||||
@@ -112,7 +114,7 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_weight="0.8"
|
android:layout_weight="0.5"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@{String.valueOf((int)bean.mftDCount)}"
|
android:text="@{String.valueOf((int)bean.mftDCount)}"
|
||||||
android:textColor="@color/text_normal"
|
android:textColor="@color/text_normal"
|
||||||
@@ -123,7 +125,7 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_weight="0.8"
|
android:layout_weight="0.5"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@{String.valueOf(bean.mftDRate)}"
|
android:text="@{String.valueOf(bean.mftDRate)}"
|
||||||
android:textColor="@color/text_normal"
|
android:textColor="@color/text_normal"
|
||||||
|
|||||||
Reference in New Issue
Block a user