保誠-保戶業務員媒合平台
Mila
2021-11-11 8d823f18353363e61b11b547c443aff8bbf85d95
PAMapp/pages/questionnaire/_agentNo.vue
File was renamed from PAMapp/pages/questionnaire/index.vue
@@ -63,7 +63,7 @@
            <i class="icon-down down-icon " style="margin-right:18px" @click="showJobDrawer = true" ></i>
        </div>
        <div class="ques-footer pt-30">
            <el-button type="primary" @click="sendReserve = true">送出</el-button>
            <el-button type="primary" @click="sentDemand">送出</el-button>
        </div>
        <PopUpFrame :isOpen.sync="showDrawer" :drawerSize=" '95%' ">
@@ -93,15 +93,16 @@
                <el-button type="primary" class="job-drawerBtn" @click="showJobDrawer = false">確定</el-button>
            </div>         
        </PopUpFrame>
        <PopUpFrame :isOpen.sync="sendReserve">
        <PopUpFrame :isOpen.sync="sendReserve" @update:isOpen="closeReservePopUp">
            <div class="fz-20 mt-30 sendReserve-txt">預約成功!您預約的保險顧問會</div>
            <div class="fz-20 sendReserve-txt">儘速與您聯絡!</div>
            <div class="qa-dialog-footer mdTxt" @click="sendReserve = false"><p>我知道了</p></div>
            <div class="qa-dialog-footer mdTxt" @click="closeReservePopUp"><p>我知道了</p></div>
        </PopUpFrame>
    </div>
</template>
<script lang="ts">
import { Vue, Component } from 'vue-property-decorator';
import { appointmentDemand } from '~/assets/ts/api/consultant';
@Component
    export default class Questionnaire extends Vue {
@@ -112,7 +113,7 @@
                mobileNumber = '';
                email = '';
                inputValue='';
                selectedQuestion = [];
                selectedQuestion: SelectedQuestion[] = [];
                // staff:'in'|'out'|'jobOther'='in';
                staff = '外勤';
            
@@ -165,7 +166,7 @@
                        content:'匹配度是透過嚴選配對或快速篩選後,將每一位保險顧問資料進行比對後排序推薦給您的媒合數值,您可以作為選擇適合顧問的參考值。'
                    },
                ]
                agentNo!: string;
                get disableActionButton(): boolean {
                    return true;
@@ -179,6 +180,10 @@
                    return this.connectDevices.includes('email');
                }
                mounted() {
                    this.agentNo = this.$route.params.agentNo;
                }
                toggleConnectDevice(selectDevice: 'mobile' | 'email'): void {
                    const deviceSelected = this.connectDevices.includes(selectDevice);
                    if (deviceSelected) {
@@ -189,6 +194,51 @@
                    this.connectDevices.push(selectDevice);
                }
                sentDemand() {
                    const data = {
                        phone: '09123456789',
                        email: this.email,
                        contactType: this.connectDevices.toString(),
                        gender: this.gender,
                        age: this.age,
                        job: this.staff,
                        requirement: this.getRequirement(),
                        hopeContactTime: this.getHopeContactTime(),
                        otherRequirement: '',
                        agentNo: this.agentNo
                    }
                    appointmentDemand(data).then(res => {
                        this.sendReserve = true
                    })
                }
                getRequirement() {
                    const requirement = this.selectedQuestion.filter(item => item.selected)
                    return requirement.map(item => item.name).toString();
                }
                getHopeContactTime() {
                    const initScheduleList = this.initScheduleList.map(item => {
                        return {
                            selectWeekOptions: item.selectWeekOptions.toString(),
                            selectTimesOptions: item.selectTimesOptions.toString()
                        }
                    })
                    return initScheduleList.map(i => {
                        return `'${i.selectWeekOptions},${i.selectTimesOptions}'`}
                    ).toString()
                }
                closeReservePopUp() {
                    this.sendReserve = false;
                    this.$router.push('/')
                }
    }
    export interface SelectedQuestion {
        name: string;
        selected: boolean;
    }
</script>
<style lang="scss">