diff --git a/src/pages/11_credit-note/TableCreditNote.vue b/src/pages/11_credit-note/TableCreditNote.vue
index 32668a27..ed82be7d 100644
--- a/src/pages/11_credit-note/TableCreditNote.vue
+++ b/src/pages/11_credit-note/TableCreditNote.vue
@@ -4,7 +4,7 @@ import { storeToRefs } from 'pinia';
import { QTableSlots } from 'quasar';
import { CreditNote, useCreditNote } from 'src/stores/credit-note';
-import { columns } from './constants';
+import { columns } from './constants.ts';
import KebabAction from 'src/components/shared/KebabAction.vue';
const creditNote = useCreditNote();
diff --git a/src/pages/11_credit-note/document-view/MainPage.vue b/src/pages/11_credit-note/document-view/MainPage.vue
index e15fe13d..f87d4b3b 100644
--- a/src/pages/11_credit-note/document-view/MainPage.vue
+++ b/src/pages/11_credit-note/document-view/MainPage.vue
@@ -248,7 +248,6 @@ function calcPricePerUnit(product: RequestWork['productService']['product']) {
function calcPrice(
product: RequestWork['productService']['product'],
amount: number,
- vat: number = 0,
) {
const pricePerUnit = agentPrice.value ? product.agentPrice : product.price;
@@ -257,8 +256,7 @@ function calcPrice(
: pricePerUnit;
const priceDiscountNoVat = priceNoVat * amount - 0;
- const rawVatTotal =
- vat === 0 ? 0 : priceDiscountNoVat * (config.value?.vat || 0.07);
+ const rawVatTotal = priceDiscountNoVat * (config.value?.vat || 0.07);
return precisionRound(priceNoVat * amount + rawVatTotal);
}
@@ -348,7 +346,7 @@ function closeAble() {
{{
formatNumberDecimal(
- calcPrice(v.product.product, v.list.length, v.product.vat),
+ calcPrice(v.product.product, v.list.length),
2,
)
}}
@@ -433,7 +431,7 @@ function closeAble() {
class="column set-width bg-color full-height"
style="padding: 12px"
>
- ({{ ThaiBahtText(precisionRound(summaryPrice.finalPrice)) }})
+ ({{ ThaiBahtText(summaryPrice.finalPrice) }})
`${i + 1}. ` +
- `${v.namePrefix}. ${v.firstNameEN ? `${v.firstNameEN} ${v.lastNameEN}` : `${v.firstName} ${v.lastName}`} `.toUpperCase(),
+ `${v.namePrefix}. ${v.firstNameEN} ${v.lastNameEN}`.toUpperCase(),
) || [],
},
}) || '-'
diff --git a/src/pages/12_debit-note/MainPage.vue b/src/pages/12_debit-note/MainPage.vue
index 15e2fc32..cd022dfa 100644
--- a/src/pages/12_debit-note/MainPage.vue
+++ b/src/pages/12_debit-note/MainPage.vue
@@ -24,7 +24,6 @@ import { pageTabs, columns, hslaColors } from './constants';
import { DebitNoteStatus, useDebitNote } from 'src/stores/debit-note';
import { dialogWarningClose } from 'src/stores/utils';
import { useQuasar } from 'quasar';
-import AdvanceSearch from 'src/components/shared/AdvanceSearch.vue';
const $q = useQuasar();
const { t } = useI18n();
@@ -47,7 +46,6 @@ const pageState = reactive({
total: 0,
debitDialog: false,
- searchDate: [],
});
const fieldSelectedOption = computed(() => {
@@ -70,8 +68,6 @@ async function getList(opts?: { page?: number; pageSize?: number }) {
? undefined
: pageState.currentTab) as DebitNoteStatus,
includeRegisteredBranch: true,
- startDate: pageState.searchDate[0],
- endDate: pageState.searchDate[1],
});
if (res) {
@@ -153,7 +149,6 @@ watch(
() => pageState.inputSearch,
() => pageSize.value,
() => pageState.statusFilter,
- () => pageState.searchDate,
],
() => getList(),
);
@@ -261,10 +256,6 @@ watch(
-
-
-
-
diff --git a/src/pages/12_debit-note/TableDebitNote.vue b/src/pages/12_debit-note/TableDebitNote.vue
index 4df008ca..de3d6907 100644
--- a/src/pages/12_debit-note/TableDebitNote.vue
+++ b/src/pages/12_debit-note/TableDebitNote.vue
@@ -4,7 +4,7 @@ import { storeToRefs } from 'pinia';
import { QTableSlots } from 'quasar';
import { DebitNote, useDebitNote } from 'src/stores/debit-note';
-import { columns } from './constants';
+import { columns } from './constants.ts';
import KebabAction from 'src/components/shared/KebabAction.vue';
const debitNote = useDebitNote();
diff --git a/src/pages/12_debit-note/document-view/MainPage.vue b/src/pages/12_debit-note/document-view/MainPage.vue
index 563b4d02..7233ede7 100644
--- a/src/pages/12_debit-note/document-view/MainPage.vue
+++ b/src/pages/12_debit-note/document-view/MainPage.vue
@@ -501,7 +501,7 @@ function print() {
details?.worker.map(
(v, i) =>
`${i + 1}. ` +
- `${v.namePrefix}. ${v.firstNameEN ? `${v.firstNameEN} ${v.lastNameEN}` : `${v.firstName} ${v.lastName}`} `.toUpperCase(),
+ `${v.namePrefix}. ${v.firstNameEN} ${v.lastNameEN}`.toUpperCase(),
) || [],
},
}) || '-'
diff --git a/src/pages/13_receipt/MainPage.vue b/src/pages/13_receipt/MainPage.vue
index 3e6083ce..8dede01c 100644
--- a/src/pages/13_receipt/MainPage.vue
+++ b/src/pages/13_receipt/MainPage.vue
@@ -17,8 +17,7 @@ import { columns, hslaColors } from './constants';
import useFlowStore from 'src/stores/flow';
import { usePayment, useReceipt } from 'src/stores/payment';
import { PaymentDataStatus } from 'src/stores/payment/types';
-import { useQuasar } from 'quasar';
-import AdvanceSearch from 'src/components/shared/AdvanceSearch.vue';
+import { QSelect, useQuasar } from 'quasar';
const $q = useQuasar();
const navigatorStore = useNavigator();
@@ -27,6 +26,7 @@ const receiptStore = useReceipt();
const { data, page, pageMax, pageSize } = storeToRefs(receiptStore);
// NOTE: Variable
+const refFilter = ref >();
const pageState = reactive({
hideStat: false,
@@ -35,7 +35,6 @@ const pageState = reactive({
fieldSelected: [...columns.map((v) => v.name)],
gridView: false,
total: 0,
- searchDate: [],
});
const fieldSelectedOption = computed(() => {
@@ -50,8 +49,6 @@ async function fetchList(opts?: { rotateFlowId?: boolean }) {
page: page.value,
pageSize: pageSize.value,
query: pageState.inputSearch,
- startDate: pageState.searchDate[0],
- endDate: pageState.searchDate[1],
});
if (ret) {
data.value = $q.screen.xs ? [...data.value, ...ret.result] : ret.result;
@@ -98,7 +95,6 @@ watch(
() => pageState.inputSearch,
() => pageState.statusFilter,
() => pageSize.value,
- () => pageState.searchDate,
],
() => {
page.value = 1;
@@ -176,43 +172,25 @@ watch(
-
-
-
-
- {{ $t('general.status') }}
-
-
+
+
+
-
+
diff --git a/src/router/index.ts b/src/router/index.ts
index 2b416040..88456704 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -1,4 +1,4 @@
-import { defineRouter } from '#q-app/wrappers';
+import { route } from 'quasar/wrappers';
import {
createMemoryHistory,
createRouter,
@@ -17,7 +17,7 @@ import routes from './routes';
* with the Router instance.
*/
-export default defineRouter(function (/* { store, ssrContext } */) {
+export default route(function (/* { store, ssrContext } */) {
const createHistory = process.env.SERVER
? createMemoryHistory
: process.env.VUE_ROUTER_MODE === 'history'
diff --git a/src/router/routes.ts b/src/router/routes.ts
index c3ef0438..e05049fd 100644
--- a/src/router/routes.ts
+++ b/src/router/routes.ts
@@ -155,16 +155,6 @@ const routes: RouteRecordRaw[] = [
name: 'ManualView',
component: () => import('pages/00_manual/ViewPage.vue'),
},
- {
- path: '/troubleshooting',
- name: 'Troubleshooting',
- component: () => import('pages/00_manual/MainPage.vue'),
- },
- {
- path: '/troubleshooting/:category/:page',
- name: 'TroubleshootingView',
- component: () => import('pages/00_manual/ViewPage.vue'),
- },
],
},
diff --git a/src/shims-vue.d.ts b/src/shims-vue.d.ts
new file mode 100644
index 00000000..4e6894b2
--- /dev/null
+++ b/src/shims-vue.d.ts
@@ -0,0 +1,10 @@
+/* eslint-disable */
+
+///
+
+// 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;
+}
diff --git a/src/stores/address/index.ts b/src/stores/address/index.ts
index 5cbbd14d..975ca773 100644
--- a/src/stores/address/index.ts
+++ b/src/stores/address/index.ts
@@ -102,25 +102,12 @@ const useAddressStore = defineStore('api-address', () => {
return subDistrict.value[districtId];
}
- async function listSameOfficeArea(districtId: string) {
- const res = await api.post (
- `/employment-office/list-same-office-area`,
- { districtId: districtId },
- );
-
- if (!res) return false;
-
- return res.data;
- }
-
return {
fetchOffice,
fetchOfficeById,
fetchProvince,
fetchDistrictByProvinceId,
fetchSubDistrictByProvinceId,
-
- listSameOfficeArea,
};
});
diff --git a/src/stores/branch/index.ts b/src/stores/branch/index.ts
index 7225fb7d..db8a5b25 100644
--- a/src/stores/branch/index.ts
+++ b/src/stores/branch/index.ts
@@ -39,8 +39,6 @@ const useBranchStore = defineStore('api-branch', () => {
withHead?: boolean;
activeOnly?: boolean;
headOfficeId?: string;
- startDate?: string;
- endDate?: string;
},
Data extends Pagination,
>(opts?: Options): Promise {
diff --git a/src/stores/config/index.ts b/src/stores/config/index.ts
index c57eb1d6..9ab43cda 100644
--- a/src/stores/config/index.ts
+++ b/src/stores/config/index.ts
@@ -1,7 +1,6 @@
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();
diff --git a/src/stores/config/types.ts b/src/stores/config/types.ts
index 819910b7..5090f8d4 100644
--- a/src/stores/config/types.ts
+++ b/src/stores/config/types.ts
@@ -1,3 +1,3 @@
-export type AppConfig = {
+type AppConfig = {
vat: number;
};
diff --git a/src/stores/credit-note/index.ts b/src/stores/credit-note/index.ts
index 24da139e..72ae3977 100644
--- a/src/stores/credit-note/index.ts
+++ b/src/stores/credit-note/index.ts
@@ -3,17 +3,17 @@ import {
CreditNoteStatus as Status,
CreditNotePayload as Payload,
CreditNotePaybackStatus,
-} from './types';
+} from './types.ts';
import { ref } from 'vue';
import { defineStore } from 'pinia';
-import { api } from 'src/boot/axios';
-import { PaginationResult } from 'src/types';
-import { manageAttachment, manageFile } from '../utils';
+import { api } from 'src/boot/axios.ts';
+import { PaginationResult } from 'src/types.ts';
+import { manageAttachment, manageFile } from '../utils/index.ts';
const ENDPOINT = 'credit-note';
-export * from './types';
+export * from './types.ts';
export async function getCreditNoteStats() {
const res = await api.get>(`/${ENDPOINT}/stats`);
@@ -28,8 +28,6 @@ export async function getCreditNoteList(params?: {
pageSize?: number;
query?: string;
creditNoteStatus?: Status;
- startDate?: string;
- endDate?: string;
}) {
const res = await api.get>(`/${ENDPOINT}`, {
params,
diff --git a/src/stores/customer/index.ts b/src/stores/customer/index.ts
index fe08b0ca..132cd0c6 100644
--- a/src/stores/customer/index.ts
+++ b/src/stores/customer/index.ts
@@ -113,8 +113,6 @@ const useCustomerStore = defineStore('api-customer', () => {
includeBranch?: boolean;
status?: 'CREATED' | 'ACTIVE' | 'INACTIVE';
customerType?: CustomerType;
- startDate?: string;
- endDate?: string;
},
Data extends Pagination<
(Customer &
@@ -502,6 +500,6 @@ const useCustomerStore = defineStore('api-customer', () => {
};
});
-export * from './types';
+export * from './types.ts';
export default useCustomerStore;
diff --git a/src/stores/debit-note/index.ts b/src/stores/debit-note/index.ts
index 6d8638f8..a943e932 100644
--- a/src/stores/debit-note/index.ts
+++ b/src/stores/debit-note/index.ts
@@ -2,17 +2,17 @@ import {
DebitNote as Data,
DebitNoteStatus as Status,
DebitNotePayload as Payload,
-} from './types';
+} from './types.ts';
import { ref } from 'vue';
import { defineStore } from 'pinia';
-import { api } from 'src/boot/axios';
-import { PaginationResult } from 'src/types';
-import { manageAttachment, manageFile } from '../utils';
+import { api } from 'src/boot/axios.ts';
+import { PaginationResult } from 'src/types.ts';
+import { manageAttachment, manageFile } from '../utils/index.ts';
const ENDPOINT = 'debit-note';
-export * from './types';
+export * from './types.ts';
export async function getDebitNoteStats() {
const res = await api.get>(`/${ENDPOINT}/stats`);
@@ -28,8 +28,6 @@ export async function getDebitNoteList(params?: {
query?: string;
status?: Status;
includeRegisteredBranch?: boolean;
- startDate?: string;
- endDate?: string;
}) {
const res = await api.get>(`/${ENDPOINT}`, {
params,
diff --git a/src/stores/employee/index.ts b/src/stores/employee/index.ts
index 73722d51..41b766a8 100644
--- a/src/stores/employee/index.ts
+++ b/src/stores/employee/index.ts
@@ -45,8 +45,6 @@ const useEmployeeStore = defineStore('api-employee', () => {
customerId?: string;
customerBranchId?: string;
activeOnly?: boolean;
- startDate?: string;
- endDate?: string;
payload?: { passport?: string[] };
}) {
const { payload, ...params } = opts || {};
diff --git a/src/stores/institution/index.ts b/src/stores/institution/index.ts
index b9f8e18d..dab8fc85 100644
--- a/src/stores/institution/index.ts
+++ b/src/stores/institution/index.ts
@@ -29,9 +29,6 @@ export const useInstitution = defineStore('institution-store', () => {
group?: string;
status?: Status;
payload?: { group?: string[] };
- startDate?: string;
- endDate?: string;
- activeOnly?: boolean;
}) {
const { payload, ...params } = opts || {};
@@ -75,67 +72,18 @@ export const useInstitution = defineStore('institution-store', () => {
}
}
- if (res.data.bank && data.bank.length > 0) {
- for (let i = 0; i < data.bank?.length; i++) {
- if (data.bank[i].bankQr) {
- await api
- .put(
- `/institution/${res.data.id}/bank-qr/${res.data.bank[i].id}`,
- data.bank[i].bankQr,
- {
- headers: { 'Content-Type': data.bank[i].bankQr?.type },
- onUploadProgress: (e) => console.log(e),
- },
- )
- .catch((e) => console.error(e));
- }
- }
- }
-
if (res.status < 400) {
return res.data;
}
return null;
}
- async function editInstitution(
- data: InstitutionPayload & { id: string },
- opts?: { indexDeleteQrCodeBank?: number[] },
- ) {
+ async function editInstitution(data: InstitutionPayload & { id: string }) {
const res = await api.put(`/institution/${data.id}`, {
...data,
id: undefined,
group: undefined,
});
-
- if (!!res.data.bank && !!data.bank.length) {
- for (let i = 0; i < data.bank?.length; i++) {
- if (data.bank[i].bankQr) {
- console.log(i);
- console.log(data.bank[i].bankQr);
- await api
- .put(
- `/institution/${res.data.id}/bank-qr/${res.data.bank[i].id}`,
- data.bank[i].bankQr,
- {
- headers: { 'Content-Type': data.bank[i].bankQr?.type },
- onUploadProgress: (e) => console.log(e),
- },
- )
- .catch((e) => console.error(e));
- }
- }
- }
-
- if (opts.indexDeleteQrCodeBank && opts.indexDeleteQrCodeBank.length > 0) {
- console.log('delete');
- opts.indexDeleteQrCodeBank.forEach(async (i) => {
- await api
- .delete(`/institution/${res.data.id}/bank-qr/${res.data.bank[i].id}`)
- .catch((e) => console.error(e));
- });
- }
-
if (res.status < 400) {
return res.data;
}
diff --git a/src/stores/institution/types.ts b/src/stores/institution/types.ts
index 9a3877a5..7bd6287f 100644
--- a/src/stores/institution/types.ts
+++ b/src/stores/institution/types.ts
@@ -1,5 +1,4 @@
import { District, Province, SubDistrict } from '../address';
-import { BankBook } from '../branch/types';
import { Status } from '../types';
export type Institution = {
@@ -26,11 +25,6 @@ export type Institution = {
districtId: string;
provinceId: string;
status: Status;
-
- contactName?: string | null;
- contactEmail?: string | null;
- contactTel?: string | null;
- bank: BankBook[];
};
export type InstitutionPayload = {
@@ -40,11 +34,6 @@ export type InstitutionPayload = {
group?: string;
selectedImage?: string | null;
- contactName?: string | null;
- contactEmail?: string | null;
- contactTel?: string | null;
- bank: BankBook[];
-
addressEN: string;
address: string;
soi?: string | null;
diff --git a/src/stores/manual/index.ts b/src/stores/manual/index.ts
index e2842bd3..fef42284 100644
--- a/src/stores/manual/index.ts
+++ b/src/stores/manual/index.ts
@@ -5,11 +5,10 @@ import { getToken } from 'src/services/keycloak';
import { Manual } from './types';
import { baseUrl } from '../utils';
-const MANUAL_ENDPOINT = 'manual';
-const TROUBLESHOOTING_ENDPOINT = 'troubleshooting';
+const ENDPOINT = 'manual';
export async function getManual() {
- const res = await api.get(`/${MANUAL_ENDPOINT}`);
+ const res = await api.get(`/${ENDPOINT}`);
if (res.status < 400) {
return res.data;
}
@@ -21,28 +20,7 @@ export async function getManualByPage(opt: {
pageName: string;
}) {
const res = await fetch(
- `${baseUrl}/${MANUAL_ENDPOINT}/${opt.category}/page/${opt.pageName}`,
- );
- if (res.status < 400) {
- return res;
- }
- return null;
-}
-
-export async function getTroubleshooting() {
- const res = await api.get(`/${TROUBLESHOOTING_ENDPOINT}`);
- if (res.status < 400) {
- return res.data;
- }
- return null;
-}
-
-export async function getTroubleshootingByPage(opt: {
- category: string;
- pageName: string;
-}) {
- const res = await fetch(
- `${baseUrl}/${TROUBLESHOOTING_ENDPOINT}/${opt.category}/page/${opt.pageName}`,
+ `${baseUrl}/${ENDPOINT}/${opt.category}/page/${opt.pageName}`,
);
if (res.status < 400) {
return res;
@@ -52,15 +30,11 @@ export async function getTroubleshootingByPage(opt: {
export const useManualStore = defineStore('manual-store', () => {
const dataManual = ref([]);
- const dataTroubleshooting = ref([]);
return {
getManual,
getManualByPage,
- getTroubleshooting,
- getTroubleshootingByPage,
dataManual,
- dataTroubleshooting,
};
});
diff --git a/src/stores/options/index.ts b/src/stores/options/index.ts
index 469d991f..d425389b 100644
--- a/src/stores/options/index.ts
+++ b/src/stores/options/index.ts
@@ -75,7 +75,6 @@ const useOptionStore = defineStore('optionStore', () => {
}
return {
- rawOption,
globalOption,
mapOption,
};
diff --git a/src/stores/payment/index.ts b/src/stores/payment/index.ts
index 960c8a23..93c210fc 100644
--- a/src/stores/payment/index.ts
+++ b/src/stores/payment/index.ts
@@ -101,8 +101,6 @@ export const useReceipt = defineStore('receipt-store', () => {
debitNoteId?: string;
debitNoteOnly?: boolean;
quotationOnly?: boolean;
- startDate?: string;
- endDate?: string;
}) {
const res = await api.get>('/receipt', {
params: opts,
@@ -164,8 +162,6 @@ export const useInvoice = defineStore('invoice-store', () => {
debitNoteOnly?: boolean;
quotationId?: string;
debitNoteId?: string;
- startDate?: string;
- endDate?: string;
}) {
const res = await api.get>('/invoice', {
params,
diff --git a/src/stores/payment/types.ts b/src/stores/payment/types.ts
index 53a855d3..f8c73b81 100644
--- a/src/stores/payment/types.ts
+++ b/src/stores/payment/types.ts
@@ -52,4 +52,8 @@ export type Payment = {
};
};
+export enum PaymentDataStatus {
+ Success = 'PaymentSuccess',
+ Wait = 'PaymentWait',
+}
export type Receipt = Payment;
diff --git a/src/stores/product-service/index.ts b/src/stores/product-service/index.ts
index 0405bf16..1804b1cd 100644
--- a/src/stores/product-service/index.ts
+++ b/src/stores/product-service/index.ts
@@ -56,8 +56,6 @@ const useProductServiceStore = defineStore('api-product-service', () => {
query?: string;
status?: 'CREATED' | 'ACTIVE' | 'INACTIVE';
activeOnly?: boolean;
- startDate?: string;
- endDate?: string;
}) {
const params = new URLSearchParams();
@@ -144,8 +142,6 @@ const useProductServiceStore = defineStore('api-product-service', () => {
orderField?: string;
activeOnly?: boolean;
orderBy?: 'asc' | 'desc';
- startDate?: string;
- endDate?: string;
}) {
const params = new URLSearchParams();
@@ -194,23 +190,6 @@ const useProductServiceStore = defineStore('api-product-service', () => {
return false;
}
- async function importProduct(
- productGroupId: string,
- files: File[],
- fetch: (...args: unknown[]) => void,
- ) {
- const importTasks = files.map((f) => {
- const formData = new FormData();
- formData.append('file', f);
- return api.post('/product/import-product', formData, {
- params: { productGroupId },
- });
- });
-
- await Promise.all(importTasks);
- fetch?.();
- }
-
async function fetchListProductById(productId: string) {
const res = await api.get(`/product/${productId}`);
@@ -270,8 +249,6 @@ const useProductServiceStore = defineStore('api-product-service', () => {
productGroupId?: string;
status?: string;
fullDetail?: boolean;
- startDate?: string;
- endDate?: string;
}) {
const params = new URLSearchParams();
@@ -566,8 +543,6 @@ const useProductServiceStore = defineStore('api-product-service', () => {
fetchImageListById,
addImageList,
deleteImageByName,
-
- importProduct,
};
});
diff --git a/src/stores/property/index.ts b/src/stores/property/index.ts
index 2765ed80..c840c053 100644
--- a/src/stores/property/index.ts
+++ b/src/stores/property/index.ts
@@ -25,8 +25,6 @@ export const useProperty = defineStore('property-store', () => {
query?: string;
status?: Status;
activeOnly?: boolean;
- startDate?: string;
- endDate?: string;
}) {
const res = await api.get>('/property', {
params,
diff --git a/src/stores/quotations/index.ts b/src/stores/quotations/index.ts
index e7faca39..133b160c 100644
--- a/src/stores/quotations/index.ts
+++ b/src/stores/quotations/index.ts
@@ -76,8 +76,6 @@ export const useQuotationStore = defineStore('quotation-store', () => {
includeRegisteredBranch?: boolean;
forDebitNote?: boolean;
cancelIncludeDebitNote?: boolean;
- startDate?: string;
- endDate?: string;
}) {
const res = await api.get>('/quotation', {
params,
@@ -239,4 +237,4 @@ export const useQuotationPayment = defineStore('quotation-payment', () => {
};
});
-export * from './types';
+export * from './types.ts';
diff --git a/src/stores/request-list/index.ts b/src/stores/request-list/index.ts
index 040c7077..a05cedc2 100644
--- a/src/stores/request-list/index.ts
+++ b/src/stores/request-list/index.ts
@@ -209,9 +209,6 @@ export const useRequestList = defineStore('request-list', () => {
requestDataStatus?: RequestDataStatus;
responsibleOnly?: boolean;
quotationId?: string;
- incomplete?: boolean;
- startDate?: string;
- endDate?: string;
}) {
const res = await api.get>('/request-data', {
params,
@@ -328,20 +325,6 @@ export const useRequestList = defineStore('request-list', () => {
return false;
}
- async function updateMessenger(
- requestDataId: string[],
- defaultMessengerId: string,
- ) {
- const res = await api.post('/request-data/update-messenger', {
- requestDataId,
- defaultMessengerId,
- });
-
- if (res.status < 400) return true;
-
- return false;
- }
-
return {
data,
page,
@@ -367,9 +350,7 @@ export const useRequestList = defineStore('request-list', () => {
rejectRequest,
rejectRequestWork,
-
- updateMessenger,
};
});
-export * from './types';
+export * from './types.ts';
diff --git a/src/stores/request-list/types.ts b/src/stores/request-list/types.ts
index e3d8cd57..f221b209 100644
--- a/src/stores/request-list/types.ts
+++ b/src/stores/request-list/types.ts
@@ -14,8 +14,6 @@ export type RequestData = {
rejectRequestCancel?: boolean;
rejectRequestCancelReason?: string;
- defaultMessengerId?: string;
-
quotation: QuotationFull & {
debitNoteQuotationId: string;
isDebitNote: boolean;
@@ -28,7 +26,6 @@ export type RequestData = {
requestWork: RequestWork[];
requestDataStatus: RequestDataStatus;
- dataOffice: { name: string; nameEN: string };
};
export enum RequestDataStatus {
diff --git a/src/stores/task-order/index.ts b/src/stores/task-order/index.ts
index abb6c553..c4aeb682 100644
--- a/src/stores/task-order/index.ts
+++ b/src/stores/task-order/index.ts
@@ -27,7 +27,6 @@ export const useTaskOrderStore = defineStore('taskorder-store', () => {
[TaskOrderStatus.Complete]: 0,
[TaskOrderStatus.Accept]: 0,
[TaskOrderStatus.Submit]: 0,
- [TaskOrderStatus.Restart]: 0,
});
const fileManager = manageAttachment(api, 'task-order');
@@ -48,8 +47,6 @@ export const useTaskOrderStore = defineStore('taskorder-store', () => {
query?: string;
taskOrderStatus?: TaskOrderStatus;
assignedUserId?: boolean;
- startDate?: string;
- endDate?: string;
}) {
const res = await api.get>('/task-order', {
params,
@@ -163,8 +160,6 @@ export const useTaskOrderStore = defineStore('taskorder-store', () => {
pageSize?: number;
query?: string;
userTaskStatus?: UserTaskStatus;
- startDate?: string;
- endDate?: string;
}) {
const res = await api.get>('/user-task-order', {
params,
diff --git a/src/stores/task-order/types.ts b/src/stores/task-order/types.ts
index 8bac1f86..0b64dc90 100644
--- a/src/stores/task-order/types.ts
+++ b/src/stores/task-order/types.ts
@@ -53,7 +53,6 @@ export interface TaskOrder {
contactName: string;
taskOrderStatus: TaskOrderStatus;
taskName: string;
- codeProductReceived?: string;
code: string;
id: string;
userTask: UserTask[];
@@ -165,8 +164,6 @@ export interface TaskOrderPayload {
requestWorkId: string;
requestWorkStep?: Task;
taskStatus?: TaskStatus;
- failedType?: string;
- failedComment?: string;
}[];
taskProduct?: {
productId: string;
@@ -180,7 +177,6 @@ export interface TaskOrderPayload {
registeredBranchId?: string;
id?: string;
code?: string;
- codeProductReceived?: string;
remark?: string;
}
diff --git a/src/stores/user/index.ts b/src/stores/user/index.ts
index ac0b4b00..1d26ea90 100644
--- a/src/stores/user/index.ts
+++ b/src/stores/user/index.ts
@@ -15,12 +15,12 @@ import {
import axios from 'axios';
import useBranchStore from '../branch';
import { Branch } from '../branch/types';
-import { getSignature, setSignature } from './signature';
-import { getUserId } from 'src/services/keycloak';
+import useFlowStore from '../flow';
const branchStore = useBranchStore();
const useUserStore = defineStore('api-user', () => {
+ const flowStore = useFlowStore();
const userOption = ref({
hqOpts: [],
brOpts: [],
@@ -39,14 +39,6 @@ const useUserStore = defineStore('api-user', () => {
const data = ref>();
- async function fetchUserGroup(id?: string) {
- return await api
- .get<
- { id: string; name: string; path: string }[]
- >(`/user/${id || getUserId()}/group`)
- .then((res) => res.data);
- }
-
async function fetchHqOption() {
if (userOption.value.hqOpts.length === 0) {
const res = await branchStore.fetchList({
@@ -103,15 +95,37 @@ const useUserStore = defineStore('api-user', () => {
});
}
- async function fetchAttachment(userId: string) {
- const res = await api.get(`/user/${userId}/attachment`);
+ async function fetchAttachment(
+ userId: string,
+ flow?: {
+ sessionId?: string;
+ refTransactionId?: string;
+ transactionId?: string;
+ },
+ ) {
+ const res = await api.get(`/user/${userId}/attachment`, {
+ headers: {
+ 'X-Session-Id': flow?.sessionId,
+ 'X-Rtid': flow?.refTransactionId || flowStore.rtid,
+ 'X-Tid': flow?.transactionId,
+ },
+ });
+
if (res && res.status === 200) {
return res.data;
}
return false;
}
- async function addAttachment(userId: string, payload: UserAttachmentCreate) {
+ async function addAttachment(
+ userId: string,
+ payload: UserAttachmentCreate,
+ flow?: {
+ sessionId?: string;
+ refTransactionId?: string;
+ transactionId?: string;
+ },
+ ) {
const list: { name: string; file: File }[] = [];
payload.file.forEach((v) => {
@@ -142,6 +156,13 @@ const useUserStore = defineStore('api-user', () => {
const res = await api.post<(UserAttachment & { uploadUrl: string })[]>(
`/user/${userId}/attachment`,
{ file: list.map((v) => v.name) },
+ {
+ headers: {
+ 'X-Session-Id': flow?.sessionId,
+ 'X-Rtid': flow?.refTransactionId || flowStore.rtid,
+ 'X-Tid': flow?.transactionId,
+ },
+ },
);
await Promise.all(
@@ -161,9 +182,19 @@ const useUserStore = defineStore('api-user', () => {
async function deleteAttachment(
userId: string,
payload: UserAttachmentDelete,
+ flow?: {
+ sessionId?: string;
+ refTransactionId?: string;
+ transactionId?: string;
+ },
) {
await api.delete(`/user/${userId}/attachment`, {
data: payload,
+ headers: {
+ 'X-Session-Id': flow?.sessionId,
+ 'X-Rtid': flow?.refTransactionId || flowStore.rtid,
+ 'X-Tid': flow?.transactionId,
+ },
});
}
@@ -177,8 +208,6 @@ const useUserStore = defineStore('api-user', () => {
status?: Status;
responsibleDistrictId?: string;
activeBranchOnly?: boolean;
- startDate?: string;
- endDate?: string;
}) {
const res = await api.get>('/user', { params: opts });
@@ -188,8 +217,21 @@ const useUserStore = defineStore('api-user', () => {
return false;
}
- async function fetchById(id: string) {
- const res = await api.get(`/user/${id}`);
+ async function fetchById(
+ id: string,
+ flow?: {
+ sessionId?: string;
+ refTransactionId?: string;
+ transactionId?: string;
+ },
+ ) {
+ const res = await api.get(`/user/${id}`, {
+ headers: {
+ 'X-Session-Id': flow?.sessionId,
+ 'X-Rtid': flow?.refTransactionId || flowStore.rtid,
+ 'X-Tid': flow?.transactionId,
+ },
+ });
if (!res) return false;
if (res.status === 200) return res.data;
@@ -198,8 +240,21 @@ const useUserStore = defineStore('api-user', () => {
return false;
}
- async function fetchImageListById(id: string) {
- const res = await api.get(`/user/${id}/profile-image`);
+ async function fetchImageListById(
+ id: string,
+ flow?: {
+ sessionId?: string;
+ refTransactionId?: string;
+ transactionId?: string;
+ },
+ ) {
+ const res = await api.get(`/user/${id}/profile-image`, {
+ headers: {
+ 'X-Session-Id': flow?.sessionId,
+ 'X-Rtid': flow?.refTransactionId || flowStore.rtid,
+ 'X-Tid': flow?.transactionId,
+ },
+ });
if (!res) return false;
if (res.status === 200) return res.data;
@@ -219,8 +274,22 @@ const useUserStore = defineStore('api-user', () => {
return name;
}
- async function deleteImageByName(id: string, name: string) {
- const res = await api.delete(`/user/${id}/profile-image/${name}`);
+ async function deleteImageByName(
+ id: string,
+ name: string,
+ flow?: {
+ sessionId?: string;
+ refTransactionId?: string;
+ transactionId?: string;
+ },
+ ) {
+ const res = await api.delete(`/user/${id}/profile-image/${name}`, {
+ headers: {
+ 'X-Session-Id': flow?.sessionId,
+ 'X-Rtid': flow?.refTransactionId || flowStore.rtid,
+ 'X-Tid': flow?.transactionId,
+ },
+ });
if (!res) return false;
}
@@ -231,12 +300,27 @@ const useUserStore = defineStore('api-user', () => {
selectedImage: string;
list: { url: string; imgFile: File | null; name: string }[];
},
+ flow?: {
+ sessionId?: string;
+ refTransactionId?: string;
+ transactionId?: string;
+ },
) {
const { zipCode, ...payload } = data;
- const res = await api.post('/user', {
- ...payload,
- selectedImage: imgList.selectedImage || '',
- });
+ const res = await api.post(
+ '/user',
+ {
+ ...payload,
+ selectedImage: imgList.selectedImage || '',
+ },
+ {
+ headers: {
+ 'X-Session-Id': flow?.sessionId,
+ 'X-Rtid': flow?.refTransactionId || flowStore.rtid,
+ 'X-Tid': flow?.transactionId,
+ },
+ },
+ );
if (imgList.list.length > 0 && res.data.id) {
for (let index = 0; index < imgList.list.length; index++) {
@@ -254,47 +338,113 @@ const useUserStore = defineStore('api-user', () => {
async function editById(
id: string,
data: Partial,
+ flow?: {
+ sessionId?: string;
+ refTransactionId?: string;
+ transactionId?: string;
+ },
) {
- const { zipCode, ...payload } = data;
+ const { zipCode, ...paylond } = data;
- const res = await api.put(`/user/${id}`, payload);
+ const res = await api.put(`/user/${id}`, paylond, {
+ headers: {
+ 'X-Session-Id': flow?.sessionId,
+ 'X-Rtid': flow?.refTransactionId || flowStore.rtid,
+ 'X-Tid': flow?.transactionId,
+ },
+ });
if (!res) return false;
return res.data;
}
- async function deleteById(id: string) {
- const res = await api.delete(`/user/${id}`);
-
- if (!res) return false;
- if (res.status === 200) return res.data;
-
- return false;
- }
-
- async function getBranch(userId: string) {
- const res = await api.get>(`/user/${userId}/branch`);
-
- if (!res) return false;
- if (res.status === 200) return res.data;
-
- return false;
- }
-
- async function addBranch(userId: string, branchId: string | string[]) {
- const res = await api.post(`/user/${userId}/branch`, {
- branch: ([] as string[]).concat(branchId),
+ async function deleteById(
+ id: string,
+ flow?: {
+ sessionId?: string;
+ refTransactionId?: string;
+ transactionId?: string;
+ },
+ ) {
+ const res = await api.delete(`/user/${id}`, {
+ headers: {
+ 'X-Session-Id': flow?.sessionId,
+ 'X-Rtid': flow?.refTransactionId || flowStore.rtid,
+ 'X-Tid': flow?.transactionId,
+ },
});
+ if (!res) return false;
+ if (res.status === 200) return res.data;
+
+ return false;
+ }
+
+ async function getBranch(
+ userId: string,
+ flow?: {
+ sessionId?: string;
+ refTransactionId?: string;
+ transactionId?: string;
+ },
+ ) {
+ const res = await api.get>(`/user/${userId}/branch`, {
+ headers: {
+ 'X-Session-Id': flow?.sessionId,
+ 'X-Rtid': flow?.refTransactionId || flowStore.rtid,
+ 'X-Tid': flow?.transactionId,
+ },
+ });
+
+ if (!res) return false;
+ if (res.status === 200) return res.data;
+
+ return false;
+ }
+
+ async function addBranch(
+ userId: string,
+ branchId: string | string[],
+ flow?: {
+ sessionId?: string;
+ refTransactionId?: string;
+ transactionId?: string;
+ },
+ ) {
+ const res = await api.post(
+ `/user/${userId}/branch`,
+ { branch: ([] as string[]).concat(branchId) },
+ {
+ headers: {
+ 'X-Session-Id': flow?.sessionId,
+ 'X-Rtid': flow?.refTransactionId || flowStore.rtid,
+ 'X-Tid': flow?.transactionId,
+ },
+ },
+ );
+
if (!res) return false;
if (res.status >= 400) return false;
return res.data || true;
}
- async function removeBranch(userId: string, branchId: string | string[]) {
+ async function removeBranch(
+ userId: string,
+ branchId: string | string[],
+ flow?: {
+ sessionId?: string;
+ refTransactionId?: string;
+ transactionId?: string;
+ },
+ ) {
const res = await api.delete(`/user/${userId}/branch`, {
+ headers: {
+ 'X-Session-Id': flow?.sessionId,
+ 'X-Rtid': flow?.refTransactionId || flowStore.rtid,
+ 'X-Tid': flow?.transactionId,
+ },
data: { branch: ([] as string[]).concat(branchId) },
});
@@ -304,8 +454,18 @@ const useUserStore = defineStore('api-user', () => {
return res.data || true;
}
- async function typeStats() {
- const res = await api.get('/user/type-stats');
+ async function typeStats(flow?: {
+ sessionId?: string;
+ refTransactionId?: string;
+ transactionId?: string;
+ }) {
+ const res = await api.get('/user/type-stats', {
+ headers: {
+ 'X-Session-Id': flow?.sessionId,
+ 'X-Rtid': flow?.refTransactionId || flowStore.rtid,
+ 'X-Tid': flow?.transactionId,
+ },
+ });
if (!res) return false;
if (res.status === 200) return res.data;
@@ -339,12 +499,7 @@ const useUserStore = defineStore('api-user', () => {
addAttachment,
deleteAttachment,
- getSignature,
- setSignature,
-
typeStats,
-
- fetchUserGroup,
};
});
diff --git a/src/stores/user/signature.ts b/src/stores/user/signature.ts
deleted file mode 100644
index da9486c6..00000000
--- a/src/stores/user/signature.ts
+++ /dev/null
@@ -1,50 +0,0 @@
-import axios from 'axios';
-import { api } from 'src/boot/axios';
-import { getUserId } from 'src/services/keycloak';
-
-export async function getSignature() {
- const userId = getUserId();
-
- if (!userId) return;
-
- const responseSignature = await api.get(
- '/user/' + userId + '/signature',
- );
-
- if (!responseSignature.data) return '';
-
- const responseBlob = await axios.get(responseSignature.data, {
- responseType: 'blob',
- });
-
- if (responseBlob.status < 400) {
- return await new Promise((resolve, reject) => {
- const reader = new FileReader();
- reader.addEventListener('error', reject);
- reader.addEventListener('load', () => resolve(reader.result as string));
- reader.readAsDataURL(responseBlob.data);
- });
- } else {
- return '';
- }
-}
-
-export async function setSignature(image: string) {
- const userId = getUserId();
-
- if (!userId) return;
-
- if (image === '') {
- return await deleteSignature();
- } else {
- return await api.put('/user/' + userId + '/signature', { data: image });
- }
-}
-
-export async function deleteSignature() {
- const userId = getUserId();
-
- if (!userId) return;
-
- return await api.delete('/user/' + userId + '/signature');
-}
diff --git a/src/stores/user/types.ts b/src/stores/user/types.ts
index 2f6daeb5..7ce8ee7e 100644
--- a/src/stores/user/types.ts
+++ b/src/stores/user/types.ts
@@ -13,7 +13,7 @@ export type User = {
createdBy: string;
status: Status;
trainingPlace: string | null;
- importNationality: [] | null;
+ importNationality: string | null;
sourceNationality: string | null;
licenseExpireDate: Date | null;
licenseIssueDate: Date | null;
@@ -57,10 +57,6 @@ export type User = {
citizenIssue?: Date | null;
citizenId: string;
branch: Branch[];
- contactName?: string;
- contactTel?: string;
- remark?: string;
- agencyStatus?: AgencyStatus;
};
export type UserCreate = {
@@ -82,7 +78,7 @@ export type UserCreate = {
streetEN: string;
street: string;
trainingPlace?: string | null;
- importNationality?: string[] | null;
+ importNationality?: string | null;
sourceNationality?: string | null;
licenseExpireDate?: Date | null;
licenseIssueDate?: Date | null;
@@ -109,18 +105,8 @@ export type UserCreate = {
citizenExpire?: Date | null;
citizenIssue?: Date | null;
citizenId: string;
- contactName?: string;
- contactTel?: string;
- remark?: string;
- agencyStatus?: AgencyStatus | string;
};
-export enum AgencyStatus {
- Normal = 'Normal',
- Canceled = 'Canceled',
- Blacklist = 'Blacklist',
-}
-
export type UserAttachment = {
name: string;
url: string;
diff --git a/src/stores/utils/index.ts b/src/stores/utils/index.ts
index 39beb6d6..84f504a7 100644
--- a/src/stores/utils/index.ts
+++ b/src/stores/utils/index.ts
@@ -610,26 +610,6 @@ export function getEmployeeName(
}[opts?.locale || 'eng'];
}
-export function setPrefixName(
- record: {
- namePrefix: string;
- firstName: string;
- lastName: string;
- firstNameEN: string;
- lastNameEN: string;
- },
- opts?: {
- locale?: string;
- },
-) {
- const data = record;
-
- return {
- ['eng']: `${typeof data.namePrefix === 'string' ? useOptionStore().mapOption(data.namePrefix) : ''} ${data.firstNameEN} ${data.lastNameEN}`,
- ['tha']: `${typeof data.namePrefix === 'string' ? useOptionStore().mapOption(data.namePrefix) : ''} ${data.firstName} ${data.lastName}`,
- }[opts?.locale || 'eng'];
-}
-
export function toCamelCase(text: string): string {
return text
.replace(/[^a-zA-Z0-9]+(.)/g, (match, chr) => chr.toUpperCase())
diff --git a/src/stores/workflow-template/index.ts b/src/stores/workflow-template/index.ts
index ef1e83d5..adabf939 100644
--- a/src/stores/workflow-template/index.ts
+++ b/src/stores/workflow-template/index.ts
@@ -2,7 +2,7 @@ import { ref } from 'vue';
import { defineStore } from 'pinia';
import { api } from 'src/boot/axios';
import { PaginationResult } from 'src/types';
-import { Group, WorkflowTemplate, WorkflowTemplatePayload } from './types';
+import { WorkflowTemplate, WorkflowTemplatePayload } from './types';
import { Status } from '../types';
export const useWorkflowTemplate = defineStore('workflow-store', () => {
@@ -25,8 +25,6 @@ export const useWorkflowTemplate = defineStore('workflow-store', () => {
query?: string;
status?: Status;
activeOnly?: boolean;
- startDate?: string;
- endDate?: string;
}) {
const res = await api.get>(
'/workflow-template',
@@ -38,7 +36,7 @@ export const useWorkflowTemplate = defineStore('workflow-store', () => {
return res.data;
}
- async function createWorkflowTemplate(data: WorkflowTemplatePayload) {
+ async function creatWorkflowTemplate(data: WorkflowTemplatePayload) {
const res = await api.post('/workflow-template', data);
if (res.status >= 400) return null;
return res;
@@ -64,12 +62,6 @@ export const useWorkflowTemplate = defineStore('workflow-store', () => {
return res;
}
- async function getGroupList() {
- const res = await api.get('/keycloak/group');
- if (res.status >= 400) return null;
- return res.data;
- }
-
return {
data,
page,
@@ -78,9 +70,8 @@ export const useWorkflowTemplate = defineStore('workflow-store', () => {
getWorkflowTemplate,
getWorkflowTemplateList,
- createWorkflowTemplate,
+ creatWorkflowTemplate,
editWorkflowTemplate,
deleteWorkflowTemplate,
- getGroupList,
};
});
diff --git a/src/stores/workflow-template/types.ts b/src/stores/workflow-template/types.ts
index c2c64036..e3750660 100644
--- a/src/stores/workflow-template/types.ts
+++ b/src/stores/workflow-template/types.ts
@@ -23,7 +23,6 @@ export type WorkflowStep = {
user: CreatedBy;
}[];
responsibleInstitution: (string | { group: string })[];
- responsibleGroup: string[];
attributes: WorkFlowAttributes;
};
@@ -50,7 +49,6 @@ export type WorkflowTemplatePayload = {
export type WorkflowUserInTable = {
name: string;
- responsibleGroup: string[];
responsiblePerson: {
id: string;
selectedImage?: string;
@@ -75,15 +73,6 @@ export type WorkFlowPayloadStep = {
value?: string[];
responsiblePersonId?: string[];
responsibleInstitution?: string[];
- responsibleGroup?: string[];
attributes: WorkFlowAttributes;
messengerByArea?: boolean;
};
-
-export type Group = {
- id: string;
- name: string;
- path: string;
- subGroupCount: number;
- subGroups: Group[];
-};
diff --git a/src/utils/address.ts b/src/utils/address.ts
index 2ee2da4b..a66ac185 100644
--- a/src/utils/address.ts
+++ b/src/utils/address.ts
@@ -19,34 +19,34 @@ export function formatAddress(opt: {
let addressParts: string[];
if (opt.en) {
// en
- addressParts = [`${opt.addressEN}`];
- if (opt.mooEN) addressParts.push(`Moo ${opt.mooEN}`);
- if (opt.soiEN) addressParts.push(`Soi ${opt.soiEN}`);
+ addressParts = [`${opt.addressEN},`];
+ if (opt.mooEN) addressParts.push(`Moo ${opt.mooEN},`);
+ if (opt.soiEN) addressParts.push(`Soi ${opt.soiEN},`);
if (opt.streetEN) addressParts.push(`${opt.streetEN} Rd.`);
if (opt.subDistrict) {
- addressParts.push(`${opt.subDistrict.nameEN} sub-district`);
+ addressParts.push(`${opt.subDistrict.nameEN} sub-district,`);
}
- if (opt.district) addressParts.push(`${opt.district.nameEN} distric`);
- if (opt.province) addressParts.push(`${opt.province.nameEN}`);
+ if (opt.district) addressParts.push(`${opt.district.nameEN} district,`);
+ if (opt.province) addressParts.push(`${opt.province.nameEN},`);
} else {
// th
- addressParts = [`${opt.address}`];
- if (opt.moo) addressParts.push(`หมู่ ${opt.moo}`);
- if (opt.soi) addressParts.push(`ซอย ${opt.soi}`);
- if (opt.street) addressParts.push(`ถนน${opt.street}`);
+ addressParts = [`${opt.address},`];
+ if (opt.moo) addressParts.push(`หมู่ ${opt.moo},`);
+ if (opt.soi) addressParts.push(`ซอย ${opt.soi},`);
+ if (opt.street) addressParts.push(`ถนน${opt.street},`);
if (opt.subDistrict) {
addressParts.push(
- `${opt.province?.id === '10' ? 'แขวง' : 'ตำบล'}${opt.subDistrict.name}`,
+ `${opt.province?.id === '10' ? 'แขวง' : 'ตำบล'}${opt.subDistrict.name},`,
);
}
if (opt.district) {
addressParts.push(
- `${opt.province?.id === '10' ? 'เขต' : 'อำเภอ'}${opt.district.name}`,
+ `${opt.province?.id === '10' ? 'เขต' : 'อำเภอ'}${opt.district.name},`,
);
}
- if (opt.province) addressParts.push(`จังหวัด${opt.province.name}`);
+ if (opt.province) addressParts.push(`จังหวัด${opt.province.name},`);
// addressParts.push(
// `${opt.province.id === '10' ? t('address.subArea') : t('address.subDistrict')}${opt.subDistrict.name},`,
// );
diff --git a/src/utils/string-template.ts b/src/utils/string-template.ts
index b62164f2..f7350d71 100644
--- a/src/utils/string-template.ts
+++ b/src/utils/string-template.ts
@@ -1,7 +1,5 @@
import { RequestWork } from 'src/stores/request-list';
-import { TaskStatus } from 'src/stores/task-order/types';
import { formatNumberDecimal } from 'src/stores/utils';
-import { i18n } from 'src/boot/i18n';
const templates = {
'quotation-labor': {
@@ -48,12 +46,7 @@ const templates = {
converter: (context?: {
items?: {
product: RequestWork['productService']['product'];
- list: (RequestWork & {
- taskStatus?: TaskStatus;
- failedComment?: string;
- failedType?: string;
- codeRequest?: string;
- })[];
+ list: RequestWork[];
}[];
itemsDiscount?: {
productId: string;
@@ -74,9 +67,8 @@ const templates = {
const branch = v.request.quotation.customerBranch;
return (
`${i + 1}. ` +
- ` ${v.request.code}_${branch.customer.customerType === 'PERS' ? `นายจ้าง ${branch.namePrefix}. ${branch.firstNameEN} ${branch.lastNameEN} `.toUpperCase() : branch.registerName}_` +
`${employee.namePrefix}. ${employee.firstNameEN} ${employee.lastNameEN} `.toUpperCase() +
- `${!!v.failedType && v.failedType !== 'other' ? `${i18n.global.t(`taskOrder.${v.failedType}`)}` : !!v.failedComment ? v.failedComment : ''}`
+ `(${branch.customer.customerType === 'PERS' ? `นายจ้าง ${branch.namePrefix}. ${branch.firstNameEN} ${branch.lastNameEN} `.toUpperCase() : branch.registerName})`
);
});
return [
diff --git a/src/utils/ui.ts b/src/utils/ui.ts
index cc3b644d..d3dec4be 100644
--- a/src/utils/ui.ts
+++ b/src/utils/ui.ts
@@ -42,7 +42,7 @@ export function setTheme(theme: Theme): Theme {
export enum Lang {
English = 'eng',
- Thai = 'tha', // spellchecker:disable-line
+ Thai = 'tha',
}
/**
diff --git a/tsconfig.json b/tsconfig.json
index 839896a0..86e4d41d 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,4 +1,7 @@
{
- "extends": "./.quasar/tsconfig.json",
- "exclude": ["./tests"]
+ "extends": "@quasar/app-vite/tsconfig-preset",
+ "compilerOptions": {
+ "baseUrl": "."
+ },
+ "exclude": ["tests"]
}
|