refactor: switch mode and color

This commit is contained in:
Thanaphon Frappet 2024-11-08 10:42:27 +07:00
parent f3fdaac2b1
commit 983f48f7e2
3 changed files with 17 additions and 34 deletions

View file

@ -31,6 +31,7 @@ import { deleteItem } from 'stores/utils';
import { runOcr, parseResultMRZ } from 'src/utils/ocr';
// NOTE Import Types
import { View } from './types.ts';
import { QuotationPayload } from 'src/stores/quotations/types';
import { EmployeeWorker } from 'src/stores/quotations/types';
import { Employee } from 'src/stores/employee/types';
@ -964,7 +965,6 @@ function storeDataLocal() {
productServiceList: productService.value,
},
meta: {
viewMod: view.value,
source: {
...quotationFormState.value.source,
code:
@ -987,14 +987,11 @@ function storeDataLocal() {
}),
);
const documentTypes: Record<number, string> = {
3: 'invoice',
4: 'payment',
7: 'receipt',
};
const documentType = documentTypes[view.value] || '';
const url = new URL('/quotation/document-view', window.location.origin);
window.open(`/quotation/document-view?type=${documentType}`, '_blank');
url.searchParams.append('type', view.value);
window.open(url, '_blank');
}
const QUOTATION_STATUS = [
'Issued',
@ -1031,17 +1028,6 @@ const statusQuotationForm = ref<
}[]
>([]);
enum View {
Quotation,
Accepted,
InvoicePre,
Invoice,
PaymentPre,
Payment,
Receipt,
Complete,
}
const view = ref<View>(View.Quotation);
const code = ref<string>('');
@ -1686,9 +1672,6 @@ async function getInvoiceCodeFullPay() {
:option="templateFormOption"
:label="$t('quotation.templateForm')"
:option-label="locale === 'eng' ? 'labelEN' : 'label'"
@filter="
(val: string, update) => filter(val, update, 'branch')
"
/>
<MainButton
outlined