diff --git a/src/pages/03_customer-management/CustomerDialog.vue b/src/pages/03_customer-management/CustomerDialog.vue new file mode 100644 index 00000000..e69de29b diff --git a/src/pages/03_customer-management/MainPage.vue b/src/pages/03_customer-management/MainPage.vue index 4c4c5344..79095e9a 100644 --- a/src/pages/03_customer-management/MainPage.vue +++ b/src/pages/03_customer-management/MainPage.vue @@ -9,7 +9,7 @@ import { calculateAge, dateFormat } from 'src/utils/datetime'; import useCustomerStore from 'stores/customer'; import useEmployeeStore from 'stores/employee'; import useMyBranchStore from 'stores/my-branch'; -import useUtilsStore, { dialog } from 'stores/utils'; +import useUtilsStore, { dialog, notify } from 'stores/utils'; import useFlowStore from 'stores/flow'; import { Status } from 'stores/types'; import { CustomerStats, Customer, CustomerBranch } from 'stores/customer/types'; @@ -20,7 +20,7 @@ import ButtonAddComponent from 'components/ButtonAddCompoent.vue'; import PersonCard from 'components/home/PersonCard.vue'; import StatCardComponent from 'components/StatCardComponent.vue'; import TooltipComponent from 'components/TooltipComponent.vue'; -import AddButton from 'components/AddButton.vue'; +import EmptyAddButton from 'components/AddButton.vue'; import NoData from 'components/NoData.vue'; import PaginationComponent from 'components/PaginationComponent.vue'; import DialogForm from 'components/DialogForm.vue'; @@ -33,6 +33,7 @@ import CustomerInfoComponent from './components/CustomerBranch.vue'; import FormAddress from 'src/components/02_personnel-management/FormAddress.vue'; import FormEmployeePassport from 'src/components/03_customer-management/FormEmployeePassport.vue'; import FormEmployeeVisa from 'src/components/03_customer-management/FormEmployeeVisa.vue'; +import { AddButton } from 'src/components/button'; import { columnsCustomer, @@ -47,6 +48,7 @@ import FormEmployeeHealthCheck from 'src/components/03_customer-management/FormE import FormEmployeeWorkHistory from 'src/components/03_customer-management/FormEmployeeWorkHistory.vue'; import FormEmployeeOther from 'src/components/03_customer-management/FormEmployeeOther.vue'; import useOptionStore from 'src/stores/options'; +import { DialogContainer, DialogHeader } from 'src/components/dialog'; const { t, locale } = useI18n(); const $q = useQuasar(); @@ -449,7 +451,7 @@ function customerConfirmUnsave(close = true) { message: t('form.warning.unsave'), action: () => { customerFormStore.resetForm(); - customerFormState.value.editReadonly = true; + customerFormState.value.readonly = true; customerFormState.value.dialogModal = !close; }, cancel: () => {}, @@ -461,7 +463,7 @@ function customerFormUndo(close = true) { return customerConfirmUnsave(close); } customerFormStore.resetForm(); - customerFormState.value.editReadonly = true; + customerFormState.value.readonly = true; } function createCustomerForm(customerType: 'CORP' | 'PERS') { @@ -1734,7 +1736,7 @@ watch( class="row items-center justify-center" style="flex-grow: 1" > - -
+ + +
-
-
- +
+
+ +
+
+
+ + > + + +
+
+ + {{ $t('customer.form.group.branch') }} + +
+ + + +
-
- - -
- - - - - - - - - - - - + (); +defineEmits<{ + (e: 'save'): void; + (e: 'edit'): void; + (e: 'delete'): void; + (e: 'cancel'): void; +}>(); const personName = defineModel('personName', { required: true }); const customerName = defineModel('customerName', { required: true }); @@ -65,15 +79,32 @@ watch( style="background-color: var(--surface-3)" /> {{ $t('customer.form.group.basicInfo') }} - + + +
+import { ref } from 'vue'; import FormAddress from 'src/components/02_personnel-management/FormAddress.vue'; import FormBusiness from './FormBusiness.vue'; import { CustomerCreate } from 'src/stores/customer/types'; import { dateFormat, parseAndFormatDate } from 'src/utils/datetime'; -import { ref, watch } from 'vue'; +import FormContact from './FormContact.vue'; +import { EditButton } from 'src/components/button'; +import DeleteButton from 'src/components/button/DeleteButton.vue'; +import SaveButton from 'src/components/button/SaveButton.vue'; +import CancelButton from 'src/components/button/CancelButton.vue'; -const branch = defineModel('customerBranch', { - default: [], -}); - -const tab = ref< +const item = defineModel[number]>( + 'customerBranch', { - branch: NonNullable[number]; - tab: string; - }[] ->([]); - -watch( - branch, - () => { - tab.value = - branch.value?.map((a) => ({ - branch: a, - tab: - tab.value.find((b) => (b.branch === a ? true : b.branch.id === a.id)) - ?.tab || 'main', - })) || []; + required: true, + default: [], }, - { deep: true }, ); +const tab = ref('main'); defineEmits<{ - (e: 'addBranch'): void; - (e: 'saveBranch', i: number, v: (typeof tab.value)[number]['branch']): void; - (e: 'deleteBranch', i: number, v: (typeof tab.value)[number]['branch']): void; + (e: 'edit'): void; + (e: 'save'): void; + (e: 'cancel'): void; + (e: 'delete'): void; }>(); + defineProps<{ - editable?: boolean; + readonly?: boolean; prefixId?: string; + actionDisabled?: boolean; customerType?: 'CORP' | 'PERS'; }>();