แก้ space ขึ้นบรรทัดใหม่ เเก้คำ พ้นราชการ

This commit is contained in:
setthawutttty 2025-03-19 17:41:35 +07:00
parent 90ed596dec
commit b8f971e251
23 changed files with 377 additions and 170 deletions

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import { reactive, ref, watch } from "vue";
import { reactive, ref, watch, computed } from "vue";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
@ -18,13 +18,14 @@ const {
showLoader,
hideLoader,
dialogConfirm,
findOrgName,
findOrgChildName,
} = mixin;
const route = useRoute();
const retireld_params = route.params.id;
/** props*/
const props = defineProps({
employeeType: Boolean,
retireld: String,
profileId: String,
dataProfile: Object,
@ -34,12 +35,12 @@ const props = defineProps({
},
});
const modal = ref<boolean>(false);
const modal = defineModel<boolean>("modal", { required: true });
const retireld = ref<any>();
const type = ref<any>();
/** คอลัมน์ */
const columns = ref<any["columns"]>([
const columns = computed(() => [
{
name: "index",
required: true,
@ -57,14 +58,14 @@ const columns = ref<any["columns"]>([
{
name: "position",
required: true,
label: "ตำแหน่งในสายงาน",
label: props.employeeType ? "ตำแหน่งในสายงาน" : "ตำแหน่ง",
field: "position",
align: "left",
},
{
name: "level",
required: true,
label: "ประเภทตำแหน่ง",
label: props.employeeType ? "ตำแหน่งประเภท" : "กลุ่มงาน",
field: "level",
align: "left",
},
@ -78,42 +79,6 @@ const columns = ref<any["columns"]>([
]);
const rows = ref<PersonData[]>([]);
function findOrgChildName(obj: any) {
if (obj) {
let name =
obj.orgChild4Name != null && obj.orgChild3Name != null
? obj.orgChild4Name + " "
: obj.orgChild4Name != null
? obj.orgChild4Name
: "";
name +=
obj.orgChild3Name != null && obj.orgChild2Name != null
? obj.orgChild3Name + " "
: obj.orgChild3Name !== null
? obj.orgChild3Name
: "";
name +=
obj.orgChild2Name != null && obj.orgChild1Name != null
? obj.orgChild2Name + " "
: obj.orgChild2Name != null
? obj.orgChild2Name
: "";
name +=
obj.orgChild1Name != null && obj.orgRootName != null
? obj.orgChild1Name + " "
: obj.orgChild1Name != null
? obj.orgChild1Name
: "";
name += obj.orgRootName != null ? obj.orgRootName : "";
return name == "" ? "-" : name;
} else {
return "";
}
}
const formPagePersonList = reactive({ keyword: "", pageSize: 10, page: 1 });
const maxPage = ref<number>(1);
const totalList = ref<number>(0);
@ -251,11 +216,7 @@ watch(modal, () => {
</script>
<template>
<q-btn flat round color="primary" icon="mdi-plus" @click="modal = true">
<q-tooltip>เพมรายช</q-tooltip></q-btn
>
<q-dialog v-model="modal" Persistent>
<q-dialog v-model="modal" persistent>
<q-card style="width: 900px; max-width: 80vw">
<DialogHeader :tittle="'เพิ่มรายชื่อ'" :close="closeDialog" />
<q-separator />
@ -315,12 +276,10 @@ watch(modal, () => {
{{ props.row.position ? props.row.position : "-" }}
</q-td>
<q-td key="level" :props="props">{{ props.row.level }}</q-td>
<q-td
key="organizationOrganization"
:props="props"
class="table_ellipsis"
>
{{ props.row.organizationOrganization }}
<q-td key="organizationOrganization" :props="props">
<div class="text-html">
{{ props.row.organizationOrganization }}
</div>
</q-td>
<q-td>
<q-btn

View file

@ -64,7 +64,6 @@ function clickAdd() {
round: `รอบ ${e.round} (ประกาศ ณ วันที่ ${e.signDate})`,
}));
actionOption.value = list;
console.log("🚀 ~ clickAdd ~ actionOption.value:", actionOption.value);
}
}
}

View file

@ -31,11 +31,13 @@ const {
date2Thai,
dateToISO,
findOrgName,
findOrgNameHtml,
onSearchDataTable,
} = mixin;
const myForm = ref<QForm | null>(null);
/** ตัวแปร */
const modal = ref<boolean>(false);
const retireld_params = route.params.retirementId;
const retireld = ref<string>(retireld_params.toString());
const modalPersonal = ref<boolean>(false);
@ -54,7 +56,7 @@ const fileUpload = ref<any>(null);
const round = ref<number>();
const typeReport = ref<string>("");
const statusReport = ref<boolean>();
const dataProfile = ref<Object>([]);
const dataProfile = ref<any>([]);
/** คอลัมน์ที่แสดง */
const columns = computed(() => [
@ -75,6 +77,9 @@ const columns = computed(() => [
field: "name",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val: any, row: any) {
return `${row.prefix ?? ""}${row.firstName ?? ""} ${row.lastName ?? ""}`;
},
},
{
name: "position",
@ -92,8 +97,8 @@ const columns = computed(() => [
label: `ตำแหน่ง (${
employeeType.value == "OFFICER" ? "ประเภท" : "กลุ่มงาน"
})`,
title: "ตำแหน่ง",
subtitle: employeeType.value == "OFFICER" ? "ประเภท" : "กลุ่มงาน",
title: employeeType.value == "OFFICER" ? "ตำแหน่ง" : "กลุ่มงาน",
subtitle: employeeType.value == "OFFICER" ? "ประเภท" : "",
field: "positionType",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
@ -103,8 +108,8 @@ const columns = computed(() => [
name: "positionNumber",
align: "left",
label: "ตำแหน่ง (เลขที่)",
title: "ตำแหน่ง",
subtitle: "เลขที่",
title: employeeType.value == "OFFICER" ? "เลขที่" : "ตำแหน่ง",
subtitle: employeeType.value == "OFFICER" ? "ตำแหน่ง" : "เลขที่",
field: "positionNumber",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
@ -168,7 +173,6 @@ async function fetchlistprofile(id: string) {
prefix: e.prefix,
firstName: e.firstName,
lastName: e.lastName,
name: `${e.prefix}${e.firstName} ${e.lastName}`,
organization: e.root,
position: e.position,
positionNumber: e.posNo,
@ -452,18 +456,15 @@ onMounted(async () => {
<q-card class="col-12 q-pa-md">
<div class="row col-12 q-pb-sm">
<div class="row">
<AddList
:dataProfile="dataProfile"
:retireld="retireld"
:profile-id="profileId"
:UpdateListId="UpdateListId"
v-if="
!checkRoutePermisson &&
!statusReport &&
(typeReport == 'ADD' || typeReport == '' || typeReport == null) &&
!statusUpload
"
/>
<q-btn
flat
round
color="primary"
icon="mdi-plus"
@click="modal = true"
>
<q-tooltip>เพมรายช</q-tooltip></q-btn
>
<q-btn color="primary" flat round icon="mdi-dots-vertical">
<q-menu>
<q-list style="min-width: 100px">
@ -670,7 +671,10 @@ onMounted(async () => {
</q-td>
<q-td v-for="col in props.cols" :key="col.id">
<div class="table_ellipsis">
<div v-if="col.name == 'organization'" class="text-html">
{{ props.row ? findOrgNameHtml(props.row) : "-" }}
</div>
<div v-else class="table_ellipsis">
{{ col.value ? col.value : "-" }}
</div>
</q-td>
@ -845,11 +849,27 @@ onMounted(async () => {
:textReport="textReport"
/>
<AddList
v-model:modal="modal"
v-model:dataProfile="dataProfile"
:retireld="retireld"
:employeeType="employeeType == 'OFFICER' ? true : false"
:profile-id="profileId"
:UpdateListId="UpdateListId"
v-if="
!checkRoutePermisson &&
!statusReport &&
(typeReport == 'ADD' || typeReport == '' || typeReport == null) &&
!statusUpload
"
/>
<PopupPersonal
:modal="modalPersonal"
:id="personId"
@update:modal="updatemodalPersonal"
v-model:is-employee="employeeType"
:type="employeeType === 'OFFICER' ? 'officer' : 'employee'"
/>
</template>