diff --git a/src/views/Workshop/home.vue b/src/views/Workshop/home.vue index 783c6c2..29dc2b2 100644 --- a/src/views/Workshop/home.vue +++ b/src/views/Workshop/home.vue @@ -8,7 +8,7 @@ import { FlowType } from '@/types/enum' //const props = defineProps({ //}) const emit = defineEmits([ - 'view-type' + 'viewType' ]) // const data = reactive({ @@ -23,7 +23,7 @@ const historicalReview = ()=>{ } onMounted(()=>{ - emit('view-type', 1) + emit('viewType', 1) }) onUnmounted(()=>{ }) diff --git a/src/views/Workshop/profile.vue b/src/views/Workshop/profile.vue index c221087..ae7eafa 100644 --- a/src/views/Workshop/profile.vue +++ b/src/views/Workshop/profile.vue @@ -4,9 +4,13 @@ import router from '@/router' import { showConfirmDialog } from 'vant' import { useUserInfoStore, useOverallStore } from '@/stores' import { LogOut } from '@/api/login' -import { getCustomerList, type CustomerListParams } from '@/api/workshop' +import { getCustomerList, type CustomerListParams,customerCheckin } from '@/api/workshop' import MyEvent from '@/utils/myEvent' +const props = defineProps<{ + isCustomer?: boolean +}>() + const userInfoStore = useUserInfoStore() const overallStore = useOverallStore() const emit = defineEmits(['view-type', 'selected-customer']) @@ -148,6 +152,14 @@ const handleSelectCustomer = () => { if (selectedCustomer) { emit('selected-customer', selectedCustomer) } + if(!props.isCustomer){ + // show.value = true + customerCheckin({ nickname: selectedCustomer.name }).then((res) => { + useUserInfoStore().resetGenerateParams() + MyEvent.emit('clear-generate-state') + useUserInfoStore().setCustomerInfo(res) + }) + } showSwitchCustomerPopup.value = false } diff --git a/src/views/login/customer.vue b/src/views/login/customer.vue index 0e49d5d..4df7116 100644 --- a/src/views/login/customer.vue +++ b/src/views/login/customer.vue @@ -58,7 +58,7 @@ - +