feat: add function edit quotation data

This commit is contained in:
Methapon Metanipat 2024-10-03 14:43:41 +07:00
parent 017f757de2
commit b7308d1833
2 changed files with 23 additions and 10 deletions

View file

@ -1,6 +1,5 @@
<script lang="ts" setup>
import { pageTabs, fieldSelectedOption } from './constants';
import { useQuotationForm } from './form';
import { onMounted, reactive, ref } from 'vue';
import { useRouter } from 'vue-router';
@ -15,6 +14,7 @@ import useEmployeeStore from 'stores/employee';
import useFlowStore from 'src/stores/flow';
import useOcrStore from 'stores/ocr';
import useMyBranch from 'stores/my-branch';
import { useQuotationForm } from './form';
// NOTE Import Types
import { CustomerBranchCreate } from 'stores/customer/types';
@ -74,7 +74,7 @@ import {
import QuotationView from './QuotationView.vue';
import { watch } from 'vue';
const quotationForm = useQuotationForm();
const quotationFormStore = useQuotationForm();
const customerFormStore = useCustomerForm();
const employeeFormStore = useEmployeeForm();
const employeeStore = useEmployeeStore();
@ -83,7 +83,7 @@ const flowStore = useFlowStore();
const userBranch = useMyBranch();
const ocrStore = useOcrStore();
const { currentFormData: quotationFormData } = storeToRefs(quotationForm);
const { currentFormData: quotationFormData } = storeToRefs(quotationFormStore);
const { state: customerFormState, currentFormData: customerFormData } =
storeToRefs(customerFormStore);
const { state: employeeFormState, currentFromDataEmployee } =
@ -753,13 +753,13 @@ watch(() => pageState.currentTab, fetchQuotationList);
:date="new Date(v.createdAt).toLocaleString()"
:amount="v.workerCount"
:customer-name="
v.customerBranch?.registerName ||
`${v.customerBranch?.firstName || '-'} ${v.customerBranch?.lastName || ''}`
v.customerBranch.registerName ||
`${v.customerBranch.firstName || '-'} ${v.customerBranch.lastName || ''}`
"
:reporter="v.actorName"
:total-price="v.totalPrice"
@view="console.log('view')"
@edit="console.log('edit')"
@view="quotationFormStore.assignFormData(v.id)"
@edit="quotationFormStore.assignFormData(v.id, 'edit')"
@link="console.log('link')"
@upload="console.log('upload')"
@delete="console.log('delete')"