feat: 国际进出港 5 个列表页侧滑新增海关回执查看
原始舱单、进港理货、出港运抵、出港装载、出港理货主单卡片 新增侧滑「回执」按钮,调用各模块 getResponse 接口后跳转 module_base 共用的只读回执页。请求同时传 prefix、no 与 wbNo,回执优先取 data、为空再取 msg,兼容后端实际返回; 回执为空时提示「暂无海关回执」不跳转。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,7 @@ import com.lukouguoji.module_base.common.ConstantEvent
|
||||
import com.lukouguoji.module_base.impl.FlowBus
|
||||
import com.lukouguoji.module_base.bean.GjjAirManifest
|
||||
import com.lukouguoji.module_base.ktx.refresh
|
||||
import com.lukouguoji.module_base.ktx.ITEM_CLICK_TYPE_CUSTOMS_RESPONSE
|
||||
|
||||
/**
|
||||
* 国际进港原始舱单 ViewHolder
|
||||
@@ -25,6 +26,12 @@ class IntArrAirManifestViewHolder(view: View) :
|
||||
binding.position = position
|
||||
binding.executePendingBindings()
|
||||
|
||||
// 侧滑菜单 - 回执按钮(关闭侧滑后分发到 ViewModel)
|
||||
binding.btnResponse.setOnClickListener {
|
||||
binding.swipeMenu.quickClose()
|
||||
clickListener?.onItemClick(position, ITEM_CLICK_TYPE_CUSTOMS_RESPONSE)
|
||||
}
|
||||
|
||||
// 整卡点击 - 跳转详情页
|
||||
notifyItemClick(position, binding.ll)
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.google.gson.Gson
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.ktx.launchCollect
|
||||
import com.lukouguoji.module_base.ktx.refresh
|
||||
import com.lukouguoji.module_base.ktx.ITEM_CLICK_TYPE_CUSTOMS_RESPONSE
|
||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||
|
||||
/**
|
||||
@@ -27,6 +28,12 @@ class IntImpTallyViewHolder(view: View) :
|
||||
binding.position = position
|
||||
binding.executePendingBindings()
|
||||
|
||||
// 侧滑菜单 - 回执按钮(关闭侧滑后分发到 ViewModel)
|
||||
binding.btnResponse.setOnClickListener {
|
||||
binding.swipeMenu.quickClose()
|
||||
clickListener?.onItemClick(position, ITEM_CLICK_TYPE_CUSTOMS_RESPONSE)
|
||||
}
|
||||
|
||||
// 选中图标点击 - 切换选择状态(独立选择,不联动分单)
|
||||
binding.ivIcon.setOnClickListener {
|
||||
bean.checked.set(!bean.checked.get())
|
||||
|
||||
@@ -16,6 +16,9 @@ import com.lukouguoji.gjj.dialog.IntImpTallyResetDialogModel
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.impl.FlowBus
|
||||
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||
import com.lukouguoji.module_base.ktx.CustomsResponseUrl
|
||||
import com.lukouguoji.module_base.ktx.ITEM_CLICK_TYPE_CUSTOMS_RESPONSE
|
||||
import com.lukouguoji.module_base.ktx.showCustomsResponse
|
||||
import com.lukouguoji.module_base.ktx.launchCollect
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.ktx.showToast
|
||||
@@ -293,10 +296,19 @@ class IntArrAirManifestViewModel : BasePageViewModel() {
|
||||
// 获取主单数据
|
||||
val manifest = airManifest.maWb ?: return
|
||||
|
||||
// 跳转到详情页
|
||||
com.lukouguoji.gjj.activity.IntArrAirManifestDetailsActivity.start(
|
||||
getTopActivity(),
|
||||
manifest
|
||||
)
|
||||
when (type) {
|
||||
// 侧滑「回执」按钮:查询海关回执并跳转只读详情页
|
||||
ITEM_CLICK_TYPE_CUSTOMS_RESPONSE -> showCustomsResponse(
|
||||
CustomsResponseUrl.INT_IMP_AIR_MANIFEST,
|
||||
manifest.prefix,
|
||||
manifest.no,
|
||||
"原始舱单回执"
|
||||
)
|
||||
// 整卡点击(type 为 view id):跳转到详情页
|
||||
else -> com.lukouguoji.gjj.activity.IntArrAirManifestDetailsActivity.start(
|
||||
getTopActivity(),
|
||||
manifest
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,9 @@ import com.lukouguoji.module_base.common.ConstantEvent
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.impl.FlowBus
|
||||
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||
import com.lukouguoji.module_base.ktx.CustomsResponseUrl
|
||||
import com.lukouguoji.module_base.ktx.ITEM_CLICK_TYPE_CUSTOMS_RESPONSE
|
||||
import com.lukouguoji.module_base.ktx.showCustomsResponse
|
||||
import com.lukouguoji.module_base.ktx.launchCollect
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.ktx.showToast
|
||||
@@ -289,4 +292,14 @@ class IntImpTallyViewModel : BasePageViewModel() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表项点击分发:侧滑「回执」按钮 → 查询海关回执并跳转只读详情页
|
||||
*/
|
||||
override fun onItemClick(position: Int, type: Int) {
|
||||
val bean = pageModel.rv?.commonAdapter()?.getItem(position) as? GjjImportTally ?: return
|
||||
if (type == ITEM_CLICK_TYPE_CUSTOMS_RESPONSE) {
|
||||
showCustomsResponse(CustomsResponseUrl.INT_IMP_TALLY, bean.prefix, bean.no, "进港理货回执")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
android:layout_marginVertical="5dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 侧滑布局:白色卡片(含展开按钮)+ 侧滑菜单 -->
|
||||
<com.mcxtzhang.swipemenulib.SwipeMenuLayout
|
||||
android:id="@+id/swipe_menu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<!-- 白色卡片(包含内容区域 + 展开按钮,统一圆角) -->
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
@@ -323,6 +329,23 @@
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<!-- 侧滑菜单区 -->
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- 回执按钮 -->
|
||||
<TextView
|
||||
android:id="@+id/btnResponse"
|
||||
style="@style/tv_item_action"
|
||||
android:background="@color/colorPrimary"
|
||||
android:text="回执" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.mcxtzhang.swipemenulib.SwipeMenuLayout>
|
||||
|
||||
<!-- 分单子列表容器(淡绿色背景) -->
|
||||
<LinearLayout
|
||||
visible="@{bean.showMore}"
|
||||
|
||||
@@ -24,6 +24,12 @@
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 侧滑布局:白色卡片(含展开按钮)+ 侧滑菜单 -->
|
||||
<com.mcxtzhang.swipemenulib.SwipeMenuLayout
|
||||
android:id="@+id/swipe_menu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<!-- 白色卡片主要内容区域 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -339,6 +345,23 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 侧滑菜单区 -->
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- 回执按钮 -->
|
||||
<TextView
|
||||
android:id="@+id/btnResponse"
|
||||
style="@style/tv_item_action"
|
||||
android:background="@color/colorPrimary"
|
||||
android:text="回执" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.mcxtzhang.swipemenulib.SwipeMenuLayout>
|
||||
|
||||
<!-- 分单子列表容器(在白色卡片外面) -->
|
||||
<LinearLayout
|
||||
visible="@{bean.showMore}"
|
||||
|
||||
Reference in New Issue
Block a user