fix: 修复国际进港原始舱单接口解析及列表项布局规范
- API返回类型从BaseResultBean<PageInfo>改为PageInfo,匹配服务端实际响应 - GjjAirManifest字段maWbList重命名为maWb匹配JSON键名 - 列表项布局weight和completeSpace按国际出港规范对齐 - 移除页面初始自动加载,需用户输入航班号后手动查询 - CLAUDE.md补充列表项布局规范及常用字段weight参考表 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -55,5 +55,16 @@ class GjjManifestAddActivity :
|
||||
.putExtra(Constant.Key.BEAN, bean)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑舱单(通过GjjImportManifest对象)
|
||||
*/
|
||||
@JvmStatic
|
||||
fun startForEdit(context: Context, bean: com.lukouguoji.module_base.bean.GjjImportManifest) {
|
||||
val starter = Intent(context, GjjManifestAddActivity::class.java)
|
||||
.putExtra(Constant.Key.PAGE_TYPE, DetailsPageType.Modify.name)
|
||||
.putExtra(Constant.Key.BEAN, bean)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -45,8 +45,6 @@ class IntArrAirManifestActivity :
|
||||
viewModel.refresh()
|
||||
}
|
||||
|
||||
// 初始加载数据
|
||||
viewModel.refresh()
|
||||
}
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
|
||||
@@ -146,9 +146,11 @@ class GjjManifestAddViewModel : BaseViewModel() {
|
||||
|
||||
// 编辑模式:从Bean对象加载数据
|
||||
if (pageType.value == DetailsPageType.Modify) {
|
||||
val bean = intent.getSerializableExtra(Constant.Key.BEAN) as? com.lukouguoji.module_base.bean.GjjManifest
|
||||
if (bean != null) {
|
||||
val bean = intent.getSerializableExtra(Constant.Key.BEAN)
|
||||
if (bean is com.lukouguoji.module_base.bean.GjjManifest) {
|
||||
loadManifestFromBean(bean)
|
||||
} else if (bean is com.lukouguoji.module_base.bean.GjjImportManifest) {
|
||||
loadManifestFromImportBean(bean)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -183,6 +185,30 @@ class GjjManifestAddViewModel : BaseViewModel() {
|
||||
waybillType.value = manifest.awbType
|
||||
}
|
||||
|
||||
/**
|
||||
* 从GjjImportManifest对象加载数据(编辑模式)
|
||||
*/
|
||||
private fun loadManifestFromImportBean(manifest: com.lukouguoji.module_base.bean.GjjImportManifest) {
|
||||
fid = manifest.fid.toString()
|
||||
|
||||
// 填充表单字段
|
||||
waybillNo.value = manifest.wbNo
|
||||
waybillNum.value = manifest.totalPc.toString()
|
||||
actualNum.value = manifest.pc.toString()
|
||||
actualWeight.value = manifest.weight.toString()
|
||||
departure.value = manifest.origin
|
||||
destination.value = manifest.dest
|
||||
goodsNameCn.value = manifest.goodsCn
|
||||
goodsNameEn.value = manifest.goods
|
||||
unNumber.value = manifest.unNumber
|
||||
remark.value = manifest.remark
|
||||
|
||||
// 设置下拉框选中值
|
||||
agent.value = manifest.agentCode
|
||||
specialCode.value = manifest.spCode
|
||||
waybillType.value = manifest.awbType
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存点击
|
||||
*/
|
||||
|
||||
@@ -106,7 +106,7 @@ class IntArrAirManifestViewModel : BasePageViewModel() {
|
||||
val haWbList = mutableListOf<GjjImportManifest>()
|
||||
|
||||
selectedItems.forEach { airManifest ->
|
||||
airManifest.maWbList?.let { maWbList.add(it) }
|
||||
airManifest.maWb?.let { maWbList.add(it) }
|
||||
airManifest.haWbList?.let { haWbList.addAll(it) }
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ class IntArrAirManifestViewModel : BasePageViewModel() {
|
||||
}
|
||||
|
||||
// 获取第一个选中项的主单数据
|
||||
val manifest = selectedItems.firstOrNull()?.maWbList ?: return
|
||||
val manifest = selectedItems.firstOrNull()?.maWb ?: return
|
||||
|
||||
// 跳转到补充信息页面
|
||||
com.lukouguoji.gjj.activity.IntArrSupplementInfoActivity.start(
|
||||
@@ -175,7 +175,7 @@ class IntArrAirManifestViewModel : BasePageViewModel() {
|
||||
val haWbList = mutableListOf<GjjImportManifest>()
|
||||
|
||||
selectedItems.forEach { airManifest ->
|
||||
airManifest.maWbList?.let { maWbList.add(it) }
|
||||
airManifest.maWb?.let { maWbList.add(it) }
|
||||
airManifest.haWbList?.let { haWbList.addAll(it) }
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ class IntArrAirManifestViewModel : BasePageViewModel() {
|
||||
val haWbList = mutableListOf<GjjImportManifest>()
|
||||
|
||||
selectedItems.forEach { airManifest ->
|
||||
airManifest.maWbList?.let { maWbList.add(it) }
|
||||
airManifest.maWb?.let { maWbList.add(it) }
|
||||
airManifest.haWbList?.let { haWbList.addAll(it) }
|
||||
}
|
||||
|
||||
@@ -264,10 +264,10 @@ class IntArrAirManifestViewModel : BasePageViewModel() {
|
||||
// 统计参数(无分页)
|
||||
val totalParams = filterParams.toRequestBody()
|
||||
|
||||
// 获取列表(带Loading)
|
||||
// 获取列表(带Loading,接口直接返回PageInfo,无BaseResultBean包装)
|
||||
launchLoadingCollect({ NetApply.api.getIntArrAirManifestList(listParams) }) {
|
||||
onSuccess = { result ->
|
||||
pageModel.handleListBean(result.data?.toBaseListBean())
|
||||
pageModel.handleListBean(result.toBaseListBean())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,7 +290,7 @@ class IntArrAirManifestViewModel : BasePageViewModel() {
|
||||
val airManifest = list.getOrNull(position) ?: return
|
||||
|
||||
// 获取主单数据
|
||||
val manifest = airManifest.maWbList ?: return
|
||||
val manifest = airManifest.maWb ?: return
|
||||
|
||||
// 跳转到详情页
|
||||
com.lukouguoji.gjj.activity.IntArrAirManifestDetailsActivity.start(
|
||||
|
||||
Reference in New Issue
Block a user