import { Context } from '@nuxt/types';
|
import { namespace } from 'nuxt-property-decorator';
|
import { Vue, Component } from 'vue-property-decorator';
|
|
import { getConsultantDetail } from '~/assets/ts/api/consultant';
|
|
import { Role } from '~/assets/ts/models/enum/role.enum';
|
import { AgentInfo } from '~/assets/ts/models/agentInfo.model';
|
|
const roleStorage = namespace('localStorage');
|
@Component
|
export default class AgentInfoComponent extends Vue {
|
@roleStorage.Getter currentRole!:string|null;
|
role = Role;
|
agentInfo!: AgentInfo;
|
isAlertAddSuccess = false;
|
isAlertFieldInfo = false;
|
fieldInfoTitle = '';
|
fieldInfoDesc = '';
|
|
async asyncData(context: Context) {
|
const agentNo = context.route.params.agentNo;
|
let agentInfo = {};
|
await getConsultantDetail(agentNo).then((res) => agentInfo = res.data )
|
return {
|
agentInfo
|
}
|
}
|
|
get agentName(): string {
|
return `${this.agentInfo.name}(${this.agentInfo.role})`;
|
}
|
|
alertAddSuccess() {
|
this.isAlertAddSuccess = true;
|
}
|
|
alertFieldInfo(field: string): void {
|
this.isAlertFieldInfo = true;
|
switch(field) {
|
case 'suitability':
|
this.fieldInfoTitle = '匹配度';
|
this.fieldInfoDesc = '匹配度是透過嚴選配對或快速篩選後,將每一位保險顧問資料進行比對後排序推薦給您的媒合數值,您可以作為選擇適合顧問的參考值。';
|
break;
|
case 'evaluation':
|
this.fieldInfoTitle = '諮詢度表現';
|
this.fieldInfoDesc = '諮詢度表現是將每一位保險顧問近一個月回覆諮詢數量進行比對後排序推薦給您的媒合數值。';
|
break;
|
}
|
}
|
}
|