feat: 国际进港舱单新增页面优化(航班代入、必填校验、特码默认值)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -46,12 +46,21 @@ class GjjManifestAddActivity :
|
||||
* 新增舱单
|
||||
*/
|
||||
@JvmStatic
|
||||
fun start(context: Context, fid: String = "", dep: String, dest: String) {
|
||||
fun start(
|
||||
context: Context,
|
||||
fid: String = "",
|
||||
dep: String,
|
||||
dest: String,
|
||||
flightDate: String = "",
|
||||
flightNo: String = ""
|
||||
) {
|
||||
val starter = Intent(context, GjjManifestAddActivity::class.java)
|
||||
.putExtra(Constant.Key.PAGE_TYPE, DetailsPageType.Add.name)
|
||||
.putExtra(Constant.Key.ID, fid)
|
||||
.putExtra(Constant.Key.DEPARTURE, dep)
|
||||
.putExtra(Constant.Key.DESTINATION, dest)
|
||||
.putExtra("flightDate", flightDate)
|
||||
.putExtra("flightNo", flightNo)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
|
||||
|
||||
@@ -212,12 +212,22 @@ class GjjManifestAddViewModel : BaseViewModel() {
|
||||
departure.value = intent.getStringExtra(Constant.Key.DEPARTURE).noNull()
|
||||
destination.value = intent.getStringExtra(Constant.Key.DESTINATION).noNull()
|
||||
|
||||
// 回填航班日期和航班号(从列表页传入)
|
||||
val passedFlightDate = intent.getStringExtra("flightDate").noNull()
|
||||
val passedFlightNo = intent.getStringExtra("flightNo").noNull()
|
||||
if (passedFlightDate.isNotEmpty()) {
|
||||
flightDate.value = passedFlightDate
|
||||
}
|
||||
if (passedFlightNo.isNotEmpty()) {
|
||||
flightNo.value = passedFlightNo
|
||||
}
|
||||
// 如果航班日期和航班号都有值且已从列表页获得航班信息,标记已查询避免重复请求
|
||||
if (passedFlightDate.isNotEmpty() && passedFlightNo.isNotEmpty() && fid.isNotEmpty()) {
|
||||
lastQueriedFlight = "$passedFlightDate-$passedFlightNo"
|
||||
}
|
||||
|
||||
// 编辑模式:从Bean对象加载数据
|
||||
if (pageType.value == DetailsPageType.Modify) {
|
||||
// 回填航班日期和航班号(Bean中不包含,从列表页传入)
|
||||
flightDate.value = intent.getStringExtra("flightDate").noNull()
|
||||
flightNo.value = intent.getStringExtra("flightNo").noNull()
|
||||
|
||||
val bean = intent.getSerializableExtra(Constant.Key.BEAN)
|
||||
if (bean is com.lukouguoji.module_base.bean.GjjManifest) {
|
||||
loadManifestFromBean(bean)
|
||||
@@ -314,10 +324,12 @@ class GjjManifestAddViewModel : BaseViewModel() {
|
||||
|| verifyWaybillNo(waybillNo.value)
|
||||
|| agent.value.verifyNullOrEmpty("请选择代理")
|
||||
|| waybillNum.value.verifyNullOrEmpty("请输入运单件数")
|
||||
|| actualNum.value.verifyNullOrEmpty("请输入实到数量")
|
||||
|| goodsNameEn.value.verifyNullOrEmpty("请输入品名(英)")
|
||||
|| actualWeight.value.verifyNullOrEmpty("请输入实到重量")
|
||||
|| packageType.value.verifyNullOrEmpty("请选择包装类型")
|
||||
|| goodsNameEn.value.verifyNullOrEmpty("请输入品名(英)")
|
||||
|| waybillType.value.verifyNullOrEmpty("请选择运单类型")
|
||||
|| businessType.value.verifyNullOrEmpty("请选择业务类型")
|
||||
|| departure.value.verifyNullOrEmpty("请输入始发站")
|
||||
|| destination.value.verifyNullOrEmpty("请输入目的站")
|
||||
)
|
||||
) {
|
||||
return
|
||||
@@ -328,7 +340,7 @@ class GjjManifestAddViewModel : BaseViewModel() {
|
||||
"fid" to fid,
|
||||
"wbNo" to waybillNo.value,
|
||||
"agentCode" to agent.value,
|
||||
"spCode" to specialCode.value,
|
||||
"spCode" to specialCode.value.let { if (it.isNullOrEmpty()) "NOR" else it },
|
||||
"businessType" to businessType.value,
|
||||
"totalPc" to waybillNum.value,
|
||||
"pc" to actualNum.value,
|
||||
|
||||
@@ -257,7 +257,9 @@ class IntImpManifestViewModel : BasePageViewModel() {
|
||||
context = getTopActivity(),
|
||||
fid = fid,
|
||||
dep = sendAddress.value ?: "",
|
||||
dest = fdest.value ?: ""
|
||||
dest = fdest.value ?: "",
|
||||
flightDate = flightDate.value ?: "",
|
||||
flightNo = flightNo.value ?: ""
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
enable="@{viewModel.pageType == DetailsPageType.Add}"
|
||||
hint='@{"请输入运单号"}'
|
||||
required="@{false}"
|
||||
required="@{true}"
|
||||
title='@{"运 单 号"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
@@ -115,7 +115,7 @@
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
hint='@{"请选择代理"}'
|
||||
list="@{viewModel.agentList}"
|
||||
required="@{false}"
|
||||
required="@{true}"
|
||||
title='@{"代 理"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
@@ -149,7 +149,7 @@
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
hint='@{"请输入始发站"}'
|
||||
required="@{false}"
|
||||
required="@{true}"
|
||||
title='@{"始 发 站"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
@@ -160,7 +160,7 @@
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
hint='@{"请输入目的站"}'
|
||||
required="@{false}"
|
||||
required="@{true}"
|
||||
title='@{"目 的 站"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
@@ -173,7 +173,7 @@
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
hint='@{"请选择运单类型"}'
|
||||
list="@{viewModel.waybillTypeList}"
|
||||
required="@{false}"
|
||||
required="@{true}"
|
||||
title='@{"运单类型"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
@@ -195,7 +195,7 @@
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
android:id="@+id/waybillNumInput"
|
||||
hint='@{"请输入总件数"}'
|
||||
required="@{false}"
|
||||
required="@{true}"
|
||||
title='@{"总 件 数"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
@@ -220,7 +220,7 @@
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
android:id="@+id/actualWeightInput"
|
||||
hint='@{"请输入实到重量"}'
|
||||
required="@{false}"
|
||||
required="@{true}"
|
||||
title='@{"实到重量"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
@@ -265,7 +265,7 @@
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
hint='@{"请输入品名(英)"}'
|
||||
required="@{false}"
|
||||
required="@{true}"
|
||||
title='@{"品名(英)"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
@@ -299,7 +299,7 @@
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
hint='@{"请选择业务类型"}'
|
||||
list="@{viewModel.businessTypeList}"
|
||||
required="@{false}"
|
||||
required="@{true}"
|
||||
title='@{"业务类型"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
|
||||
Reference in New Issue
Block a user