feat: 国际出港-出港装载 opt
This commit is contained in:
@@ -47,17 +47,4 @@ class GjcExportLoad {
|
|||||||
fun getFullWaybillNo(): String {
|
fun getFullWaybillNo(): String {
|
||||||
return if (prefix.isNotEmpty()) "$prefix$no" else no
|
return if (prefix.isNotEmpty()) "$prefix$no" else no
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取装载状态显示文字
|
|
||||||
*/
|
|
||||||
fun getLoadStatusText(): String {
|
|
||||||
return when (loadStatus) {
|
|
||||||
"01" -> "已申报"
|
|
||||||
"02" -> "申报中"
|
|
||||||
"03" -> "申报失败"
|
|
||||||
"04" -> "已删除"
|
|
||||||
else -> loadStatus
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,7 +105,6 @@ data class GjcMaWb(
|
|||||||
var activeId: Long? = null, // 有效值
|
var activeId: Long? = null, // 有效值
|
||||||
|
|
||||||
// ==================== 关联列表(非数据库字段,用于展示) ====================
|
// ==================== 关联列表(非数据库字段,用于展示) ====================
|
||||||
@Transient
|
|
||||||
var haWbList: List<GjcHaWb>? = null, // 分单列表
|
var haWbList: List<GjcHaWb>? = null, // 分单列表
|
||||||
@Transient
|
@Transient
|
||||||
var storageUseList: List<GjcStorageUse>? = null, // 库位使用列表
|
var storageUseList: List<GjcStorageUse>? = null, // 库位使用列表
|
||||||
|
|||||||
@@ -59,11 +59,6 @@ class IntExpLoadActivity :
|
|||||||
viewModel.waybillNo.value = codedContent
|
viewModel.waybillNo.value = codedContent
|
||||||
viewModel.searchClick()
|
viewModel.searchClick()
|
||||||
}
|
}
|
||||||
// 扫码分单号
|
|
||||||
Constant.RequestCode.CODE -> {
|
|
||||||
viewModel.houseWaybillNo.value = codedContent
|
|
||||||
viewModel.searchClick()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ class IntExpLoadViewModel : BasePageViewModel() {
|
|||||||
val flightDate = MutableLiveData<String>(DateUtils.getCurrentTime().formatDate()) // 航班日期
|
val flightDate = MutableLiveData<String>(DateUtils.getCurrentTime().formatDate()) // 航班日期
|
||||||
val flightNo = MutableLiveData("") // 航班号
|
val flightNo = MutableLiveData("") // 航班号
|
||||||
val waybillNo = MutableLiveData("") // 运单号
|
val waybillNo = MutableLiveData("") // 运单号
|
||||||
val houseWaybillNo = MutableLiveData("") // 分单号
|
|
||||||
|
|
||||||
// ========== 统计信息 ==========
|
// ========== 统计信息 ==========
|
||||||
val totalCount = MutableLiveData("0") // 合计票数
|
val totalCount = MutableLiveData("0") // 合计票数
|
||||||
@@ -84,13 +83,6 @@ class IntExpLoadViewModel : BasePageViewModel() {
|
|||||||
ScanModel.startScan(getTopActivity(), Constant.RequestCode.WAYBILL)
|
ScanModel.startScan(getTopActivity(), Constant.RequestCode.WAYBILL)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 扫码分单号
|
|
||||||
*/
|
|
||||||
fun scanHouseWaybill() {
|
|
||||||
ScanModel.startScan(getTopActivity(), Constant.RequestCode.CODE)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态重置 (批量操作)
|
* 状态重置 (批量操作)
|
||||||
*/
|
*/
|
||||||
@@ -198,7 +190,6 @@ class IntExpLoadViewModel : BasePageViewModel() {
|
|||||||
fdate = flightDate.value?.ifEmpty { null },
|
fdate = flightDate.value?.ifEmpty { null },
|
||||||
fno = flightNo.value?.ifEmpty { null },
|
fno = flightNo.value?.ifEmpty { null },
|
||||||
no = waybillNo.value?.ifEmpty { null },
|
no = waybillNo.value?.ifEmpty { null },
|
||||||
hno = houseWaybillNo.value?.ifEmpty { null },
|
|
||||||
pageNum = pageModel.page,
|
pageNum = pageModel.page,
|
||||||
pageSize = pageModel.limit
|
pageSize = pageModel.limit
|
||||||
)
|
)
|
||||||
@@ -210,8 +201,7 @@ class IntExpLoadViewModel : BasePageViewModel() {
|
|||||||
val totalParams = GjcCheckInPage(
|
val totalParams = GjcCheckInPage(
|
||||||
fdate = flightDate.value?.ifEmpty { null },
|
fdate = flightDate.value?.ifEmpty { null },
|
||||||
fno = flightNo.value?.ifEmpty { null },
|
fno = flightNo.value?.ifEmpty { null },
|
||||||
no = waybillNo.value?.ifEmpty { null },
|
no = waybillNo.value?.ifEmpty { null }
|
||||||
hno = houseWaybillNo.value?.ifEmpty { null }
|
|
||||||
).toRequestBody()
|
).toRequestBody()
|
||||||
|
|
||||||
// 获取列表 (带Loading)
|
// 获取列表 (带Loading)
|
||||||
|
|||||||
@@ -42,6 +42,14 @@ class IntExpTallyViewModel : BasePageViewModel() {
|
|||||||
// ========== 全选状态 ==========
|
// ========== 全选状态 ==========
|
||||||
val isAllChecked = MutableLiveData(false)
|
val isAllChecked = MutableLiveData(false)
|
||||||
|
|
||||||
|
// ========== 全局展开状态 ==========
|
||||||
|
/**
|
||||||
|
* 全局展开状态
|
||||||
|
* - true: 全部展开
|
||||||
|
* - false: 全部收起
|
||||||
|
*/
|
||||||
|
val isAllExpanded = MutableLiveData(false)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
// 监听全选状态,自动更新所有列表项
|
// 监听全选状态,自动更新所有列表项
|
||||||
isAllChecked.observeForever { checked ->
|
isAllChecked.observeForever { checked ->
|
||||||
@@ -76,6 +84,28 @@ class IntExpTallyViewModel : 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.haWbList.isNullOrEmpty()) {
|
||||||
|
bean.showMore.set(shouldExpand)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 刷新列表UI
|
||||||
|
pageModel.rv?.commonAdapter()?.notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 扫码运单号
|
* 扫码运单号
|
||||||
*/
|
*/
|
||||||
@@ -213,7 +243,11 @@ class IntExpTallyViewModel : BasePageViewModel() {
|
|||||||
|
|
||||||
// 获取列表 (带Loading)
|
// 获取列表 (带Loading)
|
||||||
launchLoadingCollect({ NetApply.api.getIntExpTallyList(listParams) }) {
|
launchLoadingCollect({ NetApply.api.getIntExpTallyList(listParams) }) {
|
||||||
onSuccess = { pageModel.handleListBean(it) }
|
onSuccess = {
|
||||||
|
pageModel.handleListBean(it)
|
||||||
|
// 数据加载完成后,重置全局展开状态为收起
|
||||||
|
isAllExpanded.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取统计信息 (后台请求,不阻塞列表)
|
// 获取统计信息 (后台请求,不阻塞列表)
|
||||||
|
|||||||
@@ -61,17 +61,6 @@
|
|||||||
type="@{SearchLayoutType.INPUT}"
|
type="@{SearchLayoutType.INPUT}"
|
||||||
value="@={viewModel.waybillNo}" />
|
value="@={viewModel.waybillNo}" />
|
||||||
|
|
||||||
<!-- 分单号 -->
|
|
||||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
hint='@{"请输入分单号"}'
|
|
||||||
icon="@{@drawable/img_scan}"
|
|
||||||
setOnIconClickListener="@{(v)-> viewModel.scanHouseWaybill()}"
|
|
||||||
type="@{SearchLayoutType.INPUT}"
|
|
||||||
value="@={viewModel.houseWaybillNo}" />
|
|
||||||
|
|
||||||
<!-- 搜索按钮 -->
|
<!-- 搜索按钮 -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
|||||||
@@ -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.IntExpTallyViewModel" />
|
type="com.lukouguoji.gjc.viewModel.IntExpTallyViewModel" />
|
||||||
@@ -88,6 +90,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>
|
||||||
|
|||||||
@@ -93,8 +93,8 @@
|
|||||||
<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.getLoadStatusText()}"
|
android:text="@{bean.loadStatus}"
|
||||||
android:textColor="@color/text_red"
|
android:textColor="@color/text_normal"
|
||||||
android:textSize="16sp" />
|
android:textSize="16sp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -74,7 +74,15 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<!-- 展开/折叠按钮 -->
|
<!-- 展开/折叠按钮 -->
|
||||||
<ImageView android:id="@+id/iv_show" android:layout_width="match_parent" android:layout_height="20dp" android:layout_marginTop="5dp" android:layout_marginBottom="5dp" android:padding="5dp" android:src="@mipmap/img_down"/>
|
<ImageView
|
||||||
|
android:id="@+id/iv_show"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:src="@mipmap/img_down"
|
||||||
|
visible="@{bean.haWbList != null && !bean.haWbList.empty}" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<!-- 子订单列表容器(在白色卡片外面) -->
|
<!-- 子订单列表容器(在白色卡片外面) -->
|
||||||
<LinearLayout visible="@{bean.showMore}" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="5dp" android:background="#e3f6e0" android:orientation="vertical" android:visibility="gone">
|
<LinearLayout visible="@{bean.showMore}" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="5dp" android:background="#e3f6e0" android:orientation="vertical" android:visibility="gone">
|
||||||
|
|||||||
Reference in New Issue
Block a user