feat: 国际进港装机单列表改为 ULD 主单与运单子单结构

适配装机单查询接口按 ULD 分组的新返回结构,主单展示 ULD 编号、
总件数、总重量、航班信息,展开后显示关联运单的运单号、件数、重量、品名,
样式与展开交互与其他主子单列表一致;点击子单行进入装机单编辑。
右下角“修改库位”“入库”按钮暂时隐藏。同步修正进港舱单页修改库位时
从新分组结构中取运单记录。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-09-08 19:43:26 +08:00
parent 51c5ac6e96
commit 5edb1bea06
10 changed files with 374 additions and 247 deletions

View File

@@ -0,0 +1,36 @@
package com.lukouguoji.module_base.bean
import androidx.databinding.ObservableBoolean
import com.lukouguoji.module_base.interfaces.ICheck
import java.io.Serializable
/**
* 国际进港装机单 ULD 主单 Bean
* 对应接口:/IntImpManifest/pageQueryAir 返回的列表项(按 ULD 分组manifestList 为关联运单)
*/
data class GjjLoadingUld(
var uld: String? = null, // ULD 编号
var flight: String? = null, // 航班信息
var totalPc: Long? = null, // 总件数
var totalWeight: Double? = null, // 总重量
var manifestList: List<GjjManifest>? = null, // 关联运单列表
// 展开/收起状态
@Transient
val showMore: ObservableBoolean = ObservableBoolean(false),
// 选中状态
@Transient
val checked: ObservableBoolean = ObservableBoolean(false)
) : Serializable, ICheck {
override fun getCheckObservable(): ObservableBoolean = checked
var isSelected: Boolean
get() = checked.get()
set(value) = checked.set(value)
/** 总重量显示(取整) */
val totalWeightText: String
get() = ((totalWeight ?: 0.0).toInt()).toString()
}

View File

@@ -56,6 +56,7 @@ import com.lukouguoji.module_base.bean.IntImpAccidentVisaBean
import com.lukouguoji.module_base.bean.IntImpPickUpDLVBean import com.lukouguoji.module_base.bean.IntImpPickUpDLVBean
import com.lukouguoji.module_base.bean.IntImpPickUpRecordBean import com.lukouguoji.module_base.bean.IntImpPickUpRecordBean
import com.lukouguoji.module_base.bean.IntImpQueryBean import com.lukouguoji.module_base.bean.IntImpQueryBean
import com.lukouguoji.module_base.bean.GjjLoadingUld
import com.lukouguoji.module_base.bean.GjjManifest import com.lukouguoji.module_base.bean.GjjManifest
import com.lukouguoji.module_base.bean.GjjManifestBean import com.lukouguoji.module_base.bean.GjjManifestBean
import com.lukouguoji.module_base.bean.GjjPackTypeBean import com.lukouguoji.module_base.bean.GjjPackTypeBean
@@ -1956,10 +1957,10 @@ interface Api {
suspend fun getMaWbMinusHaWb(@Body data: RequestBody): BaseResultBean<GjjHaWb> suspend fun getMaWbMinusHaWb(@Body data: RequestBody): BaseResultBean<GjjHaWb>
/** /**
* 国际进港舱单-分拣理货(装机单)-分页查询 * 国际进港舱单-分拣理货(装机单)-分页查询(按 ULD 分组manifestList 为关联运单)
*/ */
@POST("IntImpManifest/pageQueryAir") @POST("IntImpManifest/pageQueryAir")
suspend fun getIntImpLoadingList(@Body data: RequestBody): PageInfo<GjjManifest> suspend fun getIntImpLoadingList(@Body data: RequestBody): PageInfo<GjjLoadingUld>
/** /**
* 国际进港舱单-分拣理货(装机单)-分页合计 * 国际进港舱单-分拣理货(装机单)-分页合计

View File

@@ -10,13 +10,11 @@ import com.lukouguoji.gjj.dialog.IntImpInStorageDialogModel
import com.lukouguoji.gjj.dialog.IntImpModifyStorageDialogModel import com.lukouguoji.gjj.dialog.IntImpModifyStorageDialogModel
import com.lukouguoji.gjj.viewModel.IntImpLoadingListViewModel import com.lukouguoji.gjj.viewModel.IntImpLoadingListViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.bean.GjjManifest
import com.lukouguoji.module_base.common.Constant import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.common.ConstantEvent import com.lukouguoji.module_base.common.ConstantEvent
import com.lukouguoji.module_base.impl.FlowBus import com.lukouguoji.module_base.impl.FlowBus
import com.lukouguoji.module_base.impl.observe import com.lukouguoji.module_base.impl.observe
import com.lukouguoji.module_base.ktx.addOnItemClickListener import com.lukouguoji.module_base.ktx.addOnItemClickListener
import com.lukouguoji.module_base.ktx.commonAdapter
import com.lukouguoji.module_base.ktx.showToast import com.lukouguoji.module_base.ktx.showToast
import com.lukouguoji.module_base.router.ARouterConstants import com.lukouguoji.module_base.router.ARouterConstants
@@ -78,8 +76,7 @@ class IntImpLoadingListActivity :
* 显示入库操作对话框 * 显示入库操作对话框
*/ */
fun showInStorageDialog() { fun showInStorageDialog() {
val list = viewModel.pageModel.rv?.commonAdapter()?.items as? List<*> ?: return val selectedItems = viewModel.getSelectedManifests()
val selectedItems = list.filterIsInstance<GjjManifest>().filter { it.isSelected }
if (selectedItems.isEmpty()) { if (selectedItems.isEmpty()) {
showToast("请选择要入库的记录") showToast("请选择要入库的记录")
@@ -97,8 +94,7 @@ class IntImpLoadingListActivity :
* 显示修改库位对话框 * 显示修改库位对话框
*/ */
fun showModifyStorageDialog() { fun showModifyStorageDialog() {
val list = viewModel.pageModel.rv?.commonAdapter()?.items as? List<*> ?: return val selectedItems = viewModel.getSelectedManifests()
val selectedItems = list.filterIsInstance<GjjManifest>().filter { it.isSelected }
if (selectedItems.isEmpty()) { if (selectedItems.isEmpty()) {
showToast("请选择要修改库位的记录") showToast("请选择要修改库位的记录")

View File

@@ -0,0 +1,26 @@
package com.lukouguoji.gjj.holder
import android.view.View
import com.lukouguoji.gjj.activity.IntImpLoadingListEditActivity
import com.lukouguoji.gjj.databinding.ItemIntImpLoadingListSubBinding
import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.bean.GjjManifest
/**
* 国际进港装机单 关联运单(子单) ViewHolder
*/
class IntImpLoadingListSubViewHolder(view: View) :
BaseViewHolder<GjjManifest, ItemIntImpLoadingListSubBinding>(view) {
override fun onBind(item: Any?, position: Int) {
val bean = getItemBean(item) ?: return
binding.bean = bean
binding.position = position + 1
binding.executePendingBindings()
// 点击运单行进入装机单编辑
binding.llRow.setOnClickListener {
IntImpLoadingListEditActivity.start(itemView.context, bean)
}
}
}

View File

@@ -1,17 +1,20 @@
package com.lukouguoji.gjj.holder package com.lukouguoji.gjj.holder
import android.view.View import android.view.View
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.databinding.ItemIntImpLoadingListBinding import com.lukouguoji.gjj.databinding.ItemIntImpLoadingListBinding
import com.lukouguoji.module_base.adapter.setCommonAdapter
import com.lukouguoji.module_base.base.BaseViewHolder import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.bean.GjjLoadingUld
import com.lukouguoji.module_base.common.ConstantEvent import com.lukouguoji.module_base.common.ConstantEvent
import com.lukouguoji.module_base.impl.FlowBus import com.lukouguoji.module_base.impl.FlowBus
import com.lukouguoji.module_base.bean.GjjManifest import com.lukouguoji.module_base.ktx.refresh
/** /**
* 国际进港装机单 ViewHolder * 国际进港装机单 ULD 主单 ViewHolder
*/ */
class IntImpLoadingListViewHolder(view: View) : class IntImpLoadingListViewHolder(view: View) :
BaseViewHolder<GjjManifest, ItemIntImpLoadingListBinding>(view) { BaseViewHolder<GjjLoadingUld, ItemIntImpLoadingListBinding>(view) {
override fun onBind(item: Any?, position: Int) { override fun onBind(item: Any?, position: Int) {
val bean = getItemBean(item) ?: return val bean = getItemBean(item) ?: return
@@ -26,10 +29,35 @@ class IntImpLoadingListViewHolder(view: View) :
binding.executePendingBindings() binding.executePendingBindings()
} }
// 侧滑菜单 - 编辑按钮 // 展开/收起关联运单
binding.btnEdit.setOnClickListener { binding.ivShow.setOnClickListener {
binding.swipeMenu.quickClose() bean.showMore.set(!bean.showMore.get())
clickListener?.onItemClick(position, 2000) }
// 初始化子列表 RecyclerView
setCommonAdapter(
binding.rvSub,
IntImpLoadingListSubViewHolder::class.java,
R.layout.item_int_imp_loading_list_sub
)
// 刷新子列表数据
val subList = bean.manifestList ?: emptyList()
binding.rvSub.refresh(subList)
updateSubListVisibility(subList.isNotEmpty())
}
private fun updateSubListVisibility(hasData: Boolean) {
if (hasData) {
binding.llHeader.visibility = View.VISIBLE
binding.dividerHeader.visibility = View.VISIBLE
binding.rvSub.visibility = View.VISIBLE
binding.tvEmpty.visibility = View.GONE
} else {
binding.llHeader.visibility = View.GONE
binding.dividerHeader.visibility = View.GONE
binding.rvSub.visibility = View.GONE
binding.tvEmpty.visibility = View.VISIBLE
} }
} }
} }

View File

@@ -5,6 +5,7 @@ import androidx.lifecycle.viewModelScope
import com.lukouguoji.gjj.R import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.holder.IntImpLoadingListViewHolder import com.lukouguoji.gjj.holder.IntImpLoadingListViewHolder
import com.lukouguoji.module_base.base.BasePageViewModel import com.lukouguoji.module_base.base.BasePageViewModel
import com.lukouguoji.module_base.bean.GjjLoadingUld
import com.lukouguoji.module_base.bean.GjjManifest import com.lukouguoji.module_base.bean.GjjManifest
import com.lukouguoji.module_base.common.Constant import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.common.ConstantEvent import com.lukouguoji.module_base.common.ConstantEvent
@@ -115,10 +116,18 @@ class IntImpLoadingListViewModel : BasePageViewModel(), IOnItemClickListener {
} }
fun updateCheckAllStatus() { fun updateCheckAllStatus() {
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjManifest> ?: return val list = pageModel.rv?.commonAdapter()?.items as? List<GjjLoadingUld> ?: return
isAllChecked.value = list.isNotEmpty() && list.all { it.checked.get() } isAllChecked.value = list.isNotEmpty() && list.all { it.checked.get() }
} }
/**
* 获取选中 ULD 下的全部运单(供修改库位/入库使用)
*/
fun getSelectedManifests(): List<GjjManifest> {
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjLoadingUld> ?: return emptyList()
return list.filter { it.checked.get() }.flatMap { it.manifestList ?: emptyList() }
}
// ========== 适配器配置 ========== // ========== 适配器配置 ==========
val itemViewHolder = IntImpLoadingListViewHolder::class.java val itemViewHolder = IntImpLoadingListViewHolder::class.java
val itemLayoutId = R.layout.item_int_imp_loading_list val itemLayoutId = R.layout.item_int_imp_loading_list
@@ -191,7 +200,7 @@ class IntImpLoadingListViewModel : BasePageViewModel(), IOnItemClickListener {
* 全选按钮点击(切换全选状态) * 全选按钮点击(切换全选状态)
*/ */
fun checkAllClick() { fun checkAllClick() {
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjManifest> ?: return val list = pageModel.rv?.commonAdapter()?.items as? List<GjjLoadingUld> ?: return
// 切换全选状态 // 切换全选状态
val shouldCheckAll = !isAllChecked.value!! val shouldCheckAll = !isAllChecked.value!!
@@ -280,17 +289,9 @@ class IntImpLoadingListViewModel : BasePageViewModel(), IOnItemClickListener {
} }
/** /**
* 列表项点击回调(侧滑菜单 * 列表项点击回调(运单编辑已改为在子列表 ViewHolder 中直接跳转
*/ */
override fun onItemClick(position: Int, type: Int) { override fun onItemClick(position: Int, type: Int) {
when (type) {
2000 -> {
// 编辑操作
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjManifest> ?: return
val bean = list.getOrNull(position) ?: return
com.lukouguoji.gjj.activity.IntImpLoadingListEditActivity.start(getTopActivity(), bean)
}
}
} }
/** /**

View File

@@ -509,7 +509,10 @@ class IntImpManifestViewModel : BasePageViewModel() {
launchLoadingCollect({ NetApply.api.getIntImpLoadingList(queryParams) }) { launchLoadingCollect({ NetApply.api.getIntImpLoadingList(queryParams) }) {
onSuccess = { result -> onSuccess = { result ->
val tallyRecord = result.list?.firstOrNull() // 装机单接口已按 ULD 分组,运单记录在 manifestList 中
val tallyRecord = result.list
?.flatMap { it.manifestList ?: emptyList() }
?.let { list -> list.firstOrNull { it.wbNo == selectedItem.wbNo || it.getWaybillNo() == selectedItem.wbNo } ?: list.firstOrNull() }
showModifyStorageDialog( showModifyStorageDialog(
selectedItems = selectedItems, selectedItems = selectedItems,
currentLocationId = tallyRecord?.locationTallyId?.takeIf { it > 0 }?.toString() ?: "", currentLocationId = tallyRecord?.locationTallyId?.takeIf { it > 0 }?.toString() ?: "",

View File

@@ -207,7 +207,7 @@
</LinearLayout> </LinearLayout>
<!-- 修改库位按钮 (蓝色) --> <!-- 修改库位按钮 (蓝色):暂时隐藏 -->
<TextView <TextView
android:layout_width="100dp" android:layout_width="100dp"
android:layout_height="40dp" android:layout_height="40dp"
@@ -218,9 +218,10 @@
android:onClick="@{()-> activity.showModifyStorageDialog()}" android:onClick="@{()-> activity.showModifyStorageDialog()}"
android:text="修改库位" android:text="修改库位"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="18sp" /> android:textSize="18sp"
android:visibility="gone" />
<!-- 入库按钮 (蓝色) --> <!-- 入库按钮 (蓝色):暂时隐藏 -->
<TextView <TextView
android:layout_width="100dp" android:layout_width="100dp"
android:layout_height="40dp" android:layout_height="40dp"
@@ -230,7 +231,8 @@
android:onClick="@{()-> activity.showInStorageDialog()}" android:onClick="@{()-> activity.showInStorageDialog()}"
android:text="入库" android:text="入库"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="18sp" /> android:textSize="18sp"
android:visibility="gone" />
</LinearLayout> </LinearLayout>

View File

@@ -8,55 +8,56 @@
<variable <variable
name="bean" name="bean"
type="com.lukouguoji.module_base.bean.GjjManifest" /> type="com.lukouguoji.module_base.bean.GjjLoadingUld" />
<variable <variable
name="position" name="position"
type="Integer" /> type="Integer" />
</data> </data>
<com.mcxtzhang.swipemenulib.SwipeMenuLayout <LinearLayout
android:id="@+id/swipe_menu"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginHorizontal="10dp" android:layout_marginHorizontal="10dp"
android:layout_marginTop="10dp"> android:layout_marginTop="10dp"
android:orientation="vertical">
<!-- 主内容区域 --> <!-- 白色卡片ULD 主单 -->
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/bg_white_radius_8" android:background="@drawable/bg_white_radius_8"
android:orientation="horizontal" android:orientation="vertical">
android:paddingVertical="20dp"
android:paddingHorizontal="10dp"
android:gravity="center_vertical">
<!-- 选中图标(飞机图标,根据选择状态切换图片) --> <!-- 主要内容区域 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="10dp"
android:paddingVertical="20dp">
<!-- 选中图标 (飞机图标,根据选择状态切换图片) -->
<ImageView <ImageView
android:id="@+id/iv_icon" android:id="@+id/iv_icon"
loadImage="@{bean.checked.get() ? @drawable/img_plane_s : @drawable/img_plane}"
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_gravity="center" android:layout_gravity="center"
loadImage="@{bean.checked.get() ? @drawable/img_plane_s : @drawable/img_plane}" android:layout_marginTop="0.5px"
android:src="@drawable/img_plane" /> android:src="@drawable/img_plane" />
<!-- 舱单信息区域 --> <!-- ULD 信息区域ULD编号、总件数、总重量、航班信息 -->
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:layout_weight="1" android:layout_weight="1"
android:orientation="vertical">
<!-- 第一行运单号、始发站、ULD编号、总件数、件数 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<!-- 运单号 (weight=1.0) --> <!-- ULD编号 -->
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@@ -65,260 +66,207 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
completeSpace="@{5}"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
completeSpace="@{5}" android:text="ULD编号"
android:text="运单号:" android:textColor="@color/text_normal"
android:textSize="15sp" /> android:textSize="15sp" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@{bean.getWaybillNo()}" android:text="@{bean.uld}"
android:textColor="@color/colorPrimary" android:textColor="@color/colorPrimary"
android:textSize="15sp" android:textSize="15sp"
android:textStyle="bold" /> android:textStyle="bold" />
</LinearLayout> </LinearLayout>
<!-- 始发站 (weight=1) --> <!-- 总件数 -->
<LinearLayout <LinearLayout
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="0.8"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
completeSpace="@{4}" completeSpace="@{4}"
android:text="始发站:"
android:textSize="15sp" />
<TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@{bean.origin}"
android:textSize="15sp" />
</LinearLayout>
<!-- ULD编号 (weight=1.0) -->
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
completeSpace="@{5}"
android:text="ULD编号"
android:textSize="15sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.locationMft}"
android:textSize="15sp" />
</LinearLayout>
<!-- 总件数 (weight=1) -->
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
completeSpace="@{4}"
android:text="总件数:" android:text="总件数:"
android:textColor="@color/text_normal"
android:textSize="15sp" /> android:textSize="15sp" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@{String.valueOf(bean.totalPc)}" android:text="@{bean.totalPc == null ? `0` : String.valueOf(bean.totalPc)}"
android:textColor="@color/text_normal"
android:textSize="15sp" /> android:textSize="15sp" />
</LinearLayout> </LinearLayout>
<!-- 件数 (weight=1) --> <!-- 总重量 -->
<LinearLayout <LinearLayout
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="0.8"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
completeSpace="@{4}"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
completeSpace="@{5}" android:text="总重量:"
android:text="件数:" android:textColor="@color/text_normal"
android:textSize="15sp" /> android:textSize="15sp" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@{String.valueOf(bean.pc)}" android:text="@{bean.totalWeightText}"
android:textColor="@color/text_normal"
android:textSize="15sp" />
</LinearLayout>
<!-- 航班信息 -->
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.2"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
completeSpace="@{5}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="航班信息:"
android:textColor="@color/text_normal"
android:textSize="15sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:lines="1"
android:maxLines="1"
android:text="@{bean.flight}"
android:textColor="@color/text_normal"
android:textSize="15sp" /> android:textSize="15sp" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<!-- 第二行:品名、代理、库位号、重量、计费重量 --> </LinearLayout>
<!-- 展开按钮 -->
<ImageView
android:id="@+id/iv_show"
android:layout_width="match_parent"
android:layout_height="20dp"
android:layout_marginTop="-20dp"
android:paddingVertical="2.5dp"
android:rotation="@{bean.showMore.get() ? 180f : 0f}"
android:scaleType="center"
android:src="@mipmap/img_down" />
</LinearLayout>
<!-- 子单列表容器(关联运单,白色圆角卡片) -->
<LinearLayout <LinearLayout
visible="@{bean.showMore}"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:gravity="center_vertical" android:background="@drawable/bg_white_radius_8"
android:orientation="horizontal"> android:orientation="vertical"
android:visibility="gone">
<!-- 品名 (weight=1.0) --> <!-- 暂无数据提示 -->
<TextView
android:id="@+id/tv_empty"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingVertical="15dp"
android:text="暂无运单数据"
android:textColor="@color/text_gray"
android:textSize="14sp"
android:visibility="gone" />
<!-- 表头 -->
<LinearLayout <LinearLayout
android:id="@+id/ll_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_arrive_sub_header"
android:orientation="horizontal"
android:paddingHorizontal="10dp"
android:paddingVertical="10dp">
<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="1.2"
android:gravity="center_vertical" android:gravity="center"
android:orientation="horizontal"> android:text="运单号"
android:textColor="@color/text_normal"
android:textSize="14sp"
android:textStyle="bold" />
<TextView <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
completeSpace="@{5}"
android:text="品名(中)"
android:textSize="15sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.goodsCn}"
android:textSize="15sp" />
</LinearLayout>
<!-- 代理 (weight=1) -->
<LinearLayout
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="0.8"
android:gravity="center_vertical" android:gravity="center"
android:orientation="horizontal"> android:text="件数"
android:textColor="@color/text_normal"
android:textSize="14sp"
android:textStyle="bold" />
<TextView <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
completeSpace="@{4}"
android:text="代理:"
android:textSize="15sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.agentCode}"
android:textSize="15sp" />
</LinearLayout>
<!-- 库位号 (weight=1.0) -->
<LinearLayout
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="0.8"
android:gravity="center_vertical" android:gravity="center"
android:orientation="horizontal"> android:text="重量"
android:textColor="@color/text_normal"
android:textSize="14sp"
android:textStyle="bold" />
<TextView <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
completeSpace="@{5}"
android:text="库位号:"
android:textSize="15sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.locationTally}"
android:textSize="15sp" />
</LinearLayout>
<!-- 重量 (weight=1) -->
<LinearLayout
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="2"
android:gravity="center_vertical" android:gravity="center"
android:orientation="horizontal"> android:text="品名"
android:textColor="@color/text_normal"
<TextView android:textSize="14sp"
android:layout_width="wrap_content" android:textStyle="bold" />
android:layout_height="wrap_content"
completeSpace="@{4}"
android:text="重量:"
android:textSize="15sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{String.valueOf((int)bean.weight)}"
android:textSize="15sp" />
</LinearLayout> </LinearLayout>
<!-- 计费重量 (weight=1) --> <com.google.android.material.divider.MaterialDivider
<LinearLayout android:id="@+id/divider_header"
android:layout_width="0dp" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="1px"
android:layout_weight="1" app:dividerColor="@color/sub_list_divider" />
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView <!-- 子列表 RecyclerView -->
android:layout_width="wrap_content" <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_sub"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
completeSpace="@{5}" app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
android:text="计费重量:"
android:textSize="15sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{String.valueOf((int)bean.cashWeight)}"
android:textSize="15sp" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout>
</LinearLayout>
<!-- 侧滑菜单区域 -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal">
<!-- 编辑按钮 -->
<TextView
android:id="@+id/btn_edit"
style="@style/tv_item_action"
android:background="@color/colorPrimary"
android:text="编辑" />
</androidx.appcompat.widget.LinearLayoutCompat>
</com.mcxtzhang.swipemenulib.SwipeMenuLayout>
</layout> </layout>

View File

@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="bean"
type="com.lukouguoji.module_base.bean.GjjManifest" />
<variable
name="position"
type="Integer" />
</data>
<LinearLayout
android:id="@+id/ll_row"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="8dp"
android:orientation="horizontal"
android:paddingHorizontal="10dp">
<!-- 运单号 -->
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1.2"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:text="@{bean.getWaybillNo()}"
android:textColor="@color/text_normal"
android:textSize="14sp" />
<!-- 件数 -->
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="0.8"
android:gravity="center"
android:text="@{String.valueOf(bean.pc)}"
android:textColor="@color/text_normal"
android:textSize="14sp" />
<!-- 重量 -->
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="0.8"
android:gravity="center"
android:text="@{String.valueOf((int)bean.weight)}"
android:textColor="@color/text_normal"
android:textSize="14sp" />
<!-- 品名 -->
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="2"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:text="@{bean.goodsCn.isEmpty() ? bean.goods : bean.goodsCn}"
android:textColor="@color/text_normal"
android:textSize="14sp" />
</LinearLayout>
<com.google.android.material.divider.MaterialDivider
android:layout_width="match_parent"
android:layout_height="1px"
app:dividerColor="@color/sub_list_divider" />
</LinearLayout>
</layout>