Merge branch 'develop' into devTee

This commit is contained in:
setthawutttty 2025-01-08 14:59:18 +07:00
commit e3fed86699
18 changed files with 806 additions and 407 deletions

View file

@ -14,4 +14,46 @@ interface ResponseObject {
government: String;
}
export type { ResponseObject };
interface ResponesePosType {
createdAt: string;
id: string;
lastUpdateFullName: string;
lastUpdatedAt: string;
posTypeName: string;
posTypeRank: number;
posLevels: DataPosLevel[];
}
interface DataPosLevel {
createdAt: string;
id: string;
lastUpdateFullName: string;
lastUpdatedAt: string;
posLevelAuthority: string;
posLevelName: string;
posLevelRank: number;
}
interface ResponesePosition {
createdAt: string;
id: string;
isSpecial: boolean;
lastUpdateFullName: string;
lastUpdatedAt: string;
posLevelId: string;
posLevelName: string;
posTypeId: string;
posTypeName: string;
positionArea: string;
positionExecutiveField: null;
positionField: string;
positionIsSelected: boolean;
positionName: string;
}
export type {
ResponseObject,
ResponesePosType,
DataPosLevel,
ResponesePosition,
};

View file

@ -36,14 +36,16 @@ const number = ref<string>("");
const score_expired = ref<string>("");
const mixin = useCounterMixin();
const { messageError, showLoader, hideLoader } = mixin;
const examID = ref<string>("62150001");
const prefix = ref<string>("นาย");
const fullname = ref<string>("เกียรติศักดิ์ บัณฑิต");
const examID = ref<string>("");
const prefix = ref<string>("");
const fullname = ref<string>("");
const importId = ref<string>(route.params.id as string); // Period Import Id
const examId = ref<string>(route.params.examId as string); //
const isData = ref<boolean>(false);
/** ดึงข้อมูล */
async function fetchData() {
isData.value = false;
showLoader();
await http
.get(config.API.getExamDetail(importId.value, examId.value))
@ -76,6 +78,7 @@ async function fetchData() {
scoreSum.value = data.scoreResult.scoreSum;
examResultinscore.value = data.scoreResult.examResult;
}
isData.value = true;
}
})
.catch((e) => {
@ -147,7 +150,13 @@ onMounted(async () => {
รายละเอยดของผสมครสอบ {{ examID }} : {{ prefix }}{{ fullname }}
</div>
<q-card flat bordered class="col-12 row q-mt-sm q-pa-md">
<div class="row q-col-gutter-md col-12">
<div class="col-12" v-if="!isData">
<q-banner inline-actions rounded class="bg-warning text-center">
ไมพบรายละเอยดการสอบ
</q-banner>
</div>
<div class="row q-col-gutter-md col-12" v-else>
<div class="col-xs-12 col-sm-12 col-md-6">
<q-card bordered flat class="col-12 q-pa-md">
<div class="col-12 q-col-gutter-sm row items-center">

View file

@ -21,6 +21,11 @@ import type {
DataOption2,
UploadType,
} from "@/modules/02_organization/interface/index/Main";
import type {
ResponesePosType,
DataPosLevel,
ResponesePosition,
} from "@/modules/03_recruiting/interface/response/Main";
import ProfileTable from "@/modules/03_recruiting/components/Table1.vue";
@ -60,10 +65,6 @@ const dateAnnounce = ref<Date | null>(null); //วันประกาศผล
const dateExam = ref<Date | null>(null); //
const myFormPayment = ref<any>();
const myFormPosition = ref<any>();
const positionPathOptions = ref<DataOption2[]>([]);
const positionPathFilters = ref<DataOption2[]>([]);
const positionLevelOptions = ref<DataOption2[]>([]);
const positionLevelFilters = ref<DataOption2[]>([]);
const organizationShortName = ref<DataOption2>();
const organizationName = ref<DataOption2>();
const examTypeOptions = [
@ -142,12 +143,13 @@ const columnsPosition = ref<QTableProps["columns"]>([
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "position",
name: "highDegree",
align: "left",
label: "ตำแหน่ง",
label: "ประเภทตำแหน่ง",
sortable: true,
field: "position",
field: "highDegree",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
@ -165,16 +167,17 @@ const columnsPosition = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "highDegree",
name: "position",
align: "left",
label: "ประเภทตำแหน่ง",
label: "ตำแหน่ง",
sortable: true,
field: "highDegree",
field: "position",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "type",
align: "left",
@ -293,83 +296,38 @@ async function fetchData() {
});
}
/**
* get รายการ ตำแหนงในสายงาน
*/
async function fetchPositionPath() {
showLoader();
await http
.get(config.API.positionPath)
.then((res) => {
const data = res.data.result;
let option: DataOption2[] = [];
data.map((r: DataOption2) => {
option.push({
id: r.id.toString(),
name: r.name.toString(),
});
});
positionPathOptions.value = option;
positionPathFilters.value = option;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
/**
* get รายการ ตำแหนงระด
*/
async function fetchPositionLevel() {
showLoader();
await http
.get(config.API.positionLevel)
.then((res) => {
const data = res.data.result;
let option: DataOption2[] = [];
data.map((r: DataOption2) => {
option.push({
id: r.id.toString(),
name: r.name.toString(),
level: r.level,
});
});
positionLevelOptions.value = option.filter(
(v: DataOption2) => v.level === 0
);
positionLevelFilters.value = option.filter(
(v: DataOption2) => v.level === 0
);
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
/**
* งช filter
* @param val input
* @param update Function #quasar
* @param refData เเยก case
*/
function filterSelector(val: any, update: Function, refData: string) {
function filterSelector(val: string, update: Function, refData: string) {
switch (refData) {
case "positionLevel":
case "positionLevel1":
update(() => {
positionLevelOptions.value = positionLevelFilters.value.filter(
optionPosLevel1.value = filterOptionPosLevel1.value.filter(
(v: DataOption2) => v.name.indexOf(val) > -1
);
});
break;
case "position":
case "positionLevel2":
update(() => {
positionPathOptions.value = positionPathFilters.value.filter(
optionPosLevel2.value = filterOptionPosLevel2.value.filter(
(v: DataOption2) => v.name.indexOf(val) > -1
);
});
break;
case "position1":
update(() => {
optionPosType1.value = filterOptionPosType1.value.filter(
(v: DataOption2) => v.name.indexOf(val) > -1
);
});
break;
case "position2":
update(() => {
optionPosType2.value = filterOptionPosType2.value.filter(
(v: DataOption2) => v.name.indexOf(val) > -1
);
});
@ -495,16 +453,16 @@ async function editData(id: string) {
showLoader();
await http
.put(config.API.periodExamId(id), sendData())
.then(async (res) => {
success($q, "แก้ไขรอบคัดเลือกสำเร็จ");
.then(async () => {
await uploadImgData();
await uploadDocData();
success($q, "แก้ไขรอบคัดเลือกสำเร็จ");
await clickBack();
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
.finally(() => {
hideLoader();
});
}
@ -656,7 +614,7 @@ function clickAddPosition() {
position: null,
type: { id: "normol", name: "ทั่วไป" },
code: null,
highDegree: "0",
highDegree: "",
});
}
});
@ -704,6 +662,97 @@ function clearDateAnnounce() {
dateAnnounce.value = null;
}
const mainDataPosLevel = ref<ResponesePosType[]>([]); //
const optionPosLevel1 = ref<DataOption2[]>([]); //
const filterOptionPosLevel1 = ref<DataOption2[]>([]); //
const optionPosLevel2 = ref<DataOption2[]>([]); //
const filterOptionPosLevel2 = ref<DataOption2[]>([]); //
const optionPosType1 = ref<DataOption2[]>([]); //
const filterOptionPosType1 = ref<DataOption2[]>([]); //
const optionPosType2 = ref<DataOption2[]>([]); //
const filterOptionPosType2 = ref<DataOption2[]>([]); //
/** ฟังก์ชันเรียกข้อมูล ประเภทตำแหน่ง*/
async function fetchPositionType() {
http
.get(config.API.orgPosType)
.then((res) => {
mainDataPosLevel.value = res.data.result.filter(
(e: ResponesePosType) => e.posTypeRank <= 2
);
const getDataByRank = (rank: number) => {
const data =
res.data.result.find((e: ResponesePosType) => e.posTypeRank === rank)
?.posLevels || [];
return data
.filter((e: DataPosLevel) => e.posLevelRank === 1)
.map((e: DataPosLevel) => ({
id: e.id.toString(),
name: e.posLevelName.toString(),
level: e.posLevelRank,
}));
};
optionPosLevel1.value = getDataByRank(1);
filterOptionPosLevel1.value = getDataByRank(1);
optionPosLevel2.value = getDataByRank(2);
filterOptionPosLevel2.value = getDataByRank(2);
fetchPosition(1);
fetchPosition(2);
})
.catch((err) => {
messageError($q, err);
});
}
/**
* งกนเรยกขอมลตำแหน
* @param level ระดบของประเภทตำแหน
*/
function fetchPosition(level: number) {
http
.post(config.API.orgPosTypeSearch, {
posType:
mainDataPosLevel.value?.find(
(e: ResponesePosType) => e.posTypeRank === level
)?.id ?? null,
posLevel:
level === 1 ? optionPosLevel1.value[0].id : optionPosLevel2.value[0].id,
})
.then((res) => {
const option: DataOption2[] = res.data.result.map(
(r: ResponesePosition) => ({
id: r.id.toString(),
name: r.positionName.toString(),
})
);
if (level === 1) {
optionPosType1.value = option;
filterOptionPosType1.value = option;
} else if (level === 2) {
optionPosType2.value = option;
filterOptionPosType2.value = option;
}
})
.catch((err) => {
messageError($q, err);
});
}
/**
* งกนเปลยนประเภทตำแหน
* @param val าประเภทตำแหน 0 = ประเภททวไป ,1 = ประเภทวชาการ
* @param index ตำแหนงของขอม
*/
function onUpdateHighDegree(val: string, index: string) {
rowsPosition.value[index].position = null;
rowsPosition.value[index].level =
val === "0" ? optionPosLevel1.value[0] : optionPosLevel2.value[0];
}
watch(fee, () => {
if (fee.value <= 0) {
pay.value = "";
@ -720,8 +769,7 @@ onMounted(async () => {
pay.value = "";
edit.value = false;
}
await fetchPositionPath();
await fetchPositionLevel();
await fetchPositionType();
});
</script>
@ -1093,82 +1141,7 @@ onMounted(async () => {
mask="###"
/>
</q-td>
<q-td key="position" :props="props">
<selector
class=""
outlined
:readonly="checkRoutePermisson"
use-input
v-model="props.row.position"
:options="positionPathOptions"
option-value="id"
option-label="name"
input-debounce="0"
dense
hide-bottom-space
lazy-rules
:rules="[(val:any) => !!val || `${'กรุณาเลือกตำแหน่ง'}`]"
@filter="(inputValue:any,
doneFn:Function) => filterSelector(inputValue, doneFn,'position'
) "
>
<template v-slot:option="scope">
<q-item v-bind="scope.itemProps">
<q-item-section>
<q-item-label>{{ scope.opt.name }}</q-item-label>
</q-item-section>
</q-item>
</template>
<template v-slot:selected-item="scope">
ตำแหน:
<q-chip
dense
square
class="q-my-none q-ml-xs q-mr-none"
>
{{ scope.opt.name }}
</q-chip>
</template>
</selector>
</q-td>
<q-td key="level" :props="props">
<selector
class=""
outlined
use-input
v-model="props.row.level"
:readonly="checkRoutePermisson"
:options="positionLevelOptions"
option-value="id"
option-label="name"
input-debounce="0"
dense
hide-bottom-space
lazy-rules
:rules="[(val:any) => !!val || `${'กรุณาเลือกระดับ'}`]"
@filter="(inputValue:any,
doneFn:Function) => filterSelector(inputValue, doneFn,'positionLevel'
) "
>
<template v-slot:option="scope">
<q-item v-bind="scope.itemProps">
<q-item-section>
<q-item-label>{{ scope.opt.name }}</q-item-label>
</q-item-section>
</q-item>
</template>
<template v-slot:selected-item="scope">
ระด:
<q-chip
dense
square
class="q-my-none q-ml-xs q-mr-none"
>
{{ scope.opt.name }}
</q-chip>
</template>
</selector>
</q-td>
<q-td key="highDegree" :props="props">
<q-radio
v-model="props.row.highDegree"
@ -1176,6 +1149,12 @@ onMounted(async () => {
color="teal"
:disable="checkRoutePermisson"
val="0"
@update:model-value="
onUpdateHighDegree(
props.row.highDegree,
props.rowIndex
)
"
/>
<q-radio
v-model="props.row.highDegree"
@ -1183,8 +1162,82 @@ onMounted(async () => {
color="teal"
:disable="checkRoutePermisson"
val="1"
@update:model-value="
onUpdateHighDegree(
props.row.highDegree,
props.rowIndex
)
"
/>
</q-td>
<q-td key="level" :props="props">
<selector
:disable="props.row.highDegree === ''"
class=""
outlined
use-input
v-model="props.row.level"
:readonly="checkRoutePermisson"
:options="
props.row.highDegree === '0'
? optionPosLevel1
: optionPosLevel2
"
option-value="id"
option-label="name"
input-debounce="0"
dense
hide-bottom-space
lazy-rules
:rules="[(val:any) => !!val || `${'กรุณาเลือกระดับ'}`]"
@filter="(inputValue:string,
doneFn:Function) => filterSelector(inputValue, doneFn, props.row.highDegree === '0' ? 'positionLevel1':'positionLevel2'
) "
>
<template v-slot:option="scope">
<q-item v-bind="scope.itemProps">
<q-item-section>
<q-item-label>{{ scope.opt.name }}</q-item-label>
</q-item-section>
</q-item>
</template>
</selector>
</q-td>
<q-td key="position" :props="props">
<selector
:disable="props.row.highDegree === ''"
class=""
outlined
:readonly="checkRoutePermisson"
use-input
v-model="props.row.position"
:options="
props.row.highDegree === '0'
? optionPosType1
: optionPosType2
"
option-value="id"
option-label="name"
input-debounce="0"
dense
hide-bottom-space
lazy-rules
:rules="[(val:any) => !!val || `${'กรุณาเลือกตำแหน่ง'}`]"
@filter="(inputValue:string,
doneFn:Function) => filterSelector(inputValue, doneFn, props.row.highDegree === '0' ? 'position1' :'position2'
) "
>
<template v-slot:option="scope">
<q-item v-bind="scope.itemProps">
<q-item-section>
<q-item-label>{{ scope.opt.name }}</q-item-label>
</q-item-section>
</q-item>
</template>
</selector>
</q-td>
<q-td key="type" :props="props">
<selector
class=""

View file

@ -792,8 +792,13 @@ onMounted(async () => {
>
<q-tooltip>เพมขอม</q-tooltip></q-btn
>
<q-btn
v-if="isLeave == false && checkPermission($route)?.attrIsUpdate"
v-if="
isLeave == false &&
checkPermission($route)?.attrIsUpdate &&
empType === ''
"
round
flat
dense

View file

@ -6,6 +6,7 @@ import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useOrganizational } from "@/modules/02_organization/store/organizational";
import { useRoute } from "vue-router";
/** importType*/
import type { QTableProps } from "quasar";
@ -18,6 +19,7 @@ import DialogHeader from "@/components/DialogHeader.vue";
/** use*/
const $q = useQuasar();
const route = useRoute();
const store = useOrganizational();
const {
dialogConfirm,
@ -34,21 +36,12 @@ const modal = defineModel<boolean>("modal", { required: true });
const props = defineProps({
dataSort: Array as PropType<ResponseObject[]>,
});
const profileId = ref<string>(route.params.id.toString()); //id profile
/** ข้อมูล Table*/
const rows = ref<ResponseObject[]>([]);
const selected = ref<any[]>([]);
const columns = ref<QTableProps["columns"]>([
{
name: "no",
align: "left",
label: "ลำดับ",
sortable: true,
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "educationLevel",
align: "left",
@ -234,16 +227,42 @@ const columns = ref<QTableProps["columns"]>([
*/
function onDrop(from: number, to: number) {
rows.value.splice(to, 0, rows.value.splice(from, 1)[0]);
selected.value.push(rows.value[0]);
}
/** function บันทึกการจัดลำดับ*/
function onSubmit() {
dialogConfirm($q, () => {});
dialogConfirm($q, async () => {
showLoader();
const body = rows.value.map((e: any) => ({
id: e.id,
isUse: selected.value.some((i: any) => i.id === e.id),
}));
await http
.put(config.API.profileNewEducationSort("") + `/${profileId.value}`, {
data: body,
})
.then(async () => {
await success($q, "บันทึกข้อมูลสำเร็จ");
modal.value = false;
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
});
}
watch(modal, async () => {
if (modal.value && props.dataSort) {
rows.value = props.dataSort;
selected.value.push(rows.value[0]);
} else {
selected.value = [];
rows.value = [];
}
});
</script>
@ -252,7 +271,7 @@ watch(modal, async () => {
<q-dialog v-model="modal" persistent>
<q-card style="min-width: 80vw">
<DialogHeader
:tittle="`จัดลำดับการแสดง`"
:tittle="`จัดลำดับการแสดงผล`"
:close="() => (modal = false)"
/>
<q-separator />
@ -277,26 +296,34 @@ watch(modal, async () => {
hide-bottom
hide-pagination
hide-header
selection="multiple"
v-model:selected="selected"
>
<template v-slot:header-selection="scope">
<q-checkbox
keep-color
color="primary"
dense
v-model="scope.checkBox"
/>
</template>
<template v-slot:body="props">
<q-tr :props="props">
<q-td>
<q-checkbox
:disable="props.rowIndex === 0"
keep-color
color="primary"
dense
v-model="props.selected"
/>
</q-td>
<q-td
v-for="col in props.cols"
:key="col.id"
:class="props.rowIndex === 0 ? 'text-primary' : ''"
>
<div v-if="col.name === 'no'">
{{
props.rowIndex === 0
? "วุฒิในตำแหน่ง"
: props.rowIndex === 1
? "ลำดับที่ 2"
: props.rowIndex === 2
? "ลำดับที่ 3"
: ""
}}
</div>
<div v-else>
<div>
{{
col.value === "" || col.value === null ? "-" : col.value
}}

View file

@ -176,7 +176,7 @@ onMounted(async () => {
<q-card flat class="q-pa-sm">
<div class="row q-col-gutter-sm">
<div class="col-12">
<div class="row">
<div class="row q-col-gutter-sm">
<div class="q-px-sm">
<q-btn
v-if="checkPermission($route)?.attrIsUpdate"

View file

@ -369,7 +369,7 @@ function clickAdd(data: any) {
})
.finally(() => {});
},
"ยนยันการเพิ่มข้อมูล",
"ยนยันการเพิ่มข้อมูล",
"ต้องการเพิ่มข้อมูลนี้หรือไม่ ?"
);
}

View file

@ -1,12 +1,19 @@
divdivdivdiv
<script setup lang="ts">
import { computed, ref, watch } from "vue";
import { computed, reactive, ref, watch } from "vue";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
import type { OptionPeriod } from "@/modules/07_insignia/interface/index/Main";
import type { QTableProps } from "quasar";
import type {
OptionPeriod,
OptionData,
} from "@/modules/07_insignia/interface/index/Main";
import type { FormQuery } from "@/modules/07_insignia/interface/request/Main";
import type { ResponsePosition } from "@/modules/07_insignia/interface/response/Main";
import DialogHeader from "@/components/DialogHeader.vue";
@ -59,12 +66,10 @@ const options = ref<OptionPeriod[]>([
{ label: "รอบการเสนอขอพระราชทานเครื่องราชฯ รอบที่ 2", value: 2 },
]);
/**
* Function เรยกขอมลของรอบการเสนอขอ
*/
function fetchData() {
/** Function เรียกข้อมูลของรอบการเสนอขอ*/
async function fetchData() {
showLoader();
http
await http
.get(config.API.getRoundInsignia(roundId.value))
.then(async (res) => {
const data = await res.data.result;
@ -88,9 +93,7 @@ function fetchData() {
});
}
/**
* Function พเดทวนทเรมต และ นส
*/
/** Function อัพเดทวันที่เริ่มต้น และ สิ้นสุด*/
function updateDateRange() {
if (roundInsig.value.value == 1) {
dateStart.value = new Date(yearly.value, 9, 1);
@ -120,12 +123,11 @@ function fileUploadDoc(files: any) {
});
}
/**
* Function นทกขอม
*/
/** Function บันทึกข้อมูล*/
function onSubmit() {
dialogConfirm($q, async () => {
showLoader();
const newEmpPosId = selected.value.map((e) => e.id);
const formData = new FormData();
const name = `รอบการเสนอขอพระราชทานเครื่องราชฯ รอบที่ ${
roundInsig.value.value
@ -134,6 +136,7 @@ function onSubmit() {
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));
}
@ -141,6 +144,7 @@ function onSubmit() {
formData.append("endDate", dateToISO(dateEnd.value));
}
formData.append("file", files.value);
formData.append("empPosId", JSON.stringify(newEmpPosId));
const url =
actionType.value !== "edit"
? config.API.listRoundInsignia()
@ -165,7 +169,6 @@ function onSubmit() {
/**
* function popup รอบการเสนอขอพระราชทานเครองราชอสรยาภรณ
*
* และกำหนดตวแปรเปนค Defult
*/
function onCloseDialog() {
@ -191,17 +194,95 @@ function classInput(val: boolean) {
};
}
//
const optionFilter = ref<OptionData[]>([
{ id: "positionName", name: "ชื่อตำแหน่ง" },
{ id: "positionType", name: "กลุ่มงาน" },
{ id: "positionLevel", name: "ระดับชั้นงาน" },
]);
const formQuery = reactive<FormQuery>({
keyword: "",
type: "positionName",
});
const rows = ref<ResponsePosition[]>([]);
const selected = ref<ResponsePosition[]>([]); //
const columns = ref<QTableProps["columns"]>([
{
name: "posDictName",
align: "left",
label: "ชื่อตำแหน่ง",
sortable: true,
field: "posDictName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "posTypeName",
align: "left",
label: "กลุ่มงาน",
sortable: true,
field: "posTypeName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "posLevelName",
align: "left",
label: "ระดับชั้นงาน",
sortable: true,
field: "posLevelName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const visibleColumns = ref<string[]>([
"posDictName",
"posTypeName",
"posLevelName",
]);
const pagination = ref({
sortBy: "desc",
descending: false,
page: 1,
rowsPerPage: 10,
});
/**
* ทำงานเม modal เป true actionType เป view
*
*
* งกนดงขอมลรายการตำแหนงจาก API
* @param statusType สถานะการสงประเภทคนหา (true = ไมงประเภทคนหา)
* เกบขอมลรายการตำแหนงจากไวใน rows.value
*/
async function fetchDataPos(statusType: boolean = false) {
rows.value = [];
showLoader();
await http
.get(
config.API.orgEmployeePos +
`?keyword=${formQuery.keyword}&type=${statusType ? "" : formQuery.type}`
)
.then(async (res) => {
rows.value = await res.data.result;
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
/** ทำงานเมื่อ modal เป็น true actionType เป็น view*/
watch(
() => modal.value,
() => {
async () => {
if (modal.value) {
await fetchDataPos(true);
selected.value = [];
formQuery.keyword = "";
formQuery.type = "positionName";
if (actionType.value !== "") {
fetchData();
await fetchData();
}
}
}
@ -210,192 +291,334 @@ watch(
<template>
<q-dialog v-model="modal" persistent>
<q-card style="width: 1200px; max-width: 80vw">
<q-card style="min-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:string) => !!val || `${'กรุณาเลือกรอบที่'}`]"
hide-bottom-space
lazy-rules
/>
<q-card-section style="padding: 0px">
<div class="col-12 row">
<div class="col-xs-12 col-md-5 row no-wrap">
<div class="col-12">
<div class="col-12 row q-col-gutter-md q-pa-md">
<div class="col-md-9 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:string) => !!val || `${'กรุณาเลือกรอบที่'}`]"
hide-bottom-space
lazy-rules
/>
</div>
<div class="col-md-3 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:string) => !!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-4 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
:model-value="
dateStart != null ? date2Thai(dateStart) : null
"
:label="`${'วันเริ่มต้น'}`"
:rules="[(val:string) => !!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-4 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:string) => !!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-4 col-xs-12">
<q-input
:class="classInput(!readonly)"
:readonly="readonly"
dense
outlined
v-model="datelast"
label="จำนวนวันแจ้งเตือนก่อนวันสิ้นสุด"
mask="###"
:rules="[
(val:string) =>
!!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>
</div>
<div class="col-12 row">
<q-separator :vertical="!$q.screen.lt.md" />
</div>
</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:string) => !!val || `${'กรุณาเลือกปีที่เสนอ'}`]"
:label="`${'ปีที่เสนอ'}`"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
<div class="col-xs-12 col-md-7 row">
<div class="col-12">
<div class="row col-12 q-col-gutter-sm q-pa-md">
<div class="row col-12 q-col-gutter-sm">
<div class="row q-col-gutter-sm align-items-center">
<div class="col-auto">
<q-select
label="ค้นหาจาก"
v-model="formQuery.type"
:options="optionFilter"
emit-value
dense
map-options
outlined
option-label="name"
option-value="id"
/>
</div>
<div class="col">
<q-input
ref="searchRef"
v-model="formQuery.keyword"
outlined
dense
lazy-rules
label="คำค้น"
hide-bottom-space
@keydown.enter="fetchDataPos()"
>
<template v-slot:append>
<q-icon
v-if="formQuery.keyword"
name="cancel"
@click="formQuery.keyword = ''"
class="cursor-pointer"
></q-icon>
</template>
</q-input>
</div>
<div class="col-auto">
<q-btn
outline
color="primary"
icon="search"
label="ค้นหา"
class="full-width full-height"
@click="fetchDataPos()"
/>
</div>
</div>
<q-space />
<div class="row q-col-gutter-sm align-items-center">
<div class="col-auto">
<q-select
v-model="visibleColumns"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
style="min-width: 140px"
/>
</div>
</div>
</div>
<div class="col-12">
<q-card
bordered
:class="
pagination.rowsPerPage > 10 ? 'col-12 scroll' : 'col-12'
"
:style="pagination.rowsPerPage > 10 ? 'height: 75vh' : ''"
>
<d-table
:columns="columns"
:rows="rows"
row-key="id"
flat
bordered
:paging="true"
dense
:visible-columns="visibleColumns"
selection="multiple"
v-model:selected="selected"
v-model:pagination="pagination"
>
</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
:model-value="
dateStart != null ? date2Thai(dateStart) : null
"
:label="`${'วันเริ่มต้น'}`"
:rules="[(val:string) => !!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:string) => !!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:string) =>
!!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>
<template v-slot:header-selection="scope">
<q-checkbox
keep-color
color="primary"
dense
v-model="scope.selected"
/>
</template>
<template v-slot:body="props">
<q-tr :props="props">
<q-td auto-width>
<q-checkbox
keep-color
color="primary"
dense
v-model="props.selected"
/>
</q-td>
<q-td
v-for="col in props.cols"
:key="col.name"
:props="props"
>
<div>
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>
</template>
</d-table>
</q-card>
</div>
</div>
</div>
</div>
</div>
</q-card-section>

View file

@ -45,9 +45,7 @@ const {
onSearchDataTable,
} = mixin;
/**
* props
*/
/** props*/
const props = defineProps({
tab: {
type: String,
@ -426,9 +424,9 @@ async function addlistperson(id: string) {
};
await http
.post(config.API.insigniaCreate(), data)
.then(() => {
.then(async () => {
if (props.fecthInsigniaByOc) {
props.fecthInsigniaByOc(
await props.fecthInsigniaByOc(
props.roundId,
organization.value,
"officer",
@ -440,6 +438,8 @@ async function addlistperson(id: string) {
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
@ -577,7 +577,7 @@ async function listreject(profileId: string, reason: string) {
props.tab
);
success($q, "ย้ายข้อมูลสำเร็จ");
success($q, "บันทึกข้อมูลสำเร็จ");
modelPopupReject.value = false;
})
.catch((err) => {
@ -633,7 +633,7 @@ async function listdelete(id: string, reason: string) {
"officer",
props.tab
);
success($q, "บข้อมูลสำเร็จ");
success($q, "ันทึกข้อมูลสำเร็จ");
closemodelPopupDelete();
})
.catch((err) => {
@ -856,7 +856,8 @@ function onClickViewInfo(type: string, id: string, empClass: string) {
infoType.value = type;
profileId.value = id;
modalDialogInfo.value = true;
employeeClass.value = empClass === "officer" ? "" : "-employee";
employeeClass.value =
empClass.toLocaleLowerCase() === "officer" ? "" : "-employee";
}
/** Hook*/

View file

@ -187,10 +187,6 @@ function updatemodalPersonal(modal: boolean) {
/** filter table*/
const filterKeyword = ref<string>("");
const filterRef = ref<any>(null);
const resetFilter = () => {
filterKeyword.value = "";
filterRef.value.focus();
};
const pagination = ref({
sortBy: "name",
descending: false,

View file

@ -31,10 +31,16 @@ interface CheckboxData {
name: string;
val: boolean;
}
interface FormQuery {
type: string;
keyword: string;
}
export type {
FormProprsalsRound,
FormProprsalsRound2,
ItemType,
ColId,
CheckboxData,
FormQuery,
};

View file

@ -155,6 +155,16 @@ interface ResponseDataInsignia {
items: ResponseManageList[];
}
interface ResponsePosition {
id: string;
posDictName: string;
posLevelId: string;
posLevelName: number;
posTypeId: string;
posTypeName: string;
posTypeShortName: string;
}
export type {
ResponseObject,
ResponsePeriod,
@ -166,4 +176,5 @@ export type {
ResponseProfile,
ResponseManageList,
ResponseDataInsignia,
ResponsePosition,
};

View file

@ -93,7 +93,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
insigniaLevel: e.level ? e.level : "",
dateSend: e.requestDate ? date2Thai(e.requestDate) : null,
requestNote: e.requestNote ? e.requestNote : "",
employeeType: profileType(e.profileType) || null,
employeeType: profileType(e.profileType.toLocaleLowerCase()) || null,
employeeClass: e.profileType,
reason: e.reason ? e.reason : "",
markDiscipline: e.markDiscipline,

View file

@ -315,7 +315,7 @@ async function fetchDataSigner() {
nameOfWork.value = data.subjectDoc2;
nameOfOwner.value = data.authorDoc2;
position.value = data.assignedPosition;
evaluationResult.value = data.evaluationResult
evaluationResult.value = data.evaluationResult;
}
})
.catch((e) => {
@ -986,7 +986,17 @@ onMounted(async () => {
/>
</div>
</div>
<div v-if="evaluationResult !== 'PENDING'" align="right" :class="evaluationResult == 'PASS' ? `full-width text-green`:`full-width text-orange` ">ผลการพิจารณา : {{ evaluationResult == 'PASS' ? 'ผ่าน':'ไม่ผ่าน' }}</div>
<div v-if="evaluationResult !== 'PENDING'" align="right" class="full-width">
ผลการประเม:
<span
:class="
evaluationResult == 'PASS'
? `full-width text-green`
: `full-width text-red`
"
>{{ evaluationResult == "PASS" ? "ผ่าน" : "ไม่ผ่าน" }}</span
>
</div>
</div>
<q-dialog v-model="modalConfirm" persistent>

View file

@ -5,6 +5,7 @@ import { useRouter } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
import { checkPermissionGet } from "@/utils/permissions";
import avatarMain from "@/assets/avatar_user.jpg";
/**
* importCOmponents
@ -43,22 +44,28 @@ const props = defineProps({
const avatar = ref<string>("");
const fullName = ref<string>("");
const position = ref<string>("");
const isSkeleton = ref<boolean>(false);
/** function เรียกข้อมูลส่วนตัว*/
function fetchInformation() {
isSkeleton.value = false;
http
.get(config.API.orgProfileById(profileId.value, props.employeeClass))
.then(async (res) => {
const data = res.data.result;
fullName.value = `${data.prefix}${data.firstName} ${data.lastName}`;
position.value = data.position;
if (data.avatarName) {
await fetchProfile(data.id as string, data.avatarName);
} else {
avatar.value = avatarMain;
}
})
.catch((err) => {
messageError($q, err);
isSkeleton.value = true;
});
}
@ -117,12 +124,14 @@ watch(
style="object-fit: cover"
/>
<img
v-else
src="@/assets/avatar_user.jpg"
class="bg-grey-3"
style="object-fit: cover"
/>
</q-avatar>
</div>
<div
class="q-mt-md text-subtitle2 text-bold"
style="font-size: 18px"

View file

@ -392,7 +392,7 @@ onMounted(async () => {
</q-card>
</div>
<div class="col-6" v-if="isAttachment || store.dataCommand">
<div class="col-6" v-if="isAttachment">
<q-card
bordered
class="row col-12"