feat: 国际出港 收运检查 退回

This commit is contained in:
2025-12-16 10:21:05 +08:00
parent 1cfcb3fe97
commit bd8d6f683a
2 changed files with 14 additions and 9 deletions

View File

@@ -31,6 +31,9 @@ class GjcInspectionDetailsViewModel : BaseViewModel() {
// 详情数据 // 详情数据
val dataBean = MutableLiveData<GjcInspectionBean>() val dataBean = MutableLiveData<GjcInspectionBean>()
// 退回原因(独立字段,初始为空)
val returnReason = MutableLiveData("")
/** /**
* 初始化数据 * 初始化数据
*/ */
@@ -63,7 +66,7 @@ class GjcInspectionDetailsViewModel : BaseViewModel() {
fun auditPass() { fun auditPass() {
val bean = dataBean.value ?: return val bean = dataBean.value ?: return
getTopActivity().showConfirmDialog("确定要通过该单证吗?") { getTopActivity().showConfirmDialog("确定要通过该单证吗?") {
performAudit(bean, true, "通过") performAudit(bean, true, "通过", "")
} }
} }
@@ -72,12 +75,13 @@ class GjcInspectionDetailsViewModel : BaseViewModel() {
*/ */
fun auditReject() { fun auditReject() {
val bean = dataBean.value ?: return val bean = dataBean.value ?: return
if (TextUtils.isEmpty(bean.remark)) { val reason = returnReason.value ?: ""
showToast("请在备注中输入退回原因") if (reason.isEmpty()) {
showToast("请输入退回原因")
return return
} }
getTopActivity().showConfirmDialog("确定要退回该单证吗?") { getTopActivity().showConfirmDialog("确定要退回该单证吗?") {
performAudit(bean, false, "退回") performAudit(bean, false, "退回", reason)
} }
} }
@@ -86,8 +90,9 @@ class GjcInspectionDetailsViewModel : BaseViewModel() {
* @param bean 数据 * @param bean 数据
* @param isPass true:通过, false:退回 * @param isPass true:通过, false:退回
* @param action 操作名称(用于提示) * @param action 操作名称(用于提示)
* @param reason 退回原因(仅退回时使用)
*/ */
private fun performAudit(bean: GjcInspectionBean, isPass: Boolean, action: String) { private fun performAudit(bean: GjcInspectionBean, isPass: Boolean, action: String, reason: String) {
// 构建请求参数:数组对象,包含 maWbId、wbNo、prefix、no、reviewStatus必传 // 构建请求参数:数组对象,包含 maWbId、wbNo、prefix、no、reviewStatus必传
// 使用数据自身的 reviewStatus 值 // 使用数据自身的 reviewStatus 值
val requestData = listOf( val requestData = listOf(
@@ -105,7 +110,7 @@ class GjcInspectionDetailsViewModel : BaseViewModel() {
if (isPass) { if (isPass) {
NetApply.api.passGjcInspection(requestData) NetApply.api.passGjcInspection(requestData)
} else { } else {
NetApply.api.backGjcInspection(bean.remark, requestData) NetApply.api.backGjcInspection(reason, requestData)
} }
}) { }) {
onSuccess = { onSuccess = {

View File

@@ -297,15 +297,15 @@
</LinearLayout> </LinearLayout>
<!-- 备注 --> <!-- 退回原因 -->
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
enable="@{true}" enable="@{true}"
inputHeight="@{80}" inputHeight="@{80}"
title='@{"原因"}' title='@{"原因"}'
titleLength="@{5}" titleLength="@{5}"
hint="" hint='@{"请输入退回原因"}'
type="@{DataLayoutType.INPUT}" type="@{DataLayoutType.INPUT}"
value='@={viewModel.dataBean.remark}' value='@={viewModel.returnReason}'
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp" /> android:layout_marginTop="8dp" />