diff --git a/src/components/shared/AdvanceSearch.vue b/src/components/shared/AdvanceSearch.vue index 5b5b33a9..79456a42 100644 --- a/src/components/shared/AdvanceSearch.vue +++ b/src/components/shared/AdvanceSearch.vue @@ -106,6 +106,7 @@ watch( :persistent="isDateSelect" >
+
{{ $t('general.advanceSearch') }}
diff --git a/src/i18n/eng.ts b/src/i18n/eng.ts index 73b4b096..321e60e3 100644 --- a/src/i18n/eng.ts +++ b/src/i18n/eng.ts @@ -768,6 +768,7 @@ export default { }, quotation: { + ownOnly: 'View Own Quotation Only', quotationDate: 'Quotation Date', seller: 'Seller', paymentChannels: 'Payment Channels', diff --git a/src/i18n/tha.ts b/src/i18n/tha.ts index f01b2dca..cbe18525 100644 --- a/src/i18n/tha.ts +++ b/src/i18n/tha.ts @@ -766,6 +766,7 @@ export default { }, quotation: { + ownOnly: 'เห็นเฉพาะใบเสนอราคาของตัวเอง', quotationDate: 'วันที่ใบเสนอราคา', seller: 'ผู้ขาย', paymentChannels: 'ช่องทางชำระเงิน', diff --git a/src/pages/05_quotation/MainPage.vue b/src/pages/05_quotation/MainPage.vue index a713178c..f1414b70 100644 --- a/src/pages/05_quotation/MainPage.vue +++ b/src/pages/05_quotation/MainPage.vue @@ -15,6 +15,7 @@ import { useQuotationForm } from './form'; import { hslaColors } from './constants'; import { pageTabs, columnQuotation } from './constants'; import { toCamelCase, canAccess } from 'stores/utils'; +import { getUserId } from 'src/services/keycloak'; // NOTE Import Types import { CustomerBranchCreate, CustomerType } from 'stores/customer/types'; @@ -104,6 +105,7 @@ const pageState = reactive({ fieldSelected: [''], gridView: false, total: 0, + sellerId: '', currentTab: 'Issued', addModal: false, @@ -297,6 +299,7 @@ onMounted(async () => { pageSize: quotationPageSize.value, status: 'Issued', urgentFirst: true, + sellerId: pageState.sellerId || undefined, }); if (ret) { @@ -331,6 +334,7 @@ async function fetchQuotationList(mobileFetch?: boolean) { urgentFirst: true, startDate: pageState.searchDate[0], endDate: pageState.searchDate[1], + sellerId: pageState.sellerId || undefined, }); if (ret) { @@ -406,6 +410,11 @@ async function storeDataLocal(id: string) { window.open(url, '_blank'); } + +async function filterBySellerId() { + pageState.sellerId = pageState.sellerId ? '' : getUserId(); + await fetchQuotationList(); +} diff --git a/src/pages/05_quotation/QuotationForm.vue b/src/pages/05_quotation/QuotationForm.vue index 52e2fc69..ba21c9c8 100644 --- a/src/pages/05_quotation/QuotationForm.vue +++ b/src/pages/05_quotation/QuotationForm.vue @@ -2,6 +2,7 @@ import { useI18n } from 'vue-i18n'; import { storeToRefs } from 'pinia'; import { QSelect, useQuasar } from 'quasar'; +import { getUserId } from 'src/services/keycloak'; import { computed, nextTick, onMounted, reactive, ref, watch } from 'vue'; import { baseUrl, @@ -78,7 +79,6 @@ import { api } from 'src/boot/axios'; import { RouterLink, useRoute } from 'vue-router'; import { initLang, initTheme, Lang } from 'src/utils/ui'; import { convertTemplate } from 'src/utils/string-template'; -import { getRole } from 'src/services/keycloak'; type Node = { [key: string]: any; @@ -616,6 +616,7 @@ async function convertDataToFormSubmit() { discount: quotationFormData.value.discount, remark: quotationFormData.value.remark || '', agentPrice: agentPrice.value, + sellerId: quotationFormData.value.sellerId, }; newWorkerList.value = []; @@ -1015,6 +1016,7 @@ onMounted(async () => { quotationFormData.value.customerBranchId = parsed.customerBranchId; currentQuotationId.value = parsed.quotationId; agentPrice.value = parsed.agentPrice; + quotationFormData.value.sellerId = getUserId(); await fetchQuotation(); await assignWorkerToSelectedWorker(); sessionData.value = parsed; @@ -1506,6 +1508,7 @@ function covertToNode() { v-model:contactor="quotationFormData.contactName" v-model:telephone="quotationFormData.contactTel" v-model:due-date="quotationFormData.dueDate" + v-model:seller-id="quotationFormData.sellerId" >