Compare commits

...

3 Commits

Author SHA1 Message Date
6c4e97945b feat: fix form 2026-03-20 15:30:12 +08:00
a663609eeb feat: input required check 2026-03-20 15:18:56 +08:00
74e9f5a827 feat: reset status dialog 2026-03-20 15:09:27 +08:00
5 changed files with 47 additions and 14 deletions

View File

@@ -97,7 +97,10 @@
"Read(//usr/local/**)", "Read(//usr/local/**)",
"Read(//opt/homebrew/opt/**)", "Read(//opt/homebrew/opt/**)",
"Bash(/Users/kid/.vfox/sdks/java/bin/java -version 2>&1)", "Bash(/Users/kid/.vfox/sdks/java/bin/java -version 2>&1)",
"Bash(export JAVA_HOME=/Users/kid/.vfox/sdks/java)" "Bash(export JAVA_HOME=/Users/kid/.vfox/sdks/java)",
"mcp__apifox__read_project_oas_kcl8s7",
"mcp__apifox__refresh_project_oas_kcl8s7",
"mcp__apifox__read_project_oas_ref_resources_kcl8s7"
], ],
"deny": [], "deny": [],
"ask": [] "ask": []

View File

@@ -302,6 +302,12 @@ interface Api {
@POST("typeCode/countryType") @POST("typeCode/countryType")
suspend fun getAreaTypeList(): DictListBean suspend fun getAreaTypeList(): DictListBean
/**
* 获取国家代码
*/
@POST("typeCode/countryCode")
suspend fun getCountryCodeList(): DictListBean
/** /**
* 获取通讯方式类型 * 获取通讯方式类型
*/ */

View File

@@ -12,6 +12,7 @@ import com.lukouguoji.module_base.bean.GjjDeclareParam
import com.lukouguoji.module_base.bean.GjjImportManifest import com.lukouguoji.module_base.bean.GjjImportManifest
import com.lukouguoji.module_base.common.Constant import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.common.ConstantEvent import com.lukouguoji.module_base.common.ConstantEvent
import com.lukouguoji.gjj.dialog.IntImpTallyResetDialogModel
import com.lukouguoji.module_base.http.net.NetApply import com.lukouguoji.module_base.http.net.NetApply
import com.lukouguoji.module_base.impl.FlowBus import com.lukouguoji.module_base.impl.FlowBus
import com.lukouguoji.module_base.ktx.commonAdapter import com.lukouguoji.module_base.ktx.commonAdapter
@@ -134,22 +135,25 @@ class IntArrAirManifestViewModel : BasePageViewModel() {
fun resetStatusClick() { fun resetStatusClick() {
val (maWbList, haWbList) = getSelectedItems("请选择要重置的舱单") ?: return val (maWbList, haWbList) = getSelectedItems("请选择要重置的舱单") ?: return
val param = GjjDeclareParam( val dialog = IntImpTallyResetDialogModel { dialogModel ->
maWbList = maWbList, val param = GjjDeclareParam(
haWbList = haWbList, maWbList = maWbList,
restStatus = null, haWbList = haWbList,
resetReason = "状态重置" restStatus = dialogModel.resetStatusCode
) )
launchLoadingCollect({ NetApply.api.resetIntArrManifestStatus(param.toRequestBody()) }) { launchLoadingCollect({ NetApply.api.resetIntArrManifestStatus(param.toRequestBody()) }) {
onSuccess = { onSuccess = {
showToast("状态重置成功") showToast("状态重置成功")
viewModelScope.launch { viewModelScope.launch {
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh") FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh")
}
refresh()
} }
refresh()
} }
} }
dialog.show()
} }
/** /**

View File

@@ -13,6 +13,7 @@ import com.lukouguoji.module_base.ktx.launchCollect
import com.lukouguoji.module_base.ktx.launchLoadingCollect import com.lukouguoji.module_base.ktx.launchLoadingCollect
import com.lukouguoji.module_base.ktx.showToast import com.lukouguoji.module_base.ktx.showToast
import com.lukouguoji.module_base.ktx.toRequestBody import com.lukouguoji.module_base.ktx.toRequestBody
import com.lukouguoji.module_base.ktx.verifyNullOrEmpty
import dev.utils.app.info.KeyValue import dev.utils.app.info.KeyValue
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@@ -56,7 +57,7 @@ class IntArrSupplementInfoViewModel : BaseViewModel() {
* 加载国家代码下拉列表 * 加载国家代码下拉列表
*/ */
private fun loadCountryCodeList() { private fun loadCountryCodeList() {
launchCollect({ NetApply.api.getAreaTypeList() }) { launchCollect({ NetApply.api.getCountryCodeList() }) {
onSuccess = { result -> onSuccess = { result ->
val keyValueList = result.data?.mapNotNull { bean -> val keyValueList = result.data?.mapNotNull { bean ->
if (bean.code != null && bean.name != null) { if (bean.code != null && bean.name != null) {
@@ -96,6 +97,17 @@ class IntArrSupplementInfoViewModel : BaseViewModel() {
fun save() { fun save() {
val formBean = dataBean.value ?: return val formBean = dataBean.value ?: return
// 收货人必填校验
if (formBean.consigneeName.verifyNullOrEmpty("收货人名称不能为空")) return
if (formBean.consigneeCountryCode.verifyNullOrEmpty("收货人国家代码不能为空")) return
if (formBean.consigneeComType.verifyNullOrEmpty("收货人通讯方式不能为空")) return
if (formBean.consigneePNum.verifyNullOrEmpty("收货人联系号码不能为空")) return
// 发货人必填校验
if (formBean.consignorName.verifyNullOrEmpty("发货人名称不能为空")) return
if (formBean.consignorCountryCode.verifyNullOrEmpty("发货人国家代码不能为空")) return
if (formBean.consignorComType.verifyNullOrEmpty("发货人通讯方式不能为空")) return
if (formBean.consignorPNum.verifyNullOrEmpty("发货人联系号码不能为空")) return
if (manifestList.isEmpty()) { if (manifestList.isEmpty()) {
showToast("无可保存的数据") showToast("无可保存的数据")
return return

View File

@@ -59,6 +59,7 @@
android:layout_weight="1" android:layout_weight="1"
enable="@{true}" enable="@{true}"
hint='@{"请输入名称"}' hint='@{"请输入名称"}'
required="@{true}"
title='@{"名称"}' title='@{"名称"}'
titleLength="@{5}" titleLength="@{5}"
type="@{DataLayoutType.INPUT}" type="@{DataLayoutType.INPUT}"
@@ -71,6 +72,7 @@
enable="@{true}" enable="@{true}"
hint='@{"请选择国家代码"}' hint='@{"请选择国家代码"}'
list="@{viewModel.countryCodeList}" list="@{viewModel.countryCodeList}"
required="@{true}"
title='@{"国家代码"}' title='@{"国家代码"}'
titleLength="@{5}" titleLength="@{5}"
type="@{DataLayoutType.SPINNER}" type="@{DataLayoutType.SPINNER}"
@@ -83,6 +85,7 @@
enable="@{true}" enable="@{true}"
hint='@{"请选择通讯方式"}' hint='@{"请选择通讯方式"}'
list="@{viewModel.comTypeList}" list="@{viewModel.comTypeList}"
required="@{true}"
title='@{"通讯方式"}' title='@{"通讯方式"}'
titleLength="@{5}" titleLength="@{5}"
type="@{DataLayoutType.SPINNER}" type="@{DataLayoutType.SPINNER}"
@@ -103,6 +106,7 @@
android:layout_weight="1" android:layout_weight="1"
enable="@{true}" enable="@{true}"
hint='@{"请输入联系号码"}' hint='@{"请输入联系号码"}'
required="@{true}"
title='@{"联系号码"}' title='@{"联系号码"}'
titleLength="@{5}" titleLength="@{5}"
type="@{DataLayoutType.INPUT}" type="@{DataLayoutType.INPUT}"
@@ -154,6 +158,7 @@
android:layout_weight="1" android:layout_weight="1"
enable="@{true}" enable="@{true}"
hint='@{"请输入名称"}' hint='@{"请输入名称"}'
required="@{true}"
title='@{"名称"}' title='@{"名称"}'
titleLength="@{5}" titleLength="@{5}"
type="@{DataLayoutType.INPUT}" type="@{DataLayoutType.INPUT}"
@@ -166,6 +171,7 @@
enable="@{true}" enable="@{true}"
hint='@{"请选择国家代码"}' hint='@{"请选择国家代码"}'
list="@{viewModel.countryCodeList}" list="@{viewModel.countryCodeList}"
required="@{true}"
title='@{"国家代码"}' title='@{"国家代码"}'
titleLength="@{5}" titleLength="@{5}"
type="@{DataLayoutType.SPINNER}" type="@{DataLayoutType.SPINNER}"
@@ -178,6 +184,7 @@
enable="@{true}" enable="@{true}"
hint='@{"请选择通讯方式"}' hint='@{"请选择通讯方式"}'
list="@{viewModel.comTypeList}" list="@{viewModel.comTypeList}"
required="@{true}"
title='@{"通讯方式"}' title='@{"通讯方式"}'
titleLength="@{5}" titleLength="@{5}"
type="@{DataLayoutType.SPINNER}" type="@{DataLayoutType.SPINNER}"
@@ -198,6 +205,7 @@
android:layout_weight="1" android:layout_weight="1"
enable="@{true}" enable="@{true}"
hint='@{"请输入联系号码"}' hint='@{"请输入联系号码"}'
required="@{true}"
title='@{"联系号码"}' title='@{"联系号码"}'
titleLength="@{5}" titleLength="@{5}"
type="@{DataLayoutType.INPUT}" type="@{DataLayoutType.INPUT}"