From 46c3d28c5633baaddad0da441185310b9360a45b Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期三, 03 七月 2024 14:56:21 +0800
Subject: [PATCH] 高级表单优化

---
 src/views/components/StepModal.vue |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/src/views/components/StepModal.vue b/src/views/components/StepModal.vue
index 477052d..86f80a9 100644
--- a/src/views/components/StepModal.vue
+++ b/src/views/components/StepModal.vue
@@ -4,7 +4,7 @@
  * @version: 
  * @Date: 2024-06-26 22:54:42
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-06-27 10:44:54
+ * @LastEditTime: 2024-06-27 22:14:51
 -->
 <template>
   <BasicModal
@@ -42,10 +42,13 @@
   import { BasicModal, useModalInner } from '/@/components/Modal';
   import { Steps } from 'ant-design-vue';
   import { useI18n } from '/@/hooks/web/useI18n';
+  import { isNullOrUnDef } from '/@/utils/is';
+  import { useMessage } from '/@/hooks/web/useMessage';
 
   defineOptions({ name: 'StepModal' });
 
   const emit = defineEmits(['success']);
+  const { createErrorModal } = useMessage();
   const { t } = useI18n();
   const title = ref('');
   const current = ref(0);
@@ -78,6 +81,20 @@
    */
   async function handleSubmit() {
     try {
+      if (isNullOrUnDef(step1Values.value['CUST_CODE'])) {
+        createErrorModal({
+          title: t('sys.api.errorTip'),
+          content: '姝ラ1鏈畬鎴愶紝璇峰畬鎴愬啀淇濆瓨鎻愪氦',
+        });
+        return;
+      }
+      if (isNullOrUnDef(step2Values.value['ROT_CODE'])) {
+        createErrorModal({
+          title: t('sys.api.errorTip'),
+          content: '姝ラ2鏈畬鎴愶紝璇峰畬鎴愬啀淇濆瓨鎻愪氦',
+        });
+        return;
+      }
       closeModal();
       emit('success', { ...step1Values.value, ...step2Values.value });
     } finally {
@@ -94,6 +111,12 @@
 
   function handleStepPrev() {
     current.value--;
+    if(current.value == 1){
+      step2Values.value = '';
+    }
+    if(current.value == 0){
+      step1Values.value = '';
+    }
   }
 
   function handleStep2Next(Values: any) {

--
Gitblit v1.9.3