feat: detect edit mode

This commit is contained in:
Methapon Metanipat 2024-10-18 13:30:40 +07:00
parent d3112db017
commit 5ddb142f3e

View file

@ -213,7 +213,11 @@ const productServiceList = ref<
>([]);
function closeTab() {
window.close();
if (quotationFormState.value.mode === 'edit') {
quotationForm.resetForm();
} else {
window.close();
}
}
async function assignToProductServiceList() {
@ -902,7 +906,12 @@ function storeDataLocal() {
{{ $t('general.view', { msg: $t('general.example') }) }}
</MainButton>
<div class="row" style="gap: var(--size-2)">
<CancelButton solid @click="closeTab()" />
<UndoButton
solid
@click="closeTab()"
v-if="quotationFormState.mode === 'edit'"
/>
<CancelButton solid @click="closeTab()" v-else />
<SaveButton
v-if="
quotationFormState.mode === 'create' ||