fixing column บรรจุ แต่งตั้ง ย้าย

This commit is contained in:
Warunee Tamkoo 2024-05-24 14:58:40 +07:00
parent bb2d03e499
commit 9cde68ab4f
74 changed files with 620 additions and 626 deletions

View file

@ -7,7 +7,7 @@ import type { ResponseTitle } from "@/modules/05_placement/interface/response/Re
import type {
appointmentData,
ResponseData,
DataProfile
DataProfile,
} from "@/modules/05_placement/interface/response/AppointMent";
import type { QForm } from "quasar";
import http from "@/plugins/http";
@ -181,11 +181,8 @@ onMounted(async () => {
/>
รายละเอยดการปรบระดบชนงานลกจาง {{ title.fullname }}
</div>
<CardProfile
:data="dataProfile as DataProfile"
:type="'employee'"
/>
<CardProfile :data="dataProfile as DataProfile" :type="'employee'" />
<q-card bordered class="row col-12 text-dark q-mt-sm">
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
@ -284,9 +281,9 @@ onMounted(async () => {
:readonly="!edit"
:borderless="!edit"
v-model="positionTypeOld"
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งประเภท'}`]"
:rules="[(val) => !!val || `${'กรุณากรอกประเภทตำแหน่ง'}`]"
hide-bottom-space
:label="`${'ตำแหน่งประเภท'}`"
:label="`${'ประเภทตำแหน่ง'}`"
/>
</div>
</div>
@ -300,9 +297,9 @@ onMounted(async () => {
:readonly="!edit"
:borderless="!edit"
v-model="positionLevelOld"
:rules="[(val) => !!val || `${'กรุณากรอกระดับ'}`]"
:rules="[(val) => !!val || `${'กรุณากรอกระดับตำแหน่ง'}`]"
hide-bottom-space
:label="`${'ระดับ'}`"
:label="`${'ระดับตำแหน่ง'}`"
/>
</div>
</div>

View file

@ -15,7 +15,14 @@ const storeFn = useTransferDataStore();
const { statusText } = storeFn;
const mixin = useCounterMixin();
const { showLoader, success, messageError, dialogConfirm, hideLoader ,date2Thai} = mixin;
const {
showLoader,
success,
messageError,
dialogConfirm,
hideLoader,
date2Thai,
} = mixin;
const $q = useQuasar();
const selected = ref<[]>([]);
@ -73,7 +80,7 @@ const columns2 = ref<QTableProps["columns"]>([
{
name: "organizationName",
align: "left",
label: "หน่วยงานที่รับการแต่งตั้ง-เลื่อน-ย้าย",
label: "หน่วยงานที่รับปรับระดับชั้นงาน-ย้าย",
sortable: true,
field: "organizationName",
headerStyle: "font-size: 14px",
@ -241,11 +248,7 @@ watchEffect(() => {
v-model="props.selected"
/>
</q-td>
<q-td
v-for="col in props.cols"
:key="col.name"
:props="props"
>
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</div>

View file

@ -213,7 +213,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "organizationName",
align: "left",
label: "หน่วยงานที่รับการแต่งตั้ง-เลื่อน-ย้าย",
label: "หน่วยงานที่รับปรับระดับชั้นงาน-ย้าย",
sortable: true,
field: "organizationName",
headerStyle: "font-size: 14px",
@ -260,7 +260,7 @@ const fecthlistappointment = async () => {
.then((res) => {
let response = res.data.result;
listRecevice.value = response;
rows.value = response
rows.value = response;
// rows.value = response.map((e: resData) => ({
// personalId: e.id,
// citizenId: e.citizenId,
@ -485,17 +485,14 @@ const savePosition = async () => {
// }
// };
function openModalTree(data:any,type:string){
modalTree.value = true
function openModalTree(data: any, type: string) {
modalTree.value = true;
typeModal.value = type;
personalId.value = data.id;
dataRows.value = data;
posType.value = data.posTypeId;
posLevel.value = data.posLevelId;
position.value = data.positionName;
posType.value = data.posTypeNameOld;
posLevel.value = data.posLevelNameOld;
position.value = data.positionOld;
}
function onSave(data: any) {
@ -532,7 +529,6 @@ function onSave(data: any) {
hideLoader();
});
}
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">
@ -711,7 +707,7 @@ function onSave(data: any) {
<q-item
clickable
v-close-popup
@click="openModalTree(props.row,'SLIP')"
@click="openModalTree(props.row, 'SLIP')"
>
<q-item-section
style="min-width: 0px"
@ -724,12 +720,14 @@ function onSave(data: any) {
name="mdi-bookmark-outline"
/>
</q-item-section>
<q-item-section>เลอกหนวยงานทบปรบระดบชนงาน</q-item-section>
<q-item-section
>เลอกหนวยงานทบปรบระดบชนงาน</q-item-section
>
</q-item>
<q-item
clickable
v-close-popup
@click="openModalTree(props.row,'MOVE')"
@click="openModalTree(props.row, 'MOVE')"
>
<q-item-section
style="min-width: 0px"
@ -742,7 +740,9 @@ function onSave(data: any) {
name="mdi-bookmark-outline"
/>
</q-item-section>
<q-item-section>เลอกหนวยงานทบยาย</q-item-section>
<q-item-section
>เลอกหนวยงานทบยาย</q-item-section
>
</q-item>
<q-item
clickable
@ -877,6 +877,5 @@ function onSave(data: any) {
:dataRows="dataRows"
:onSubmit="onSave"
/>
</template>
<style scoped lang="scss"></style>

View file

@ -228,7 +228,7 @@ const positionPathSideOptions = ref<Object[]>([
value: "",
},
]);
//
//
const positionTypeOptions = ref<Object[]>([
{
label: "",

View file

@ -47,7 +47,6 @@ let dataForm = reactive({
positionTypeId: "",
});
const fetchPublishFile = async () => {
await http
.get(config.API.getPublishFileHistory)
@ -237,7 +236,7 @@ const positionPathSideOptions = ref<Object[]>([
value: "",
},
]);
//
//
const positionTypeOptions = ref<Object[]>([
{
label: "",
@ -673,9 +672,9 @@ onMounted(async () => {
lazy-rules
:options="positionLevelOptions"
v-model="dataForm.positionLevelId"
:label="`${'ระดับ'}`"
:label="`${'ระดับตำแหน่ง'}`"
hide-bottom-space
:rules="[(val: string) => !!val || `${'กรุณาเลือกระดับ'}`]"
:rules="[(val: string) => !!val || `${'กรุณาเลือกระดับตำแหน่ง'}`]"
emit-value
map-options
/>

View file

@ -279,9 +279,9 @@ onMounted(async () => {
:readonly="!edit"
:borderless="!edit"
v-model="positionLevelOld"
:rules="[(val) => !!val || `${'กรุณากรอกประเภทตำแหน่ง'}`]"
:rules="[(val) => !!val || `${'กรุณากรอกระดับตำแหน่ง'}`]"
hide-bottom-space
:label="`${'ประเภทตำแหน่ง'}`"
:label="`${'ระดับตำแหน่ง'}`"
/>
</div>
</div>

View file

@ -6,11 +6,10 @@ import { useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useTransferDataStore } from "@/modules/05_placement/store";
import Dialogbody from "@/modules/05_placement/components/AppointMent/Dialogbody.vue";
import DialogOrgTree from "@/modules/05_placement/components/AppointMent/AppointmentModal.vue";
import type {
listAppointType,
resData,
orgFilter,
} from "@/modules/05_placement/interface/response/AppointMent";
import type { OpType } from "@/modules/05_placement/interface/response/Main";
import http from "@/plugins/http";
@ -255,9 +254,9 @@ const openModalTree = (data: any, type: string) => {
modalTree.value = true;
typeModal.value = type;
dataRows.value = data;
posType.value = data.posTypeId;
posLevel.value = data.posLevelId;
position.value = data.positionName;
posType.value = data.posTypeNameOld;
posLevel.value = data.positionLevelOld;
position.value = data.positionOld;
};
//
const clickDelete = (id: string) => {

View file

@ -258,9 +258,9 @@ onMounted(async () => {
:readonly="!edit"
:borderless="!edit"
v-model="positionTypeOld"
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งประเภท'}`]"
:rules="[(val) => !!val || `${'กรุณากรอกประเภทตำแหน่ง'}`]"
hide-bottom-space
:label="`${'ตำแหน่งประเภท'}`"
:label="`${'ประเภทตำแหน่ง'}`"
/>
</div>
</div>
@ -274,9 +274,9 @@ onMounted(async () => {
:readonly="!edit"
:borderless="!edit"
v-model="positionLevelOld"
:rules="[(val) => !!val || `${'กรุณากรอกระดับ'}`]"
:rules="[(val) => !!val || `${'กรุณากรอกระดับตำแหน่ง'}`]"
hide-bottom-space
:label="`${'ระดับ'}`"
:label="`${'ระดับตำแหน่ง'}`"
/>
</div>
</div>

View file

@ -43,9 +43,8 @@ const props = defineProps({
const visibleColumns2 = ref<string[]>([
"no",
"fullname",
"position",
"positionLevel",
"affiliation",
"organizationPositionOld",
"createdAt",
"status",
]);
@ -71,15 +70,6 @@ const columns2 = ref<QTableProps["columns"]>([
return `${row.prefix}${row.firstName} ${row.lastName}`;
},
},
{
name: "position",
align: "left",
label: "ตำแหน่งในสายงาน",
sortable: true,
field: "position",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "positionLevel",
align: "left",
@ -90,27 +80,24 @@ const columns2 = ref<QTableProps["columns"]>([
style: "font-size: 14px",
format(val, row) {
let name = "";
if (row.posTypeName && row.posLevelName) {
name = `${row.posTypeName} (${row.posLevelName})`;
} else if (row.posTypeName) {
name = `${row.posTypeName}`;
} else if (row.posLevelName) {
name = `(${row.posLevelName})`;
if (row.positionTypeOld && row.positionLevelOld) {
name = `${row.positionTypeOld} (${row.positionLevelOld})`;
} else if (row.positionTypeOld) {
name = `${row.positionTypeOld}`;
} else if (row.positionLevelOld) {
name = `(${row.positionLevelOld})`;
} else name = "-";
return name;
},
},
{
name: "affiliation",
name: "organizationPositionOld",
align: "left",
label: "สังกัด",
label: "ตำแหน่งและหน่วยงานเดิม",
sortable: true,
field: "affiliation",
field: "organizationPositionOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return findOrgName(row);
},
},
{
name: "createdAt",

View file

@ -47,9 +47,8 @@ const filterRef = ref<any>(null);
const visibleColumns = ref<string[]>([
"no",
"fullname",
"position",
"positionLevel",
"affiliation",
"organizationPositionOld",
"createdAt",
"status",
]);
@ -75,15 +74,6 @@ const columns = ref<QTableProps["columns"]>([
return `${row.prefix}${row.firstName} ${row.lastName}`;
},
},
{
name: "position",
align: "left",
label: "ตำแหน่งในสายงาน",
sortable: true,
field: "position",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "positionLevel",
align: "left",
@ -94,27 +84,24 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px",
format(val, row) {
let name = "";
if (row.posTypeName && row.posLevelName) {
name = `${row.posTypeName} (${row.posLevelName})`;
} else if (row.posTypeName) {
name = `${row.posTypeName}`;
} else if (row.posLevelName) {
name = `(${row.posLevelName})`;
if (row.positionTypeOld && row.positionLevelOld) {
name = `${row.positionTypeOld} (${row.positionLevelOld})`;
} else if (row.positionTypeOld) {
name = `${row.positionTypeOld}`;
} else if (row.positionLevelOld) {
name = `(${row.positionLevelOld})`;
} else name = "-";
return name;
},
},
{
name: "affiliation",
name: "organizationPositionOld",
align: "left",
label: "สังกัด",
label: "ตำแหน่งและหน่วยงานเดิม",
sortable: true,
field: "affiliation",
field: "organizationPositionOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return findOrgName(row);
},
},
{
name: "createdAt",

View file

@ -253,7 +253,7 @@ const positionPathSideOptions = ref<Object[]>([
value: "",
},
]);
//
//
const positionTypeOptions = ref<Object[]>([
{
label: "",

View file

@ -145,8 +145,12 @@ async function fetchDataTable(id: string, level: number = 0) {
nodeId: id,
position: props?.dataRow?.positionCandidate,
typeCommand: props.typeCommand,
posLevel: props.dataRow?.posLevelCandidateId,
posType: props.dataRow?.posTypeCandidateId,
posLevel: props.dataRow?.posLevelCandidateId
? props.dataRow?.posLevelCandidateId
: "",
posType: props.dataRow?.posTypeCandidateId
? props.dataRow?.posTypeCandidateId
: "",
isAll: isAll.value,
isBlank: isBlank.value,
};

View file

@ -41,7 +41,7 @@ const posNoOptions = ref<Object[]>([{ label: "", value: "" }]);
const positionOptions = ref<Object[]>([{ label: "", value: "" }]);
// /
const positionPathSideOptions = ref<Object[]>([{ label: "", value: "" }]);
//
//
const positionTypeOptions = ref<Object[]>([{ label: "", value: "" }]);
//
const positionLineOptions = ref<Object[]>([{ label: "", value: "" }]);

View file

@ -385,8 +385,8 @@ function insertAvatar(items: any) {
config.API.fileByFile(
"ทะเบียนประวัติ",
"โปรไฟล์",
x.id,
"profile-" + x.id
x.personalId,
"profile-" + x.personalId
)
)
.then((img) => {

View file

@ -43,8 +43,6 @@ const columns2 = ref<QTableProps["columns"]>([
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "citizenId",

View file

@ -889,9 +889,9 @@ onMounted(async () => {
:readonly="!edit"
:borderless="!edit"
v-model="positionTypeOld"
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งประเภท'}`]"
:rules="[(val) => !!val || `${'กรุณากรอกประเภทตำแหน่ง'}`]"
hide-bottom-space
:label="`${'ตำแหน่งประเภท'}`"
:label="`${'ประเภทตำแหน่ง'}`"
/>
</div>
<div class="col-xs-6 col-sm-3">
@ -903,9 +903,9 @@ onMounted(async () => {
:readonly="!edit"
:borderless="!edit"
v-model="positionLevelOld"
:rules="[(val) => !!val || `${'กรุณากรอกระดับ'}`]"
:rules="[(val) => !!val || `${'กรุณากรอกระดับตำแหน่ง'}`]"
hide-bottom-space
:label="`${'ระดับ'}`"
:label="`${'ระดับตำแหน่ง'}`"
/>
</div>
<div class="col-xs-6 col-sm-3">

View file

@ -273,10 +273,11 @@ const openModalTree = (id: string, data: any) => {
modalTree.value = true;
type.value = null;
dataRows.value = data;
// console.log("data===>", data);
posType.value = data.posTypeId;
posLevel.value = data.posLevelId;
position.value = data.positionName;
posType.value = data.posTypeOldId;
posLevel.value = data.posLevelOldId;
position.value = data.positionOld;
};
//
const openUpload = (id: string) => {

View file

@ -84,7 +84,7 @@ const positionOptions = ref<Object[]>([{ label: "", value: "" }]);
// /
const positionPathSideOptions = ref<Object[]>([{ label: "", value: "" }]);
//
//
const positionTypeOptions = ref<Object[]>([{ label: "", value: "" }]);
//

View file

@ -259,7 +259,7 @@ const positionPathSideOptions = ref<Object[]>([
value: "",
},
]);
//
//
const positionTypeOptions = ref<Object[]>([
{
label: "",

View file

@ -350,7 +350,7 @@ onMounted(async () => {
:readonly="!edit"
:borderless="!edit"
v-model="educationOld"
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งประเภท'}`]"
:rules="[(val) => !!val || `${'กรุณากรอกประเภทตำแหน่ง'}`]"
hide-bottom-space
:label="`${'วุฒิ/สาขา'}`"
/>
@ -390,9 +390,9 @@ onMounted(async () => {
:readonly="!edit"
:borderless="!edit"
v-model="positionTypeOld"
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งประเภท'}`]"
:rules="[(val) => !!val || `${'กรุณากรอกประเภทตำแหน่ง'}`]"
hide-bottom-space
:label="`${'ตำแหน่งประเภท'}`"
:label="`${'ประเภทตำแหน่ง'}`"
/>
</div>
</div>

View file

@ -23,8 +23,7 @@ const {
messageError,
dialogConfirm,
hideLoader,
findOrgName,
findPosMasterNo,
findPosMasterNoOld,
date2Thai,
} = mixin;
@ -51,26 +50,17 @@ const columns2 = ref<QTableProps["columns"]>([
},
},
{
name: "posNo",
name: "posMasterNoOld",
align: "left",
label: "เลขที่ตำแหน่ง",
sortable: true,
field: "posNo",
field: "posMasterNoOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return findPosMasterNo(row);
return findPosMasterNoOld(row);
},
},
{
name: "position",
align: "left",
label: "ตำแหน่งในสายงาน",
sortable: true,
field: "position",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "positionLevel",
align: "left",
@ -80,20 +70,25 @@ const columns2 = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return `${row.posTypeName} (${row.posLevelName})`;
let name = "";
if (row.positionTypeOld && row.positionLevelOld) {
name = `${row.positionTypeOld} (${row.positionLevelOld})`;
} else if (row.positionTypeOld) {
name = `${row.positionTypeOld}`;
} else if (row.positionLevelOld) {
name = `(${row.positionLevelOld})`;
} else name = "-";
return name;
},
},
{
name: "organizationPositionOld",
align: "left",
label: "สังกัด",
label: "ตำแหน่งและหน่วยงานเดิม",
sortable: true,
field: "organizationPositionOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return findOrgName(row);
},
},
{
name: "organization",
@ -128,8 +123,7 @@ const columns2 = ref<QTableProps["columns"]>([
const visibleColumns2 = ref<string[]>([
"no",
"name",
"posNo",
"position",
"posMasterNoOld",
"positionLevel",
"organizationPositionOld",
"organization",

View file

@ -30,8 +30,7 @@ const {
hideLoader,
success,
dialogRemove,
findOrgName,
findPosMasterNo,
findPosMasterNoOld,
} = mixin;
//
@ -58,26 +57,17 @@ const columns = ref<QTableProps["columns"]>([
},
},
{
name: "posNo",
name: "posMasterNoOld",
align: "left",
label: "เลขที่ตำแหน่ง",
sortable: true,
field: "posNo",
field: "posMasterNoOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return findPosMasterNo(row);
return findPosMasterNoOld(row);
},
},
{
name: "position",
align: "left",
label: "ตำแหน่งในสายงาน",
sortable: true,
field: "position",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "positionLevel",
align: "left",
@ -88,12 +78,12 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px",
format(val, row) {
let name = "";
if (row.posTypeName && row.posLevelName) {
name = `${row.posTypeName} (${row.posLevelName})`;
} else if (row.posTypeName) {
name = `${row.posTypeName}`;
} else if (row.posLevelName) {
name = `(${row.posLevelName})`;
if (row.positionTypeOld && row.positionLevelOld) {
name = `${row.positionTypeOld} (${row.positionLevelOld})`;
} else if (row.positionTypeOld) {
name = `${row.positionTypeOld}`;
} else if (row.positionLevelOld) {
name = `(${row.positionLevelOld})`;
} else name = "-";
return name;
},
@ -101,14 +91,11 @@ const columns = ref<QTableProps["columns"]>([
{
name: "organizationPositionOld",
align: "left",
label: "สังกัด",
label: "ตำแหน่งและหน่วยงานเดิม",
sortable: true,
field: "organizationPositionOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return findOrgName(row);
},
},
{
name: "organization",
@ -143,8 +130,7 @@ const columns = ref<QTableProps["columns"]>([
const visibleColumns = ref<string[]>([
"no",
"name",
"posNo",
"position",
"posMasterNoOld",
"positionLevel",
"organizationPositionOld",
"organization",
@ -324,7 +310,7 @@ onMounted(async () => {
: ''
"
>
{{ col.value ? col.value : "-" }}
{{ col.value == null ? "" : col.value }}
</div>
</q-td>
<q-td auto-width>

View file

@ -231,9 +231,9 @@ onMounted(() => {
:readonly="!edit"
:borderless="!edit"
v-model="positionTypeOld"
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งประเภท'}`]"
:rules="[(val) => !!val || `${'กรุณากรอกประเภทตำแหน่ง'}`]"
hide-bottom-space
:label="`${'ตำแหน่งประเภท'}`"
:label="`${'ประเภทตำแหน่ง'}`"
/>
</div>
</div>
@ -247,9 +247,9 @@ onMounted(() => {
:readonly="!edit"
:borderless="!edit"
v-model="positionLevelOld"
:rules="[(val) => !!val || `${'กรุณากรอกระดับ'}`]"
:rules="[(val) => !!val || `${'กรุณากรอกระดับตำแหน่ง'}`]"
hide-bottom-space
:label="`${'ระดับ'}`"
:label="`${'ระดับตำแหน่ง'}`"
/>
</div>
</div>

View file

@ -2,6 +2,7 @@
import { ref, computed, watchEffect } from "vue";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useTransferDataStore } from "@/modules/05_placement/store";
import type { QTableProps } from "quasar";
import type { ResponseData } from "@/modules/05_placement/interface/response/Transfer";
@ -9,21 +10,30 @@ import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogH
import http from "@/plugins/http";
import config from "@/app.config";
const transferStore = useTransferDataStore();
const { statusText } = transferStore;
const $q = useQuasar();
const selected = ref<ResponseData[]>([]);
const mixin = useCounterMixin();
const { showLoader, success, messageError, dialogConfirm,hideLoader } = mixin;
const {
showLoader,
success,
messageError,
dialogConfirm,
hideLoader,
date2Thai,
} = mixin;
//
const visibleColumns2 = ref<string[]>([
"no",
"fullname",
"position",
"positionLevel",
"posType",
"organizationPositionOld",
"organization",
"statustext",
"dateText",
"status",
"createdAt",
]);
const columns2 = ref<QTableProps["columns"]>([
{
@ -34,8 +44,6 @@ const columns2 = ref<QTableProps["columns"]>([
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "fullname",
@ -47,33 +55,26 @@ const columns2 = ref<QTableProps["columns"]>([
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
format(val, row) {
return `${row.prefix}${row.firstName} ${row.lastName}`;
},
},
{
name: "position",
name: "posType",
align: "left",
label: "ตำแหน่งในสายงาน",
label: "ประเภทตำแหน่ง",
sortable: true,
field: "position",
field: "posType",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionLevel",
align: "left",
label: "ระดับ",
sortable: true,
field: "positionLevel",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
format(val, row) {
return row.positionTypeOld + " (" + row.positionLevelOld + ")";
},
},
{
name: "organizationPositionOld",
align: "left",
label: "สังกัด",
label: "ตำแหน่งและหน่วยงานเดิม",
sortable: true,
field: "organizationPositionOld",
headerStyle: "font-size: 14px",
@ -93,27 +94,28 @@ const columns2 = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "dateText",
name: "createdAt",
align: "left",
label: "วันที่ดำเนินการ",
sortable: true,
field: "dateText",
field: "createdAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
sortOrder: "da",
format(val) {
return date2Thai(val);
},
},
{
name: "statustext",
name: "status",
align: "left",
label: "สถานะ",
sortable: true,
field: "statustext",
field: "status",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
format: (val) => statusText(val),
},
]);
@ -122,11 +124,9 @@ const props = defineProps({
closeModal: Function,
getData: Function,
rows2: Array,
filterKeyword2:String,
filterKeyword2: String,
});
const checkSelected = computed(() => {
if (selected.value.length === 0) {
return true;
@ -135,8 +135,13 @@ const checkSelected = computed(() => {
//popup
const saveOrder = () => {
dialogConfirm($q,() => Ordersave(),"ยืนยันส่งไปออกคำสั่ง","ต้องการยืนยันส่งไปออกคำสั่งใช่หรือไม่?" )
}
dialogConfirm(
$q,
() => Ordersave(),
"ยืนยันส่งไปออกคำสั่ง",
"ต้องการยืนยันส่งไปออกคำสั่งใช่หรือไม่?"
);
};
//
const Ordersave = async () => {
const id = selected.value.map((r) => r.id);
@ -160,17 +165,13 @@ const Ordersave = async () => {
});
};
const emit = defineEmits([
"update:filterKeyword2",
"update:selected",
]);
const emit = defineEmits(["update:filterKeyword2", "update:selected"]);
const updateInput = (value: any) => {
emit("update:filterKeyword2", value);
};
//
const Reset = () => {
emit("update:filterKeyword2", "");
emit("update:filterKeyword2", "");
};
watchEffect(() => {
if (props.Modal === true) {
@ -192,7 +193,7 @@ watchEffect(() => {
outlined
dense
debounce="300"
:model-value="filterKeyword2"
:model-value="filterKeyword2"
@update:model-value="updateInput"
placeholder="ค้นหา"
style="width: 850px; max-width: auto"
@ -254,34 +255,23 @@ watchEffect(() => {
v-model="props.selected"
/>
</q-td>
<q-td key="no" :props="props">
{{ props.rowIndex + 1 }}
</q-td>
<q-td key="fullname" :props="props">
{{ props.row.fullname }}
</q-td>
<q-td key="position" :props="props">
{{ props.row.position }}
</q-td>
<q-td key="positionLevel" :props="props">
{{ props.row.positionLevel }}
</q-td>
<q-td key="organizationPositionOld" :props="props">
<div class="table_ellipsis">
{{ props.row.organizationPositionOld }}
<q-td v-for="col in props.cols" :key="col.id">
<div v-if="col.name === 'no'">
{{ props.rowIndex + 1 }}
</div>
</q-td>
<q-td key="organization" :props="props">
<div class="table_ellipsis">
{{ props.row.organization }}
<div
v-else
:class="
col.name === 'organizationPositionOld' ||
col.name === 'organization'
? 'table_ellipsis'
: ''
"
>
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td key="dateText" :props="props">
{{ props.row.dateText }}
</q-td>
<q-td key="statustext" :props="props">
{{ props.row.statustext }}
</q-td>
</q-tr>
</template>
</d-table>
@ -297,4 +287,4 @@ watchEffect(() => {
</q-card-actions>
</q-card>
</q-dialog>
</template>
</template>

View file

@ -15,9 +15,10 @@ const router = useRouter();
const mixin = useCounterMixin();
const transferStore = useTransferDataStore();
const { date2Thai, messageError, showLoader, hideLoader, success } = mixin;
const { statusText } = transferStore;
const { date2Thai, messageError, showLoader, hideLoader } = mixin;
const modal = ref<boolean>(false);
const filterKeyword = ref<string>("");
const filterKeyword2 = ref<string>("");
@ -30,12 +31,11 @@ const filters = ref<ResponseData[]>([]);
const visibleColumns = ref<string[]>([
"no",
"fullname",
"position",
"positionLevel",
"posType",
"organizationPositionOld",
"organization",
"statustext",
"dateText",
"status",
"createdAt",
]);
const resetFilter = () => {
@ -65,33 +65,26 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
format(val, row) {
return `${row.prefix}${row.firstName} ${row.lastName}`;
},
},
{
name: "position",
name: "posType",
align: "left",
label: "ตำแหน่งในสายงาน",
label: "ประเภทตำแหน่ง",
sortable: true,
field: "position",
field: "posType",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionLevel",
align: "left",
label: "ระดับ",
sortable: true,
field: "positionLevel",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
format(val, row) {
return row.positionTypeOld + " (" + row.positionLevelOld + ")";
},
},
{
name: "organizationPositionOld",
align: "left",
label: "สังกัด",
label: "ตำแหน่งและหน่วยงานเดิม",
sortable: true,
field: "organizationPositionOld",
headerStyle: "font-size: 14px",
@ -111,27 +104,28 @@ const columns = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "dateText",
name: "createdAt",
align: "left",
label: "วันที่ดำเนินการ",
sortable: true,
field: "dateText",
field: "createdAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
sortOrder: "da",
format(val) {
return date2Thai(val);
},
},
{
name: "statustext",
name: "status",
align: "left",
label: "สถานะ",
sortable: true,
field: "statustext",
field: "status",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
format: (val) => statusText(val),
},
]);
@ -144,17 +138,16 @@ const closeModal = () => {
//
const openModalOrder = () => {
openModal();
console.log("filters===>",filters.value)
const row = filters.value.filter(
(r: ResponseData) =>
(r.status == "APPROVE") &&
r.status == "APPROVE" &&
r.organizationPositionOld &&
r.positionTypeOld &&
r.positionLevelOld &&
r.positionNumberOld &&
r.salary !== null &&
r.organization &&
r.date
r.date
);
rows2.value = row;
};
@ -164,38 +157,8 @@ const getData = async () => {
await http
.get(config.API.transfer)
.then((res: any) => {
const data = res.data.result;
let list: ResponseData[] = [];
data.map((r: ResponseData) => {
list.push({
dateText:
r.createdAt !== null ? date2Thai(new Date(r.createdAt)) : "-",
createdAt: r.createdAt !== null ? new Date(r.createdAt) : null,
date: r.date,
firstName: r.firstName ?? "",
id: r.id ?? "",
isActive: r.isActive ? r.isActive : false,
lastName: r.lastName ?? "",
organization: r.organization ?? "",
organizationPositionOld: r.organizationPositionOld ?? "",
posNo: r.posNo ?? "",
position: r.position ?? "",
positionLevel: r.positionLevel ?? "",
positionLevelOld: r.positionLevelOld ?? "",
positionNumberOld: r.positionNumberOld ?? "",
positionTypeOld: r.positionTypeOld ?? "",
prefix: r.prefix ?? "",
reason: r.reason ?? "",
salary: r.salary ? r.salary : 0,
status: r.status ?? "",
statustext: statusText(r.status ?? ""),
fullname: `${r.prefix ?? ""} ${r.firstName ?? ""} ${
r.lastName ?? ""
}`,
});
});
rows.value = list;
filters.value = list;
rows.value = res.data.result;
filters.value = rows.value;
})
.catch((e) => {
messageError($q, e);
@ -282,39 +245,23 @@ onMounted(async () => {
</q-tr>
</template>
<template v-slot:body="props">
<q-tr
:props="props"
class="cursor-pointer"
@click="router.push(`/transfer/${props.row.id}`)"
>
<q-td key="no" :props="props">
{{ props.rowIndex + 1 }}
</q-td>
<q-td key="fullname" :props="props">
{{ props.row.fullname }}
</q-td>
<q-td key="position" :props="props">
{{ props.row.position }}
</q-td>
<q-td key="positionLevel" :props="props">
{{ props.row.positionLevel }}
</q-td>
<q-td key="organizationPositionOld" :props="props">
<div class="table_ellipsis">
{{ props.row.organizationPositionOld }}
<q-tr :props="props" class="cursor-pointer">
<q-td
v-for="col in props.cols"
:key="col.id"
class="cursor-pointer"
@click="router.push(`/transfer/${props.row.id}`)"
>
<div v-if="col.name === 'no'">
{{ props.rowIndex + 1 }}
</div>
</q-td>
<q-td key="organization" :props="props">
<div class="table_ellipsis">
{{ props.row.organization }}
<div v-else>
{{
col.value == null ? "" : col.value == "" ? "-" : col.value
}}
</div>
</q-td>
<q-td key="dateText" :props="props">
{{ props.row.dateText }}
</q-td>
<q-td key="statustext" :props="props">
{{ props.row.statustext }}
</q-td>
</q-tr>
</template>
</d-table>

View file

@ -360,7 +360,7 @@ onMounted(async () => {
</div>
<div class="col-xs-6 col-sm-3 row items-center">
<div class="col-12">
<div class="col-12 text-top">ระด</div>
<div class="col-12 text-top">ระดตำแหน</div>
<div class="col-12 text-detail">
{{ responseData.positionLevelOld }}
</div>
@ -584,9 +584,9 @@ onMounted(async () => {
:readonly="!edit"
:borderless="!edit"
v-model="positionTypeOld"
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งประเภท'}`]"
:rules="[(val) => !!val || `${'กรุณากรอกประเภทตำแหน่ง'}`]"
hide-bottom-space
:label="`${'ตำแหน่งประเภท'}`"
:label="`${'ประเภทตำแหน่ง'}`"
/>
</div>
<div class="col-xs-6 col-sm-3">
@ -598,9 +598,9 @@ onMounted(async () => {
:readonly="!edit"
:borderless="!edit"
v-model="positionLevelOld"
:rules="[(val) => !!val || `${'กรุณากรอกระดับ'}`]"
:rules="[(val) => !!val || `${'กรุณากรอกระดับตำแหน่ง'}`]"
hide-bottom-space
:label="`${'ระดับ'}`"
:label="`${'ระดับตำแหน่ง'}`"
/>
</div>
<div class="col-xs-6 col-sm-3">

View file

@ -22,8 +22,8 @@ const {
messageError,
dialogConfirm,
hideLoader,
findOrgName,
findPosMasterNo,
findOrgNameOld,
findPosMasterNoOld,
date2Thai,
} = mixin;
@ -51,23 +51,23 @@ const columns2 = ref<QTableProps["columns"]>([
},
},
{
name: "posNo",
name: "posMasterNoOld",
align: "left",
label: "เลขที่ตำแหน่ง",
sortable: true,
field: "posNo",
field: "posMasterNoOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return findPosMasterNo(row);
return findPosMasterNoOld(row);
},
},
{
name: "position",
name: "positionOld",
align: "left",
label: "ตำแหน่งในสายงาน",
sortable: true,
field: "position",
field: "positionOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
@ -80,7 +80,15 @@ const columns2 = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return `${row.posTypeName} (${row.posLevelName})`;
let name = "";
if (row.posTypeNameOld && row.posLevelNameOld) {
name = `${row.posTypeNameOld} (${row.posLevelNameOld})`;
} else if (row.posTypeNameOld) {
name = `${row.posTypeNameOld}`;
} else if (row.posLevelNameOld) {
name = `(${row.posLevelNameOld})`;
} else name = "-";
return name;
},
},
{
@ -88,13 +96,10 @@ const columns2 = ref<QTableProps["columns"]>([
align: "left",
label: "สังกัด",
sortable: true,
field: "organizationPositionOld",
field: "organization",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
classes: "table_ellipsis",
format(val, row) {
return findOrgName(row);
},
format: (val, row) => findOrgNameOld(row),
},
{
name: "organization",
@ -104,7 +109,6 @@ const columns2 = ref<QTableProps["columns"]>([
field: "organization",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
classes: "table_ellipsis",
},
{
name: "dateStart",
@ -150,8 +154,8 @@ const columns2 = ref<QTableProps["columns"]>([
const visibleColumns2 = ref<string[]>([
"no",
"name",
"posNo",
"position",
"posMasterNoOld",
"positionOld",
"positionLevel",
"organizationPositionOld",
"organization",
@ -301,13 +305,18 @@ watchEffect(() => {
{{ props.rowIndex + 1 }}
</div>
<div v-else :class="
col.name === 'organizationPositionOld' ||
col.name === 'organization'
? 'table_ellipsis'
: ''
">
{{ col.value ? col.value : "-" }}
<div
v-else
:class="
col.name === 'organizationPositionOld' ||
col.name === 'organization'
? 'table_ellipsis'
: ''
"
>
{{
col.value == null ? "" : col.value == "" ? "-" : col.value
}}
</div>
</q-td>
</q-tr>

View file

@ -31,8 +31,8 @@ const {
hideLoader,
success,
dialogRemove,
findOrgName,
findPosMasterNo,
findOrgNameOld,
findPosMasterNoOld,
} = mixin;
//
@ -59,23 +59,23 @@ const columns = ref<QTableProps["columns"]>([
},
},
{
name: "posNo",
name: "posMasterNoOld",
align: "left",
label: "เลขที่ตำแหน่ง",
sortable: true,
field: "posNo",
field: "posMasterNoOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return findPosMasterNo(row);
return findPosMasterNoOld(row);
},
},
{
name: "position",
name: "positionOld",
align: "left",
label: "ตำแหน่งในสายงาน",
sortable: true,
field: "position",
field: "positionOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
@ -89,12 +89,12 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px",
format(val, row) {
let name = "";
if (row.posTypeName && row.posLevelName) {
name = `${row.posTypeName} (${row.posLevelName})`;
} else if (row.posTypeName) {
name = `${row.posTypeName}`;
} else if (row.posLevelName) {
name = `(${row.posLevelName})`;
if (row.posTypeNameOld && row.posLevelNameOld) {
name = `${row.posTypeNameOld} (${row.posLevelNameOld})`;
} else if (row.posTypeNameOld) {
name = `${row.posTypeNameOld}`;
} else if (row.posLevelNameOld) {
name = `(${row.posLevelNameOld})`;
} else name = "-";
return name;
},
@ -104,12 +104,10 @@ const columns = ref<QTableProps["columns"]>([
align: "left",
label: "สังกัด",
sortable: true,
field: "organizationPositionOld",
field: "organization",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return findOrgName(row);
},
format: (val, row) => findOrgNameOld(row),
},
{
name: "organization",
@ -164,8 +162,8 @@ const columns = ref<QTableProps["columns"]>([
const visibleColumns = ref<string[]>([
"no",
"name",
"posNo",
"position",
"posMasterNoOld",
"positionOld",
"positionLevel",
"organizationPositionOld",
"organization",
@ -334,7 +332,9 @@ onMounted(async () => {
: ''
"
>
{{ col.value ? col.value : "-" }}
{{
col.value == null ? "" : col.value == "" ? "-" : col.value
}}
</div>
</q-td>
<q-td auto-width>