Compare commits
3 Commits
9735dc5d9a
...
31a1e1ceec
| Author | SHA1 | Date | |
|---|---|---|---|
| 31a1e1ceec | |||
| 23b4a5ec31 | |||
| e9bef08309 |
@@ -745,10 +745,15 @@ class IntExpAssembleStartViewModel : BaseViewModel() {
|
||||
reloadUldUseId(uldNo)
|
||||
}
|
||||
|
||||
// 添加形式(全新 ULD)时航班可能未从 ULD 查询接口获取,导致组装信息列表查不出;
|
||||
// 仅在航班为空时用本次操作运单的航班信息兜底补全,ULD 已带航班时保持原值不变。
|
||||
if (assembleFlightNo.value.isNullOrEmpty() || assembleFlightDate.value.isNullOrEmpty()) {
|
||||
if (operationFno.isNotEmpty() && operationFdate.isNotEmpty()) {
|
||||
// 同步航班信息,保证左侧组装信息列表查询的是本次操作 ULD 所属航班:
|
||||
// - 装货:装货决定该 ULD 归属哪个航班。若在同一 ULD 上先卸光原航班(如 MU0128)货物、
|
||||
// 再装入另一航班(如 MU0205)的货,必须无条件把航班改为本次所装运单的航班,
|
||||
// 否则 assembleFlightNo 仍停留在旧航班,左侧组装信息列表会继续显示旧航班的 ULD。
|
||||
// - 卸货:卸货不改变 ULD 归属航班,沿用原有"仅航班为空时兜底补全"逻辑。
|
||||
if (operationFno.isNotEmpty() && operationFdate.isNotEmpty()) {
|
||||
val shouldUpdateFlight =
|
||||
isLoad || assembleFlightNo.value.isNullOrEmpty() || assembleFlightDate.value.isNullOrEmpty()
|
||||
if (shouldUpdateFlight) {
|
||||
assembleFlightNo.value = operationFno
|
||||
// 与 ULD 查询保持一致,只取年月日(去掉时间部分)
|
||||
assembleFlightDate.value =
|
||||
|
||||
@@ -35,9 +35,9 @@ class IntExpLoadViewModel : BasePageViewModel() {
|
||||
val flightDate = MutableLiveData<String>(DateUtils.getCurrentTime().formatDate()) // 航班日期
|
||||
val flightNo = MutableLiveData("") // 航班号
|
||||
val waybillNo = MutableLiveData("") // 运单号
|
||||
val depPort = MutableLiveData("") // 始发站(下拉选择)
|
||||
val depPortList = MutableLiveData<List<KeyValue>>(emptyList()) // 始发站下拉列表(始发港 + 经停港)
|
||||
val destPort = MutableLiveData("") // 目的站(航班查询自动填充,不可编辑)
|
||||
val depPort = MutableLiveData("") // 始发站(航班查询自动填充,锁定不可编辑)
|
||||
val destPort = MutableLiveData("") // 目的站(下拉选择)
|
||||
val destPortList = MutableLiveData<List<KeyValue>>(emptyList()) // 目的站下拉列表(目的港 + 经停港)
|
||||
|
||||
// ========== 航班级联查询 ==========
|
||||
private var lastQueriedFlight = "" // 避免重复查询
|
||||
@@ -59,7 +59,7 @@ class IntExpLoadViewModel : BasePageViewModel() {
|
||||
|
||||
/**
|
||||
* 航班日期 + 航班号 均有值时,查询航班并填充始发站/目的站
|
||||
* 参考「电报生成」(/flt/intFlight):始发站下拉(始发港+经停港),目的站自动填充且只读
|
||||
* 出港:始发站自动填充且锁定(始发港),目的站下拉可选(目的港+经停港)
|
||||
*/
|
||||
private fun queryFlightIfReady() {
|
||||
val fdate = flightDate.value
|
||||
@@ -82,25 +82,25 @@ class IntExpLoadViewModel : BasePageViewModel() {
|
||||
onSuccess = {
|
||||
if (it.verifySuccess() && it.data != null) {
|
||||
val flight = it.data!!
|
||||
// 目的站:航班查询返回,自动填充
|
||||
destPort.value = flight.fdest.noNull()
|
||||
// 始发站下拉:始发港 + 经停港(可逗号分隔多个)
|
||||
val list = mutableListOf(KeyValue(flight.fdep.noNull(), flight.fdep.noNull()))
|
||||
// 始发站:航班查询返回,自动填充并锁定
|
||||
depPort.value = flight.fdep.noNull()
|
||||
// 目的站下拉:目的港 + 经停港(可逗号分隔多个)
|
||||
val list = mutableListOf(KeyValue(flight.fdest.noNull(), flight.fdest.noNull()))
|
||||
flight.jtz.split(",").forEach { stop ->
|
||||
val s = stop.trim()
|
||||
if (s.isNotEmpty()) list.add(KeyValue(s, s))
|
||||
}
|
||||
depPortList.value = list
|
||||
depPort.value = flight.fdep.noNull()
|
||||
destPortList.value = list
|
||||
destPort.value = flight.fdest.noNull()
|
||||
} else {
|
||||
depPortList.value = emptyList()
|
||||
destPortList.value = emptyList()
|
||||
depPort.value = ""
|
||||
destPort.value = ""
|
||||
}
|
||||
}
|
||||
|
||||
onFailed = { _, _ ->
|
||||
depPortList.value = emptyList()
|
||||
destPortList.value = emptyList()
|
||||
depPort.value = ""
|
||||
destPort.value = ""
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="单证审核"
|
||||
android:text="国际出港单证审核"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp" />
|
||||
|
||||
|
||||
@@ -52,24 +52,24 @@
|
||||
value="@={viewModel.flightNo}"
|
||||
setUpperCaseAlphanumeric="@{true}" />
|
||||
|
||||
<!-- 始发站(下拉选择:始发港 + 经停港) -->
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
hint='@{"始发站"}'
|
||||
type="@{SearchLayoutType.SPINNER}"
|
||||
list="@{viewModel.depPortList}"
|
||||
value="@={viewModel.depPort}" />
|
||||
|
||||
<!-- 目的站(航班查询自动填充,不可编辑) -->
|
||||
<!-- 始发站(航班查询自动填充,锁定不可编辑) -->
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
enable="@{false}"
|
||||
hint='@{"目的站"}'
|
||||
hint='@{"始发站"}'
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={viewModel.depPort}" />
|
||||
|
||||
<!-- 目的站(下拉选择:目的港 + 经停港) -->
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
hint='@{"目的站"}'
|
||||
type="@{SearchLayoutType.SPINNER}"
|
||||
list="@{viewModel.destPortList}"
|
||||
value="@={viewModel.destPort}" />
|
||||
|
||||
<!-- 运单号 -->
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
android:layout_marginLeft="10dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 第一行数据 -->
|
||||
<!-- 第一行数据:航班日期 | 航班号 | 航程 | 组装人 | 分配人 -->
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
@@ -45,7 +45,7 @@
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1.2"
|
||||
android:layout_weight="1.3"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
@@ -68,14 +68,14 @@
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_weight="1.0"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="15sp"
|
||||
completeSpace="@{5}"
|
||||
completeSpace="@{4}"
|
||||
android:text="航班号:" />
|
||||
|
||||
<TextView
|
||||
@@ -92,14 +92,14 @@
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1.5"
|
||||
android:layout_weight="1.1"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="15sp"
|
||||
completeSpace="@{5}"
|
||||
completeSpace="@{3}"
|
||||
android:text="航程:" />
|
||||
|
||||
<TextView
|
||||
@@ -111,26 +111,18 @@
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<!-- 第二行数据 -->
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp">
|
||||
|
||||
<!-- 组装人 -->
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1.2"
|
||||
android:layout_weight="1.0"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="15sp"
|
||||
completeSpace="@{5}"
|
||||
completeSpace="@{4}"
|
||||
android:text="组装人:" />
|
||||
|
||||
<TextView
|
||||
@@ -146,14 +138,14 @@
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_weight="1.0"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="15sp"
|
||||
completeSpace="@{5}"
|
||||
completeSpace="@{4}"
|
||||
android:text="分配人:" />
|
||||
|
||||
<TextView
|
||||
@@ -165,28 +157,28 @@
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<!-- 分配时间 -->
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="0dp"
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<!-- 第二行数据:仅分配时间(左对齐第一列,值向右延伸) -->
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1.5"
|
||||
android:gravity="center_vertical">
|
||||
android:textSize="15sp"
|
||||
completeSpace="@{5}"
|
||||
android:text="分配时间:" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="15sp"
|
||||
completeSpace="@{5}"
|
||||
android:text="分配时间:" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="15sp"
|
||||
android:text="@{bean.acDate ?? ``}"
|
||||
tools:text="2024-01-15 14:27:12" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="15sp"
|
||||
android:text="@{bean.acDate ?? ``}"
|
||||
tools:text="2024-01-15 14:27:12" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user