diff --git a/src/pages/04_product-service/MainPage.vue b/src/pages/04_product-service/MainPage.vue index 47570c55..0177910c 100644 --- a/src/pages/04_product-service/MainPage.vue +++ b/src/pages/04_product-service/MainPage.vue @@ -41,7 +41,7 @@ import PaginationPageSize from 'src/components/PaginationPageSize.vue'; import useFlowStore from 'stores/flow'; import { dateFormat } from 'src/utils/datetime'; -import { formatNumberDecimal, isRoleInclude, notify } from 'stores/utils'; +import { formatNumberDecimal, isRoleInclude, canAccess } from 'stores/utils'; const { getWorkflowTemplate } = useWorkflowTemplate(); import { Status } from 'stores/types'; @@ -143,27 +143,25 @@ const { t } = useI18n(); const baseUrl = ref(import.meta.env.VITE_API_BASE_URL); const priceDisplay = computed(() => ({ - price: !isRoleInclude(['sale_agent']), + // price: !isRoleInclude(['sale_agent']), + price: true, agentPrice: isRoleInclude([ - 'admin', - 'head_of_admin', - 'head_of_sale', 'system', - 'owner', + 'head_of_admin', + 'admin', + 'executive', 'accountant', - 'sale_agent', + 'head_of_sale', ]), serviceCharge: isRoleInclude([ - 'admin', - 'head_of_admin', 'system', - 'owner', + 'head_of_admin', + 'admin', + 'executive', 'accountant', ]), })); -const actionDisplay = computed(() => - isRoleInclude(['admin', 'head_of_admin', 'system', 'owner', 'accountant']), -); +const actionDisplay = computed(() => canAccess('product', 'edit')); const splitterModel = computed(() => $q.screen.lt.md ? (productMode.value !== 'group' ? 0 : 100) : 25, ); diff --git a/src/pages/05_quotation/QuotationFormProductSelect.vue b/src/pages/05_quotation/QuotationFormProductSelect.vue index eb6ffef8..39be19e7 100644 --- a/src/pages/05_quotation/QuotationFormProductSelect.vue +++ b/src/pages/05_quotation/QuotationFormProductSelect.vue @@ -66,21 +66,21 @@ const serviceList = defineModel>>( ); const priceDisplay = computed(() => ({ - price: !isRoleInclude(['sale_agent']), + // price: !isRoleInclude(['sale_agent']), + price: true, agentPrice: isRoleInclude([ - 'admin', - 'head_of_admin', - 'head_of_sale', 'system', - 'owner', + 'head_of_admin', + 'admin', + 'executive', 'accountant', - 'sale_agent', + 'head_of_sale', ]), serviceCharge: isRoleInclude([ - 'admin', - 'head_of_admin', 'system', - 'owner', + 'head_of_admin', + 'admin', + 'executive', 'accountant', ]), }));