refactor: receipt dialog & type

This commit is contained in:
puriphatt 2024-10-18 16:14:19 +07:00
parent a6955929e9
commit 0a9b9dfb79
3 changed files with 271 additions and 66 deletions

View file

@ -38,6 +38,7 @@ import {
} from 'src/pages/03_customer-management/components';
import { useCustomerForm } from 'src/pages/03_customer-management/form';
import { Quotation } from 'src/stores/quotations/types';
const quotationFormStore = useQuotationForm();
const customerFormStore = useCustomerForm();
@ -60,6 +61,7 @@ const onCreateImageList = ref<{
selectedImage: string;
list: { url: string; imgFile: File | null; name: string }[];
}>({ selectedImage: '', list: [] });
const currentQuotationPayment = ref<Quotation>();
const pageState = reactive({
hideStat: false,
@ -204,7 +206,8 @@ function triggerQuotationDialog(opts: {
window.open(url.toString(), '_blank');
}
function triggerReceiptDialog() {
function triggerReceiptDialog(data: Quotation) {
currentQuotationPayment.value = data;
pageState.receiptModal = true;
}
@ -528,7 +531,11 @@ async function storeDataLocal(id: string) {
</article>
<article v-else class="col q-pa-md surface-2 scroll">
<div class="row q-col-gutter-md">
<div v-for="v in quotationData" :key="v.id" class="col-md-4 col-12">
<div
v-for="v in quotationData"
:key="v.id"
class="col-md-4 col-sm-6 col-12"
>
<QuotationCard
:urgent="v.urgent"
:type="
@ -572,10 +579,9 @@ async function storeDataLocal(id: string) {
branchId: v.customerBranch.customer.registeredBranchId,
})
"
@link="triggerReceiptDialog()"
@link="triggerReceiptDialog(v)"
@upload="console.log('upload')"
@delete="triggerDialogDeleteQuottaion(v.id)"
@change-status="console.log('change')"
/>
</div>
</div>
@ -940,7 +946,10 @@ async function storeDataLocal(id: string) {
</div>
</DialogForm>
<ReceiptDialog v-model="pageState.receiptModal"></ReceiptDialog>
<ReceiptDialog
v-model:data="currentQuotationPayment"
v-model="pageState.receiptModal"
></ReceiptDialog>
</template>
<style scoped></style>