保誠-保戶業務員媒合平台
charlie
2022-01-20 ea96831935bdf65bbf82377a539221aa6885a4e8
update:顧問結案時的輸入資料驗證
修改1個檔案
40 ■■■■■ 已變更過的檔案
PAMapp/pages/appointment/_appointmentId/close/index.vue 40 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
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
@@ -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;
  }
 .error {
    @extend .smTxt_bold;
    @extend .text--primary;
    height: 16px;
  }
</style>