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,
|
||||
RequestWork,
|
||||
RequestWorkStatus,
|
||||
RequestDataStatus,
|
||||
} from 'src/stores/request-list';
|
||||
import DialogHeader from 'src/components/dialog/DialogHeader.vue';
|
||||
import CancelButton from 'src/components/button/CancelButton.vue';
|
||||
|
|
@ -192,7 +193,8 @@ function submit() {
|
|||
s.workStatus ===
|
||||
(props.creditNote
|
||||
? RequestWorkStatus.Canceled
|
||||
: RequestWorkStatus.InProgress),
|
||||
: RequestWorkStatus.InProgress) ||
|
||||
v.request.requestDataStatus === RequestDataStatus.Canceled,
|
||||
);
|
||||
if (curr) {
|
||||
const task: Task = {
|
||||
|
|
@ -387,8 +389,8 @@ function assignTempGroup() {
|
|||
}
|
||||
|
||||
: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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import {
|
|||
import { RequestWork } from 'src/stores/request-list/types';
|
||||
import { storeToRefs } from 'pinia';
|
||||
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 { QForm } from 'quasar';
|
||||
import { getName } from 'src/services/keycloak';
|
||||
|
|
@ -684,6 +684,7 @@ onMounted(async () => {
|
|||
|
||||
<RefundInformation
|
||||
v-if="view === CreditNoteStatus.Pending"
|
||||
:readonly="!canAccess('related', 'edit')"
|
||||
:total="creditNoteData?.value"
|
||||
:paid="
|
||||
creditNoteData?.paybackStatus === CreditNotePaybackStatus.Done
|
||||
|
|
@ -871,7 +872,8 @@ onMounted(async () => {
|
|||
<SaveButton
|
||||
v-if="
|
||||
!creditNoteData ||
|
||||
creditNoteData?.creditNoteStatus === CreditNoteStatus.Waiting
|
||||
(creditNoteData?.creditNoteStatus === CreditNoteStatus.Waiting &&
|
||||
canAccess('related', 'edit'))
|
||||
"
|
||||
:disabled="taskListGroup.length === 0 || pageState.mode === 'edit'"
|
||||
type="submit"
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import useFlowStore from 'src/stores/flow';
|
|||
import { pageTabs, columns, hslaColors } from './constants';
|
||||
import { CreditNoteStatus, useCreditNote } from 'src/stores/credit-note';
|
||||
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';
|
||||
|
||||
const $q = useQuasar();
|
||||
|
|
@ -146,6 +146,7 @@ watch(
|
|||
</script>
|
||||
<template>
|
||||
<FloatingActionButton
|
||||
v-if="canAccess('related', 'edit')"
|
||||
style="z-index: 999"
|
||||
hide-icon
|
||||
@click.stop="triggerCreateCreditNote()"
|
||||
|
|
@ -360,7 +361,10 @@ watch(
|
|||
<TableCreditNote
|
||||
:grid="pageState.gridView"
|
||||
: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 })"
|
||||
@delete="(v) => triggerDelete(v.id)"
|
||||
>
|
||||
|
|
@ -376,6 +380,10 @@ watch(
|
|||
})
|
||||
"
|
||||
@delete="() => triggerDelete(item.row.id)"
|
||||
:hide-kebab-delete="
|
||||
pageState.currentTab !== CreditNoteStatus.Waiting ||
|
||||
!canAccess('related', 'edit')
|
||||
"
|
||||
:title="item.row.quotation.workName"
|
||||
:code="item.row.code"
|
||||
:status="$t(`creditNote.status.${item.row.creditNoteStatus}`)"
|
||||
|
|
|
|||
|
|
@ -172,11 +172,13 @@ const refundOpts = ref<
|
|||
>
|
||||
{{ $t('creditNote.label.refund') }}
|
||||
<q-btn-dropdown
|
||||
:disable="readonly"
|
||||
dense
|
||||
unelevated
|
||||
:label="$t(`creditNote.status.payback.${paybackStatus}`)"
|
||||
class="text-capitalize text-weight-regular product-status rounded"
|
||||
:class="{
|
||||
'hide-dropdown q-pr-md': readonly,
|
||||
warning: paybackStatus === CreditNotePaybackStatus.Pending,
|
||||
danger: paybackStatus === CreditNotePaybackStatus.Verify,
|
||||
'positive hide-dropdown q-pr-md':
|
||||
|
|
@ -219,7 +221,6 @@ const refundOpts = ref<
|
|||
<UploadFileSection
|
||||
multiple
|
||||
:layout="$q.screen.gt.sm ? 'column' : 'row'"
|
||||
:readonly
|
||||
:label="`${$t('general.upload', { msg: ' E-slip' })} ${$t(
|
||||
'general.or',
|
||||
{
|
||||
|
|
@ -281,9 +282,9 @@ const refundOpts = ref<
|
|||
}
|
||||
|
||||
:deep(
|
||||
.hide-dropdown
|
||||
i.q-icon.mdi.mdi-chevron-down.q-btn-dropdown__arrow.q-btn-dropdown__arrow-container
|
||||
) {
|
||||
.hide-dropdown
|
||||
i.q-icon.mdi.mdi-chevron-down.q-btn-dropdown__arrow.q-btn-dropdown__arrow-container
|
||||
) {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue