refactor: add closeTab

This commit is contained in:
Thanaphon Frappet 2024-10-18 09:10:33 +07:00
parent 8f069de610
commit 7a06bfe87e

View file

@ -46,6 +46,7 @@ import {
EditButton, EditButton,
UndoButton, UndoButton,
DeleteButton, DeleteButton,
CancelButton,
} from 'components/button'; } from 'components/button';
import ProductServiceForm from './ProductServiceForm.vue'; import ProductServiceForm from './ProductServiceForm.vue';
import QuotationFormInfo from './QuotationFormInfo.vue'; import QuotationFormInfo from './QuotationFormInfo.vue';
@ -210,6 +211,10 @@ const productServiceList = ref<
Required<QuotationPayload['productServiceList'][number]>[] Required<QuotationPayload['productServiceList'][number]>[]
>([]); >([]);
function closeTab() {
window.close();
}
async function assignToProductServiceList() { async function assignToProductServiceList() {
const ret = await productServiceStore.fetchProductGroup({ const ret = await productServiceStore.fetchProductGroup({
page: 1, page: 1,
@ -873,24 +878,27 @@ async function searchEmployee(text: string) {
<q-icon name="mdi-play-box-outline" size="xs" class="q-mr-xs" /> <q-icon name="mdi-play-box-outline" size="xs" class="q-mr-xs" />
{{ $t('general.view', { msg: $t('general.example') }) }} {{ $t('general.view', { msg: $t('general.example') }) }}
</q-btn> </q-btn>
<SaveButton <div class="row" style="gap: var(--size-2)">
v-if=" <CancelButton solid @click="closeTab()" />
quotationFormState.mode === 'create' || <SaveButton
quotationFormState.mode === 'edit' v-if="
" quotationFormState.mode === 'create' ||
@click=" quotationFormState.mode === 'edit'
() => { "
convertDataToFormSubmit(); @click="
} () => {
" convertDataToFormSubmit();
solid }
/> "
<EditButton solid
v-else />
class="no-print" <EditButton
@click="quotationFormState.mode = 'edit'" v-else
solid class="no-print"
/> @click="quotationFormState.mode = 'edit'"
solid
/>
</div>
</div> </div>
</footer> </footer>