Merge branch 'develop' of github.com:Frappet/bma-ehr-frontend into develop
This commit is contained in:
commit
537277c381
20 changed files with 1238 additions and 697 deletions
|
|
@ -10,6 +10,7 @@ const $q = useQuasar();
|
|||
const isEdit = ref<boolean>(true);
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const checkRoutePermisson = ref<boolean>(route.name == "probationFormDetail");
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
date2Thai,
|
||||
|
|
@ -1111,7 +1112,7 @@ onMounted(async () => {
|
|||
<div v-else class="col-12 row q-gutter-md">
|
||||
<div>แบบมอบหมายงานการทดลองปฏิบัติหน้าที่ราชการ</div>
|
||||
<q-btn
|
||||
v-if="!isEdit"
|
||||
v-if="!isEdit && !checkRoutePermisson"
|
||||
size="12px"
|
||||
flat
|
||||
dense
|
||||
|
|
@ -1147,6 +1148,7 @@ onMounted(async () => {
|
|||
|
||||
<div v-if="!isEdit">
|
||||
<q-btn
|
||||
v-if="!checkRoutePermisson"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
|
|
@ -1160,6 +1162,7 @@ onMounted(async () => {
|
|||
|
||||
<div v-else>
|
||||
<q-btn
|
||||
v-if="!checkRoutePermisson"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
|
|
@ -1171,6 +1174,7 @@ onMounted(async () => {
|
|||
</q-btn>
|
||||
<!-- @click="saveEdit(assignId)" -->
|
||||
<q-btn
|
||||
v-if="!checkRoutePermisson"
|
||||
dense
|
||||
flat
|
||||
class="q-ml-md"
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -35,6 +35,7 @@ const {
|
|||
dialogConfirm,
|
||||
} = mixin;
|
||||
const route = useRoute();
|
||||
const checkRoutePermisson = ref<boolean>(route.name == "probationFormDetail");
|
||||
const assignId = ref<string>(route.params.form.toString());
|
||||
const personalId = ref<string>(route.params.personalId.toString());
|
||||
const myForm = ref<any>(null);
|
||||
|
|
@ -430,6 +431,7 @@ onMounted(async () => {
|
|||
<div>แบบประเมินผล (คณะกรรมการ)</div>
|
||||
<div v-if="status == false">
|
||||
<q-btn
|
||||
v-if="!checkRoutePermisson"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
|
|
@ -442,10 +444,19 @@ onMounted(async () => {
|
|||
</div>
|
||||
|
||||
<div v-else>
|
||||
<q-btn dense flat round color="red" @click="cancel()" icon="mdi-undo">
|
||||
<q-btn
|
||||
v-if="!checkRoutePermisson"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
color="red"
|
||||
@click="cancel()"
|
||||
icon="mdi-undo"
|
||||
>
|
||||
<q-tooltip>ยกเลิก</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="!checkRoutePermisson"
|
||||
dense
|
||||
class="q-ml-sm"
|
||||
flat
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ const {
|
|||
dialogMessageNotify,
|
||||
} = mixin;
|
||||
const route = useRoute();
|
||||
const checkRoutePermisson = ref<boolean>(route.name == "probationFormDetail");
|
||||
const assignId = ref<string>(route.params.form.toString());
|
||||
const personalId = ref<string>(route.params.personalId.toString());
|
||||
const action = ref<string>("add");
|
||||
|
|
@ -332,7 +333,7 @@ onMounted(() => {
|
|||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
:readonly="!status"
|
||||
:readonly="!status || checkRoutePermisson"
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
|
|
@ -346,7 +347,7 @@ onMounted(() => {
|
|||
<q-input
|
||||
outlined
|
||||
dense
|
||||
:disable="!status"
|
||||
:disable="!status || checkRoutePermisson"
|
||||
class="full-width datepicker"
|
||||
:model-value="
|
||||
date_start != null ? date2Thai(date_start) : null
|
||||
|
|
@ -373,7 +374,7 @@ onMounted(() => {
|
|||
v-model="date_finish"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:readonly="!status"
|
||||
:readonly="!status || checkRoutePermisson"
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
|
|
@ -388,7 +389,7 @@ onMounted(() => {
|
|||
<q-input
|
||||
outlined
|
||||
dense
|
||||
:disable="!status"
|
||||
:disable="!status || checkRoutePermisson"
|
||||
class="full-width datepicker"
|
||||
:model-value="
|
||||
date_finish != null ? date2Thai(date_finish) : null
|
||||
|
|
@ -425,7 +426,7 @@ onMounted(() => {
|
|||
class="col-xs-12 col-sm-6"
|
||||
dense
|
||||
borderless
|
||||
:disable="!status"
|
||||
:disable="!status || checkRoutePermisson"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="label"
|
||||
|
|
@ -454,7 +455,7 @@ onMounted(() => {
|
|||
]"
|
||||
hide-bottom-space
|
||||
:options="optionsResult"
|
||||
:disable="!status"
|
||||
:disable="!status || checkRoutePermisson"
|
||||
dense
|
||||
borderless
|
||||
emit-value
|
||||
|
|
@ -497,7 +498,7 @@ onMounted(() => {
|
|||
dense
|
||||
borderless
|
||||
outlined
|
||||
:disable="!status"
|
||||
:disable="!status || checkRoutePermisson"
|
||||
class="bg-white"
|
||||
type="textarea"
|
||||
v-model="reson"
|
||||
|
|
@ -550,7 +551,7 @@ onMounted(() => {
|
|||
menu-class-name="modalfix"
|
||||
v-model="chairman_dated"
|
||||
:locale="'th'"
|
||||
:readonly="!status"
|
||||
:readonly="!status || checkRoutePermisson"
|
||||
autoApply
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
|
|
@ -566,7 +567,7 @@ onMounted(() => {
|
|||
<q-input
|
||||
outlined
|
||||
dense
|
||||
:disable="!status"
|
||||
:disable="!status || checkRoutePermisson"
|
||||
class="full-width datepicker col-3"
|
||||
:model-value="
|
||||
chairman_dated != null ? date2Thai(chairman_dated) : null
|
||||
|
|
@ -612,7 +613,7 @@ onMounted(() => {
|
|||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
:readonly="!status"
|
||||
:readonly="!status || checkRoutePermisson"
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
|
|
@ -626,7 +627,7 @@ onMounted(() => {
|
|||
<q-input
|
||||
outlined
|
||||
dense
|
||||
:disable="!status"
|
||||
:disable="!status || checkRoutePermisson"
|
||||
class="full-width datepicker col-3"
|
||||
:model-value="
|
||||
director1_dated != null
|
||||
|
|
@ -675,7 +676,7 @@ onMounted(() => {
|
|||
v-model="director2_dated"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:readonly="!status"
|
||||
:readonly="!status || checkRoutePermisson"
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
|
|
@ -690,7 +691,7 @@ onMounted(() => {
|
|||
<q-input
|
||||
outlined
|
||||
dense
|
||||
:disable="!status"
|
||||
:disable="!status || checkRoutePermisson"
|
||||
class="full-width datepicker col-3"
|
||||
:model-value="
|
||||
director2_dated != null
|
||||
|
|
@ -717,7 +718,7 @@ onMounted(() => {
|
|||
</div>
|
||||
</q-form>
|
||||
|
||||
<q-toolbar class="text-primary" v-if="action == 'add'">
|
||||
<q-toolbar class="text-primary" v-if="action == 'add' && !checkRoutePermisson">
|
||||
<q-space />
|
||||
<q-btn label="บันทึก" color="secondary" @click="savaForm" />
|
||||
</q-toolbar>
|
||||
|
|
|
|||
|
|
@ -12,9 +12,11 @@ import criterion from "@/modules/05_placement/components/Other/Criterion.vue";
|
|||
import type { ListDataText } from "@/modules/05_placement/interface/index/Main";
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const routeName = router.currentRoute.value.name;
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const checkRoutePermisson = ref<boolean>(route.name == "probationFormDetail");
|
||||
const probationStore = useProbationDataStore();
|
||||
const { fecthAssignoutput, assign } = probationStore;
|
||||
|
||||
|
|
@ -362,6 +364,7 @@ onMounted(async () => {
|
|||
<div>แบบบันทึกผล (ผู้ดูเเล)</div>
|
||||
<div v-if="status == false">
|
||||
<q-btn
|
||||
v-if="!checkRoutePermisson"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
|
|
@ -373,11 +376,12 @@ onMounted(async () => {
|
|||
</q-btn>
|
||||
</div>
|
||||
<div v-else>
|
||||
<q-btn dense flat round color="red" @click="cancel()" icon="mdi-undo">
|
||||
<q-btn dense flat round color="red" @click="cancel()" icon="mdi-undo" v-if="!checkRoutePermisson">
|
||||
<q-tooltip>ยกเลิก</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
dense
|
||||
v-if="!checkRoutePermisson"
|
||||
flat
|
||||
round
|
||||
class="q-ml-md"
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ const router = useRouter();
|
|||
const routeName = router.currentRoute.value.name;
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const checkRoutePermisson = ref<boolean>(route.name == "probationFormDetail");
|
||||
const probationStore = useProbationDataStore();
|
||||
const { fecthAssignoutput, assign } = probationStore;
|
||||
|
||||
|
|
@ -373,6 +374,7 @@ onMounted(async () => {
|
|||
<div>แบบบันทึกผล (ผู้บังคับบัญชา)</div>
|
||||
<div v-if="status == false">
|
||||
<q-btn
|
||||
v-if="!checkRoutePermisson"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
|
|
@ -384,10 +386,19 @@ onMounted(async () => {
|
|||
</q-btn>
|
||||
</div>
|
||||
<div v-else>
|
||||
<q-btn dense flat round color="red" @click="cancel()" icon="mdi-undo">
|
||||
<q-btn
|
||||
v-if="!checkRoutePermisson"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
color="red"
|
||||
@click="cancel()"
|
||||
icon="mdi-undo"
|
||||
>
|
||||
<q-tooltip>ยกเลิก</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="!checkRoutePermisson"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
|
|
@ -854,24 +865,24 @@ onMounted(async () => {
|
|||
<q-item-label>{{ list.label }}</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side>
|
||||
<q-btn-group outline>
|
||||
<q-btn
|
||||
v-for="(item, index) in 5"
|
||||
:disable="!status"
|
||||
:class="conduct_level[i] == item && 'active'"
|
||||
outline
|
||||
color="grey-6"
|
||||
:label="item"
|
||||
@click="conduct_level[i] = item"
|
||||
>
|
||||
<q-tooltip>
|
||||
<div class="text-body2">
|
||||
<span>{{ optionText[index].label }}</span>
|
||||
</div>
|
||||
</q-tooltip>
|
||||
</q-btn>
|
||||
</q-btn-group>
|
||||
</q-item-section>
|
||||
<q-btn-group outline>
|
||||
<q-btn
|
||||
v-for="(item, index) in 5"
|
||||
:disable="!status"
|
||||
:class="conduct_level[i] == item && 'active'"
|
||||
outline
|
||||
color="grey-6"
|
||||
:label="item"
|
||||
@click="conduct_level[i] = item"
|
||||
>
|
||||
<q-tooltip>
|
||||
<div class="text-body2">
|
||||
<span>{{ optionText[index].label }}</span>
|
||||
</div>
|
||||
</q-tooltip>
|
||||
</q-btn>
|
||||
</q-btn-group>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-separator class="q-my-xs" v-if="i + 1 < list2_1.length" />
|
||||
</q-list>
|
||||
|
|
@ -894,24 +905,24 @@ onMounted(async () => {
|
|||
<q-item-label>{{ list.label }}</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side>
|
||||
<q-btn-group outline>
|
||||
<q-btn
|
||||
v-for="(item, index) in 5"
|
||||
:disable="!status"
|
||||
:class="moral_level[i] == item && 'active'"
|
||||
outline
|
||||
color="grey-6"
|
||||
:label="item"
|
||||
@click="moral_level[i] = item"
|
||||
>
|
||||
<q-tooltip>
|
||||
<div class="text-body2">
|
||||
<span>{{ optionText[index].label }}</span>
|
||||
</div>
|
||||
</q-tooltip>
|
||||
</q-btn>
|
||||
</q-btn-group>
|
||||
</q-item-section>
|
||||
<q-btn-group outline>
|
||||
<q-btn
|
||||
v-for="(item, index) in 5"
|
||||
:disable="!status"
|
||||
:class="moral_level[i] == item && 'active'"
|
||||
outline
|
||||
color="grey-6"
|
||||
:label="item"
|
||||
@click="moral_level[i] = item"
|
||||
>
|
||||
<q-tooltip>
|
||||
<div class="text-body2">
|
||||
<span>{{ optionText[index].label }}</span>
|
||||
</div>
|
||||
</q-tooltip>
|
||||
</q-btn>
|
||||
</q-btn-group>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-separator class="q-my-xs" v-if="i + 1 < list2_2.length" />
|
||||
</q-list>
|
||||
|
|
@ -934,24 +945,24 @@ onMounted(async () => {
|
|||
<q-item-label>{{ list.label }}</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side>
|
||||
<q-btn-group outline>
|
||||
<q-btn
|
||||
v-for="(item, index) in 5"
|
||||
:disable="!status"
|
||||
:class="discipline_level[i] == item && 'active'"
|
||||
outline
|
||||
color="grey-6"
|
||||
:label="item"
|
||||
@click="discipline_level[i] = item"
|
||||
>
|
||||
<q-tooltip>
|
||||
<div class="text-body2">
|
||||
<span>{{ optionText[index].label }}</span>
|
||||
</div>
|
||||
</q-tooltip>
|
||||
</q-btn>
|
||||
</q-btn-group>
|
||||
</q-item-section>
|
||||
<q-btn-group outline>
|
||||
<q-btn
|
||||
v-for="(item, index) in 5"
|
||||
:disable="!status"
|
||||
:class="discipline_level[i] == item && 'active'"
|
||||
outline
|
||||
color="grey-6"
|
||||
:label="item"
|
||||
@click="discipline_level[i] = item"
|
||||
>
|
||||
<q-tooltip>
|
||||
<div class="text-body2">
|
||||
<span>{{ optionText[index].label }}</span>
|
||||
</div>
|
||||
</q-tooltip>
|
||||
</q-btn>
|
||||
</q-btn-group>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-separator class="q-my-xs" v-if="i + 1 < list2_3.length" />
|
||||
</q-list>
|
||||
|
|
@ -997,24 +1008,24 @@ onMounted(async () => {
|
|||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side>
|
||||
<q-btn-group outline>
|
||||
<q-btn
|
||||
v-for="(item, index) in 5"
|
||||
:disable="!status"
|
||||
:class="behavio_orther.level == item && 'active'"
|
||||
outline
|
||||
color="grey-6"
|
||||
:label="item"
|
||||
@click="behavio_orther.level = item"
|
||||
>
|
||||
<q-tooltip>
|
||||
<div class="text-body2">
|
||||
<span>{{ optionText[index].label }}</span>
|
||||
</div>
|
||||
</q-tooltip>
|
||||
</q-btn>
|
||||
</q-btn-group>
|
||||
</q-item-section>
|
||||
<q-btn-group outline>
|
||||
<q-btn
|
||||
v-for="(item, index) in 5"
|
||||
:disable="!status"
|
||||
:class="behavio_orther.level == item && 'active'"
|
||||
outline
|
||||
color="grey-6"
|
||||
:label="item"
|
||||
@click="behavio_orther.level = item"
|
||||
>
|
||||
<q-tooltip>
|
||||
<div class="text-body2">
|
||||
<span>{{ optionText[index].label }}</span>
|
||||
</div>
|
||||
</q-tooltip>
|
||||
</q-btn>
|
||||
</q-btn-group>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-card>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, watch } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
const tabHead = ref<string>("save1");
|
||||
|
||||
const route = useRoute();
|
||||
const checkRoutePermisson = ref<boolean>(route.name == "probationFormDetail");
|
||||
/** รับค่ามาจากหน้าหลัก */
|
||||
const props = defineProps({
|
||||
FileDownload: {
|
||||
|
|
@ -29,22 +31,22 @@ const props = defineProps({
|
|||
});
|
||||
|
||||
/** เรียกใช้ฟังชั่นจากหน้าหลัก */
|
||||
function downloadFile(type: string){
|
||||
function downloadFile(type: string) {
|
||||
props.FileDownload(type);
|
||||
};
|
||||
}
|
||||
|
||||
watch(tabHead, () => {
|
||||
props.changeTab(tabHead.value);
|
||||
});
|
||||
|
||||
/** ไปยัง step ต่อไป */
|
||||
function nextPage(){
|
||||
function nextPage() {
|
||||
if (props.loop !== undefined) {
|
||||
if (props.loop < 3) {
|
||||
props.addData();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -99,7 +101,7 @@ function nextPage(){
|
|||
</q-tab>
|
||||
</q-tabs>
|
||||
<div>
|
||||
<q-btn color="blue" flat dense icon="mdi-plus" @click="nextPage">
|
||||
<q-btn v-if="!checkRoutePermisson" color="blue" flat dense icon="mdi-plus" @click="nextPage">
|
||||
<q-tooltip> เพิ่ม </q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ const FormSaveResult = defineAsyncComponent(
|
|||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const checkRoutePermisson = ref<boolean>(route.name == "probationFormDetail");
|
||||
const $q = useQuasar();
|
||||
const probationStore = useProbationDataStore();
|
||||
const { fecthdataAssign } = probationStore;
|
||||
|
|
@ -169,6 +170,7 @@ onMounted(async () => {
|
|||
<div class="q-gutter-md" v-else-if="probationStore.tabs.length == 0">
|
||||
<div class="flex justify-center items-center q-my-md q-gutter-md">
|
||||
<q-btn
|
||||
v-if="!checkRoutePermisson"
|
||||
outline
|
||||
color="primary"
|
||||
label="สร้างแบบบันทึกผล"
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ const FormSaveResultCommader = defineAsyncComponent(
|
|||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const checkRoutePermisson = ref<boolean>(route.name == "probationFormDetail");
|
||||
const $q = useQuasar();
|
||||
const probationStore = useProbationDataStore();
|
||||
const { fecthdataAssign } = probationStore;
|
||||
|
|
@ -171,6 +172,7 @@ function addData() {
|
|||
<div class="q-gutter-md" v-else-if="probationStore.tabs.length == 0">
|
||||
<div class="flex justify-center items-center q-my-md q-gutter-md">
|
||||
<q-btn
|
||||
v-if="!checkRoutePermisson"
|
||||
outline
|
||||
color="primary"
|
||||
label="สร้างแบบบันทึกผล"
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ const FormEvaluate = defineAsyncComponent(
|
|||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const checkRoutePermisson = ref<boolean>(route.name == "probationFormDetail");
|
||||
const mixin = useCounterMixin();
|
||||
const $q = useQuasar();
|
||||
const { showLoader, hideLoader, messageError } = mixin;
|
||||
|
|
@ -156,7 +157,7 @@ function addData() {
|
|||
|
||||
<div v-else class="q-gutter-md">
|
||||
<div class="flex justify-center items-center q-my-md q-gutter-md">
|
||||
<q-btn outline color="primary" label="สร้างแบบประเมิน" @click="addData" />
|
||||
<q-btn v-if="!checkRoutePermisson" outline color="primary" label="สร้างแบบประเมิน" @click="addData" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ const FormEvaluateScore = defineAsyncComponent(
|
|||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const checkRoutePermisson = ref<boolean>(route.name == "probationFormDetail");
|
||||
const mixin = useCounterMixin();
|
||||
const $q = useQuasar();
|
||||
const { showLoader, hideLoader, messageError, success } = mixin;
|
||||
|
|
@ -140,7 +141,7 @@ const changeTab = (tabVal: string) => {
|
|||
|
||||
<div class="q-gutter-md" v-if="tabs.length === 0">
|
||||
<div class="flex justify-center items-center q-my-md q-gutter-md">
|
||||
<q-btn outline color="primary" label="สร้างแบบประเมิน" @click="addData" />
|
||||
<q-btn v-if="!checkRoutePermisson" outline color="primary" label="สร้างแบบประเมิน" @click="addData" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ const SummarySurvey = defineAsyncComponent(
|
|||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const checkRoutePermisson = ref<boolean>(route.name == "probationFormDetail");
|
||||
const drawer = ref<boolean>(true);
|
||||
const activeTab = ref<string>("");
|
||||
const personalId = ref<string>(route.params.personalId.toString());
|
||||
|
|
@ -62,7 +63,7 @@ function changeTab(tab: string){
|
|||
|
||||
/** ปุ่มกลับ */
|
||||
function clickBack(){
|
||||
router.push(`/probation/detail/${personalId.value}`);
|
||||
router.go(-1)
|
||||
DataStore.mainTab = "tab1";
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import router from "@/router";
|
|||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
const rows = ref<FormMainProbation[]>([]);
|
||||
|
|
@ -505,8 +506,8 @@ onMounted(async () => {
|
|||
|
||||
<div>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsCreate"
|
||||
@click="onclickAddProbation"
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="add"
|
||||
|
|
@ -575,17 +576,47 @@ onMounted(async () => {
|
|||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width></q-th>
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr
|
||||
:props="props"
|
||||
class="cursor-pointer"
|
||||
@click="router.push(`/probation/detail/${props.row.personal_id}`)"
|
||||
>
|
||||
<q-tr :props="props">
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="info"
|
||||
icon="mdi-eye"
|
||||
@click="
|
||||
router.push(
|
||||
`/probation/detail-view/${props.row.personal_id}`
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-tooltip>รายละเอียด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsGet &&
|
||||
checkPermission($route)?.attrIsUpdate
|
||||
"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="edit"
|
||||
icon="edit"
|
||||
@click="
|
||||
router.push(`/probation/detail/${props.row.personal_id}`)
|
||||
"
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
|
|
|
|||
|
|
@ -8,13 +8,14 @@ import { useQuasar } from "quasar";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
|
||||
const modalPersonal = ref<boolean>(false);
|
||||
const personId = ref<string>("");
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const personalId = ref<string>(route.params.id as string);
|
||||
|
||||
const checkRoutePermisson = ref<boolean>(route.name == "probationDetailOnly");
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
const rows = ref<FormProbationDetail[]>([]);
|
||||
const name = ref<string>("");
|
||||
|
|
@ -220,7 +221,11 @@ async function selectStatus() {
|
|||
* @param id personal id
|
||||
*/
|
||||
function clickSelect(id: string) {
|
||||
router.push(`${route.fullPath}/${id}`);
|
||||
if (checkRoutePermisson.value) {
|
||||
router.push(`/probation/detail-view/${personalId.value}/${id}`);
|
||||
} else {
|
||||
router.push(`/probation/detail/${personalId.value}/${id}`);
|
||||
}
|
||||
}
|
||||
|
||||
/** รีเซ็ตค่าในช่อง input */
|
||||
|
|
@ -335,6 +340,7 @@ onMounted(async () => {
|
|||
<div class="col-12 text-detail">
|
||||
<q-select
|
||||
:disable="
|
||||
checkRoutePermisson ||
|
||||
probation_status == 2 ||
|
||||
probation_status == 3 ||
|
||||
probation_status == 7 ||
|
||||
|
|
@ -361,8 +367,8 @@ onMounted(async () => {
|
|||
<div class="row col-12 q-col-gutter-sm">
|
||||
<div>
|
||||
<q-btn
|
||||
v-if="!checkRoutePermisson"
|
||||
@click="router.push(`/probation/add/${personalId}`)"
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="add"
|
||||
|
|
@ -428,18 +434,46 @@ onMounted(async () => {
|
|||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width />
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
<q-th auto-width />
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr
|
||||
:props="props"
|
||||
class="cursor-pointer"
|
||||
@click="clickSelect(props.row.id)"
|
||||
>
|
||||
<q-tr :props="props">
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="info"
|
||||
icon="mdi-eye"
|
||||
@click="
|
||||
router.push(
|
||||
`/probation/detail-view/${personalId}/${props.row.id}`
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-tooltip>รายละเอียด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsGet &&
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
!checkRoutePermisson
|
||||
"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="edit"
|
||||
icon="edit"
|
||||
@click="clickSelect(props.row.id)"
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
|
|
@ -448,7 +482,6 @@ onMounted(async () => {
|
|||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td auto-width> </q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ const {
|
|||
dialogConfirm,
|
||||
} = mixin;
|
||||
const route = useRoute();
|
||||
|
||||
const checkRoutePermisson = ref<boolean>(route.name == "probationFormDetail");
|
||||
const assignId = ref<string>(route.params.form.toString());
|
||||
const action = ref<string>("edit");
|
||||
const status = ref<boolean>(false);
|
||||
|
|
@ -266,7 +266,7 @@ onMounted(() => {
|
|||
outlined
|
||||
dense
|
||||
type="number"
|
||||
:disable="!status"
|
||||
:disable="!status || checkRoutePermisson"
|
||||
v-model="develop_orientation_score"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -276,7 +276,7 @@ onMounted(() => {
|
|||
outlined
|
||||
dense
|
||||
type="number"
|
||||
:disable="!status"
|
||||
:disable="!status || checkRoutePermisson"
|
||||
v-model="develop_orientation_percent"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -290,7 +290,7 @@ onMounted(() => {
|
|||
dense
|
||||
outlined
|
||||
type="number"
|
||||
:disable="!status"
|
||||
:disable="!status || checkRoutePermisson"
|
||||
v-model="develop_self_learning_score"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -300,7 +300,7 @@ onMounted(() => {
|
|||
outlined
|
||||
dense
|
||||
type="number"
|
||||
:disable="!status"
|
||||
:disable="!status || checkRoutePermisson"
|
||||
v-model="develop_self_learning_percent"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -314,7 +314,7 @@ onMounted(() => {
|
|||
outlined
|
||||
dense
|
||||
type="number"
|
||||
:disable="!status"
|
||||
:disable="!status || checkRoutePermisson"
|
||||
v-model="develop_training_seminar_score"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -324,7 +324,7 @@ onMounted(() => {
|
|||
outlined
|
||||
dense
|
||||
type="number"
|
||||
:disable="!status"
|
||||
:disable="!status || checkRoutePermisson"
|
||||
v-model="develop_training_seminar_percent"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -339,7 +339,7 @@ onMounted(() => {
|
|||
outlined
|
||||
dense
|
||||
type="number"
|
||||
:disable="!status"
|
||||
:disable="!status || checkRoutePermisson"
|
||||
v-model="develop_other_training_score"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -349,7 +349,7 @@ onMounted(() => {
|
|||
outlined
|
||||
dense
|
||||
type="number"
|
||||
:disable="!status"
|
||||
:disable="!status || checkRoutePermisson"
|
||||
v-model="develop_other_training_percent"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -386,7 +386,7 @@ onMounted(() => {
|
|||
option-value="value"
|
||||
map-options
|
||||
emit-value
|
||||
:disable="!status"
|
||||
:disable="!status || checkRoutePermisson"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -405,7 +405,7 @@ onMounted(() => {
|
|||
autogrow
|
||||
hide-bottom-space
|
||||
:row="3"
|
||||
:disable="!status"
|
||||
:disable="!status || checkRoutePermisson"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
@ -426,7 +426,7 @@ onMounted(() => {
|
|||
option-value="value"
|
||||
map-options
|
||||
emit-value
|
||||
:disable="!status"
|
||||
:disable="!status || checkRoutePermisson"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -440,7 +440,7 @@ onMounted(() => {
|
|||
v-model="evaluate_date"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:readonly="!status"
|
||||
:readonly="!status || checkRoutePermisson"
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
|
|
@ -455,7 +455,7 @@ onMounted(() => {
|
|||
<q-input
|
||||
outlined
|
||||
dense
|
||||
:disable="!status"
|
||||
:disable="!status || checkRoutePermisson"
|
||||
class="full-width datepicker"
|
||||
:model-value="
|
||||
evaluate_date != null ? date2Thai(evaluate_date) : null
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ const {
|
|||
dialogConfirm,
|
||||
} = mixin;
|
||||
const route = useRoute();
|
||||
|
||||
const checkRoutePermisson = ref<boolean>(route.name == "probationFormDetail");
|
||||
const assignId = ref<string>(route.params.form.toString());
|
||||
const action = ref<string>("edit");
|
||||
const status = ref<boolean>(true);
|
||||
|
|
@ -126,7 +126,7 @@ onMounted(() => {
|
|||
</div>
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:disable="!status"
|
||||
:disable="!status || checkRoutePermisson"
|
||||
label="ความคิดเห็น"
|
||||
class="bg-white"
|
||||
dense
|
||||
|
|
@ -146,7 +146,7 @@ onMounted(() => {
|
|||
</div>
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:disable="!status"
|
||||
:disable="!status || checkRoutePermisson"
|
||||
label="ความคิดเห็น"
|
||||
class="bg-white"
|
||||
dense
|
||||
|
|
@ -168,7 +168,7 @@ onMounted(() => {
|
|||
<q-btn-group outline>
|
||||
<q-btn
|
||||
v-for="(item, index) in 5"
|
||||
:disable="!status"
|
||||
:disable="!status || checkRoutePermisson"
|
||||
:class="
|
||||
answer3 == item && 'active'
|
||||
"
|
||||
|
|
@ -192,7 +192,7 @@ onMounted(() => {
|
|||
<criterion />
|
||||
</q-form>
|
||||
<!-- <Footer /> -->
|
||||
<div class="row col-12">
|
||||
<div class="row col-12" v-if="!checkRoutePermisson">
|
||||
<q-space />
|
||||
<q-btn label="บันทึก" color="secondary" @click="save" v-if="status" />
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -16,8 +16,13 @@ const mainProbation = () =>
|
|||
const probationDetail = () =>
|
||||
import("@/modules/05_placement/components/probation/ProbationDetail.vue");
|
||||
|
||||
const probationDetailOnly = () =>
|
||||
import("@/modules/05_placement/components/probation/ProbationDetail.vue");
|
||||
|
||||
const probationFormEvaluation = () =>
|
||||
import("@/modules/05_placement/components/probation/MainDetail.vue");
|
||||
const probationFormEvaluationDetail = () =>
|
||||
import("@/modules/05_placement/components/probation/MainDetail.vue");
|
||||
|
||||
const probationWorkAdd = () =>
|
||||
import("@/modules/05_placement/components/probation/MainDetail.vue");
|
||||
|
|
@ -143,6 +148,16 @@ export default [
|
|||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/probation/detail-view/:id",
|
||||
name: "probationDetailOnly",
|
||||
component: probationDetailOnly,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: "SYS_PROBATION",
|
||||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/probation/detail/:personalId/:form",
|
||||
name: "probationForm",
|
||||
|
|
@ -153,6 +168,16 @@ export default [
|
|||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/probation/detail-view/:personalId/:form",
|
||||
name: "probationFormDetail",
|
||||
component: probationFormEvaluationDetail,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: "SYS_PROBATION",
|
||||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/probation/detail/addresult/:id/:form",
|
||||
name: "probationFormAddresult",
|
||||
|
|
|
|||
391
src/modules/07_insignia/components/1_Proposals/DialogDetail.vue
Normal file
391
src/modules/07_insignia/components/1_Proposals/DialogDetail.vue
Normal file
|
|
@ -0,0 +1,391 @@
|
|||
<script setup lang="ts">
|
||||
import { computed, ref, watch } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
/** import Store*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
/** use*/
|
||||
const $q = useQuasar();
|
||||
const {
|
||||
date2Thai,
|
||||
dateToISO,
|
||||
messageError,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
dialogConfirm,
|
||||
success,
|
||||
} = useCounterMixin();
|
||||
|
||||
/**
|
||||
* props
|
||||
*/
|
||||
const modal = defineModel<boolean>("modal", { required: true });
|
||||
const actionType = defineModel<string>("actionType", { required: true });
|
||||
const roundId = defineModel<string>("roundId", { required: true });
|
||||
const props = defineProps({
|
||||
fetchList: { type: Function, required: true },
|
||||
});
|
||||
|
||||
const title = computed(() => {
|
||||
return actionType.value === "view"
|
||||
? "รายละเอียดรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์"
|
||||
: actionType.value === "edit"
|
||||
? "แก้ไขข้อมูล"
|
||||
: "เพิ่มรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์";
|
||||
});
|
||||
|
||||
const readonly = computed(() => {
|
||||
return actionType.value === "view" ? true : false;
|
||||
});
|
||||
|
||||
const options = ref([
|
||||
{ label: "รอบการเสนอขอพระราชทานเครื่องราชฯ รอบที่ 1", value: 1 },
|
||||
{ label: "รอบการเสนอขอพระราชทานเครื่องราชฯ รอบที่ 2", value: 2 },
|
||||
]);
|
||||
|
||||
const roundInsig = ref<any>();
|
||||
const yearly = ref<number>(new Date().getFullYear());
|
||||
const dateStart = ref<Date | null>(null);
|
||||
const dateEnd = ref<Date | null>(null);
|
||||
const datelast = ref<number | null>(null);
|
||||
const files = ref<any>();
|
||||
const fileDocDataUpload = ref<File[]>([]);
|
||||
|
||||
/**
|
||||
* Function เรียกข้อมูลของรอบการเสนอขอ
|
||||
*/
|
||||
function fetchData() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.getRoundInsignia(roundId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
roundInsig.value =
|
||||
options.value.filter((r: any) => r.value == data.period_round).length >
|
||||
0
|
||||
? options.value.filter((r: any) => r.value == data.period_round)[0]
|
||||
: null;
|
||||
yearly.value = data.period_year;
|
||||
datelast.value = data.period_amount;
|
||||
dateStart.value = new Date(data.period_start);
|
||||
dateEnd.value = new Date(data.period_end);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/** Function อัพเดทวันที่เริ่มต้น และ สิ้นสุด */
|
||||
function updateDateRange() {
|
||||
if (roundInsig.value.value == 1) {
|
||||
dateStart.value = new Date(yearly.value, 9, 1);
|
||||
dateEnd.value = new Date(yearly.value + 1, 3, 29);
|
||||
} else if (roundInsig.value.value == 2) {
|
||||
dateStart.value = new Date(yearly.value + 1, 3, 29);
|
||||
dateEnd.value = new Date(yearly.value + 1, 4, 29);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function อัพเดทปี
|
||||
* @param year รับค่าปี คศ
|
||||
*/
|
||||
function updateYear(year: number) {
|
||||
yearly.value = year;
|
||||
updateDateRange();
|
||||
}
|
||||
|
||||
/**
|
||||
* Function อัพโหลดไฟล์
|
||||
* @param files ไฟล์
|
||||
*/
|
||||
function fileUploadDoc(files: any) {
|
||||
files.forEach((file: any) => {
|
||||
fileDocDataUpload.value.push(file);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Function บันทึกข้อมูล
|
||||
*/
|
||||
function onSubmit() {
|
||||
dialogConfirm($q, () => {
|
||||
showLoader();
|
||||
const formData = new FormData();
|
||||
const name = `รอบการเสนอขอพระราชทานเครื่องราชฯ รอบที่ ${
|
||||
roundInsig.value.value
|
||||
} ปี ${yearly.value + 543} `;
|
||||
formData.append("name", name);
|
||||
formData.append("year", yearly.value.toString());
|
||||
formData.append("amount", datelast.value ? datelast.value.toString() : "");
|
||||
formData.append("round", roundInsig.value.value);
|
||||
if (dateStart.value !== null) {
|
||||
formData.append("startDate", dateToISO(dateStart.value));
|
||||
}
|
||||
if (dateEnd.value !== null) {
|
||||
formData.append("endDate", dateToISO(dateEnd.value));
|
||||
}
|
||||
formData.append("file", files.value);
|
||||
const url =
|
||||
actionType.value !== "edit"
|
||||
? config.API.listRoundInsignia()
|
||||
: config.API.editRoundInsignia(roundId.value);
|
||||
|
||||
const httpMethod = actionType.value !== "edit" ? http.post : http.put;
|
||||
|
||||
httpMethod(url, formData)
|
||||
.then(async () => {
|
||||
await props.fetchList();
|
||||
onCloseDialog();
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function onCloseDialog() {
|
||||
modal.value = false;
|
||||
roundInsig.value = "";
|
||||
yearly.value = new Date().getFullYear();
|
||||
dateStart.value = null;
|
||||
dateEnd.value = null;
|
||||
datelast.value = null;
|
||||
files.value = null;
|
||||
fileDocDataUpload.value = [];
|
||||
}
|
||||
|
||||
watch(
|
||||
() => modal.value,
|
||||
() => {
|
||||
if (modal.value) {
|
||||
if (actionType.value !== "") {
|
||||
fetchData();
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
const classInput = (val: boolean) => {
|
||||
return {
|
||||
"full-width inputgreen cursor-pointer": val,
|
||||
"full-width cursor-pointer": !val,
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<q-dialog v-model="modal" persistent>
|
||||
<q-card style="width: 1200px; max-width: 80vw">
|
||||
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
||||
<DialogHeader :tittle="title" :close="onCloseDialog" />
|
||||
<q-separator />
|
||||
|
||||
<q-card-section>
|
||||
<div class="col-12 row q-col-gutter-md">
|
||||
<div class="col-md-10 col-xs-12">
|
||||
<q-select
|
||||
:class="classInput(!readonly)"
|
||||
:readonly="readonly"
|
||||
dense
|
||||
outlined
|
||||
v-model="roundInsig"
|
||||
:options="options"
|
||||
option-value="value"
|
||||
option-label="label"
|
||||
label="รอบการเสนอขอพระราชทานเครื่องราชฯ"
|
||||
@update:model-value="updateDateRange"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกรอบที่'}`]"
|
||||
hide-bottom-space
|
||||
lazy-rules
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-2 col-xs-12">
|
||||
<datepicker
|
||||
:class="classInput(!readonly)"
|
||||
:readonly="readonly"
|
||||
menu-class-name="modalfix"
|
||||
v-model="yearly"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
year-picker
|
||||
:enableTimePicker="false"
|
||||
@update:modelValue="updateYear"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
:class="classInput(!readonly)"
|
||||
:readonly="readonly"
|
||||
dense
|
||||
outlined
|
||||
hide-bottom-space
|
||||
:model-value="yearly + 543"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกปีที่เสนอ'}`]"
|
||||
:label="`${'ปีที่เสนอ'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-md-5 col-xs-12">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateStart"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
:class="classInput(!readonly)"
|
||||
:readonly="readonly"
|
||||
:max-date="dateEnd"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
<template #year-overlay-value="{ value }">
|
||||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
:class="classInput(!readonly)"
|
||||
:readonly="readonly"
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker"
|
||||
:model-value="
|
||||
dateStart != null ? date2Thai(dateStart) : null
|
||||
"
|
||||
:label="`${'วันเริ่มต้น'}`"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกวันเริ่มต้น'}`]"
|
||||
hide-bottom-space
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-md-5 col-xs-12">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateEnd"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
:class="classInput(!readonly)"
|
||||
:readonly="readonly"
|
||||
:min-date="dateStart"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
<template #year-overlay-value="{ value }">
|
||||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
class="col-xs-12 col-sm-4"
|
||||
:model-value="dateEnd != null ? date2Thai(dateEnd) : null"
|
||||
:label="`${'วันสิ้นสุด'}`"
|
||||
:rules="[
|
||||
(val) => !!val || `${'กรุณาเลือกวันที่วันสิ้นสุด'}`,
|
||||
]"
|
||||
:class="classInput(!readonly)"
|
||||
:readonly="readonly"
|
||||
hide-bottom-space
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-md-2 col-xs-12">
|
||||
<q-input
|
||||
:class="classInput(!readonly)"
|
||||
:readonly="readonly"
|
||||
dense
|
||||
outlined
|
||||
v-model="datelast"
|
||||
label="จำนวนวันแจ้งเตือนก่อนวันสิ้นสุด"
|
||||
mask="###"
|
||||
:rules="[
|
||||
(val) =>
|
||||
!!val || `${'กรุณากรอกจำนวนวันแจ้งเตือนก่อนวันสิ้นสุด'}`,
|
||||
]"
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-12 col-xs-12">
|
||||
<q-file
|
||||
:class="classInput(!readonly)"
|
||||
:readonly="readonly"
|
||||
outlined
|
||||
dense
|
||||
v-model="files"
|
||||
@added="fileUploadDoc"
|
||||
label="อัปโหลดเอกสารประกอบ"
|
||||
hide-bottom-space
|
||||
lazy-rules
|
||||
accept=".pdf,.xlsx,.doc"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
</q-file>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
|
||||
<q-separator />
|
||||
<q-card-actions align="right" v-if="actionType !== 'view'">
|
||||
<q-btn label="บันทึก" color="secondary" type="submit" />
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, useAttrs, onMounted } from "vue";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import router from "@/router";
|
||||
import { useQuasar } from "quasar";
|
||||
import config from "@/app.config";
|
||||
|
|
@ -12,10 +13,13 @@ import type {
|
|||
ColId,
|
||||
} from "@/modules/07_insignia/interface/request/Main";
|
||||
|
||||
import DialogDetail from "@/modules/07_insignia/components/1_Proposals/DialogDetail.vue";
|
||||
|
||||
/** import Store*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useInsigniaDataStore } from "@/modules/07_insignia/store";
|
||||
/** useStroe */
|
||||
|
||||
/** use */
|
||||
const storeInsignia = useInsigniaDataStore();
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
|
|
@ -114,7 +118,7 @@ async function fetchData() {
|
|||
e.period_end == null ? null : date2Thai(new Date(e.period_end)),
|
||||
period_isActive: e.period_isActive,
|
||||
period_doc: e.period_doc,
|
||||
period_status: e.period_status.result,
|
||||
period_status: e.period_status,
|
||||
statusRoyal: storeInsignia.convertStatus(e.period_status),
|
||||
}));
|
||||
})
|
||||
|
|
@ -140,9 +144,9 @@ function clickDelete(id: string) {
|
|||
showLoader();
|
||||
await http
|
||||
.delete(config.API.RoundInsignia(id))
|
||||
.then(() => {
|
||||
success($q, "ลบข้อมูลการเสนอขอสำเร็จ");
|
||||
fetchData();
|
||||
.then(async () => {
|
||||
await fetchData();
|
||||
await success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -207,6 +211,16 @@ const pagination = ref({
|
|||
onMounted(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
|
||||
const modalForm = ref<boolean>(false);
|
||||
const actionType = ref<string>("");
|
||||
const roundId = ref<string>("");
|
||||
|
||||
function onOpenFormDetail(action: string = "", id: string = "") {
|
||||
modalForm.value = true;
|
||||
actionType.value = action;
|
||||
roundId.value = id;
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
|
|
@ -217,8 +231,8 @@ onMounted(async () => {
|
|||
<div class="row col-12 q-col-gutter-sm">
|
||||
<div>
|
||||
<q-btn
|
||||
@click="clickAdd()"
|
||||
size="12px"
|
||||
v-if="checkPermission($route)?.attrIsCreate"
|
||||
@click="onOpenFormDetail()"
|
||||
flat
|
||||
round
|
||||
color="add"
|
||||
|
|
@ -288,28 +302,14 @@ onMounted(async () => {
|
|||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
<q-th auto-width />
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td>
|
||||
<!-- <q-icon
|
||||
v-if="props.row.period_isActive == true"
|
||||
name="mdi-close"
|
||||
color="grey-5"
|
||||
class="text-h5"
|
||||
@click="clickEdit(props.row)"
|
||||
/>
|
||||
<q-icon
|
||||
v-else
|
||||
name="mdi-check"
|
||||
color="positive"
|
||||
class="text-h5"
|
||||
@click="clickEdit(props.row)"
|
||||
/> -->
|
||||
<q-btn
|
||||
<q-tr :props="props">
|
||||
<q-td auto-width>
|
||||
<!-- <q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
|
|
@ -317,24 +317,41 @@ onMounted(async () => {
|
|||
icon="mdi-account-check"
|
||||
>
|
||||
<q-tooltip>ผู้ได้รับเครื่องราชฯ</q-tooltip>
|
||||
</q-btn>
|
||||
</q-btn> -->
|
||||
|
||||
<q-btn
|
||||
v-if="props.row.period_doc !== null"
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
dense
|
||||
type="a"
|
||||
size="12px"
|
||||
flat
|
||||
target="_blank"
|
||||
round
|
||||
color="light-blue-8"
|
||||
icon="mdi-file-download"
|
||||
:href="props.row.period_doc"
|
||||
color="info"
|
||||
@click="onOpenFormDetail('view', props.row.period_id)"
|
||||
icon="mdi-eye"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดเอกสารประกอบ </q-tooltip>
|
||||
<q-tooltip>รายละเอียด</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsGet &&
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
props.row.period_status !== 'DONE'
|
||||
"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
color="edit"
|
||||
@click="onOpenFormDetail('edit', props.row.period_id)"
|
||||
icon="edit"
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsDelete &&
|
||||
props.row.period_status !== 'DONE'
|
||||
"
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="red"
|
||||
|
|
@ -345,21 +362,42 @@ onMounted(async () => {
|
|||
</q-btn>
|
||||
</q-td>
|
||||
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.id"
|
||||
@click="clickEdit(props.row)"
|
||||
>
|
||||
<q-td v-for="col in props.cols" :key="col.id">
|
||||
<div>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
v-if="
|
||||
props.row.period_doc !== null &&
|
||||
checkPermission($route)?.attrIsGet
|
||||
"
|
||||
dense
|
||||
type="a"
|
||||
flat
|
||||
target="_blank"
|
||||
round
|
||||
color="light-blue-8"
|
||||
icon="mdi-file-download"
|
||||
:href="props.row.period_doc"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดเอกสารประกอบ </q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<DialogDetail
|
||||
v-model:modal="modalForm"
|
||||
:actionType="actionType"
|
||||
:roundId="roundId"
|
||||
:fetchList="fetchData"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scope>
|
||||
|
|
|
|||
|
|
@ -35,26 +35,26 @@ export default [
|
|||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/insignia/round/:id",
|
||||
name: "roundAddEdit",
|
||||
component: roundAdd,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: "SYS_INSIGNIA_ROUND",
|
||||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/insignia/round/add",
|
||||
name: "roundAdd",
|
||||
component: roundAdd,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: "SYS_INSIGNIA_ROUND",
|
||||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
// {
|
||||
// path: "/insignia/round/:id",
|
||||
// name: "roundAddEdit",
|
||||
// component: roundAdd,
|
||||
// meta: {
|
||||
// Auth: true,
|
||||
// Key: "SYS_INSIGNIA_ROUND",
|
||||
// Role: "STAFF",
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// path: "/insignia/round/add",
|
||||
// name: "roundAdd",
|
||||
// component: roundAdd,
|
||||
// meta: {
|
||||
// Auth: true,
|
||||
// Key: "SYS_INSIGNIA_ROUND",
|
||||
// Role: "STAFF",
|
||||
// },
|
||||
// },
|
||||
|
||||
{
|
||||
path: "/insignia/record",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue