refactor: update status
This commit is contained in:
parent
c0b89478b9
commit
db67ccd05c
1 changed files with 29 additions and 37 deletions
|
|
@ -74,11 +74,6 @@ import { useConfigStore } from 'src/stores/config';
|
||||||
import QuotationFormMetadata from './QuotationFormMetadata.vue';
|
import QuotationFormMetadata from './QuotationFormMetadata.vue';
|
||||||
import BadgeComponent from 'src/components/BadgeComponent.vue';
|
import BadgeComponent from 'src/components/BadgeComponent.vue';
|
||||||
import PaymentForm from './PaymentForm.vue';
|
import PaymentForm from './PaymentForm.vue';
|
||||||
import TableComponents from 'src/components/TableComponents.vue';
|
|
||||||
|
|
||||||
// defineProps<{
|
|
||||||
// readonly?: boolean;
|
|
||||||
// }>();
|
|
||||||
|
|
||||||
type Node = {
|
type Node = {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
|
|
@ -309,14 +304,13 @@ async function fetchStatus() {
|
||||||
|
|
||||||
async function fetchQuotation() {
|
async function fetchQuotation() {
|
||||||
if (
|
if (
|
||||||
currentQuotationId.value !== undefined &&
|
(!!currentQuotationId.value || !!quotationFormData.value.id) &&
|
||||||
quotationFormState.value.mode &&
|
quotationFormState.value.mode &&
|
||||||
quotationFormState.value.mode !== 'create'
|
quotationFormState.value.mode !== 'create'
|
||||||
) {
|
) {
|
||||||
await quotationForm.assignFormData(
|
const id = currentQuotationId.value || quotationFormData.value.id || '';
|
||||||
currentQuotationId.value,
|
|
||||||
quotationFormState.value.mode,
|
await quotationForm.assignFormData(id, quotationFormState.value.mode);
|
||||||
);
|
|
||||||
await assignWorkerToSelectedWorker();
|
await assignWorkerToSelectedWorker();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -401,7 +395,10 @@ async function convertInvoiceToSubmit() {
|
||||||
};
|
};
|
||||||
|
|
||||||
const res = await quotationForm.submitInvoice();
|
const res = await quotationForm.submitInvoice();
|
||||||
if (res) view.value = View.Payment;
|
if (res) {
|
||||||
|
await fetchQuotation();
|
||||||
|
view.value = View.Payment;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -743,11 +740,9 @@ onMounted(async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => quotationFormData.value.status,
|
() => quotationFormData.value.quotationStatus,
|
||||||
() => {
|
() => {
|
||||||
fetchStatus();
|
fetchStatus();
|
||||||
|
|
||||||
statusQuotationForm.value.filter((v) => v.title === 'ลูกค้าตอบรับ');
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -1175,7 +1170,6 @@ const view = ref<View>(View.Quotation);
|
||||||
:rows="
|
:rows="
|
||||||
selectedInstallmentNo.length > 0
|
selectedInstallmentNo.length > 0
|
||||||
? productServiceList.filter((v) => {
|
? productServiceList.filter((v) => {
|
||||||
console.log(v.installmentNo, selectedInstallmentNo);
|
|
||||||
return (
|
return (
|
||||||
v.installmentNo &&
|
v.installmentNo &&
|
||||||
selectedInstallmentNo.includes(v.installmentNo)
|
selectedInstallmentNo.includes(v.installmentNo)
|
||||||
|
|
@ -1377,8 +1371,15 @@ const view = ref<View>(View.Quotation);
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
<footer class="surface-1 q-pa-md full-width">
|
<footer class="surface-1 q-pa-md full-width">
|
||||||
<div class="row full-width justify-between">
|
<div
|
||||||
|
class="row full-width"
|
||||||
|
:class="{
|
||||||
|
'justify-between': view !== View.InvoicePre,
|
||||||
|
'justify-end': view === View.InvoicePre,
|
||||||
|
}"
|
||||||
|
>
|
||||||
<MainButton
|
<MainButton
|
||||||
|
v-if="view !== View.InvoicePre"
|
||||||
outlined
|
outlined
|
||||||
icon="mdi-play-box-outline"
|
icon="mdi-play-box-outline"
|
||||||
color="207 96% 32%"
|
color="207 96% 32%"
|
||||||
|
|
@ -1389,16 +1390,20 @@ const view = ref<View>(View.Quotation);
|
||||||
|
|
||||||
<div v-if="view === View.Accepted">
|
<div v-if="view === View.Accepted">
|
||||||
<MainButton
|
<MainButton
|
||||||
outlined
|
solid
|
||||||
icon="mdi-play-box-outline"
|
icon="mdi-account-multiple-check-outline"
|
||||||
color="207 96% 32%"
|
color="207 96% 32%"
|
||||||
@click="storeDataLocal"
|
@click="
|
||||||
|
() => {
|
||||||
|
submitAccepted();
|
||||||
|
}
|
||||||
|
"
|
||||||
>
|
>
|
||||||
{{ $t('general.view', { msg: $t('general.example') }) }}
|
{{ $t('quotation.customerAcceptance') }}
|
||||||
</MainButton>
|
</MainButton>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="view === View.InvoicePre">
|
<template v-if="view === View.InvoicePre">
|
||||||
<MainButton
|
<MainButton
|
||||||
solid
|
solid
|
||||||
icon="mdi-account-multiple-check-outline"
|
icon="mdi-account-multiple-check-outline"
|
||||||
|
|
@ -1411,7 +1416,7 @@ const view = ref<View>(View.Quotation);
|
||||||
>
|
>
|
||||||
{{ $t('quotation.selectInvoice') }}
|
{{ $t('quotation.selectInvoice') }}
|
||||||
</MainButton>
|
</MainButton>
|
||||||
</div>
|
</template>
|
||||||
|
|
||||||
<div v-if="view === View.Invoice">
|
<div v-if="view === View.Invoice">
|
||||||
<MainButton
|
<MainButton
|
||||||
|
|
@ -1432,8 +1437,8 @@ const view = ref<View>(View.Quotation);
|
||||||
class="row"
|
class="row"
|
||||||
style="gap: var(--size-2)"
|
style="gap: var(--size-2)"
|
||||||
v-if="
|
v-if="
|
||||||
quotationFormData.quotationStatus === 'Issued' ||
|
view === View.Quotation &&
|
||||||
!quotationFormData.quotationStatus
|
quotationFormData.quotationStatus === 'Issued'
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<UndoButton
|
<UndoButton
|
||||||
|
|
@ -1464,19 +1469,6 @@ const view = ref<View>(View.Quotation);
|
||||||
@click="quotationFormState.mode = 'edit'"
|
@click="quotationFormState.mode = 'edit'"
|
||||||
solid
|
solid
|
||||||
/>
|
/>
|
||||||
<MainButton
|
|
||||||
v-if="view === View.Quotation"
|
|
||||||
solid
|
|
||||||
icon="mdi-account-multiple-check-outline"
|
|
||||||
color="207 96% 32%"
|
|
||||||
@click="
|
|
||||||
() => {
|
|
||||||
submitAccepted();
|
|
||||||
}
|
|
||||||
"
|
|
||||||
>
|
|
||||||
{{ $t('quotation.customerAcceptance') }}
|
|
||||||
</MainButton>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue