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