fix: can access quotation
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 6s

This commit is contained in:
puriphatt 2025-07-09 14:19:13 +07:00
parent 6b55701afb
commit 9999a49fa0
4 changed files with 25 additions and 12 deletions

View file

@ -422,7 +422,7 @@ async function filterBySellerId() {
hide-icon
style="z-index: 999"
@click.stop="triggerAddQuotationDialog"
v-if="canAccess('quotation', 'edit')"
v-if="canAccess('quotation', 'create')"
/>
<div class="column full-height no-wrap">
@ -670,7 +670,7 @@ async function filterBySellerId() {
<NoData
v-if="
pageState.inputSearch ||
!canAccess('quotation', 'edit') ||
!canAccess('quotation', 'create') ||
pageState.currentTab !== 'Issued'
"
:not-found="!!pageState.inputSearch"
@ -680,7 +680,7 @@ async function filterBySellerId() {
v-if="
!pageState.inputSearch &&
pageState.currentTab === 'Issued' &&
canAccess('quotation', 'edit')
canAccess('quotation', 'create')
"
@click="triggerAddQuotationDialog"
label="general.add"
@ -711,6 +711,8 @@ async function filterBySellerId() {
:visible-columns="pageState.fieldSelected"
:grid="pageState.gridView"
:hide-edit="pageState.currentTab !== 'Issued'"
:hide-action="!canAccess('quotation', 'edit')"
:hide-delete="!canAccess('quotation', 'delete')"
:hide-btn-preview="pageState.currentTab === 'PaymentSuccess'"
@preview="(id: any) => storeDataLocal(id)"
@view="
@ -736,7 +738,8 @@ async function filterBySellerId() {
<div class="col-md-4 col-sm-6 col-12 column">
<QuotationCard
class="col"
hide-kebab-delete
:hide-action="!canAccess('quotation', 'edit')"
:hide-kebab-delete="!canAccess('quotation', 'delete')"
:hide-kebab-edit="!(pageState.currentTab === 'Issued')"
:hide-preview="pageState.currentTab === 'PaymentSuccess'"
:urgent="item.row.urgent"

View file

@ -1563,7 +1563,7 @@ function covertToNode() {
}}
</template>
</div>
<nav class="q-ml-auto">
<nav v-if="canAccess('quotation', 'edit')" class="q-ml-auto">
<AddButton
id="btn-add-worker"
for="btn-add-worker"
@ -1740,7 +1740,9 @@ function covertToNode() {
:readonly="
{
quotation: quotationFormState.mode !== 'edit',
invoice: isRoleInclude(['sale', 'head_of_sale']),
invoice:
isRoleInclude(['sale', 'head_of_sale']) ||
!canAccess('quotation', 'edit'),
accepted: true,
}[view]
"
@ -1944,7 +1946,10 @@ function covertToNode() {
view !== View.Receipt &&
view !== View.Complete
"
:readonly="isRoleInclude(['sale', 'head_of_sale'])"
:readonly="
isRoleInclude(['sale', 'head_of_sale']) ||
!canAccess('quotation', 'edit')
"
:data="quotationFormState.source"
v-model:first-code-payment="firstCodePayment"
@fetch-status="
@ -2274,6 +2279,7 @@ function covertToNode() {
class="q-ml-sm"
v-if="
view === View.Accepted &&
canAccess('quotation', 'edit') &&
quotationFormData.quotationStatus === 'Issued'
"
>
@ -2313,6 +2319,7 @@ function covertToNode() {
class="q-ml-sm"
v-if="
view === View.Invoice &&
canAccess('quotation', 'edit') &&
((quotationFormData.quotationStatus !== 'PaymentPending' &&
quotationFormData.payCondition !== 'Full') ||
quotationFormData.quotationStatus === 'Accepted') &&
@ -2339,6 +2346,7 @@ function covertToNode() {
style="gap: var(--size-2)"
v-if="
(view === View.Quotation &&
canAccess('quotation', 'edit') &&
(quotationFormData.quotationStatus === 'Issued' ||
quotationFormData.quotationStatus === 'Expired')) ||
!quotationFormData.quotationStatus