From ea96831935bdf65bbf82377a539221aa6885a4e8 Mon Sep 17 00:00:00 2001 From: charlie <charlie@lvguanqingdeMacBook-Pro.local> Date: 星期四, 20 一月 2022 09:53:11 +0800 Subject: [PATCH] update:顧問結案時的輸入資料驗證 --- PAMapp/pages/appointment/_appointmentId/close/index.vue | 48 ++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 42 insertions(+), 6 deletions(-) diff --git a/PAMapp/pages/appointment/_appointmentId/close/index.vue b/PAMapp/pages/appointment/_appointmentId/close/index.vue index d6fa3da..09d6b8b 100644 --- a/PAMapp/pages/appointment/_appointmentId/close/index.vue +++ b/PAMapp/pages/appointment/_appointmentId/close/index.vue @@ -14,14 +14,18 @@ <template v-if="appointmentCloseInfo.selectCloseOption === 'done'"> <el-row type="flex" - class="pam-paragraph"> + class="pam-paragraph" style="flex-direction: column"> <UiField label="靽頨怠�����" :labelSize="20"> <input class="appointment-client-detail-close__input" + :class="{'is-invalid':!identityIdValid}" v-model="appointmentCloseInfo.policyholderIdentityId" placeholder="隢撓�" type="text"> </UiField> + <div class="error mt-5 mb-5" v-show="!identityIdValid"> + <span>頨怠����撘�炊</span> + </div> </el-row> <el-row @@ -40,7 +44,7 @@ type="flex" class="pam-paragraph"> <UiField label="�脖辣����" :labelSize="20"> - <DateTimePicker @changeDateTime="appointmentCloseDate = $event"></DateTimePicker> + <DateTimePicker @changeDateTime="appointmentCloseDate = $event"></DateTimePicker> </UiField> </el-row> </template> @@ -100,7 +104,7 @@ justify="center" class="pam-paragraph"> <el-button @click="$router.go(-1)">����</el-button> - <el-button @click="closeAppointment">蝣箄��</el-button> + <el-button @click="closeAppointment" :disabled="isSubmitBtnDisabled">蝣箄��</el-button> </el-row> <PopUpFrame :isOpen.sync="isShowSuccessAlert"> @@ -212,6 +216,30 @@ this.$router.push(`/myAppointmentList/contactedList`); } + get isSubmitBtnDisabled() { + const { + selectCloseOption, + policyholderIdentityId, + planCode, + remark, + closedReason, + closedOtherReason + } = this.appointmentCloseInfo; + // this.appointmentCloseInfo.policyEntryDate 銝行��齒瘜��澆 this.appointmentCloseDate + if (selectCloseOption === 'done') { + return !policyholderIdentityId || !this.identityIdValid || !planCode || !this.appointmentCloseDate || !remark + } else if (closedReason === 'other' || closedReason === 'no_suitable_commodity') { + return !closedOtherReason || !remark + } + return !remark + } + + get identityIdValid() { + const rule = /^[A-Z]\d{9}$/; + const identityId = this.appointmentCloseInfo.policyholderIdentityId; + return identityId ? rule.test(identityId) : true; + } + } </script> @@ -227,10 +255,18 @@ &::placeholder { color: $MID_GREY; } + &.is-invalid { + border-color: $PRIMARY_RED !important; + } } .invite-review{ - display: flex; - flex-direction: column; - align-items: center; + display: flex; + flex-direction: column; + align-items: center; +} + .error { + @extend .smTxt_bold; + @extend .text--primary; + height: 16px; } </style> -- Gitblit v1.8.0