Merge branch 'master' of ssh://dev.pollex.com.tw:29418/pcalife/PAM
¤ñ¹ï·sÀÉ®× |
| | |
| | | import { service } from '~/assets/ts/api/share'; |
| | | import { AxiosResponse } from 'axios'; |
| | | |
| | | // å徿æé ç´æ¸
å® |
| | | export function getMyAppointmentList():Promise<AxiosResponse<ClientInfo>> { |
| | | const headers = { |
| | | Authorization: 'Bearer ' + localStorage.getItem('id_token') |
| | | } |
| | | return service.get('/consultant/getMyAppointment', {headers}); |
| | | } |
| | | |
| | | // æ¨è¨çºå·²è¯çµ¡ |
| | | export function markAsContact(appointmentId: number) { |
| | | const headers = { |
| | | Authorization: 'Bearer ' + localStorage.getItem('id_token') |
| | | } |
| | | return service.post('/appointment/markAsContacted/'+appointmentId, undefined, {headers}) |
| | | } |
| | | |
| | | |
| | | export interface ClientInfo { |
| | | id: number, |
| | | phone: string, |
| | | email: string, |
| | | contactType: string, |
| | | gender: string, |
| | | age: string, |
| | | job: string, |
| | | requirement: string, |
| | | communicateStatus: string, |
| | | hopeContactTime: string, |
| | | otherRequirement: string, |
| | | appointmentDate: Date, |
| | | agentNo: string, |
| | | customerId: number, |
| | | name: string |
| | | } |
| | |
| | | import axios from 'axios'; |
| | | import { AxiosRequestConfig, AxiosError, AxiosResponse } from 'axios'; |
| | | import { MessageBox } from 'element-ui'; |
| | | import { functionsIn } from 'lodash'; |
| | | import Router from 'vue-router'; |
| | | |
| | | export const service = axios.create({ |
| | | baseURL: process.env.BASE_URL |
| | | }) |
| | | |
| | | service.interceptors.request.use(function (config: AxiosRequestConfig) { |
| | | return config; |
| | | }, function (error: AxiosError) { |
| | | return Promise.reject(error); |
| | | }); |
| | | |
| | | service.interceptors.response.use(function (response: AxiosResponse) { |
| | | return response; |
| | | }, function (error: AxiosError) { |
| | | return Promise.reject(error); |
| | | }); |
| | | import { service } from '~/assets/ts/api/share'; |
| | | import { AxiosResponse } from 'axios'; |
| | | |
| | | // 顧客ç»å
¥(TODO: OTPèªèéç¼å æ«æä½¿ç¨) |
| | | export function login(user: any) { |
| | |
| | | const headers = { |
| | | Authorization: 'Bearer ' + localStorage.getItem('id_token') |
| | | } |
| | | return service.post('/appointment/customer/create', data ,{headers}) |
| | | return service.post('/appointment/customer/create', data, {headers}) |
| | | } |
| | | |
| | | //é¡§å詳細è³è¨ |
| | |
| | | return service.get('/consultant/detail', {params:{agentNo:agentNo}}) |
| | | } |
| | | |
| | | // å徿æé ç´æ¸
å® |
| | | export function getMyAppointmentList():Promise<AxiosResponse<ClientInfo>> { |
| | | // ç§»é¤é¡§å |
| | | export function deleteConsultant(agentId: string) { |
| | | const headers = { |
| | | Authorization: 'Bearer ' + localStorage.getItem('id_token') |
| | | } |
| | | return service.get('/consultant/getMyAppointment', {headers}); |
| | | return service.delete('/consultant/favorite/'+agentId, {headers}) |
| | | } |
| | | |
| | | // å¿è¨å¯ç¢¼ç¶²å |
| | |
| | | new: boolean; |
| | | } |
| | | |
| | | export interface ClientInfo { |
| | | id: number, |
| | | phone: string, |
| | | email: string, |
| | | contactType: string, |
| | | gender: string, |
| | | age: string, |
| | | job: string, |
| | | requirement: string, |
| | | communicateStatus: string, |
| | | hopeContactTime: string, |
| | | otherRequirement: string, |
| | | appointmentDate: Date, |
| | | agentNo: string, |
| | | customerId: number, |
| | | name: string |
| | | } |
¤ñ¹ï·sÀÉ®× |
| | |
| | | import axios from 'axios'; |
| | | import { AxiosRequestConfig, AxiosError, AxiosResponse } from 'axios'; |
| | | |
| | | export const service = axios.create({ |
| | | baseURL: process.env.BASE_URL |
| | | }) |
| | | |
| | | service.interceptors.request.use(function (config: AxiosRequestConfig) { |
| | | return config; |
| | | }, function (error: AxiosError) { |
| | | return Promise.reject(error); |
| | | }); |
| | | |
| | | service.interceptors.response.use(function (response: AxiosResponse) { |
| | | return response; |
| | | }, function (error: AxiosError) { |
| | | return Promise.reject(error); |
| | | }); |
| | |
| | | <p>æ§å¥ï¼{{client.gender === 'male' ? 'ç·æ§' : '女æ§'}}</p> |
| | | <p>年齡ï¼{{client.age}}</p> |
| | | <p>è·æ¥ï¼{{client.job}}</p> |
| | | <p>éæ±ï¼{{client.requirements}}</p> |
| | | <p>é£çµ¡ææ®µä¸ï¼{{hopeContactTime}}</p> |
| | | <p>éæ±ï¼{{client.requirement.replace(',', 'ã')}}</p> |
| | | <p v-for="(item, index) in hopeContactTime" :key="index">é£çµ¡ææ®µ{{index + 1 | formatNumber}}ï¼{{item}}</p> |
| | | <div class="mt-30 text--center" v-if="isReserved"> |
| | | <el-button>æ¨è¨»çºå·²é£çµ¡</el-button> |
| | | <el-button @click="markAppointment">æ¨è¨»çºå·²é£çµ¡</el-button> |
| | | </div> |
| | | |
| | | </div> |
| | | </Ui-Dialog> |
| | | </div> |
| | |
| | | |
| | | <script lang="ts"> |
| | | import { Vue, Component, Prop } from 'nuxt-property-decorator'; |
| | | import { ClientInfo } from '~/assets/ts/api/consultant'; |
| | | import { isMobileDevice } from '~/assets/ts/device'; |
| | | import { ClientInfo, markAsContact } from '~/assets/ts/api/appointment'; |
| | | |
| | | @Component |
| | | @Component({ |
| | | filters: { |
| | | formatNumber(index: number) { |
| | | if (index) { |
| | | const upperNumber = ['é¶', 'ä¸', 'äº', 'ä¸', 'å', 'äº', 'å
', 'ä¸', 'å
«', 'ä¹', 'å'] |
| | | return upperNumber[index]; |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | export default class ClientList extends Vue { |
| | | @Prop() client!: ClientInfo; |
| | | isVisibleDialog = false; |
| | |
| | | } |
| | | |
| | | get hopeContactTime() { |
| | | return this.client.hopeContactTime.slice(1, this.client.hopeContactTime.length - 1) |
| | | const contactList = this.client.hopeContactTime.split("'").map(item => item.slice(0, item.length - 1)); |
| | | return contactList.filter(item => !!item) |
| | | } |
| | | |
| | | get time() { |
| | | if (this.client.appointmentDate) { |
| | | const newDate = new Date(this.client.appointmentDate); |
| | | const hours = newDate.getHours(); |
| | | const minutes = newDate.getMinutes(); |
| | | return `${hours} : ${minutes}` |
| | | } |
| | | return '' |
| | | const formatDate = (this.$options.filters as any).formatDate(this.client.appointmentDate); |
| | | return formatDate.split(' ')[1] |
| | | } |
| | | |
| | | get date() { |
| | | if (this.client.appointmentDate) { |
| | | const newDate = new Date(this.client.appointmentDate); |
| | | const month = newDate.getMonth(); |
| | | const date = newDate.getDate(); |
| | | return `${month} / ${date}` |
| | | } |
| | | return '' |
| | | const formatDate = (this.$options.filters as any).formatDate(this.client.appointmentDate); |
| | | return formatDate.split(' ')[0] |
| | | } |
| | | |
| | | get isReserved() { |
| | |
| | | this.isVisibleDialog = true; |
| | | } |
| | | |
| | | markAppointment() { |
| | | markAsContact(this.client.id).then(res => this.$router.go(0)) |
| | | } |
| | | |
| | | } |
| | | </script> |
| | | |
| | |
| | | |
| | | <script lang='ts'> |
| | | import { Vue, Component, Prop } from 'nuxt-property-decorator'; |
| | | import { ClientInfo } from '~/assets/ts/api/consultant'; |
| | | import { ClientInfo } from '~/assets/ts/api/appointment'; |
| | | |
| | | @Component |
| | | export default class ClientList extends Vue { |
| | |
| | | </div> |
| | | <div |
| | | class="delete" |
| | | v-if="agentInfo.contactStatus !== 'reserved' |
| | | || agentInfo.contactStatus !== 'contacted'" |
| | | v-if="agentInfo.contactStatus === 'picked' |
| | | || !agentInfo.contactStatus" |
| | | @click="removeAgent" |
| | | >ç§»é¤</div> |
| | | </el-col> |
| | |
| | | <script lang="ts"> |
| | | import { Vue, Component, State, Action } from 'nuxt-property-decorator'; |
| | | import { getFavoriteFromStorage, setFavoriteToStorage } from '~/assets/ts/storageConsultant'; |
| | | import { addFavoriteConsultant, Consultants } from '~/assets/ts/api/consultant'; |
| | | import { addFavoriteConsultant, Consultants, deleteConsultant } from '~/assets/ts/api/consultant'; |
| | | import { login, getFavoriteConsultant } from '~/assets/ts/api/consultant'; |
| | | import { isLogin } from '~/assets/ts/auth'; |
| | | |
| | |
| | | } |
| | | |
| | | removeAgent(agentNo: string) { |
| | | const findIndex = this.consultantList.findIndex((item, i) => { |
| | | return item.agentNo === agentNo; |
| | | }) |
| | | this.consultantList.splice(findIndex, 1); |
| | | |
| | | if (!isLogin()) { |
| | | const findIndex = this.consultantList.findIndex((item, i) => { |
| | | return item.agentNo === agentNo; |
| | | }) |
| | | this.consultantList.splice(findIndex, 1); |
| | | setFavoriteToStorage(this.consultantList) |
| | | } else { |
| | | deleteConsultant(agentNo).then(res => this.$router.go(0)) |
| | | } |
| | | } |
| | | } |
| | |
| | | <script lang="ts"> |
| | | import { Context } from '@nuxt/types'; |
| | | import { Vue, Component } from 'nuxt-property-decorator'; |
| | | import { ClientInfo, getMyAppointmentList } from '~/assets/ts/api/consultant'; |
| | | import { ClientInfo, getMyAppointmentList } from '~/assets/ts/api/appointment'; |
| | | |
| | | @Component |
| | | export default class ClientReservedList extends Vue { |
| | |
| | | |
| | | <script lang="ts"> |
| | | import { Vue, Component, Prop } from 'nuxt-property-decorator'; |
| | | import { ClientInfo } from '~/assets/ts/api/consultant'; |
| | | import { ClientInfo } from '~/assets/ts/api/appointment'; |
| | | |
| | | @Component |
| | | export default class ClientReservedList extends Vue { |
| | |
| | | |
| | | <script lang="ts"> |
| | | import { Vue, Component, Prop } from 'nuxt-property-decorator'; |
| | | import { ClientInfo } from '~/assets/ts/api/consultant'; |
| | | import { ClientInfo } from '~/assets/ts/api/appointment'; |
| | | |
| | | @Component |
| | | export default class ClientContactedList extends Vue { |
| | |
| | | import { Vue, Component, Watch } from 'vue-property-decorator'; |
| | | import { Route } from 'vue-router/types/router.d' |
| | | import { getFavoriteFromStorage, setFavoriteToStorage } from '~/assets/ts/storageConsultant'; |
| | | import { Consultants, getFavoriteConsultant } from '~/assets/ts/api/consultant'; |
| | | import { Consultants, deleteConsultant, getFavoriteConsultant } from '~/assets/ts/api/consultant'; |
| | | import { isLogin } from '~/assets/ts/auth'; |
| | | |
| | | @Component |
| | |
| | | } |
| | | |
| | | removeAgent(agentNo: string) { |
| | | const fintIndex = this.consultantList.findIndex(item => item.agentNo === agentNo); |
| | | this.consultantList.splice(fintIndex, 1); |
| | | if (!isLogin()) { |
| | | const fintIndex = this.consultantList.findIndex(item => item.agentNo === agentNo); |
| | | this.consultantList.splice(fintIndex, 1); |
| | | setFavoriteToStorage(this.consultantList); |
| | | } else { |
| | | deleteConsultant(agentNo).then(res => this.$router.go(0)) |
| | | } |
| | | } |
| | | |