From eb981b07fac8c753c28765556a6f40b447f27f74 Mon Sep 17 00:00:00 2001 From: "STW_TTTY\\stwtt" Date: Wed, 7 Aug 2024 17:55:05 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=81=E0=B8=B2?= =?UTF-8?q?=E0=B8=A3=E0=B9=80=E0=B8=A3=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=87?= =?UTF-8?q?=E0=B8=A3=E0=B9=89=E0=B8=AD=E0=B8=87=E0=B9=80=E0=B8=A3=E0=B8=B5?= =?UTF-8?q?=E0=B8=A2=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/1_Complaint/EditPage.vue | 6 +- .../components/1_Complaint/Form.vue | 83 +++++++++---------- .../components/1_Complaint/MainPage.vue | 4 +- .../components/1_Complaint/TableComplaint.vue | 44 ++++++++-- src/modules/11_discipline/router.ts | 13 +++ 5 files changed, 98 insertions(+), 52 deletions(-) diff --git a/src/modules/11_discipline/components/1_Complaint/EditPage.vue b/src/modules/11_discipline/components/1_Complaint/EditPage.vue index 826cb7d7f..d6d343e42 100644 --- a/src/modules/11_discipline/components/1_Complaint/EditPage.vue +++ b/src/modules/11_discipline/components/1_Complaint/EditPage.vue @@ -26,6 +26,8 @@ const router = useRouter(); const route = useRoute(); const id = ref(route.params.id as string); +const checkRoutePermisson = ref(route.name == "disciplineComplaintsDetail"); + const modalPopup = ref(false); /** ข้อมูล v-model ของฟอร์ม */ @@ -349,9 +351,9 @@ onMounted(() => { class="q-mr-sm" @click="$router.push(`/discipline/complaints`)" /> -
แก้ไขเรื่องร้องเรียน
+
{{ checkRoutePermisson ? 'รายละเอียดเรื่องร้องเรียน':'แก้ไขเรื่องร้องเรียน'}}
-
+
([]); const channelOptions = ref([]); - +const route = useRoute(); /** เรียกใช้ store */ const mixin = useCounterMixin(); const mainStore = useDisciplineMainStore(); @@ -30,7 +32,9 @@ const modalPersonal = ref(false); const personId = ref(""); const organization = ref(); const consideredAgency = ref(); - +const checkRoutePermisson = ref( + route.name == "disciplineComplaintsDetail" +); /**ชั่งฟังเพิ่มข้อมูล ลง ตาราง */ const modal = ref(false); const toggleModal = () => (modal.value = !modal.value); @@ -430,7 +434,7 @@ function filterOptionFnAgency(val: string, update: Function) { ref="respondentTypeRef" dense outlined - :readonly="isReadonly" + :readonly="isReadonly ||checkRoutePermisson" label="ผู้ถูกร้องเรียน" option-value="id" option-label="name" @@ -467,7 +471,7 @@ function filterOptionFnAgency(val: string, update: Function) { ref="organizationIdRef" dense hide-bottom-space - :readonly="isReadonly" + :readonly="isReadonly || checkRoutePermisson" outlined option-label="name" option-value="id" @@ -504,7 +508,7 @@ function filterOptionFnAgency(val: string, update: Function) { label="หน่วยงานที่พิจารณา" option-value="id" option-label="name" - :readonly="isReadonly" + :readonly="isReadonly || checkRoutePermisson" hide-bottom-space map-options :rules="[(val) => !!val || `${'กรุณาเลือกหน่วยงาน'}`]" @@ -536,7 +540,7 @@ function filterOptionFnAgency(val: string, update: Function) { > ผู้ถูกร้องเรียน - @@ -657,7 +656,7 @@ function filterOptionFnAgency(val: string, update: Function) { dense :class="inputEdit(isReadonly)" outlined - :readonly="isReadonly" + :readonly="isReadonly || checkRoutePermisson" hide-bottom-space v-model="formData.title" :rules="[(val) => !!val || 'กรุณากรอกเรื่องร้องเรียน']" @@ -675,7 +674,7 @@ function filterOptionFnAgency(val: string, update: Function) { ref="descriptionRef" dense outlined - :readonly="isReadonly" + :readonly="isReadonly|| checkRoutePermisson" hide-bottom-space v-model="formData.description" label="รายละเอียดเรื่องร้องเรียน" @@ -692,7 +691,7 @@ function filterOptionFnAgency(val: string, update: Function) { :locale="'th'" autoApply borderless - :readonly="isReadonly" + :readonly="isReadonly|| checkRoutePermisson" :enableTimePicker="false" week-start="0" @update:model-value="changeFormData()" @@ -710,7 +709,7 @@ function filterOptionFnAgency(val: string, update: Function) { outlined dense :class="inputEdit(isReadonly)" - :readonly="isReadonly" + :readonly="isReadonly|| checkRoutePermisson" hide-bottom-space :model-value=" formData.dateReceived != null @@ -742,7 +741,7 @@ function filterOptionFnAgency(val: string, update: Function) { ref="levelConsiderationRef" dense outlined - :readonly="isReadonly" + :readonly="isReadonly|| checkRoutePermisson" v-model="formData.levelConsideration" :options="complainstStore.levelConsiderationtOptions" label="ระดับการพิจารณา" @@ -765,7 +764,7 @@ function filterOptionFnAgency(val: string, update: Function) { v-model="formData.dateConsideration" @update:model-value="changeFormData()" :locale="'th'" - :readonly="isReadonly" + :readonly="isReadonly|| checkRoutePermisson" autoApply borderless :enableTimePicker="false" @@ -789,7 +788,7 @@ function filterOptionFnAgency(val: string, update: Function) { ? date2Thai(formData.dateConsideration) : null " - :readonly="isReadonly" + :readonly="isReadonly|| checkRoutePermisson" label="วันที่กำหนดพิจารณา" hide-bottom-space > @@ -802,7 +801,7 @@ function filterOptionFnAgency(val: string, update: Function) {