feat: input required check
This commit is contained in:
@@ -13,6 +13,7 @@ import com.lukouguoji.module_base.ktx.launchCollect
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.ktx.showToast
|
||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||
import com.lukouguoji.module_base.ktx.verifyNullOrEmpty
|
||||
import dev.utils.app.info.KeyValue
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@@ -96,6 +97,17 @@ class IntArrSupplementInfoViewModel : BaseViewModel() {
|
||||
fun save() {
|
||||
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()) {
|
||||
showToast("无可保存的数据")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user