refactor: credit note role check
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 7s
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 7s
This commit is contained in:
parent
9dcec6b4c6
commit
f646b3c9ba
4 changed files with 24 additions and 11 deletions
|
|
@ -4,6 +4,7 @@ import {
|
||||||
useRequestList,
|
useRequestList,
|
||||||
RequestWork,
|
RequestWork,
|
||||||
RequestWorkStatus,
|
RequestWorkStatus,
|
||||||
|
RequestDataStatus,
|
||||||
} from 'src/stores/request-list';
|
} from 'src/stores/request-list';
|
||||||
import DialogHeader from 'src/components/dialog/DialogHeader.vue';
|
import DialogHeader from 'src/components/dialog/DialogHeader.vue';
|
||||||
import CancelButton from 'src/components/button/CancelButton.vue';
|
import CancelButton from 'src/components/button/CancelButton.vue';
|
||||||
|
|
@ -192,7 +193,8 @@ function submit() {
|
||||||
s.workStatus ===
|
s.workStatus ===
|
||||||
(props.creditNote
|
(props.creditNote
|
||||||
? RequestWorkStatus.Canceled
|
? RequestWorkStatus.Canceled
|
||||||
: RequestWorkStatus.InProgress),
|
: RequestWorkStatus.InProgress) ||
|
||||||
|
v.request.requestDataStatus === RequestDataStatus.Canceled,
|
||||||
);
|
);
|
||||||
if (curr) {
|
if (curr) {
|
||||||
const task: Task = {
|
const task: Task = {
|
||||||
|
|
@ -387,8 +389,8 @@ function assignTempGroup() {
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(
|
:deep(
|
||||||
i.q-icon.mdi.mdi-chevron-down-circle.q-expansion-item__toggle-icon.q-expansion-item__toggle-icon--rotated
|
i.q-icon.mdi.mdi-chevron-down-circle.q-expansion-item__toggle-icon.q-expansion-item__toggle-icon--rotated
|
||||||
) {
|
) {
|
||||||
color: var(--brand-1);
|
color: var(--brand-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ import {
|
||||||
import { RequestWork } from 'src/stores/request-list/types';
|
import { RequestWork } from 'src/stores/request-list/types';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import useOptionStore from 'src/stores/options';
|
import useOptionStore from 'src/stores/options';
|
||||||
import { dialogWarningClose } from 'src/stores/utils';
|
import { dialogWarningClose, canAccess } from 'src/stores/utils';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { QForm } from 'quasar';
|
import { QForm } from 'quasar';
|
||||||
import { getName } from 'src/services/keycloak';
|
import { getName } from 'src/services/keycloak';
|
||||||
|
|
@ -684,6 +684,7 @@ onMounted(async () => {
|
||||||
|
|
||||||
<RefundInformation
|
<RefundInformation
|
||||||
v-if="view === CreditNoteStatus.Pending"
|
v-if="view === CreditNoteStatus.Pending"
|
||||||
|
:readonly="!canAccess('related', 'edit')"
|
||||||
:total="creditNoteData?.value"
|
:total="creditNoteData?.value"
|
||||||
:paid="
|
:paid="
|
||||||
creditNoteData?.paybackStatus === CreditNotePaybackStatus.Done
|
creditNoteData?.paybackStatus === CreditNotePaybackStatus.Done
|
||||||
|
|
@ -871,7 +872,8 @@ onMounted(async () => {
|
||||||
<SaveButton
|
<SaveButton
|
||||||
v-if="
|
v-if="
|
||||||
!creditNoteData ||
|
!creditNoteData ||
|
||||||
creditNoteData?.creditNoteStatus === CreditNoteStatus.Waiting
|
(creditNoteData?.creditNoteStatus === CreditNoteStatus.Waiting &&
|
||||||
|
canAccess('related', 'edit'))
|
||||||
"
|
"
|
||||||
:disabled="taskListGroup.length === 0 || pageState.mode === 'edit'"
|
:disabled="taskListGroup.length === 0 || pageState.mode === 'edit'"
|
||||||
type="submit"
|
type="submit"
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ import useFlowStore from 'src/stores/flow';
|
||||||
import { pageTabs, columns, hslaColors } from './constants';
|
import { pageTabs, columns, hslaColors } from './constants';
|
||||||
import { CreditNoteStatus, useCreditNote } from 'src/stores/credit-note';
|
import { CreditNoteStatus, useCreditNote } from 'src/stores/credit-note';
|
||||||
import TableCreditNote from './TableCreditNote.vue';
|
import TableCreditNote from './TableCreditNote.vue';
|
||||||
import { dialogWarningClose } from 'src/stores/utils';
|
import { dialogWarningClose, canAccess } from 'src/stores/utils';
|
||||||
import AdvanceSearch from 'src/components/shared/AdvanceSearch.vue';
|
import AdvanceSearch from 'src/components/shared/AdvanceSearch.vue';
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
|
@ -146,6 +146,7 @@ watch(
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FloatingActionButton
|
<FloatingActionButton
|
||||||
|
v-if="canAccess('related', 'edit')"
|
||||||
style="z-index: 999"
|
style="z-index: 999"
|
||||||
hide-icon
|
hide-icon
|
||||||
@click.stop="triggerCreateCreditNote()"
|
@click.stop="triggerCreateCreditNote()"
|
||||||
|
|
@ -360,7 +361,10 @@ watch(
|
||||||
<TableCreditNote
|
<TableCreditNote
|
||||||
:grid="pageState.gridView"
|
:grid="pageState.gridView"
|
||||||
:visible-columns="pageState.fieldSelected"
|
:visible-columns="pageState.fieldSelected"
|
||||||
:hide-delete="pageState.currentTab !== CreditNoteStatus.Waiting"
|
:hide-delete="
|
||||||
|
pageState.currentTab !== CreditNoteStatus.Waiting ||
|
||||||
|
!canAccess('related', 'edit')
|
||||||
|
"
|
||||||
@view="(v) => navigateTo({ statusDialog: 'info', creditId: v.id })"
|
@view="(v) => navigateTo({ statusDialog: 'info', creditId: v.id })"
|
||||||
@delete="(v) => triggerDelete(v.id)"
|
@delete="(v) => triggerDelete(v.id)"
|
||||||
>
|
>
|
||||||
|
|
@ -376,6 +380,10 @@ watch(
|
||||||
})
|
})
|
||||||
"
|
"
|
||||||
@delete="() => triggerDelete(item.row.id)"
|
@delete="() => triggerDelete(item.row.id)"
|
||||||
|
:hide-kebab-delete="
|
||||||
|
pageState.currentTab !== CreditNoteStatus.Waiting ||
|
||||||
|
!canAccess('related', 'edit')
|
||||||
|
"
|
||||||
:title="item.row.quotation.workName"
|
:title="item.row.quotation.workName"
|
||||||
:code="item.row.code"
|
:code="item.row.code"
|
||||||
:status="$t(`creditNote.status.${item.row.creditNoteStatus}`)"
|
:status="$t(`creditNote.status.${item.row.creditNoteStatus}`)"
|
||||||
|
|
|
||||||
|
|
@ -172,11 +172,13 @@ const refundOpts = ref<
|
||||||
>
|
>
|
||||||
{{ $t('creditNote.label.refund') }}
|
{{ $t('creditNote.label.refund') }}
|
||||||
<q-btn-dropdown
|
<q-btn-dropdown
|
||||||
|
:disable="readonly"
|
||||||
dense
|
dense
|
||||||
unelevated
|
unelevated
|
||||||
:label="$t(`creditNote.status.payback.${paybackStatus}`)"
|
:label="$t(`creditNote.status.payback.${paybackStatus}`)"
|
||||||
class="text-capitalize text-weight-regular product-status rounded"
|
class="text-capitalize text-weight-regular product-status rounded"
|
||||||
:class="{
|
:class="{
|
||||||
|
'hide-dropdown q-pr-md': readonly,
|
||||||
warning: paybackStatus === CreditNotePaybackStatus.Pending,
|
warning: paybackStatus === CreditNotePaybackStatus.Pending,
|
||||||
danger: paybackStatus === CreditNotePaybackStatus.Verify,
|
danger: paybackStatus === CreditNotePaybackStatus.Verify,
|
||||||
'positive hide-dropdown q-pr-md':
|
'positive hide-dropdown q-pr-md':
|
||||||
|
|
@ -219,7 +221,6 @@ const refundOpts = ref<
|
||||||
<UploadFileSection
|
<UploadFileSection
|
||||||
multiple
|
multiple
|
||||||
:layout="$q.screen.gt.sm ? 'column' : 'row'"
|
:layout="$q.screen.gt.sm ? 'column' : 'row'"
|
||||||
:readonly
|
|
||||||
:label="`${$t('general.upload', { msg: ' E-slip' })} ${$t(
|
:label="`${$t('general.upload', { msg: ' E-slip' })} ${$t(
|
||||||
'general.or',
|
'general.or',
|
||||||
{
|
{
|
||||||
|
|
@ -281,9 +282,9 @@ const refundOpts = ref<
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(
|
:deep(
|
||||||
.hide-dropdown
|
.hide-dropdown
|
||||||
i.q-icon.mdi.mdi-chevron-down.q-btn-dropdown__arrow.q-btn-dropdown__arrow-container
|
i.q-icon.mdi.mdi-chevron-down.q-btn-dropdown__arrow.q-btn-dropdown__arrow-container
|
||||||
) {
|
) {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue