feat: 国际出港 收运检查 退回
This commit is contained in:
@@ -31,6 +31,9 @@ class GjcInspectionDetailsViewModel : BaseViewModel() {
|
||||
// 详情数据
|
||||
val dataBean = MutableLiveData<GjcInspectionBean>()
|
||||
|
||||
// 退回原因(独立字段,初始为空)
|
||||
val returnReason = MutableLiveData("")
|
||||
|
||||
/**
|
||||
* 初始化数据
|
||||
*/
|
||||
@@ -63,7 +66,7 @@ class GjcInspectionDetailsViewModel : BaseViewModel() {
|
||||
fun auditPass() {
|
||||
val bean = dataBean.value ?: return
|
||||
getTopActivity().showConfirmDialog("确定要通过该单证吗?") {
|
||||
performAudit(bean, true, "通过")
|
||||
performAudit(bean, true, "通过", "")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,12 +75,13 @@ class GjcInspectionDetailsViewModel : BaseViewModel() {
|
||||
*/
|
||||
fun auditReject() {
|
||||
val bean = dataBean.value ?: return
|
||||
if (TextUtils.isEmpty(bean.remark)) {
|
||||
showToast("请在备注中输入退回原因")
|
||||
val reason = returnReason.value ?: ""
|
||||
if (reason.isEmpty()) {
|
||||
showToast("请输入退回原因")
|
||||
return
|
||||
}
|
||||
getTopActivity().showConfirmDialog("确定要退回该单证吗?") {
|
||||
performAudit(bean, false, "退回")
|
||||
performAudit(bean, false, "退回", reason)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,8 +90,9 @@ class GjcInspectionDetailsViewModel : BaseViewModel() {
|
||||
* @param bean 数据
|
||||
* @param isPass true:通过, false:退回
|
||||
* @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(必传)
|
||||
// 使用数据自身的 reviewStatus 值
|
||||
val requestData = listOf(
|
||||
@@ -105,7 +110,7 @@ class GjcInspectionDetailsViewModel : BaseViewModel() {
|
||||
if (isPass) {
|
||||
NetApply.api.passGjcInspection(requestData)
|
||||
} else {
|
||||
NetApply.api.backGjcInspection(bean.remark, requestData)
|
||||
NetApply.api.backGjcInspection(reason, requestData)
|
||||
}
|
||||
}) {
|
||||
onSuccess = {
|
||||
|
||||
@@ -297,15 +297,15 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 备注 -->
|
||||
<!-- 退回原因 -->
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
enable="@{true}"
|
||||
inputHeight="@{80}"
|
||||
title='@{"原因"}'
|
||||
titleLength="@{5}"
|
||||
hint=""
|
||||
hint='@{"请输入退回原因"}'
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.remark}'
|
||||
value='@={viewModel.returnReason}'
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
Reference in New Issue
Block a user