แก้บรรจุแต่งตั้ง รายชื่อที่สอบผ่าน

This commit is contained in:
Warunee Tamkoo 2024-10-28 12:16:50 +07:00
parent 627696ea65
commit e6dcc39765
5 changed files with 87 additions and 102 deletions

View file

@ -75,6 +75,7 @@ export default {
activeOrganizationRoot: `${organization}/active/root`, activeOrganizationRoot: `${organization}/active/root`,
activeOrganizationRootById: (id: string) => activeOrganizationRootById: (id: string) =>
`${organization}/active/root/${id}`, `${organization}/active/root/${id}`,
orgPosPlacementAll: `${orgPos}/placement/search-all`,
/** ข้อมูลตำแหน่งลูกจ้างประจำ*/ /** ข้อมูลตำแหน่งลูกจ้างประจำ*/
orgEmployeePos: `${orgEmployeePos}/position`, orgEmployeePos: `${orgEmployeePos}/position`,
@ -137,11 +138,12 @@ export default {
checkIsOfficer: (id: string) => `${organization}/check/child1/${id}`, checkIsOfficer: (id: string) => `${organization}/check/child1/${id}`,
checkIsDeputys: (id: string) => `${organization}/check/root/${id}`, checkIsDeputys: (id: string) => `${organization}/check/root/${id}`,
orgPosReport:`${orgPos}/report/draft`, orgPosReport: `${orgPos}/report/draft`,
orgPosReportAct:`${orgPos}/act/report/draft`, orgPosReportAct: `${orgPos}/act/report/draft`,
/** /**
* workflow * workflow
*/ */
workflow: `${workflow}/`, workflow: `${workflow}/`,
workflowKeycloakSystem:(type:string)=> `${workflow}/keycloak/isofficer/${type}`, workflowKeycloakSystem: (type: string) =>
`${workflow}/keycloak/isofficer/${type}`,
}; };

View file

@ -63,7 +63,8 @@ async function addAvatarToData(item: any) {
// avatar item // avatar item
const updatedItem = { const updatedItem = {
...item, ...item,
avatar: item.avatar ? await fetchProfile(item.avatar) : avatar, // avatar: item.avatar ? await fetchProfile(item.avatar) : avatar,
avatar: avatar,
// item children // item children
children: item.children children: item.children
? await Promise.all(item.children.map(addAvatarToData)) ? await Promise.all(item.children.map(addAvatarToData))

View file

@ -27,8 +27,8 @@ const date = defineModel<Date>("datePos", { required: true }); //วันยท
const positionData = defineModel<any[]>("position", { required: true }); // const positionData = defineModel<any[]>("position", { required: true }); //
const isAll = defineModel<boolean>("isAll", { required: true }); // const isAll = defineModel<boolean>("isAll", { required: true }); //
const isBlank = defineModel<boolean>("isBlank", { required: true }); // const isBlank = defineModel<boolean>("isBlank", { required: true }); //
const isPosition = defineModel<boolean>("isPosition", { required: true }); const isPosition = defineModel<string>("isPosition", { required: true });
const isPositionOld = defineModel<boolean>("isPositionOld", { required: true }); // // const isPositionOld = defineModel<boolean>("isPositionOld", { required: true }); //
const posType = defineModel<FormPosType>("posType", { required: true }); // const posType = defineModel<FormPosType>("posType", { required: true }); //
const posLevel = defineModel<string>("posLevel", { required: true }); // const posLevel = defineModel<string>("posLevel", { required: true }); //
const optionPosType = defineModel<FormPosType[]>("optionPosType", { const optionPosType = defineModel<FormPosType[]>("optionPosType", {
@ -37,6 +37,7 @@ const optionPosType = defineModel<FormPosType[]>("optionPosType", {
const optionPosLevel = defineModel<FormPosLevel[]>("optionPosLevel", { const optionPosLevel = defineModel<FormPosLevel[]>("optionPosLevel", {
required: true, required: true,
}); });
const bmaOfficer = defineModel<string>("bmaOfficer", { required: true });
const positionRows = ref<DataPositionNo[]>(positionData.value); const positionRows = ref<DataPositionNo[]>(positionData.value);
@ -219,16 +220,16 @@ async function onClickSelectPos(id: string) {
} }
} }
function onPositionOld() { // function onPositionOld() {
props.fetchDataTable?.(props.nodeId, props.nodeLevel); // props.fetchDataTable?.(props.nodeId, props.nodeLevel);
if (isPositionOld.value == false) { // if (isPositionOld.value == false) {
posType.value.id = ""; // posType.value.id = "";
posType.value.posTypeName = ""; // posType.value.posTypeName = "";
posType.value.posTypeRank = null; // posType.value.posTypeRank = null;
posType.value.posLevels = []; // posType.value.posLevels = [];
posLevel.value = ""; // posLevel.value = "";
} // }
} // }
// filter filter // filter filter
watch(positionData, (newVal, oldVal) => { watch(positionData, (newVal, oldVal) => {
@ -269,18 +270,6 @@ onMounted(async () => {
> >
<q-tooltip>แสดงเฉพาะตำแหนงวาง </q-tooltip> <q-tooltip>แสดงเฉพาะตำแหนงวาง </q-tooltip>
</q-checkbox> </q-checkbox>
<q-checkbox
keep-color
v-model="isPosition"
label="แสดงเฉพาะตำแหน่งที่ตรงกับการสอบ"
color="primary"
@update:model-value="
props.fetchDataTable?.(props.nodeId, props.nodeLevel)
"
>
<q-tooltip>แสดงเฉพาะตำแหนงทตรงกบการสอบ</q-tooltip>
</q-checkbox>
<q-checkbox <q-checkbox
keep-color keep-color
v-model="isAll" v-model="isAll"
@ -295,20 +284,34 @@ onMounted(async () => {
<div class="col-12"> <div class="col-12">
<div class="row q-gutter-sm no-wrap"> <div class="row q-gutter-sm no-wrap">
<div> <div>
<q-checkbox <q-radio
keep-color keep-color
v-model="isPositionOld" v-model="isPosition"
label="แสดงตำแหน่งที่ตรงกับประเภทและระดับเดิม" val="exam"
label="แสดงเฉพาะตำแหน่งที่ตรงกับการสอบ"
color="primary" color="primary"
@update:model-value="onPositionOld" :disable="bmaOfficer == 'บุคคลภายนอก'"
> >
<q-tooltip>แสดงตำแหนงทตรงกประเภทและระดบเด</q-tooltip> <q-tooltip>แสดงเฉพาะตำแหนงทตรงกการสอบ</q-tooltip>
</q-checkbox> </q-radio>
</div> </div>
<div class="col-3"> <div>
<q-radio
keep-color
v-model="isPosition"
val="select"
label="แสดงตำแหน่งที่ตรงกับประเภทและระดับ"
color="primary"
:disable="bmaOfficer == 'บุคคลภายนอก'"
>
<q-tooltip>แสดงตำแหนงทตรงกบประเภทและระด</q-tooltip>
</q-radio>
</div>
<div class="col-2">
<q-select <q-select
v-if="isPositionOld" v-if="isPosition == 'select'"
v-model="posType" v-model="posType"
:options="optionPosType" :options="optionPosType"
option-label="posTypeName" option-label="posTypeName"
@ -319,14 +322,14 @@ onMounted(async () => {
> >
</q-select> </q-select>
</div> </div>
<div class="col-3"> <div class="col-2">
<q-select <q-select
v-if="isPositionOld" v-if="isPosition == 'select'"
:readonly="posType == null" :readonly="posType == null"
v-model="posLevel" v-model="posLevel"
:options="optionPosLevel" :options="optionPosLevel"
option-label="posLevelName" option-label="posLevelName"
option-value="posLevelName" option-value="id"
label="ระดับตำแหน่ง" label="ระดับตำแหน่ง"
dense dense
outlined outlined

View file

@ -50,10 +50,6 @@ const props = defineProps({
require: true, require: true,
}, },
fetchStatCard: { type: Function, require: true }, fetchStatCard: { type: Function, require: true },
typeCommand: {
type: String,
require: true,
},
}); });
/** Tree*/ /** Tree*/
@ -116,32 +112,34 @@ function updateSelected(data: TreeMain) {
*/ */
const isAll = ref<boolean>(false); const isAll = ref<boolean>(false);
const isBlank = ref<boolean>(true); const isBlank = ref<boolean>(true);
const isPosition = ref<boolean>(true); const isPosition = ref<string>("exam");
const isPositionOld = ref<boolean>(false); // const isPositionOld = ref<boolean>(false);
async function fetchDataTable(id: string, level: number = 0) { async function fetchDataTable(id: string, level: number = 0) {
showLoader(); showLoader();
const body = { const body = {
node: level, node: level,
nodeId: id, nodeId: id,
position: props?.dataRow?.positionCandidate, position:
typeCommand: props.typeCommand, isPosition.value === "exam" ? props?.dataRow?.positionCandidate : null,
posLevel: props.dataRow?.posLevelCandidateId posLevel:
? props.dataRow?.posLevelCandidateId isPosition.value === "exam"
: "", ? props.dataRow?.posLevelCandidateId
posType: props.dataRow?.posTypeCandidateId : posLevel.value
? props.dataRow?.posTypeCandidateId ? posLevel.value
: "", : null,
posType:
isPosition.value === "exam"
? props.dataRow?.posTypeCandidateId
: posType.value
? posType.value.id
: null,
isAll: isAll.value, isAll: isAll.value,
isBlank: isBlank.value, isBlank: isBlank.value,
isPosition: isPosition.value,
isPositionOld: isPositionOld.value,
positionType: posType.value ? posType.value.posTypeName : null,
positionLevel: posLevel.value ? posLevel.value : null,
}; };
await http await http
.post(config.API.orgPosPlacement, body) .post(config.API.orgPosPlacementAll, body)
.then((res) => { .then((res) => {
const dataMain: PositionMaim[] = []; const dataMain: PositionMaim[] = [];
posMasterMain.value = res.data.result.data; posMasterMain.value = res.data.result.data;
@ -236,7 +234,6 @@ async function onClickSubmit() {
posLevelName: selectedPos.value[0].posLevelName, // posLevelName: selectedPos.value[0].posLevelName, //
reportingDate: datePos.value, reportingDate: datePos.value,
posmasterId: dataPosMaster.id, posmasterId: dataPosMaster.id,
typeCommand: props.typeCommand,
}; };
await http await http
@ -268,7 +265,7 @@ function clearData() {
expanded.value = []; expanded.value = [];
posType.value = null; posType.value = null;
posLevel.value = ""; posLevel.value = "";
isPositionOld.value = false; isPosition.value = "exam";
} }
/** callback function เมื่อมีการเปิด popup*/ /** callback function เมื่อมีการเปิด popup*/
@ -351,7 +348,7 @@ watch(
); );
watch( watch(
() => isPositionOld.value, () => isPosition.value === "select",
(value, oldVal) => { (value, oldVal) => {
if (value !== oldVal) { if (value !== oldVal) {
fetchDataTable(nodeId.value, nodeLevel.value); fetchDataTable(nodeId.value, nodeLevel.value);
@ -463,7 +460,6 @@ onMounted(() => {
v-model:is-all="isAll" v-model:is-all="isAll"
v-model:is-blank="isBlank" v-model:is-blank="isBlank"
v-model:is-position="isPosition" v-model:is-position="isPosition"
v-model:is-position-old="isPositionOld"
v-model:pos-type="posType as FormPosType" v-model:pos-type="posType as FormPosType"
v-model:pos-level="posLevel" v-model:pos-level="posLevel"
v-model:option-pos-type="optionPosType" v-model:option-pos-type="optionPosType"
@ -472,6 +468,7 @@ onMounted(() => {
:on-pos-type="onPosType" :on-pos-type="onPosType"
:node-id="nodeId" :node-id="nodeId"
:node-level="nodeLevel" :node-level="nodeLevel"
:bma-officer="props.dataRow?.bmaOfficer"
/> />
</q-tab-panel> </q-tab-panel>
</q-tab-panels> </q-tab-panels>

View file

@ -8,7 +8,6 @@ import config from "@/app.config";
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
import { checkPermission } from "@/utils/permissions"; import { checkPermission } from "@/utils/permissions";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { tokenParsed } from "@/plugins/auth";
import { usePlacementDataStore } from "@/modules/05_placement/store"; import { usePlacementDataStore } from "@/modules/05_placement/store";
import avatar from "@/assets/avatar_user.jpg"; import avatar from "@/assets/avatar_user.jpg";
@ -257,24 +256,24 @@ function convertContainStatus(val: string) {
} }
} }
/** // /**
* แปลงสถาน // *
* @param val type // * @param val type
*/ // */
function convertTypeCommand(val: string) { // function convertTypeCommand(val: string) {
switch (val) { // switch (val) {
case "APPOINTED": // case "APPOINTED":
return "บรรจุแต่งตั้ง"; // return "";
case "APPOINT": // case "APPOINT":
return "แต่งตั้ง/ย้าย"; // return "/";
// case "SLIP": // // case "SLIP":
// return ""; // // return "";
// case "MOVE": // // case "MOVE":
// return ""; // // return "";
default: // default:
return ""; // return "";
} // }
} // }
/** /**
* แปลงสถานะการสงรายช * แปลงสถานะการสงรายช
@ -579,13 +578,8 @@ function editDetail(
const modalDialogSelectOrg = ref<boolean>(false); const modalDialogSelectOrg = ref<boolean>(false);
const typeCommand = ref<string>(""); const typeCommand = ref<string>("");
const dataRow = ref<DataList>(); const dataRow = ref<DataList>();
function openAppointModal( function openAppointModal(pid: string, data: DataList) {
pid: string,
data: DataList,
typeCommandVal: "APPOINTED" | "APPOINT" | "SLIP" | "MOVE"
) {
dataRow.value = data; dataRow.value = data;
typeCommand.value = typeCommandVal;
modalDialogSelectOrg.value = !modalDialogSelectOrg.value; modalDialogSelectOrg.value = !modalDialogSelectOrg.value;
} }
@ -936,13 +930,7 @@ onMounted(async () => {
" "
clickable clickable
v-close-popup v-close-popup
@click=" @click="openAppointModal(props.row.personalId, props.row)"
openAppointModal(
props.row.personalId,
props.row,
'APPOINT'
)
"
> >
<q-item-section <q-item-section
style="min-width: 0px" style="min-width: 0px"
@ -970,13 +958,7 @@ onMounted(async () => {
" "
clickable clickable
v-close-popup v-close-popup
@click=" @click="openAppointModal(props.row.personalId, props.row)"
openAppointModal(
props.row.personalId,
props.row,
'APPOINTED'
)
"
> >
<q-item-section <q-item-section
style="min-width: 0px" style="min-width: 0px"