jws-frontend/src/layouts/DrawerComponent.vue

522 lines
14 KiB
Vue
Raw Normal View History

2024-04-02 11:02:16 +07:00
<script setup lang="ts">
2024-12-04 18:07:10 +07:00
import { computed, ref, onMounted, watch } from 'vue';
import { useRouter } from 'vue-router';
2024-07-10 13:21:32 +07:00
import { storeToRefs } from 'pinia';
2024-04-05 17:58:34 +07:00
import { Icon } from '@iconify/vue';
2024-07-10 13:21:32 +07:00
import useMyBranch from 'stores/my-branch';
import { getUserId, getRole } from 'src/services/keycloak';
refactor: responsive (#180) * refactor: can open one dropdown whe lt.md * style: update MainLayout background color and fix avatar border class name * feat: add touch position binding for dropdown in ProfileMenu * refactor: enhance icon styling in DrawerComponent * fix: update screen size conditions * feat: add responsive search and filter functionality in MainPage * feat: update styling and functionality in BasicInformation and MainPage components * feat: package view mode improve layout and responsiveness * feat: improve layout and responsiveness of ProfileBanner component * feat: enhance TreeView component with improved icon layout and cursor pointer styling * feat: update DialogForm component to prevent text wrapping in the center column * feat: enhance FormDocument, PriceDataComponent, and BasicInfoProduct components with layout and styling improvements * feat: enhance ProfileBanner dark tab * feat: 02 => responsive & responsibleArea type * fix: layout header bg condition & 02 filter col * feat: 04 flow => add AddButton component and enhance layout in FormFlow and FlowDialog * feat: 07 => enhance layout and responsiveness * refactor: simplify header structure and improve layout consistency * fix: improve text color in ItemCard and adjust responsive breakpoints in product service group * refactor: 05 => enhance layout responsiveness and improve class bindings in quotation components * refactor: enhance styling and improve props flexibility in dialog and select components * refactor: 05 => enhance layout responsiveness in quotation components * refactor: 05 => enhance layout responsiveness * refactor: 05 => formWorkerAdd * refactor: 05 => formWorkerAdd Product table * refactor: 05 => improve layout responsiveness and enhance component structure * refactor: enhance grid view handling and improve component imports * refactor: improve column classes for better layout consistency * refactor: 09 => enhance layout structure and improve responsiveness in task order views * refactor: 10 => enhance invoice main page layout and improve component interactions * refactor: 13 => enhance receipt main page layout and improve component interactions * refactor: 11 => enhance layout and improve responsiveness in credit note pages * refactor: 01 => screen.sm search & filter * refactor: 01 => improve layout responsiveness and fix variable naming in branch management forms --------- Co-authored-by: puriphatt <puriphat@frappet.com>
2025-01-27 10:39:53 +07:00
import { useQuasar } from 'quasar';
2024-04-03 14:21:02 +07:00
2024-10-30 16:12:06 +07:00
type Menu = {
label: string;
route?: string;
icon?: string;
hidden?: boolean;
disabled?: boolean;
isax?: boolean;
children?: Menu[];
};
2024-07-04 09:53:16 +00:00
2024-10-30 16:05:27 +07:00
const router = useRouter();
refactor: responsive (#180) * refactor: can open one dropdown whe lt.md * style: update MainLayout background color and fix avatar border class name * feat: add touch position binding for dropdown in ProfileMenu * refactor: enhance icon styling in DrawerComponent * fix: update screen size conditions * feat: add responsive search and filter functionality in MainPage * feat: update styling and functionality in BasicInformation and MainPage components * feat: package view mode improve layout and responsiveness * feat: improve layout and responsiveness of ProfileBanner component * feat: enhance TreeView component with improved icon layout and cursor pointer styling * feat: update DialogForm component to prevent text wrapping in the center column * feat: enhance FormDocument, PriceDataComponent, and BasicInfoProduct components with layout and styling improvements * feat: enhance ProfileBanner dark tab * feat: 02 => responsive & responsibleArea type * fix: layout header bg condition & 02 filter col * feat: 04 flow => add AddButton component and enhance layout in FormFlow and FlowDialog * feat: 07 => enhance layout and responsiveness * refactor: simplify header structure and improve layout consistency * fix: improve text color in ItemCard and adjust responsive breakpoints in product service group * refactor: 05 => enhance layout responsiveness and improve class bindings in quotation components * refactor: enhance styling and improve props flexibility in dialog and select components * refactor: 05 => enhance layout responsiveness in quotation components * refactor: 05 => enhance layout responsiveness * refactor: 05 => formWorkerAdd * refactor: 05 => formWorkerAdd Product table * refactor: 05 => improve layout responsiveness and enhance component structure * refactor: enhance grid view handling and improve component imports * refactor: improve column classes for better layout consistency * refactor: 09 => enhance layout structure and improve responsiveness in task order views * refactor: 10 => enhance invoice main page layout and improve component interactions * refactor: 13 => enhance receipt main page layout and improve component interactions * refactor: 11 => enhance layout and improve responsiveness in credit note pages * refactor: 01 => screen.sm search & filter * refactor: 01 => improve layout responsiveness and fix variable naming in branch management forms --------- Co-authored-by: puriphatt <puriphat@frappet.com>
2025-01-27 10:39:53 +07:00
const $q = useQuasar();
2024-10-30 16:05:27 +07:00
const userBranch = useMyBranch();
const { currentMyBranch } = storeToRefs(userBranch);
2024-10-30 16:12:06 +07:00
const leftDrawerOpen = defineModel<boolean>('leftDrawerOpen', {
default: true,
});
const props = defineProps<{
mini?: boolean;
}>();
const role = ref();
2024-10-31 10:46:42 +07:00
const menuActive = ref<boolean[]>([]);
2024-10-30 16:12:06 +07:00
const menuData = ref<Menu[]>([]);
2024-10-30 16:05:27 +07:00
const currentPath = computed(() => {
return router.currentRoute.value.path;
});
function navigateTo(label: string, destination?: string) {
if (!destination) return;
router.push(`${destination}`);
}
function reActiveMenu() {
const currMenu = menuData.value.find((m) =>
m.children?.some((c) => c.route === currentPath.value),
);
const currMenuIndex = menuData.value.findIndex((m) => m === currMenu);
refactor: responsive (#180) * refactor: can open one dropdown whe lt.md * style: update MainLayout background color and fix avatar border class name * feat: add touch position binding for dropdown in ProfileMenu * refactor: enhance icon styling in DrawerComponent * fix: update screen size conditions * feat: add responsive search and filter functionality in MainPage * feat: update styling and functionality in BasicInformation and MainPage components * feat: package view mode improve layout and responsiveness * feat: improve layout and responsiveness of ProfileBanner component * feat: enhance TreeView component with improved icon layout and cursor pointer styling * feat: update DialogForm component to prevent text wrapping in the center column * feat: enhance FormDocument, PriceDataComponent, and BasicInfoProduct components with layout and styling improvements * feat: enhance ProfileBanner dark tab * feat: 02 => responsive & responsibleArea type * fix: layout header bg condition & 02 filter col * feat: 04 flow => add AddButton component and enhance layout in FormFlow and FlowDialog * feat: 07 => enhance layout and responsiveness * refactor: simplify header structure and improve layout consistency * fix: improve text color in ItemCard and adjust responsive breakpoints in product service group * refactor: 05 => enhance layout responsiveness and improve class bindings in quotation components * refactor: enhance styling and improve props flexibility in dialog and select components * refactor: 05 => enhance layout responsiveness in quotation components * refactor: 05 => enhance layout responsiveness * refactor: 05 => formWorkerAdd * refactor: 05 => formWorkerAdd Product table * refactor: 05 => improve layout responsiveness and enhance component structure * refactor: enhance grid view handling and improve component imports * refactor: improve column classes for better layout consistency * refactor: 09 => enhance layout structure and improve responsiveness in task order views * refactor: 10 => enhance invoice main page layout and improve component interactions * refactor: 13 => enhance receipt main page layout and improve component interactions * refactor: 11 => enhance layout and improve responsiveness in credit note pages * refactor: 01 => screen.sm search & filter * refactor: 01 => improve layout responsiveness and fix variable naming in branch management forms --------- Co-authored-by: puriphatt <puriphat@frappet.com>
2025-01-27 10:39:53 +07:00
if ($q.screen.lt.sm) menuActive.value.fill(false);
2024-10-30 16:05:27 +07:00
menuActive.value[currMenuIndex] = true;
}
2024-10-30 16:12:06 +07:00
function branchSetting() {
//TODO: click setting (cog icon) on drawer menu
}
2024-10-30 16:05:27 +07:00
watch(
() => currentPath.value,
() => {
if (currentPath.value === '/') {
menuActive.value.fill(false);
menuActive.value[0] = true;
} else reActiveMenu();
},
);
watch(
() => props.mini,
() => {
if (props.mini) {
reActiveMenu();
}
},
);
2024-08-15 12:31:30 +07:00
2024-07-10 13:21:32 +07:00
onMounted(async () => {
const uid = getUserId();
2024-10-31 10:46:42 +07:00
2024-08-15 12:31:30 +07:00
role.value = getRole();
2024-07-10 13:21:32 +07:00
if (!uid) return;
2024-08-15 12:31:30 +07:00
if (role.value.includes('system')) {
2024-07-10 13:21:32 +07:00
const result = await userBranch.fetchListOptionBranch();
if (result && result.total > 0) currentMyBranch.value = result.result[0];
}
const result = await userBranch.fetchListMyBranch(uid);
if (result && result.total > 0) currentMyBranch.value = result.result[0];
2024-08-15 12:31:30 +07:00
2024-10-30 16:05:27 +07:00
menuData.value = [
2024-08-15 12:31:30 +07:00
{
2024-10-30 16:05:27 +07:00
label: 'menu.manage',
icon: 'mdi-account-cog-outline',
children: [
{
label: 'branch',
route: '/branch-management',
2024-12-04 18:07:10 +07:00
hidden: !(
2024-10-30 16:05:27 +07:00
role.value.includes('admin') ||
2024-12-04 18:07:10 +07:00
role.value.includes('branch_manager') ||
2024-10-30 16:05:27 +07:00
role.value.includes('head_of_admin') ||
role.value.includes('system') ||
role.value.includes('owner') ||
role.value.includes('head_of_account')
2024-12-04 18:07:10 +07:00
),
2024-10-30 16:05:27 +07:00
},
{
label: 'personnel',
route: '/personnel-management',
2024-12-04 18:07:10 +07:00
hidden: !(
2024-10-30 16:05:27 +07:00
role.value.includes('admin') ||
role.value.includes('head_of_admin') ||
role.value.includes('system') ||
role.value.includes('owner') ||
role.value.includes('branch_manager')
2024-12-04 18:07:10 +07:00
),
2024-10-30 16:05:27 +07:00
},
2024-11-08 16:44:15 +07:00
{ label: 'workflow', route: '/workflow' },
2024-10-30 16:05:27 +07:00
{ label: 'productService', route: '/product-service' },
{ label: 'customer', route: '/customer-management' },
{ label: 'agencies', route: '/agencies-management' },
2024-10-30 16:05:27 +07:00
],
2024-08-15 12:31:30 +07:00
},
{
2024-10-30 16:05:27 +07:00
label: 'menu.sales',
icon: 'mdi-store-settings-outline',
children: [
{ label: 'quotation', route: '/quotation' },
{ label: 'invoice', route: '/invoice' },
],
2024-08-15 12:31:30 +07:00
},
{
2024-10-30 16:05:27 +07:00
label: 'menu.order',
icon: 'mdi-file-chart-outline',
feat: menu request list (#75) * feat: i18n * feat: request list * refactor: hide stat transition on app.scss * feat: request list i18n * feat: request list => constants and main page * feat: add store * feat: add fetch data * feat: add utilities fn * feat: add store function / types * refactor: request list type * refactor: request list constants * refactor: quotation card => add customData and badge color props * feat: avatar group components * feat: request list group * refactor: request list => remove tab, add table data * feat: send search query * feat: add parameter * refactor: remove unused function * fix: rename component lits to list * feat: show stats from api * chore: cleanup * refactor: make it type safe * refactor: accept rotate flow id as parameter * feat: use page size component * feat: add component, data display & expansion product * feat: i18n * refactor: constants and request list table * refactor: type code, createdAt, updatedAt * refactor: utils function changThemeMode * feat: request list => view page * refactor: use type instead of infer from value * fix: function getEmployeeName att type * refactor: fetch work list * refactor: loop work list * feat: add i18n duty * feat: add form issue component * feat: add form issue section * fix: store error * refactor: edit by value * refactor: accept basic info from outside instead * feat: add status filter support on fetch * refactor: remove delete button * refactor: wording * feat/fix: request list i18n & constant * feat: document type * feat/refactor: request list => document expansion * refactor: doc expansion use FormGroupHead * refactor: fetch data based on id from route param * refactor: text area disable * feat: properties expansion display (mocking) * refactor: add document at product relation * refactor: edit get value product * feat: get workflow step to show on top * refactor: add type * refactor: add get attachment * refactor: add view attachment * refactor: edit file name * refactor: define props get hide icon * refactor: edit align row * refactor: by value table document * refactor: by value row table * feat: add independent ocr dialog * chore: clean up * refactor: accept more props and small adjustment * fix: error withDefault call * feat: accept default metadata when open * fix: typo * feat: add override hook when finish ocr * feat: reset state on open * feat: detect reader result is actually string * fix: variable name conflict * feat: properties to input component * feat: properties input in properties expansion * feat: properties expansion data (temporary) * refactor: add i18n status work * refactor: edit type work status and add step status * refactor: add edit status work * refactor: edit step work * refactor: properties data type * refactor: filter selected product & specific properties * feat: add emit event * refactor: change variable name for better understanding * refactor: hide step that no properties * refactor: work status type to validate * feat: work status color * refactor: key for filename * refactor: close expansion when change step * refactor: responsive meta data * refactor: product expansion responsive * fix: dark mode step text color * fix: document expansion table no data label * refactor: main page body bordered and overflow hidden * refactor: use utils function instead * refactor: add process * refactor: by value name * refactor: add upload file * refactor: upload file * refactor: by value * fix: option worker type * refactor: fetchRequestAttachment after edit * fix: metadata display * refactor: add class full-height * refactor: edit type * refactor: fetch file * refactor: by value visa * refactor: request list attributes type * fix: properties to input props (placeholder, readonly, disable) * feat: request list properties function * fix: error when no workflow * docs: update comment to fix indent * refactor: step type (attributes) * refactor: add attributes payload on editStatusRequestWork function * feat/refactor: functional form expansion/filter worklist * refactor: set attributes properties after submit * refactor: add request work ready status * feat: request list => form employee component * feat/refactor: form expansion select user/layout * fix: properties readonly --------- Co-authored-by: puriphatt <puriphat@frappet.com> Co-authored-by: Thanaphon Frappet <thanaphon@frappet.com>
2024-11-22 18:02:03 +07:00
disabled: false,
2024-10-30 16:05:27 +07:00
children: [
feat: menu request list (#75) * feat: i18n * feat: request list * refactor: hide stat transition on app.scss * feat: request list i18n * feat: request list => constants and main page * feat: add store * feat: add fetch data * feat: add utilities fn * feat: add store function / types * refactor: request list type * refactor: request list constants * refactor: quotation card => add customData and badge color props * feat: avatar group components * feat: request list group * refactor: request list => remove tab, add table data * feat: send search query * feat: add parameter * refactor: remove unused function * fix: rename component lits to list * feat: show stats from api * chore: cleanup * refactor: make it type safe * refactor: accept rotate flow id as parameter * feat: use page size component * feat: add component, data display & expansion product * feat: i18n * refactor: constants and request list table * refactor: type code, createdAt, updatedAt * refactor: utils function changThemeMode * feat: request list => view page * refactor: use type instead of infer from value * fix: function getEmployeeName att type * refactor: fetch work list * refactor: loop work list * feat: add i18n duty * feat: add form issue component * feat: add form issue section * fix: store error * refactor: edit by value * refactor: accept basic info from outside instead * feat: add status filter support on fetch * refactor: remove delete button * refactor: wording * feat/fix: request list i18n & constant * feat: document type * feat/refactor: request list => document expansion * refactor: doc expansion use FormGroupHead * refactor: fetch data based on id from route param * refactor: text area disable * feat: properties expansion display (mocking) * refactor: add document at product relation * refactor: edit get value product * feat: get workflow step to show on top * refactor: add type * refactor: add get attachment * refactor: add view attachment * refactor: edit file name * refactor: define props get hide icon * refactor: edit align row * refactor: by value table document * refactor: by value row table * feat: add independent ocr dialog * chore: clean up * refactor: accept more props and small adjustment * fix: error withDefault call * feat: accept default metadata when open * fix: typo * feat: add override hook when finish ocr * feat: reset state on open * feat: detect reader result is actually string * fix: variable name conflict * feat: properties to input component * feat: properties input in properties expansion * feat: properties expansion data (temporary) * refactor: add i18n status work * refactor: edit type work status and add step status * refactor: add edit status work * refactor: edit step work * refactor: properties data type * refactor: filter selected product & specific properties * feat: add emit event * refactor: change variable name for better understanding * refactor: hide step that no properties * refactor: work status type to validate * feat: work status color * refactor: key for filename * refactor: close expansion when change step * refactor: responsive meta data * refactor: product expansion responsive * fix: dark mode step text color * fix: document expansion table no data label * refactor: main page body bordered and overflow hidden * refactor: use utils function instead * refactor: add process * refactor: by value name * refactor: add upload file * refactor: upload file * refactor: by value * fix: option worker type * refactor: fetchRequestAttachment after edit * fix: metadata display * refactor: add class full-height * refactor: edit type * refactor: fetch file * refactor: by value visa * refactor: request list attributes type * fix: properties to input props (placeholder, readonly, disable) * feat: request list properties function * fix: error when no workflow * docs: update comment to fix indent * refactor: step type (attributes) * refactor: add attributes payload on editStatusRequestWork function * feat/refactor: functional form expansion/filter worklist * refactor: set attributes properties after submit * refactor: add request work ready status * feat: request list => form employee component * feat/refactor: form expansion select user/layout * fix: properties readonly --------- Co-authored-by: puriphatt <puriphat@frappet.com> Co-authored-by: Thanaphon Frappet <thanaphon@frappet.com>
2024-11-22 18:02:03 +07:00
{ label: 'requestList', route: '/request-list' },
{ label: 'documentCheck', route: '', hidden: true },
2024-12-02 10:02:10 +07:00
{ label: 'taskOrder', route: '/task-order' },
feat: menu request list (#75) * feat: i18n * feat: request list * refactor: hide stat transition on app.scss * feat: request list i18n * feat: request list => constants and main page * feat: add store * feat: add fetch data * feat: add utilities fn * feat: add store function / types * refactor: request list type * refactor: request list constants * refactor: quotation card => add customData and badge color props * feat: avatar group components * feat: request list group * refactor: request list => remove tab, add table data * feat: send search query * feat: add parameter * refactor: remove unused function * fix: rename component lits to list * feat: show stats from api * chore: cleanup * refactor: make it type safe * refactor: accept rotate flow id as parameter * feat: use page size component * feat: add component, data display & expansion product * feat: i18n * refactor: constants and request list table * refactor: type code, createdAt, updatedAt * refactor: utils function changThemeMode * feat: request list => view page * refactor: use type instead of infer from value * fix: function getEmployeeName att type * refactor: fetch work list * refactor: loop work list * feat: add i18n duty * feat: add form issue component * feat: add form issue section * fix: store error * refactor: edit by value * refactor: accept basic info from outside instead * feat: add status filter support on fetch * refactor: remove delete button * refactor: wording * feat/fix: request list i18n & constant * feat: document type * feat/refactor: request list => document expansion * refactor: doc expansion use FormGroupHead * refactor: fetch data based on id from route param * refactor: text area disable * feat: properties expansion display (mocking) * refactor: add document at product relation * refactor: edit get value product * feat: get workflow step to show on top * refactor: add type * refactor: add get attachment * refactor: add view attachment * refactor: edit file name * refactor: define props get hide icon * refactor: edit align row * refactor: by value table document * refactor: by value row table * feat: add independent ocr dialog * chore: clean up * refactor: accept more props and small adjustment * fix: error withDefault call * feat: accept default metadata when open * fix: typo * feat: add override hook when finish ocr * feat: reset state on open * feat: detect reader result is actually string * fix: variable name conflict * feat: properties to input component * feat: properties input in properties expansion * feat: properties expansion data (temporary) * refactor: add i18n status work * refactor: edit type work status and add step status * refactor: add edit status work * refactor: edit step work * refactor: properties data type * refactor: filter selected product & specific properties * feat: add emit event * refactor: change variable name for better understanding * refactor: hide step that no properties * refactor: work status type to validate * feat: work status color * refactor: key for filename * refactor: close expansion when change step * refactor: responsive meta data * refactor: product expansion responsive * fix: dark mode step text color * fix: document expansion table no data label * refactor: main page body bordered and overflow hidden * refactor: use utils function instead * refactor: add process * refactor: by value name * refactor: add upload file * refactor: upload file * refactor: by value * fix: option worker type * refactor: fetchRequestAttachment after edit * fix: metadata display * refactor: add class full-height * refactor: edit type * refactor: fetch file * refactor: by value visa * refactor: request list attributes type * fix: properties to input props (placeholder, readonly, disable) * feat: request list properties function * fix: error when no workflow * docs: update comment to fix indent * refactor: step type (attributes) * refactor: add attributes payload on editStatusRequestWork function * feat/refactor: functional form expansion/filter worklist * refactor: set attributes properties after submit * refactor: add request work ready status * feat: request list => form employee component * feat/refactor: form expansion select user/layout * fix: properties readonly --------- Co-authored-by: puriphatt <puriphat@frappet.com> Co-authored-by: Thanaphon Frappet <thanaphon@frappet.com>
2024-11-22 18:02:03 +07:00
{ label: 'goodReceipt', route: '', hidden: true },
{ label: 'workReceipt', route: '', hidden: true },
{ label: 'workDelivery', route: '', hidden: true },
2024-10-30 16:05:27 +07:00
],
2024-08-15 12:31:30 +07:00
},
{
2024-10-30 16:05:27 +07:00
label: 'menu.account',
icon: 'mdi-bank-outline',
feat: credit note (#171) * feat: add main page credit note * feat: enable credit note route and update menu item states * refactor: add i18n * refactor: edit i18n status * feat: add action column * feat: add empty form page * feat: add get data * feat: add type credit note status * refactor: add type name en * refactor: add type credit note status in type credit note * feat: add hsla colors * refactor: add slot grid * refactor: handle hide kebab edit show only tab tssued * feat: show grid card * feat: i18n * feat: add credit note form and dialog * refactor: add props hide kebab deelete * refactor: hide kebab * style: update color segments to indigo theme * feat: i18n * fix: update labels for credit note fields * refactor: add type * feat: new select quotation * refactor: use new select quotation * feat: navigate to * refactor: function trigger and navigate to * feat: i18n bank * feat: add payment expansion component and integrate into credit note form * refactor: bind i18n pay condition * refactor: navigate to get quotation id * feat: i18n * fix: update label for createdBy field in credit note form * feat: add credit note information expansion component * feat: add Credit Note expansion component and update form layout * refactor: bind quotation id and send * refactor: deelete duplicate type * refactor: show state button * refactor: handle show status * feat: add function update payback status * feat: add return and canceled reasons to credit note translations * feat: enhance SelectReadyRequestWork component with credit note handling and fetch parameters * feat: type * feat: add status handling and optional display for employee table * refactor: rename selectedQuotationId to quotationId in FormCredit component * feat: set default opened state for CreditNoteExpansion and add reason options * feat: update PaymentExpansion to handle payback type selection and clear fields for cash payments * feat: enhance ProductExpansion to support credit note handling and adjust price calculations * feat: implement product handling and price calculation in CreditNote form * feat: add manage attachment function to store * refactor: bind delete credit note * feat: add credit note status and reference fields to types * refactor: update task step handling and simplify request work structure in credit note form * feat: add navigation to quotation from credit note form * feat: enhance upload section layout based on file data * feat: add readonly functionality to credit note form and related components * refactor: remove console log * feat: update i18n * style: add rounded corners to complete view container in quotation form * feat: add RefundInformation component and update credit note form status handling * feat: i18n * feat: update payback status endpoint and add paybackStatus to CreditNote type * feat: enhance QuotationFormReceipt component with optional props and slot support * feat: integrate payback status handling in RefundInformation and FormPage components * feat: add external file group * feat: update API endpoint paths for credit note operations * feat: improve layout and styling in UploadFile components * feat: implement file upload and management in Credit Note * refactor: update upload to check if it is redirect or not * feat: upload file slips * feat: add payback date dispaly * refactor: change module no * fix: icon link to main page instead * feat: add file dialog with image download functionality * fix: view slip * feat: add download button to image viewer * feat: handle after submit * feat: conditionally render bank transfer information * feat: handle upload file on create * feat: handle change payback status * feat: payback type in credit note form * fix: correct reference to quotation data in goToQuotation function --------- Co-authored-by: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Co-authored-by: puriphatt <puriphat@frappet.com> Co-authored-by: Thanaphon Frappet <thanaphon@frappet.com>
2025-01-14 09:08:31 +07:00
disabled: false,
2024-10-30 16:05:27 +07:00
children: [
{ label: 'receipt', route: '/receipt' },
2025-01-27 10:44:36 +07:00
{ label: 'creditNote', route: '/credit-note' },
feat: debit note (#172) * feat: new file * feat: function api debit * feat: add route debit * feat: new form page * refactor: show menu debit * refactor: add type debit note status * feat: add i18n * feat: add constants * feat: add stores * feat: layout * feat: add function * refactor: change name value * feat: form select quotation * refactor: change name url * refactor: use form debit * refactor: change src import * refactor: move file form debit * refactor: add i18n * feat: add type debit note * refactor: add columns * refactor: bind value columns * refactor: change name Table * refactor: edit type * refactor: bind type debit note * refactor: bind value debit * refactor: chame name function * fix: calculate page * refactor: delete table * refactor: change name get list * refactor: change i18n * refactor: change name value * refactor: bind navigate and trigger delete * refactor: format number deciml * refactor: add i18n * feat: new page * refactor: add color debit * feat: Debit tab #178 * feat: TableRequest * refactor: edit type pay condition * refactor: add i18n btn submit * refactor: use type enum * feat: edit layout product expansion * refactor: bind function * refactor: show code * feat: add input search and select status * feat: paymentform * refactor: edit type * refactor: add manage file and edit end point * feat: add form.ts * refactor: send mode * refactor: edit v-model of due date * feat: submit create debit * fix: status * refactor: handle data not allow * fix: call updateDebitNote in edit mode and simplify payload handling * refactor: hide edit * refactor: handle pay condition only full * refactor: delete pay split * refactor: add query * refactor: handle is debit note * refactor: handle is quotation * refactor: add props hide * refactor: tap payment and receipt * refactor: add i18n * feat: view document * refactor: handle btn view doc * refactor: use my remark --------- Co-authored-by: Thanaphon Frappet <thanaphon@frappet.com> Co-authored-by: nwpptrs <jay02499@gmail.com> Co-authored-by: aif912752 <siripak@chamomind.com>
2025-01-27 09:04:08 +07:00
{ label: 'debitNote', route: '/debit-note' },
2024-10-30 16:05:27 +07:00
],
2024-08-15 12:31:30 +07:00
},
2024-11-11 11:23:52 +07:00
{
feat: menu request list (#75) * feat: i18n * feat: request list * refactor: hide stat transition on app.scss * feat: request list i18n * feat: request list => constants and main page * feat: add store * feat: add fetch data * feat: add utilities fn * feat: add store function / types * refactor: request list type * refactor: request list constants * refactor: quotation card => add customData and badge color props * feat: avatar group components * feat: request list group * refactor: request list => remove tab, add table data * feat: send search query * feat: add parameter * refactor: remove unused function * fix: rename component lits to list * feat: show stats from api * chore: cleanup * refactor: make it type safe * refactor: accept rotate flow id as parameter * feat: use page size component * feat: add component, data display & expansion product * feat: i18n * refactor: constants and request list table * refactor: type code, createdAt, updatedAt * refactor: utils function changThemeMode * feat: request list => view page * refactor: use type instead of infer from value * fix: function getEmployeeName att type * refactor: fetch work list * refactor: loop work list * feat: add i18n duty * feat: add form issue component * feat: add form issue section * fix: store error * refactor: edit by value * refactor: accept basic info from outside instead * feat: add status filter support on fetch * refactor: remove delete button * refactor: wording * feat/fix: request list i18n & constant * feat: document type * feat/refactor: request list => document expansion * refactor: doc expansion use FormGroupHead * refactor: fetch data based on id from route param * refactor: text area disable * feat: properties expansion display (mocking) * refactor: add document at product relation * refactor: edit get value product * feat: get workflow step to show on top * refactor: add type * refactor: add get attachment * refactor: add view attachment * refactor: edit file name * refactor: define props get hide icon * refactor: edit align row * refactor: by value table document * refactor: by value row table * feat: add independent ocr dialog * chore: clean up * refactor: accept more props and small adjustment * fix: error withDefault call * feat: accept default metadata when open * fix: typo * feat: add override hook when finish ocr * feat: reset state on open * feat: detect reader result is actually string * fix: variable name conflict * feat: properties to input component * feat: properties input in properties expansion * feat: properties expansion data (temporary) * refactor: add i18n status work * refactor: edit type work status and add step status * refactor: add edit status work * refactor: edit step work * refactor: properties data type * refactor: filter selected product & specific properties * feat: add emit event * refactor: change variable name for better understanding * refactor: hide step that no properties * refactor: work status type to validate * feat: work status color * refactor: key for filename * refactor: close expansion when change step * refactor: responsive meta data * refactor: product expansion responsive * fix: dark mode step text color * fix: document expansion table no data label * refactor: main page body bordered and overflow hidden * refactor: use utils function instead * refactor: add process * refactor: by value name * refactor: add upload file * refactor: upload file * refactor: by value * fix: option worker type * refactor: fetchRequestAttachment after edit * fix: metadata display * refactor: add class full-height * refactor: edit type * refactor: fetch file * refactor: by value visa * refactor: request list attributes type * fix: properties to input props (placeholder, readonly, disable) * feat: request list properties function * fix: error when no workflow * docs: update comment to fix indent * refactor: step type (attributes) * refactor: add attributes payload on editStatusRequestWork function * feat/refactor: functional form expansion/filter worklist * refactor: set attributes properties after submit * refactor: add request work ready status * feat: request list => form employee component * feat/refactor: form expansion select user/layout * fix: properties readonly --------- Co-authored-by: puriphatt <puriphat@frappet.com> Co-authored-by: Thanaphon Frappet <thanaphon@frappet.com>
2024-11-22 18:02:03 +07:00
label: 'menu.manageDocument',
icon: 'mdi-archive-outline',
2024-11-11 11:23:52 +07:00
children: [
{
label: 'document',
route: '/document-management',
},
],
},
2024-08-15 12:31:30 +07:00
{
2024-10-30 16:05:27 +07:00
label: 'menu.overall',
icon: 'mdi-monitor-dashboard',
children: [
2025-03-04 11:22:31 +07:00
{ label: 'report', route: '/report' },
{ label: 'dashboard', route: '/dash-board' },
2024-10-30 16:05:27 +07:00
],
2024-08-15 12:31:30 +07:00
},
];
2024-04-02 11:02:16 +07:00
2024-10-31 10:46:42 +07:00
menuActive.value = menuData.value.map(() => false);
2024-10-30 16:05:27 +07:00
if (currentPath.value === '/') menuActive.value[0] = true;
else reActiveMenu();
2024-07-02 10:15:29 +00:00
});
2024-04-02 11:02:16 +07:00
</script>
<template>
<!-- Drawer -->
<q-drawer
2024-07-04 10:39:54 +00:00
no-swipe-open
v-model="leftDrawerOpen"
side="left"
2024-07-02 09:11:10 +00:00
:breakpoint="599"
2024-07-04 07:43:50 +00:00
class="column justify-between no-wrap"
2024-07-31 06:09:10 +00:00
:class="{ dark: $q.dark.isActive }"
2024-07-05 16:29:06 +07:00
:width="mini ? 80 : 256"
2024-07-08 10:44:36 +07:00
show-if-above
>
2024-10-30 16:05:27 +07:00
<section
class="scroll"
style="overflow-x: hidden; scrollbar-gutter: stable"
>
<header
2024-07-05 16:29:06 +07:00
class="flex justify-center items-center q-pl-sm cursor-pointer"
2024-07-04 07:43:50 +00:00
@click="$router.push('/')"
id="btn-drawer-home"
2024-07-04 09:53:16 +00:00
style="height: 128px"
2024-07-04 07:43:50 +00:00
>
2024-07-04 15:22:59 +07:00
<q-img
2024-07-04 09:53:16 +00:00
fit="contain"
:src="mini ? 'logo_jws.png' : '/logo.png'"
2024-07-04 15:22:59 +07:00
:style="{ filter: `brightness(${$q.dark.isActive ? '1.3' : '1'})` }"
2024-07-04 09:53:16 +00:00
style="height: 64px"
2024-07-04 15:22:59 +07:00
/>
2024-10-30 16:05:27 +07:00
</header>
<div id="drawer-menu" class="q-pl-md q-mr-xs q-gutter-y-sm">
<template v-for="(menu, i) in menuData" :key="i">
<q-expansion-item
v-if="!menu.hidden"
2024-11-01 10:02:53 +07:00
:id="menu.label"
:for="menu.label"
2024-10-30 16:05:27 +07:00
dense
:model-value="menuActive[i]"
expand-icon-class="no-padding"
:hide-expand-icon="mini"
:disable="menu.disabled"
:header-class="{
row: true,
'no-padding justify-center': mini,
'active-menu text-weight-bold': menuActive[i],
'text-weight-medium': !menu.disabled,
}"
@update:model-value="
() => {
mini ? '' : (menuActive[i] = !menuActive[i]);
}
"
>
<template #header>
<nav class="row items-center q-py-sm no-wrap">
<i
v-if="menu.isax"
:class="`isax ${menu.icon}`"
style="font-size: 24px"
/>
refactor: responsive (#180) * refactor: can open one dropdown whe lt.md * style: update MainLayout background color and fix avatar border class name * feat: add touch position binding for dropdown in ProfileMenu * refactor: enhance icon styling in DrawerComponent * fix: update screen size conditions * feat: add responsive search and filter functionality in MainPage * feat: update styling and functionality in BasicInformation and MainPage components * feat: package view mode improve layout and responsiveness * feat: improve layout and responsiveness of ProfileBanner component * feat: enhance TreeView component with improved icon layout and cursor pointer styling * feat: update DialogForm component to prevent text wrapping in the center column * feat: enhance FormDocument, PriceDataComponent, and BasicInfoProduct components with layout and styling improvements * feat: enhance ProfileBanner dark tab * feat: 02 => responsive & responsibleArea type * fix: layout header bg condition & 02 filter col * feat: 04 flow => add AddButton component and enhance layout in FormFlow and FlowDialog * feat: 07 => enhance layout and responsiveness * refactor: simplify header structure and improve layout consistency * fix: improve text color in ItemCard and adjust responsive breakpoints in product service group * refactor: 05 => enhance layout responsiveness and improve class bindings in quotation components * refactor: enhance styling and improve props flexibility in dialog and select components * refactor: 05 => enhance layout responsiveness in quotation components * refactor: 05 => enhance layout responsiveness * refactor: 05 => formWorkerAdd * refactor: 05 => formWorkerAdd Product table * refactor: 05 => improve layout responsiveness and enhance component structure * refactor: enhance grid view handling and improve component imports * refactor: improve column classes for better layout consistency * refactor: 09 => enhance layout structure and improve responsiveness in task order views * refactor: 10 => enhance invoice main page layout and improve component interactions * refactor: 13 => enhance receipt main page layout and improve component interactions * refactor: 11 => enhance layout and improve responsiveness in credit note pages * refactor: 01 => screen.sm search & filter * refactor: 01 => improve layout responsiveness and fix variable naming in branch management forms --------- Co-authored-by: puriphatt <puriphat@frappet.com>
2025-01-27 10:39:53 +07:00
<Icon
v-else
:icon="menu.icon || ''"
width="24px"
:class="{ 'fix-icon': !menuActive[i] }"
/>
2024-10-31 18:18:29 +07:00
<span
v-if="!mini"
class="q-pl-sm"
style="white-space: nowrap"
:style="!menuActive[i] && `color: var(--foreground)`"
>
2024-10-30 16:05:27 +07:00
{{ $t(`${menu.label}.title`) }}
</span>
<q-tooltip :delay="500">
{{ $t(`${menu.label}.title`) }}
</q-tooltip>
<q-menu
2024-10-31 09:16:04 +07:00
v-if="mini && !menu.disabled"
2024-10-30 16:05:27 +07:00
fit
anchor="center end"
self="top left"
:offset="[16, 0]"
>
<q-list dense>
<template v-for="(sub, i) in menu.children" :key="i">
<q-item
v-if="!sub.hidden"
clickable
:disabled="sub.disabled"
class="row items-center no-wrap"
:class="{
'text-weight-bold app-bg-brand-1':
currentPath === sub.route,
}"
@click="
() => {
!sub.disabled && navigateTo('', sub.route);
}
"
2024-11-01 10:02:53 +07:00
:id="`sub-menu-${sub.label}`"
2024-10-30 16:05:27 +07:00
>
<span style="white-space: nowrap">
{{ $t(`${menu.label}.${sub.label}`) }}
</span>
</q-item>
</template>
</q-list>
</q-menu>
</nav>
</template>
<q-list v-if="!mini" dense>
<template v-for="(sub, i) in menu.children" :key="i">
<div
v-if="!sub.hidden"
class="row items-center q-ml-lg q-py-sm no-wrap"
:class="{ 'q-mt-sm': i === 0, 'sub-menu': !sub.disabled }"
style="border-left: 2px solid var(--surface-tab)"
@click="!sub.disabled && navigateTo('', sub.route)"
2024-11-01 10:02:53 +07:00
:id="`sub-menu-${sub.label}`"
2024-10-30 16:05:27 +07:00
>
<nav
class="row items-center no-wrap"
:class="{
active: currentPath === sub.route,
disabled: sub.disabled,
}"
>
<span class="q-px-md" style="white-space: nowrap">
{{ $t(`${menu.label}.${sub.label}`) }}
</span>
</nav>
</div>
</template>
</q-list>
</q-expansion-item>
</template>
2024-07-04 07:43:50 +00:00
2024-10-30 16:05:27 +07:00
<!-- <q-item
2024-08-15 12:09:31 +07:00
v-for="v in labelMenu.filter((v) => !v.hidden)"
2024-09-18 15:04:45 +07:00
:id="`drawer-${v.label}`"
2024-07-04 07:43:50 +00:00
dense
clickable
2024-08-19 15:05:37 +07:00
class="row items-center q-my-xs q-px-xs q-py-sm"
2024-09-18 15:04:45 +07:00
:key="`drawer-${v.label}`"
2024-07-04 07:43:50 +00:00
:disable="!!v.disabled"
:class="{
active: currentPath === v.route,
'border-active': currentPath === v.route,
dark: $q.dark.isActive,
}"
@click="navigateTo(v.label, v.route)"
>
2024-07-04 09:53:16 +00:00
<div class="row justify-center items-center">
2024-08-08 02:16:50 +00:00
<i
v-if="v.isax"
:class="`isax ${v.icon}`"
style="font-size: 24px"
/>
<Icon v-else :icon="v.icon" width="24px" />
2024-07-04 09:53:16 +00:00
<q-tooltip v-if="mini">
2024-07-04 07:43:50 +00:00
{{ $t(v.label) }}
2024-07-04 09:53:16 +00:00
</q-tooltip>
</div>
<div v-if="!mini" class="q-ml-md" style="white-space: nowrap">
{{ $t(v.label) }}
</div>
2024-10-30 16:05:27 +07:00
</q-item> -->
2024-07-04 07:43:50 +00:00
</div>
2024-10-30 16:05:27 +07:00
</section>
2024-04-02 11:02:16 +07:00
2024-10-30 16:05:27 +07:00
<footer
2024-07-04 09:53:16 +00:00
class="surface-2 q-px-md q-py-sm row items-center no-wrap justify-start"
:class="{ 'justify-center': mini }"
style="min-height: 56px; overflow-x: hidden"
>
<q-avatar
text-color="white"
size="md"
:style="`background-color: hsla(var(--violet-${$q.dark.isActive ? '10' : '11'}-hsl)/0.15)`"
class="relative-position"
>
<q-icon
name="mdi-home-group"
size="sm"
:style="`color: var(--violet-${$q.dark.isActive ? '10' : '11'})`"
/>
<div class="dot absolute-bottom-right" />
</q-avatar>
<div
v-if="!mini"
2024-08-15 11:56:20 +07:00
class="text-caption column q-mx-md col"
2024-07-04 09:53:16 +00:00
style="white-space: nowrap"
>
2024-08-15 11:56:20 +07:00
<span class="text-weight-bold ellipsis full-width">
2024-07-10 13:21:32 +07:00
{{
2024-08-26 16:24:08 +07:00
($i18n.locale === 'eng'
2024-07-10 13:21:32 +07:00
? currentMyBranch?.nameEN
: currentMyBranch?.name) ?? '-'
}}
2024-08-16 11:09:53 +07:00
<q-tooltip>
{{
2024-08-26 16:24:08 +07:00
($i18n.locale === 'eng'
2024-08-16 11:09:53 +07:00
? currentMyBranch?.nameEN
: currentMyBranch?.name) ?? '-'
}}
</q-tooltip>
2024-07-04 09:53:16 +00:00
</span>
<span>
2024-07-10 13:21:32 +07:00
{{ currentMyBranch?.code ?? '-' }}
2024-07-04 09:53:16 +00:00
</span>
2024-07-04 07:43:50 +00:00
</div>
2024-07-04 09:53:16 +00:00
2024-07-04 07:43:50 +00:00
<q-btn
2024-07-04 09:53:16 +00:00
v-if="!mini"
2024-07-04 07:43:50 +00:00
dense
flat
rounded
icon="mdi-cog-outline"
size="sm"
@click="branchSetting"
2024-07-04 09:53:16 +00:00
style="margin-left: auto"
/>
2024-10-30 16:05:27 +07:00
</footer>
2024-04-02 11:02:16 +07:00
</q-drawer>
</template>
<style lang="scss" scoped>
#drawer-menu :deep(.q-item) {
2024-07-24 03:03:00 +00:00
color: var(--gray-7);
2024-07-04 07:43:50 +00:00
border-radius: var(--radius-2);
2024-08-01 02:55:21 +00:00
&.dark {
color: var(--gray-3);
}
2024-04-02 11:02:16 +07:00
}
2024-08-01 02:55:21 +00:00
2024-04-02 11:02:16 +07:00
#drawer-menu :deep(.q-item.active) {
--_drawer-item-background-color: var(--brand-1) !important;
2024-04-09 14:52:53 +07:00
background-color: var(--_drawer-item-background-color);
2024-04-02 11:02:16 +07:00
color: white;
2024-07-04 07:43:50 +00:00
// border-left: 10px solid $secondary;
2024-04-02 11:02:16 +07:00
}
2024-07-04 13:16:28 +07:00
2024-07-04 07:43:50 +00:00
#drawer-menu :deep(.q-item.active)::before {
display: block;
position: absolute;
content: ' ';
background: var(--brand-2);
border-radius: 99rem;
width: 6px;
2024-07-04 09:53:16 +00:00
left: -0.6rem;
2024-07-04 07:43:50 +00:00
top: 18%;
bottom: 18%;
cursor: context-menu;
}
2024-07-04 09:53:16 +00:00
:deep(.q-drawer) {
transition: 0.1s width ease-in-out;
2024-07-04 10:39:54 +00:00
background-color: transparent;
2024-07-04 09:53:16 +00:00
padding: var(--size-4);
padding-right: 0;
}
:deep(.q-drawer__content) {
border-radius: var(--radius-2);
2024-07-31 06:09:10 +00:00
background-color: rgba(255, 255, 255, 0.5);
backdrop-filter: blur(11.2px);
-webkit-backdrop-filter: blur(11.2px);
&.dark {
background-color: hsla(var(--gray-10-hsl) / 0.5);
}
2024-07-04 09:53:16 +00:00
}
2024-07-04 07:43:50 +00:00
.dot {
height: 10px;
width: 10px;
background-color: var(--teal-6);
border-radius: 50%;
display: inline-block;
border: 1.5px solid white;
}
2024-10-30 16:05:27 +07:00
:deep(.active-menu) {
color: white !important;
background: var(--brand-1) !important;
2024-10-31 10:03:39 +07:00
&
i.q-icon.mdi.mdi-chevron-down.q-expansion-item__toggle-icon.q-expansion-item__toggle-icon--rotated {
2024-10-30 16:05:27 +07:00
color: white !important;
}
}
.sub-menu {
font-weight: 400;
2024-10-31 10:03:39 +07:00
& .active {
color: var(--brand-1) !important;
font-weight: bold;
2024-10-30 16:05:27 +07:00
&::before {
content: '';
display: inline-block;
margin-left: -3px;
width: 4px;
height: 18px;
border-radius: 50px;
background-color: var(--brand-2);
}
}
&:hover {
2024-10-31 10:03:39 +07:00
cursor: pointer;
2024-10-31 13:38:46 +07:00
background-color: hsla(var(--stone-8-hsl) / 0.1);
transition: 0.3s ease-in-out;
border-top-right-radius: var(--radius-2);
border-bottom-right-radius: var(--radius-2);
2024-10-30 16:05:27 +07:00
}
}
refactor: responsive (#180) * refactor: can open one dropdown whe lt.md * style: update MainLayout background color and fix avatar border class name * feat: add touch position binding for dropdown in ProfileMenu * refactor: enhance icon styling in DrawerComponent * fix: update screen size conditions * feat: add responsive search and filter functionality in MainPage * feat: update styling and functionality in BasicInformation and MainPage components * feat: package view mode improve layout and responsiveness * feat: improve layout and responsiveness of ProfileBanner component * feat: enhance TreeView component with improved icon layout and cursor pointer styling * feat: update DialogForm component to prevent text wrapping in the center column * feat: enhance FormDocument, PriceDataComponent, and BasicInfoProduct components with layout and styling improvements * feat: enhance ProfileBanner dark tab * feat: 02 => responsive & responsibleArea type * fix: layout header bg condition & 02 filter col * feat: 04 flow => add AddButton component and enhance layout in FormFlow and FlowDialog * feat: 07 => enhance layout and responsiveness * refactor: simplify header structure and improve layout consistency * fix: improve text color in ItemCard and adjust responsive breakpoints in product service group * refactor: 05 => enhance layout responsiveness and improve class bindings in quotation components * refactor: enhance styling and improve props flexibility in dialog and select components * refactor: 05 => enhance layout responsiveness in quotation components * refactor: 05 => enhance layout responsiveness * refactor: 05 => formWorkerAdd * refactor: 05 => formWorkerAdd Product table * refactor: 05 => improve layout responsiveness and enhance component structure * refactor: enhance grid view handling and improve component imports * refactor: improve column classes for better layout consistency * refactor: 09 => enhance layout structure and improve responsiveness in task order views * refactor: 10 => enhance invoice main page layout and improve component interactions * refactor: 13 => enhance receipt main page layout and improve component interactions * refactor: 11 => enhance layout and improve responsiveness in credit note pages * refactor: 01 => screen.sm search & filter * refactor: 01 => improve layout responsiveness and fix variable naming in branch management forms --------- Co-authored-by: puriphatt <puriphat@frappet.com>
2025-01-27 10:39:53 +07:00
.fix-icon {
color: var(--text-mute-2) !important;
}
:deep(.q-item.q-item-type.row.no-wrap.q-item--dense.disabled) {
opacity: 30% !important;
}
2024-04-02 11:02:16 +07:00
</style>