feat: 国际出港 出港仓库
This commit is contained in:
@@ -109,7 +109,6 @@ data class GjcMaWb(
|
|||||||
|
|
||||||
// ==================== 关联列表(非数据库字段,用于展示) ====================
|
// ==================== 关联列表(非数据库字段,用于展示) ====================
|
||||||
var haWbList: List<GjcHaWb>? = null, // 分单列表
|
var haWbList: List<GjcHaWb>? = null, // 分单列表
|
||||||
@Transient
|
|
||||||
var storageUseList: List<GjcStorageUse>? = null, // 库位使用列表
|
var storageUseList: List<GjcStorageUse>? = null, // 库位使用列表
|
||||||
@Transient
|
@Transient
|
||||||
var attachList: List<ComAttach>? = null // 附件列表
|
var attachList: List<ComAttach>? = null // 附件列表
|
||||||
@@ -277,10 +276,10 @@ data class GjcStorageUse(
|
|||||||
var location: String? = null, // 库位号
|
var location: String? = null, // 库位号
|
||||||
var storageCode: String? = null, // 库位号(兼容字段)
|
var storageCode: String? = null, // 库位号(兼容字段)
|
||||||
var uld: String? = null, // 板箱号
|
var uld: String? = null, // 板箱号
|
||||||
var inDate: Date? = null, // 入库时间
|
var inDate: String? = null, // 入库时间
|
||||||
var inOpId: String? = null, // 入库人
|
var inOpId: String? = null, // 入库人
|
||||||
var inId: String? = null, // 入库人(兼容字段)
|
var inId: String? = null, // 入库人(兼容字段)
|
||||||
var outDate: Date? = null, // 出库时间
|
var outDate: String? = null, // 出库时间
|
||||||
var outOpId: String? = null, // 出库人
|
var outOpId: String? = null, // 出库人
|
||||||
var outId: String? = null // 出库人(兼容字段)
|
var outId: String? = null // 出库人(兼容字段)
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -42,6 +42,14 @@ class IntExpStorageUseViewModel : BasePageViewModel() {
|
|||||||
// ========== 全选状态 ==========
|
// ========== 全选状态 ==========
|
||||||
val isAllChecked = MutableLiveData(false)
|
val isAllChecked = MutableLiveData(false)
|
||||||
|
|
||||||
|
// ========== 全局展开状态 ==========
|
||||||
|
/**
|
||||||
|
* 全局展开状态
|
||||||
|
* - true: 全部展开
|
||||||
|
* - false: 全部收起
|
||||||
|
*/
|
||||||
|
val isAllExpanded = MutableLiveData(false)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
// 初始化清仓综合结果列表(根据实际需求配置)
|
// 初始化清仓综合结果列表(根据实际需求配置)
|
||||||
clearResultList.value = listOf(
|
clearResultList.value = listOf(
|
||||||
@@ -82,6 +90,28 @@ class IntExpStorageUseViewModel : BasePageViewModel() {
|
|||||||
pageModel.rv?.commonAdapter()?.notifyDataSetChanged()
|
pageModel.rv?.commonAdapter()?.notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 切换全局展开/收起状态
|
||||||
|
*/
|
||||||
|
fun toggleAllExpand() {
|
||||||
|
val list = pageModel.rv?.commonAdapter()?.items as? List<GjcMaWb> ?: return
|
||||||
|
|
||||||
|
// 切换全局状态
|
||||||
|
val shouldExpand = !isAllExpanded.value!!
|
||||||
|
isAllExpanded.value = shouldExpand
|
||||||
|
|
||||||
|
// 更新所有列表项的 showMore 状态
|
||||||
|
list.forEach { bean ->
|
||||||
|
// 只有当有子列表时才设置展开状态
|
||||||
|
if (!bean.storageUseList.isNullOrEmpty()) {
|
||||||
|
bean.showMore.set(shouldExpand)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 刷新列表UI
|
||||||
|
pageModel.rv?.commonAdapter()?.notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 扫码运单号
|
* 扫码运单号
|
||||||
*/
|
*/
|
||||||
@@ -180,6 +210,8 @@ class IntExpStorageUseViewModel : BasePageViewModel() {
|
|||||||
// 手动处理 PageInfo 数据
|
// 手动处理 PageInfo 数据
|
||||||
pageModel.handleDataList(result.list)
|
pageModel.handleDataList(result.list)
|
||||||
pageModel.haveMore.postValue((result.pages) > pageModel.page)
|
pageModel.haveMore.postValue((result.pages) > pageModel.page)
|
||||||
|
// 数据加载完成后,重置全局展开状态为收起
|
||||||
|
isAllExpanded.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
|
|
||||||
<import type="com.lukouguoji.module_base.ui.weight.search.layout.SearchLayoutType" />
|
<import type="com.lukouguoji.module_base.ui.weight.search.layout.SearchLayoutType" />
|
||||||
|
|
||||||
|
<import type="com.lukouguoji.gjc.R" />
|
||||||
|
|
||||||
<variable
|
<variable
|
||||||
name="viewModel"
|
name="viewModel"
|
||||||
type="com.lukouguoji.gjc.viewModel.IntExpStorageUseViewModel" />
|
type="com.lukouguoji.gjc.viewModel.IntExpStorageUseViewModel" />
|
||||||
@@ -87,7 +89,7 @@
|
|||||||
|
|
||||||
<!-- 搜索按钮 -->
|
<!-- 搜索按钮 -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="200dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
@@ -100,6 +102,17 @@
|
|||||||
android:padding="2dp"
|
android:padding="2dp"
|
||||||
android:src="@drawable/img_search" />
|
android:src="@drawable/img_search" />
|
||||||
|
|
||||||
|
<!-- 全局展开/收起按钮 -->
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:onClick="@{()-> viewModel.toggleAllExpand()}"
|
||||||
|
android:padding="2dp"
|
||||||
|
android:scaleType="fitCenter"
|
||||||
|
loadImage="@{viewModel.isAllExpanded ? R.mipmap.img_up : R.mipmap.img_down}"
|
||||||
|
android:contentDescription="展开/收起全部子列表" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -156,7 +156,7 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="0.7"
|
android:layout_weight="0.6"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -275,7 +275,7 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="0.7"
|
android:layout_weight="0.6"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_weight="1.5"
|
android:layout_weight="1.5"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@{bean.inDate != null ? bean.inDate.toString() : ``}"
|
android:text="@{bean.inDate ?? ``}"
|
||||||
android:textColor="@color/text_normal"
|
android:textColor="@color/text_normal"
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp" />
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@
|
|||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_weight="1.5"
|
android:layout_weight="1.5"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@{bean.outDate != null ? bean.outDate.toString() : ``}"
|
android:text="@{bean.outDate ?? ``}"
|
||||||
android:textColor="@color/text_normal"
|
android:textColor="@color/text_normal"
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user