feat: quotation attachment (#49)

* fix: i18n

* fix: 18n

* feat: file upload component

* feat: quotation attachment

---------

Co-authored-by: puriphatt <puriphat@frappet.com>
This commit is contained in:
Methapon Metanipat 2024-11-01 17:18:24 +07:00 committed by GitHub
parent 7817f8bd40
commit 0ef389c69b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 235 additions and 3 deletions

View file

@ -58,7 +58,7 @@ export const useQuotationStore = defineStore('quotation-store', () => {
| 'BillSplitCustom';
query?: string;
}) {
const res = await api.get<PaginationResult<Quotation>>(`/quotation`, {
const res = await api.get<PaginationResult<Quotation>>('/quotation', {
params,
});
if (res.status < 400) {
@ -141,6 +141,8 @@ export const useQuotationStore = defineStore('quotation-store', () => {
return null;
}
const fileManager = manageAttachment(api, 'quotation');
return {
data,
page,
@ -154,6 +156,8 @@ export const useQuotationStore = defineStore('quotation-store', () => {
editQuotation,
deleteQuotation,
changeStatus,
...fileManager,
};
});
@ -163,7 +167,7 @@ export const useQuotationStore = defineStore('quotation-store', () => {
export const useQuotationPayment = defineStore('quotation-payment', () => {
async function getQuotationPayment(quotationId: string) {
const res = await api.get<PaginationResult<QuotationPaymentData>>(
`/payment`,
'/payment',
{ params: { quotationId } },
);
if (res.status < 400) {
@ -186,7 +190,7 @@ export const useQuotationPayment = defineStore('quotation-payment', () => {
return null;
}
const fileManager = manageAttachment(api, `payment`);
const fileManager = manageAttachment(api, 'payment');
return {
getQuotationPayment,