保誠-保戶業務員媒合平台
wayne
2022-03-10 e8241decc705f9db3e46aed7b3a3f8b3188cf820
PAMapp/pages/appointment/_appointmentId/close/index.vue
@@ -17,7 +17,7 @@
          class="pam-paragraph" style="flex-direction: column">
          <UiField label="身分證字號/居留證字號" :labelSize="20" class="required">
            <input
              class="appointment-client-detail-close__input"
              class="appointment-client-detail-close__input mt-10"
              :class="{'is-invalid':!identityIdValid}"
              v-model="appointmentCloseInfo.policyholderIdentityId"
              placeholder="請輸入"
@@ -33,7 +33,7 @@
          class="pam-paragraph">
          <UiField label="商品代碼Plan Code" :labelSize="20" class="required">
            <input
              class="appointment-client-detail-close__input"
              class="appointment-client-detail-close__input mt-10"
              v-model="appointmentCloseInfo.planCode"
              placeholder="請輸入"
              type="text">
@@ -46,6 +46,7 @@
          <UiField label="進件時間" :labelSize="20" class="required">
            <DateTimePicker
              :defaultValue="appointmentCloseInfo.policyEntryDate"
              class="mt-10"
              @changeDateTime="appointmentCloseDate = $event"></DateTimePicker>
          </UiField>
        </el-row>
@@ -56,7 +57,7 @@
          class="pam-paragraph">
          <UiField label="未成交原因" :labelSize="20" class="required">
            <UiSelect :closeReason.sync="appointmentCloseInfo.closedReason"
              :options="appointmentFailReason"/>
              :options="appointmentFailReason" class="mt-10"/>
          </UiField>
          <input
            v-if="appointmentCloseInfo.closedReason === 'other'
@@ -73,6 +74,7 @@
        class="pam-paragraph">
        <UiField label="備註" :labelSize="20">
          <el-input
          class="mt-10"
            type="textarea"
            :rows="3"
            placeholder="請輸入"
@@ -209,20 +211,17 @@
    this.$router.push(`/myAppointmentList/contactedList`);
  }
  checkIdentityId (id) {
    const tab = "ABCDEFGHJKLMNPQRSTUVXYWZIO";
    const A1 = [ 1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3 ];
    const A2 = [ 0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5 ];
    const Mx = [ 9,8,7,6,5,4,3,2,1,1 ];
    if ( id.length != 10 ) return false;
    let i = tab.indexOf( id.charAt(0) );
    if ( i === -1 ) return false;
    let sum = A1[i] + A2[i]*9;
    for ( i=1; i<10; i+=1 ) {
      let v = parseInt( id.charAt(i) );
      if (i === 1 && isNaN(v)) {
        switch(id.charAt(i)) {
  checkIdentityId(id) {
    const tab = 'ABCDEFGHJKLMNPQRSTUVXYWZIO';
    const weight = [9, 8, 7, 6, 5, 4, 3, 2, 1, 1];
    if (id.length !== 10) return false;
    let i = tab.indexOf(id.charAt(0)) + 10;
    if (i === 9) return false;
    let sum = Math.floor((i % 100) / 10) + (i % 10) * 9;
    for (i = 1; i < 10; i += 1) {
      let v = parseInt(id.charAt(i), 10);
      if (i === 1 && Number.isNaN(v)) {
        switch (id.charAt(i)) {
          case 'A':
            v = 0;
            break;
@@ -236,16 +235,16 @@
            v = 3;
            break;
          default:
            return false
            return false;
        }
      } else if ( i === 1  && ([1,2,8,9].indexOf(v) === -1) ) {
        return false
      } else if (i === 1 && ([1, 2, 8, 9].indexOf(v) === -1)) {
        return false;
      }
      if ( i > 1 && isNaN(v) ) return false;
      sum = sum + v * Mx[i];
      if (i > 1 && Number.isNaN(v)) return false;
      sum += v * weight[i];
    }
    if ( sum % 10 != 0 ) return false;
    if (sum % 10 !== 0) return false;
    return true;
  }