This commit is contained in:
parent
fb23ec5fd4
commit
90589b3daf
34 changed files with 1271 additions and 13939 deletions
|
|
@ -1,11 +1,11 @@
|
|||
import axios, { AxiosInstance } from 'axios';
|
||||
import { boot } from 'quasar/wrappers';
|
||||
import { defineBoot } from '#q-app/wrappers';
|
||||
import { getToken } from 'src/services/keycloak';
|
||||
import { dialog } from 'stores/utils';
|
||||
import useLoader from 'stores/loader';
|
||||
import useFlowStore from 'src/stores/flow';
|
||||
|
||||
declare module '@vue/runtime-core' {
|
||||
declare module 'vue' {
|
||||
interface ComponentCustomProperties {
|
||||
$axios: AxiosInstance;
|
||||
$api: AxiosInstance;
|
||||
|
|
@ -24,10 +24,10 @@ function parseError(
|
|||
status: number,
|
||||
body?: { status: number; message: string; code: string },
|
||||
) {
|
||||
if (status === 422) return 'invalideData';
|
||||
if (status === 422) return 'invalidData';
|
||||
if (body && body.code) return body.code;
|
||||
|
||||
return 'errorOccure';
|
||||
return 'errorOccurred';
|
||||
}
|
||||
|
||||
api.interceptors.request.use(async (config) => {
|
||||
|
|
@ -64,7 +64,7 @@ api.interceptors.response.use(
|
|||
},
|
||||
);
|
||||
|
||||
export default boot(({ app }) => {
|
||||
export default defineBoot(({ app }) => {
|
||||
// for use inside Vue files (Options API) through this.$axios and this.$api
|
||||
|
||||
app.config.globalProperties.$axios = axios;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { boot } from 'quasar/wrappers';
|
||||
import { defineBoot } from '#q-app/wrappers';
|
||||
import VueDatePicker from '@vuepic/vue-datepicker';
|
||||
import '@vuepic/vue-datepicker/dist/main.css';
|
||||
import GlobalDialog from 'components/GlobalDialog.vue';
|
||||
|
|
@ -6,7 +6,7 @@ import GlobalLoading from 'components/GlobalLoading.vue';
|
|||
import VueDragscroll from 'vue-dragscroll';
|
||||
import VueApexCharts from 'vue3-apexcharts';
|
||||
|
||||
export default boot(({ app }) => {
|
||||
export default defineBoot(({ app }) => {
|
||||
app.component('global-dialog', GlobalDialog);
|
||||
app.component('global-loading', GlobalLoading);
|
||||
app.component('VueDatePicker', VueDatePicker);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { boot } from 'quasar/wrappers';
|
||||
import { defineBoot } from '#q-app/wrappers';
|
||||
import { createI18n } from 'vue-i18n';
|
||||
|
||||
import messages from 'src/i18n';
|
||||
|
|
@ -21,16 +21,17 @@ declare module 'vue-i18n' {
|
|||
}
|
||||
/* eslint-enable @typescript-eslint/no-empty-interface */
|
||||
|
||||
export const i18n = createI18n({
|
||||
locale: 'tha',
|
||||
export const i18n = createI18n<
|
||||
{ message: MessageSchema },
|
||||
MessageLanguages,
|
||||
false
|
||||
>({
|
||||
locale: 'en-US',
|
||||
legacy: false,
|
||||
messages: {
|
||||
'en-US': {},
|
||||
...messages,
|
||||
},
|
||||
messages,
|
||||
});
|
||||
|
||||
export default boot(({ app }) => {
|
||||
export default defineBoot(({ app }) => {
|
||||
// Set i18n instance on app
|
||||
app.use(i18n);
|
||||
});
|
||||
|
|
|
|||
2
src/env.d.ts
vendored
2
src/env.d.ts
vendored
|
|
@ -1,5 +1,3 @@
|
|||
/* eslint-disable */
|
||||
|
||||
declare namespace NodeJS {
|
||||
interface ProcessEnv {
|
||||
NODE_ENV: string;
|
||||
|
|
|
|||
|
|
@ -874,7 +874,7 @@ export default {
|
|||
SplitCustom: 'Custom Installments Bill',
|
||||
BillFull: 'Full Amount Bill',
|
||||
BillSplit: 'Installments Bill',
|
||||
BillCustomSplit: 'Custom Installments Bill',
|
||||
BillSplitCustom: 'Custom Installments Bill',
|
||||
},
|
||||
|
||||
status: {
|
||||
|
|
@ -1185,9 +1185,9 @@ export default {
|
|||
validateError: 'Validate Error',
|
||||
codeMisMatch: 'Code Mismatch',
|
||||
crossCompanyNotPermit: 'Cannot move between different headoffice',
|
||||
errorOccure:
|
||||
errorOccurred:
|
||||
'An error has occurred, causing the system to be unable to function. Please try again later.',
|
||||
invalideData: 'The information is incorrect. Please try again later.',
|
||||
invalidData: 'The information is incorrect. Please try again later.',
|
||||
authFailed: 'Authentication Failed. Please try again later. ',
|
||||
installmentsValidateFailed:
|
||||
'Validation failed. Each installment must include at least one product. Please review and update the installments accordingly.',
|
||||
|
|
|
|||
|
|
@ -1165,9 +1165,9 @@ export default {
|
|||
validateError: 'เกิดข้อผิดพลาดจากการตรวจสอบ',
|
||||
codeMisMatch: 'รหัสไม่ตรงกัน',
|
||||
crossCompanyNotPermit: 'ไม่สามารถดำเนินการระหว่างสำนักงานใหญ่อื่นได้',
|
||||
errorOccure:
|
||||
errorOccurred:
|
||||
'เกิดข้อผิดพลาดทำให้ระบบไม่สามารถทำงานได้ กรุณาลองใหม่ในภายหลัง',
|
||||
invalideData: 'ข้อมูลไม่ถูกต้อง กรุณาตรวจสอบใหม่อีกครั้ง',
|
||||
invalidData: 'ข้อมูลไม่ถูกต้อง กรุณาตรวจสอบใหม่อีกครั้ง',
|
||||
authFailed: 'การยืนยันตัวตนล้มเหลว กรุณาลองใหม่ในภายหลัง',
|
||||
installmentsValidateFailed:
|
||||
'ข้อมูลงวดไม่ถูกต้อง กรุณาตรวจสอบและยืนยันว่าแต่ละงวดมีสินค้าอย่างน้อยหนึ่งรายการ',
|
||||
|
|
|
|||
2
src/markdown-it.d.ts
vendored
Normal file
2
src/markdown-it.d.ts
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
declare module 'markdown-it-image-figures';
|
||||
declare module 'markdown-it-html5-media';
|
||||
|
|
@ -5,9 +5,7 @@ import hljs from 'highlight.js';
|
|||
import { nextTick, onMounted, onUnmounted, ref } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
// @ts-expect-error
|
||||
import mditFigureWithPCaption from 'markdown-it-image-figures';
|
||||
// @ts-expect-error
|
||||
import mditMedia from 'markdown-it-html5-media';
|
||||
import mditAnchor from 'markdown-it-anchor';
|
||||
import mditHighlight from 'markdown-it-highlightjs';
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import { deleteItem } from 'stores/utils';
|
|||
|
||||
// NOTE Import Types
|
||||
import { RequestData, RequestDataStatus } from 'src/stores/request-list/types';
|
||||
import { View } from './types.ts';
|
||||
import { View } from './types';
|
||||
import {
|
||||
PayCondition,
|
||||
ProductRelation,
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { Icon } from '@iconify/vue';
|
|||
import { ref, watch, computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { View } from './types.ts';
|
||||
import { View } from './types';
|
||||
|
||||
import { formatNumberDecimal, commaInput } from 'stores/utils';
|
||||
|
||||
|
|
@ -14,7 +14,7 @@ import SelectInput from 'src/components/shared/SelectInput.vue';
|
|||
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { precisionRound } from 'src/utils/arithmetic';
|
||||
import { PayCondition } from 'src/stores/quotations/types.ts';
|
||||
import { PayCondition } from 'src/stores/quotations/types';
|
||||
|
||||
defineEmits<{
|
||||
(e: 'changePayType', type: PayCondition): void;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { storeToRefs } from 'pinia';
|
|||
import { QTableSlots } from 'quasar';
|
||||
import { CreditNote, useCreditNote } from 'src/stores/credit-note';
|
||||
|
||||
import { columns } from './constants.ts';
|
||||
import { columns } from './constants';
|
||||
import KebabAction from 'src/components/shared/KebabAction.vue';
|
||||
|
||||
const creditNote = useCreditNote();
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { storeToRefs } from 'pinia';
|
|||
import { QTableSlots } from 'quasar';
|
||||
import { DebitNote, useDebitNote } from 'src/stores/debit-note';
|
||||
|
||||
import { columns } from './constants.ts';
|
||||
import { columns } from './constants';
|
||||
import KebabAction from 'src/components/shared/KebabAction.vue';
|
||||
|
||||
const debitNote = useDebitNote();
|
||||
|
|
|
|||
9
src/quasar.d.ts
vendored
9
src/quasar.d.ts
vendored
|
|
@ -1,9 +0,0 @@
|
|||
/* eslint-disable */
|
||||
|
||||
// Forces TS to apply `@quasar/app-vite` augmentations of `quasar` package
|
||||
// Removing this would break `quasar/wrappers` imports as those typings are declared
|
||||
// into `@quasar/app-vite`
|
||||
// As a side effect, since `@quasar/app-vite` reference `quasar` to augment it,
|
||||
// this declaration also apply `quasar` own
|
||||
// augmentations (eg. adds `$q` into Vue component context)
|
||||
/// <reference types="@quasar/app-vite" />
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { route } from 'quasar/wrappers';
|
||||
import { defineRouter } from '#q-app/wrappers';
|
||||
import {
|
||||
createMemoryHistory,
|
||||
createRouter,
|
||||
|
|
@ -17,7 +17,7 @@ import routes from './routes';
|
|||
* with the Router instance.
|
||||
*/
|
||||
|
||||
export default route(function (/* { store, ssrContext } */) {
|
||||
export default defineRouter(function (/* { store, ssrContext } */) {
|
||||
const createHistory = process.env.SERVER
|
||||
? createMemoryHistory
|
||||
: process.env.VUE_ROUTER_MODE === 'history'
|
||||
|
|
|
|||
10
src/shims-vue.d.ts
vendored
10
src/shims-vue.d.ts
vendored
|
|
@ -1,10 +0,0 @@
|
|||
/* eslint-disable */
|
||||
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
// Mocks all files ending in `.vue` showing them as plain Vue instances
|
||||
declare module '*.vue' {
|
||||
import type { DefineComponent } from 'vue';
|
||||
const component: DefineComponent<{}, {}, any>;
|
||||
export default component;
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
import { defineStore } from 'pinia';
|
||||
import { api } from 'src/boot/axios';
|
||||
import { ref } from 'vue';
|
||||
import type { AppConfig } from './types';
|
||||
|
||||
export const useConfigStore = defineStore('config-store', () => {
|
||||
const data = ref<AppConfig>();
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
type AppConfig = {
|
||||
export type AppConfig = {
|
||||
vat: number;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,17 +3,17 @@ import {
|
|||
CreditNoteStatus as Status,
|
||||
CreditNotePayload as Payload,
|
||||
CreditNotePaybackStatus,
|
||||
} from './types.ts';
|
||||
} from './types';
|
||||
import { ref } from 'vue';
|
||||
import { defineStore } from 'pinia';
|
||||
|
||||
import { api } from 'src/boot/axios.ts';
|
||||
import { PaginationResult } from 'src/types.ts';
|
||||
import { manageAttachment, manageFile } from '../utils/index.ts';
|
||||
import { api } from 'src/boot/axios';
|
||||
import { PaginationResult } from 'src/types';
|
||||
import { manageAttachment, manageFile } from '../utils';
|
||||
|
||||
const ENDPOINT = 'credit-note';
|
||||
|
||||
export * from './types.ts';
|
||||
export * from './types';
|
||||
|
||||
export async function getCreditNoteStats() {
|
||||
const res = await api.get<Record<Status, number>>(`/${ENDPOINT}/stats`);
|
||||
|
|
|
|||
|
|
@ -500,6 +500,6 @@ const useCustomerStore = defineStore('api-customer', () => {
|
|||
};
|
||||
});
|
||||
|
||||
export * from './types.ts';
|
||||
export * from './types';
|
||||
|
||||
export default useCustomerStore;
|
||||
|
|
|
|||
|
|
@ -2,17 +2,17 @@ import {
|
|||
DebitNote as Data,
|
||||
DebitNoteStatus as Status,
|
||||
DebitNotePayload as Payload,
|
||||
} from './types.ts';
|
||||
} from './types';
|
||||
import { ref } from 'vue';
|
||||
import { defineStore } from 'pinia';
|
||||
|
||||
import { api } from 'src/boot/axios.ts';
|
||||
import { PaginationResult } from 'src/types.ts';
|
||||
import { manageAttachment, manageFile } from '../utils/index.ts';
|
||||
import { api } from 'src/boot/axios';
|
||||
import { PaginationResult } from 'src/types';
|
||||
import { manageAttachment, manageFile } from '../utils';
|
||||
|
||||
const ENDPOINT = 'debit-note';
|
||||
|
||||
export * from './types.ts';
|
||||
export * from './types';
|
||||
|
||||
export async function getDebitNoteStats() {
|
||||
const res = await api.get<Record<Status, number>>(`/${ENDPOINT}/stats`);
|
||||
|
|
|
|||
|
|
@ -52,8 +52,4 @@ export type Payment = {
|
|||
};
|
||||
};
|
||||
|
||||
export enum PaymentDataStatus {
|
||||
Success = 'PaymentSuccess',
|
||||
Wait = 'PaymentWait',
|
||||
}
|
||||
export type Receipt = Payment;
|
||||
|
|
|
|||
|
|
@ -237,4 +237,4 @@ export const useQuotationPayment = defineStore('quotation-payment', () => {
|
|||
};
|
||||
});
|
||||
|
||||
export * from './types.ts';
|
||||
export * from './types';
|
||||
|
|
|
|||
|
|
@ -353,4 +353,4 @@ export const useRequestList = defineStore('request-list', () => {
|
|||
};
|
||||
});
|
||||
|
||||
export * from './types.ts';
|
||||
export * from './types';
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ export const useTaskOrderStore = defineStore('taskorder-store', () => {
|
|||
[TaskOrderStatus.Complete]: 0,
|
||||
[TaskOrderStatus.Accept]: 0,
|
||||
[TaskOrderStatus.Submit]: 0,
|
||||
[TaskOrderStatus.Restart]: 0,
|
||||
});
|
||||
const fileManager = manageAttachment(api, 'task-order');
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ export function setTheme(theme: Theme): Theme {
|
|||
|
||||
export enum Lang {
|
||||
English = 'eng',
|
||||
Thai = 'tha',
|
||||
Thai = 'tha', // spellchecker:disable-line
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue