Merge branch 'develop' into devTee

This commit is contained in:
setthawutttty 2025-04-21 10:01:05 +07:00
commit 275b0b183b
9 changed files with 252 additions and 129 deletions

View file

@ -162,41 +162,6 @@ function addNewImage() {
inputImage.value.click();
}
/**
* งกนตรวจสอบเลขบตรประจำตวประชาชน
* @param value เลขบตรประจำตวประชาชน
*/
async function changeCardID(value: string | number | null) {
if (value != null && typeof value == "string") {
if (value.length == 13 && value != defaultCitizenData.value) {
await checkCitizen(value);
}
}
}
/**
* งกนย API ตรวจสอบเลขบตรประจำตวประชาชนซ
* @param value เลขบตรประจำตวประชาชน
*/
async function checkCitizen(id: string) {
showLoader();
await http
.put(config.API.profileNewCitizenId(id), {
citizenId: id,
})
.then(() => {})
.catch((err) => {
if (err.response.data.status === 500) {
dialogMessageNotify($q, err.response.data.message);
} else {
messageError($q, err);
}
})
.finally(() => {
hideLoader();
});
}
/**
* งกนคนหาขอมลในรายการตวเลอก
* @param val คำคนหา
@ -465,7 +430,6 @@ onMounted(async () => {
maxlength="13"
hide-bottom-space
mask="#############"
@update:model-value="changeCardID"
/>
</div>
<div class="col-3">

View file

@ -119,7 +119,7 @@ async function fetchDataTree() {
}
function onSelectedNode(data: any) {
nodeId.value = data.orgTreeId;
nodeId.value = data.orgTreeDnaId;
nodeLevel.value = data.orgLevel;
org.value = data.orgName;
expandedModal.value = false;
@ -463,7 +463,7 @@ onMounted(async () => {
<template v-slot:default-header="prop">
<q-item
@click.stop="onSelectedNode(prop.node)"
:active="nodeId === prop.node.orgTreeId"
:active="nodeId === prop.node.orgTreeDnaId"
clickable
active-class="my-list-link text-primary text-weight-medium"
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"

View file

@ -14,6 +14,7 @@ import type { Directors } from "@/modules/12_evaluatePersonal/interface/response
/** importComponents*/
import DialogDirector from "@/modules/12_evaluatePersonal/components/Detail/viewTab2/DialogDirector.vue";
import DialogDuty from "@/modules/12_evaluatePersonal/components/Detail/viewTab2/DialogDuty.vue";
/**use*/
const $q = useQuasar();
@ -64,6 +65,15 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "duty",
align: "left",
label: "หน้าที่ของกรรมการ",
sortable: true,
field: "duty",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "email",
align: "left",
@ -180,6 +190,17 @@ async function getList() {
});
}
const directorData = ref<Director>(); //
const modalDuty = ref<boolean>(false); //Dailog
/**
* เป Dialog แกไขขอมลหนาทกรรมการ
* @param data อมลกรรมการทองการแกไขหนาท
*/
function onEditDuty(data: Director) {
directorData.value = data;
modalDuty.value = true;
}
/**
* ทำงานเม props.data การเปลยนแปลง
*/
@ -197,6 +218,7 @@ watch(
email: item.email == "" ? "-" : item.email,
position: item.position == "" ? "-" : item.position,
positionName: item.positionName == "-" ? "-" : item.positionName,
duty: !item.duty ? "-" : item.duty,
}));
}
}
@ -238,6 +260,7 @@ watch(
>
<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>
@ -245,12 +268,24 @@ watch(
</template>
<template v-slot:body="props">
<q-tr :props="props">
<q-td>
<q-btn
flat
round
denes
icon="edit"
color="edit"
@click.stop.pervent="onEditDuty(props.row)"
>
<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 }}
</div>
<div>
{{ col.value }}
<div v-else>
{{ col.value ?? "-" }}
</div>
</q-td>
</q-tr>
@ -272,6 +307,13 @@ watch(
:max-page="maxPage"
:selected-row="rows"
/>
<!-- แกไขหนาทของกรรมการ -->
<DialogDuty
v-model:modal="modalDuty"
:data="directorData"
:fetch-data="props.fetchData"
/>
</template>
<style scoped></style>

View file

@ -0,0 +1,91 @@
<script setup lang="ts">
import { ref, watch, type PropType } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
/** importType*/
import type { Director } from "@/modules/11_discipline/interface/request/Disciplinary";
/** importComponents*/
import DialogHeader from "@/components/DialogHeader.vue";
const $q = useQuasar();
const { dialogConfirm, showLoader, messageError, hideLoader, success } =
useCounterMixin();
/** props*/
const modal = defineModel<boolean>("modal", { required: true });
const props = defineProps({
data: {
type: Object as PropType<Director>,
},
fetchData: {
type: Function,
required: true,
},
});
const duty = ref<string>(""); //
/** ฟังก์ชันบันทึกข้อมูลหน้าที่ของกรรมการ*/
function onSubmit() {
dialogConfirm($q, async () => {
showLoader();
await http
.put(config.API.evaluateDirectorMain() + `/duty/${props?.data?.id}`, {
duty: duty.value,
})
.then(async () => {
await props.fetchData();
onCloseDialog();
success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
});
}
/** ฟังก์ชันปิด Doalog แก้ไขหน้าที่ของกรรมการ*/
function onCloseDialog() {
modal.value = !modal.value;
}
watch(modal, (val) => {
if (val) {
duty.value = props.data?.duty ?? "";
}
});
</script>
<template>
<q-dialog v-model="modal" persistent>
<q-card style="min-width: 40%">
<q-form greedy @submit.prevent @validation-success="onSubmit">
<DialogHeader tittle="แก้ไขหน้าที่ของกรรมการ" :close="onCloseDialog" />
<q-separator />
<q-card-section>
<q-input
class="inputgreen"
outlined
dense
v-model="duty"
label="หน้าที่ของกรรมการ"
/>
</q-card-section>
<q-separator />
<q-card-actions align="right">
<q-btn label="บันทึกข้อมูล" type="submit" color="public" />
</q-card-actions>
</q-form>
</q-card>
</q-dialog>
</template>

View file

@ -189,26 +189,53 @@ watch(
<q-separator />
<q-card-section class="scroll" style="max-height: 80vh">
<div class="q-gutter-y-sm">
<div class="row items-center q-gutter-x-sm q-pb-sm">
<q-select
class="inputgreen"
v-model="type"
label="เลื่อนขั้น"
dense
outlined
emit-value
map-options
option-label="name"
option-value="id"
:options="typeRangeOps"
:rules="[(val:string) => !!val || `${'กรุณาเลือก ขั้น'}`]"
lazy-rules
hide-bottom-space
@update:model-value="chengType()"
style="min-width: 140px"
/>
<q-space />
<div class="q-col-gutter-sm">
<div class="row q-col-gutter-sm jus">
<div class="col-3">
<q-select
class="inputgreen"
v-model="type"
label="เลื่อนขั้น"
dense
outlined
emit-value
map-options
option-label="name"
option-value="id"
:options="typeRangeOps"
:rules="[(val:string) => !!val || `${'กรุณาเลือก ขั้น'}`]"
lazy-rules
hide-bottom-space
@update:model-value="chengType()"
style="min-width: 140px"
/>
</div>
<div class="row col-9 items-center">
<q-checkbox
v-if="type === 'FULL'"
keep-color
label="สำรอง"
dense
v-model="isReserve"
/>
<q-input
v-if="type === 'NONE'"
outlined
dense
v-model="note"
label="หมายเหตุ"
type="textarea"
:class="inputEdit(isReadonly)"
/>
</div>
</div>
<div class="col-12">
<q-separator class="col-12" />
</div>
<div class="row justify-end q-col-gutter-sm">
<q-input
standout
dense
@ -237,20 +264,23 @@ watch(
/>
</div>
<div class="col-12">
<d-table
<div class="row justify-end">งหมด {{ rows.length }} รายการ</div>
<div class="col-12 q-mt-sm">
<q-table
class="custom-header-table"
ref="table"
:columns="columns"
:rows="rows"
row-key="id"
flat
bordered
:paging="true"
dense
:rows-per-page-options="[10, 25, 50, 100]"
hide-pagination
:visible-columns="visibleColumns"
selection="multiple"
v-model:selected="selectedData"
:pagination="{ page: 1, rowsPerPage: total }"
>
<template v-slot:header-selection="scope">
<q-checkbox
@ -311,27 +341,7 @@ watch(
</q-td>
</q-tr>
</template>
</d-table>
</div>
<div class="col-12">
<q-checkbox
v-if="type === 'FULL'"
keep-color
label="สำรอง"
dense
v-model="isReserve"
/>
<q-input
v-if="type === 'NONE'"
outlined
dense
v-model="note"
label="หมายเหตุ"
type="textarea"
:class="inputEdit(isReadonly)"
/>
</q-table>
</div>
</div>
</q-card-section>
@ -348,4 +358,31 @@ watch(
</q-dialog>
</template>
<style lang="scss" scoped></style>
<style lang="scss" scoped>
.custom-header-table {
height: auto;
.q-table tr:nth-child(odd) td {
background: white;
}
.q-table tr:nth-child(even) td {
background: #f8f8f8;
}
.q-table thead tr {
background: #ecebeb;
}
.q-table thead tr th {
position: sticky;
z-index: 1;
}
/* this will be the loading indicator */
.q-table thead tr:last-child th {
/* height of all previous header rows */
top: 48px;
}
.q-table thead tr:first-child th {
top: 0;
}
}
</style>

View file

@ -389,8 +389,8 @@ function onClickViewInfo(type: string, id: string) {
flat
round
dense
color="public"
icon="mdi-stairs-up"
color="green-6"
icon="mdi-swap-vertical-bold"
@click="onClickMoveLevelMulti"
>
<q-tooltip>เลอนข</q-tooltip>

View file

@ -675,6 +675,10 @@ onMounted(() => {
dense
class="custom-header-table"
hide-pagination
:pagination="{
page: 1,
rowsPerPage: 100,
}"
>
<template v-slot:header="props">
<q-tr :props="props">
@ -693,8 +697,8 @@ onMounted(() => {
"
round
flat
color="primary"
icon="mdi-pencil-outline"
color="edit"
icon="edit"
size="14px"
@click="onOpenDialog(props.row)"
>
@ -709,10 +713,19 @@ onMounted(() => {
>
{{ `- ${row.position}`
}}{{
row.posType !== null || row.posLevel !== null
? ` (${row.posType ? row.posType : ""}${
row.posLevel ? " " + row.posLevel : ""
})`
props.row.groupTarget === "OFFICER" &&
(row.posType || row.posLevel)
? ` (${
row.posType &&
(row.posType == "อำนวยการ" ||
row.posType == "บริหาร")
? row.posType
: ""
}${row.posLevel ? row.posLevel : ""})`
: row.posLevel
? ` (${row.posLevel})`
: row.posType
? ` (${row.posType})`
: ""
}}
</div>
@ -751,6 +764,10 @@ onMounted(() => {
dense
class="custom-header-table"
hide-pagination
:pagination="{
page: 1,
rowsPerPage: 100,
}"
>
<template v-slot:header="props">
<q-tr :props="props">
@ -769,8 +786,8 @@ onMounted(() => {
"
round
flat
color="primary"
icon="mdi-pencil-outline"
color="edit"
icon="edit"
size="14px"
@click="
() => {
@ -1100,13 +1117,6 @@ onMounted(() => {
option-value="name"
emit-value
map-options
:rules="[
(val:string) =>
!!val || `${formGroupTarget.groupTargetSub !== 'EMPLOYEE' &&
formGroupTarget.groupTargetSub !== 'EMPLOYEETEMP'
? 'กรุณาเลือกตำแหน่งประเภท'
: 'กรุณาเลือกกลุ่มงาน ' }`,
]"
input-class="text-red"
:label="
formGroupTarget.groupTargetSub !== 'EMPLOYEE' &&
@ -1141,13 +1151,6 @@ onMounted(() => {
? 'ระดับตำแหน่ง'
: 'ระดับชั้นงาน'
"
:rules="[
(val:string) =>
!!val || `${formGroupTarget.groupTargetSub !== 'EMPLOYEE' &&
formGroupTarget.groupTargetSub !== 'EMPLOYEETEMP'
? 'กรุณาเลือกระดับตำแหน่ง'
: 'กรุณาเลือกระดับชั้นงาน ' }`,
]"
clearable
/>
</div>
@ -1398,13 +1401,6 @@ onMounted(() => {
? 'ตำแหน่งประเภท'
: 'กลุ่มงาน'
"
:rules="[
(val:string) =>
!!val || `${formGroupTarget.groupTargetSub !== 'EMPLOYEE' &&
formGroupTarget.groupTargetSub !== 'EMPLOYEETEMP'
? 'กรุณาเลือกตำแหน่งประเภท'
: 'กรุณาเลือกกลุ่มงาน ' }`,
]"
clearable
@update:model-value="updatePosTypeName"
/>
@ -1432,13 +1428,6 @@ onMounted(() => {
"
hide-bottom-space
lazy-rules
:rules="[
(val:string) =>
!!val || `${formGroupTarget.groupTargetSub !== 'EMPLOYEE' &&
formGroupTarget.groupTargetSub !== 'EMPLOYEETEMP'
? 'กรุณาเลือกระดับตำแหน่ง'
: 'กรุณาเลือกระดับชั้นงาน ' }`,
]"
clearable
/>
</div>

View file

@ -123,7 +123,7 @@ async function fetchData() {
formMainProject.organizingTraining = data.org ? data.org : null;
dateOrder.value = data.dateOrder;
order.value = data.order;
rows.value = data.academic
rows.value = data.academic;
})
.catch((e) => {
messageError($q, e);
@ -229,7 +229,7 @@ onMounted(async () => {
หนวยงานทงก
</div>
<div class="col-12 col-sm-12 col-md-7">
<div class="col-12 col-sm-12 col-md-7 text-html">
{{ formMain.oc ?? "-" }}
</div>
</div>
@ -274,7 +274,7 @@ onMounted(async () => {
หนวยงานทบผดชอบ
</div>
<div class="col-12 col-sm-12 col-md-7">
<div class="col-12 col-sm-12 col-md-7 text-html">
{{ formMainProject.organizingTraining ?? "-" }}
</div>
</div>

View file

@ -231,7 +231,7 @@ onMounted(() => {
หนวยงานทงก
</div>
<div class="col-12 col-sm-12 col-md-7">
<div class="col-12 col-sm-12 col-md-7 text-html">
{{ formMain.oc ?? "-" }}
</div>
</div>
@ -276,7 +276,7 @@ onMounted(() => {
หนวยงานทบผดชอบ
</div>
<div class="col-12 col-sm-12 col-md-7">
<div class="col-12 col-sm-12 col-md-7 text-html">
{{ formMainProject.organizingTraining ?? "-" }}
</div>
</div>