diff --git a/src/components/displays/department/pos/steps/mobile/PosDepartmentStepMobile1.vue b/src/components/displays/department/pos/steps/mobile/PosDepartmentStepMobile1.vue index 2c3c80e6..07056d07 100644 --- a/src/components/displays/department/pos/steps/mobile/PosDepartmentStepMobile1.vue +++ b/src/components/displays/department/pos/steps/mobile/PosDepartmentStepMobile1.vue @@ -31,7 +31,10 @@ import PosDepartmentStepMobileAttachments from "@/components/displays/department/pos/steps/mobile/elements/PosDepartmentStepMobileAttachments.vue"; import PosDepartmentStep1MobileTransactionHistory from "@/components/displays/department/pos/steps/mobile/views/PosDepartmentStep1MobileTransactionHistory.vue"; -import {attachments} from "@/components/displays/department/pos/steps/mobile/objects/PosDepartmentStepMobileFlow.vue"; +import { + attachments, + popups +} from "@/components/displays/department/pos/steps/mobile/objects/PosDepartmentStepMobileFlow.vue"; // Debug mode flag const debug_mode = ref(false); // Debug array to store request results diff --git a/src/components/displays/department/pos/steps/mobile/elements/PosDepartmentStepMobilePopupAddCustomer.vue b/src/components/displays/department/pos/steps/mobile/elements/PosDepartmentStepMobilePopupAddCustomer.vue new file mode 100644 index 00000000..6ea6ec0e --- /dev/null +++ b/src/components/displays/department/pos/steps/mobile/elements/PosDepartmentStepMobilePopupAddCustomer.vue @@ -0,0 +1,228 @@ + + + + + + + CVR + + + + + + + + + {{ searchResult.name }} + + + + Firma telefon + + + + + + + Faktura email + + + + + + + Kontakt email + + + + + + + Kontakt telefon + + + + + + + {{ popups.get().props.error}} + + + + + + + + \ No newline at end of file diff --git a/src/components/displays/department/pos/steps/mobile/objects/PosDepartmentStepMobileFlow.vue b/src/components/displays/department/pos/steps/mobile/objects/PosDepartmentStepMobileFlow.vue index 0960b3d3..6dd2d22d 100644 --- a/src/components/displays/department/pos/steps/mobile/objects/PosDepartmentStepMobileFlow.vue +++ b/src/components/displays/department/pos/steps/mobile/objects/PosDepartmentStepMobileFlow.vue @@ -157,6 +157,16 @@ const defaultActionButtons = ref<{ [key: string]: PosActionButton }>({ }, color: 'primary' }, + addCustomer: { + label: 'Tilføj kunde', + description: 'Tilføj en ny kunde til systemet', + onClick: () => { + console.warn('Add Customer button clicked'); + // Open the add customer popup + popups.select('add_customer', { props: { error: null, canCreate: true } }); + }, + color: 'primary', + }, editReference: { label: 'Redigér reference', description: 'Redigér reference for denne transaktion', @@ -229,7 +239,7 @@ const addDefaultPopups = () => { message: 'Bekræft venligst valget af kunde til denne transaktion', component: 'select_customer', style: {height: '50vh'}, - actionButtons: [{...defaultActionButtons.value.cancel}], + actionButtons: [{...defaultActionButtons.value.cancel}, {...defaultActionButtons.value.addCustomer, label: 'Ny kunde'}], }); // Completed addPopup({ @@ -315,6 +325,18 @@ const addDefaultPopups = () => { ], props: {base64String: null, filename: null} }); + // Add customer + addPopup({ + id: 'add_customer', + title: 'Tilføj kunde', + message: 'Indtast venligst oplysninger for den nye kunde', + component: 'add_customer', + style: {maxHeight: '60vh'}, + actionButtons: [ + {...defaultActionButtons.value.cancel} + ], + props: {cvr: null, contactEmail: null, contactPhone: null, companyPhone: null, invoiceEmail: null, searchResult: null, canCreate: false, error: null} + }); } // Function to check if a popup is defined in the list const isPopupDefined = (id: string): boolean => { diff --git a/src/components/displays/department/pos/steps/mobile/objects/PosPopup.vue b/src/components/displays/department/pos/steps/mobile/objects/PosPopup.vue index 05a52374..2a32d3c0 100644 --- a/src/components/displays/department/pos/steps/mobile/objects/PosPopup.vue +++ b/src/components/displays/department/pos/steps/mobile/objects/PosPopup.vue @@ -20,8 +20,10 @@ import PosDepartmentStepMobilePopupCustomerNotes from "@/components/displays/department/pos/steps/mobile/elements/PosDepartmentStepMobilePopupCustomerNotes.vue"; import PosDepartmentStepMobilePopupImage from "@/components/displays/department/pos/steps/mobile/elements/PosDepartmentStepMobilePopupImage.vue"; +import PosDepartmentStepMobilePopupAddCustomer + from "@/components/displays/department/pos/steps/mobile/elements/PosDepartmentStepMobilePopupAddCustomer.vue"; -export type PopupComponentKey = 'select_customer' | 'completed_transaction' | 'complete_booking' | 'error' | 'add_product_note' | 'select_vehicle' | 'change_reference' | 'customer_notes' | 'image_viewer'; +export type PopupComponentKey = 'select_customer' | 'completed_transaction' | 'complete_booking' | 'error' | 'add_product_note' | 'select_vehicle' | 'change_reference' | 'customer_notes' | 'image_viewer' | 'add_customer'; export const PopupComponents = { select_customer: PosDepartmentStepMobilePopupSelectCustomer, @@ -33,6 +35,7 @@ export const PopupComponents = { change_reference: PosDepartmentStepMobilePopupSetReference, customer_notes: PosDepartmentStepMobilePopupCustomerNotes, image_viewer: PosDepartmentStepMobilePopupImage, + add_customer: PosDepartmentStepMobilePopupAddCustomer } as const; export const popupComponentKeyToComponent = (key: PopupComponentKey) => PopupComponents[key]; @@ -64,6 +67,7 @@ export default defineComponent({ PosDepartmentStepMobilePopupSetReference, PosDepartmentStepMobilePopupCustomerNotes, PosDepartmentStepMobilePopupImage, + PosDepartmentStepMobilePopupAddCustomer }, props: { popup: {
{{ searchResult.name }}