TODO#130023 客戶預約清單: 串接標註已聯絡 api
¤ñ¹ï·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) { |
| | |
| | | |
| | | // é ç´åè©¢å |
| | | export function appointmentDemand(data: AppointmentParams) { |
| | | return service.post('/appointment/customer/create', data) |
| | | const headers = { |
| | | Authorization: 'Bearer ' + localStorage.getItem('id_token') |
| | | } |
| | | return service.post('/appointment/customer/create', data, {headers}) |
| | | } |
| | | |
| | | //é¡§å詳細è³è¨ |
| | |
| | | return service.get('/consultant/detail', {params:{agentNo:agentNo}}) |
| | | } |
| | | |
| | | // å徿æé ç´æ¸
å® |
| | | export function getMyAppointmentList():Promise<AxiosResponse<ClientInfo>> { |
| | | const headers = { |
| | | Authorization: 'Bearer ' + localStorage.getItem('id_token') |
| | | } |
| | | return service.get('/consultant/getMyAppointment', {headers}); |
| | | } |
| | | export interface Consultants { |
| | | agentNo: string, |
| | | name: string, |
| | |
| | | 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 => console.log(res)) |
| | | } |
| | | |
| | | } |
| | | </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 { |
| | |
| | | <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 { |