From e4f79a7e36214e5836cb0e667b3ffbd3db45456d Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期二, 22 十月 2024 23:54:26 +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