feat: add close tab functionality with CancelButton in RequestListView
This commit is contained in:
parent
7e38c18352
commit
fcce551071
1 changed files with 22 additions and 1 deletions
|
|
@ -11,6 +11,7 @@ import PropertiesExpansion from './PropertiesExpansion.vue';
|
||||||
import FormGroupHead from './FormGroupHead.vue';
|
import FormGroupHead from './FormGroupHead.vue';
|
||||||
import AvatarGroup from 'src/components/shared/AvatarGroup.vue';
|
import AvatarGroup from 'src/components/shared/AvatarGroup.vue';
|
||||||
import { StateButton } from 'components/button';
|
import { StateButton } from 'components/button';
|
||||||
|
import { CancelButton } from 'components/button';
|
||||||
import DutyExpansion from './DutyExpansion.vue';
|
import DutyExpansion from './DutyExpansion.vue';
|
||||||
import MessengerExpansion from './MessengerExpansion.vue';
|
import MessengerExpansion from './MessengerExpansion.vue';
|
||||||
|
|
||||||
|
|
@ -20,6 +21,7 @@ import {
|
||||||
dialog,
|
dialog,
|
||||||
getEmployeeName,
|
getEmployeeName,
|
||||||
getCustomerName,
|
getCustomerName,
|
||||||
|
dialogWarningClose,
|
||||||
} from 'src/stores/utils';
|
} from 'src/stores/utils';
|
||||||
import { dateFormatJS } from 'src/utils/datetime';
|
import { dateFormatJS } from 'src/utils/datetime';
|
||||||
import { useRequestList } from 'src/stores/request-list';
|
import { useRequestList } from 'src/stores/request-list';
|
||||||
|
|
@ -37,7 +39,7 @@ import ProductExpansion from './ProductExpansion.vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useWorkflowTemplate } from 'src/stores/workflow-template';
|
import { useWorkflowTemplate } from 'src/stores/workflow-template';
|
||||||
import { WorkflowTemplate } from 'src/stores/workflow-template/types';
|
import { WorkflowTemplate } from 'src/stores/workflow-template/types';
|
||||||
import { initLang, initTheme, Lang } from 'src/utils/ui';
|
import { initLang, initTheme } from 'src/utils/ui';
|
||||||
import {
|
import {
|
||||||
EmployeePassportPayload,
|
EmployeePassportPayload,
|
||||||
EmployeeVisaPayload,
|
EmployeeVisaPayload,
|
||||||
|
|
@ -330,6 +332,16 @@ function goToDebitNote(opt?: { tab?: string; id?: string }) {
|
||||||
|
|
||||||
window.open(url.toString(), '_blank');
|
window.open(url.toString(), '_blank');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function closeTab() {
|
||||||
|
dialogWarningClose(t, {
|
||||||
|
message: t('dialog.message.close'),
|
||||||
|
action: () => {
|
||||||
|
window.close();
|
||||||
|
},
|
||||||
|
cancel: () => {},
|
||||||
|
});
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="column surface-0 fullscreen" v-if="data">
|
<div class="column surface-0 fullscreen" v-if="data">
|
||||||
|
|
@ -859,6 +871,15 @@ function goToDebitNote(opt?: { tab?: string; id?: string }) {
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
<!-- SEC: Footer -->
|
||||||
|
<footer class="surface-1 q-pa-md full-width text-right">
|
||||||
|
<CancelButton
|
||||||
|
@click="closeTab()"
|
||||||
|
:label="$t('dialog.action.close')"
|
||||||
|
outlined
|
||||||
|
/>
|
||||||
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue