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

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`,
activeOrganizationRootById: (id: string) =>
`${organization}/active/root/${id}`,
orgPosPlacementAll: `${orgPos}/placement/search-all`,
/** ข้อมูลตำแหน่งลูกจ้างประจำ*/
orgEmployeePos: `${orgEmployeePos}/position`,
@ -137,11 +138,12 @@ export default {
checkIsOfficer: (id: string) => `${organization}/check/child1/${id}`,
checkIsDeputys: (id: string) => `${organization}/check/root/${id}`,
orgPosReport:`${orgPos}/report/draft`,
orgPosReportAct:`${orgPos}/act/report/draft`,
orgPosReport: `${orgPos}/report/draft`,
orgPosReportAct: `${orgPos}/act/report/draft`,
/**
* 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
const updatedItem = {
...item,
avatar: item.avatar ? await fetchProfile(item.avatar) : avatar,
// avatar: item.avatar ? await fetchProfile(item.avatar) : avatar,
avatar: avatar,
// item children
children: item.children
? 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 isAll = defineModel<boolean>("isAll", { required: true }); //
const isBlank = defineModel<boolean>("isBlank", { required: true }); //
const isPosition = defineModel<boolean>("isPosition", { required: true });
const isPositionOld = defineModel<boolean>("isPositionOld", { required: true }); //
const isPosition = defineModel<string>("isPosition", { required: true });
// const isPositionOld = defineModel<boolean>("isPositionOld", { required: true }); //
const posType = defineModel<FormPosType>("posType", { required: true }); //
const posLevel = defineModel<string>("posLevel", { required: true }); //
const optionPosType = defineModel<FormPosType[]>("optionPosType", {
@ -37,6 +37,7 @@ const optionPosType = defineModel<FormPosType[]>("optionPosType", {
const optionPosLevel = defineModel<FormPosLevel[]>("optionPosLevel", {
required: true,
});
const bmaOfficer = defineModel<string>("bmaOfficer", { required: true });
const positionRows = ref<DataPositionNo[]>(positionData.value);
@ -219,16 +220,16 @@ async function onClickSelectPos(id: string) {
}
}
function onPositionOld() {
props.fetchDataTable?.(props.nodeId, props.nodeLevel);
if (isPositionOld.value == false) {
posType.value.id = "";
posType.value.posTypeName = "";
posType.value.posTypeRank = null;
posType.value.posLevels = [];
posLevel.value = "";
}
}
// function onPositionOld() {
// props.fetchDataTable?.(props.nodeId, props.nodeLevel);
// if (isPositionOld.value == false) {
// posType.value.id = "";
// posType.value.posTypeName = "";
// posType.value.posTypeRank = null;
// posType.value.posLevels = [];
// posLevel.value = "";
// }
// }
// filter filter
watch(positionData, (newVal, oldVal) => {
@ -269,18 +270,6 @@ onMounted(async () => {
>
<q-tooltip>แสดงเฉพาะตำแหนงวาง </q-tooltip>
</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
keep-color
v-model="isAll"
@ -295,20 +284,34 @@ onMounted(async () => {
<div class="col-12">
<div class="row q-gutter-sm no-wrap">
<div>
<q-checkbox
<q-radio
keep-color
v-model="isPositionOld"
label="แสดงตำแหน่งที่ตรงกับประเภทและระดับเดิม"
v-model="isPosition"
val="exam"
label="แสดงเฉพาะตำแหน่งที่ตรงกับการสอบ"
color="primary"
@update:model-value="onPositionOld"
:disable="bmaOfficer == 'บุคคลภายนอก'"
>
<q-tooltip>แสดงตำแหนงทตรงกประเภทและระดบเด</q-tooltip>
</q-checkbox>
<q-tooltip>แสดงเฉพาะตำแหนงทตรงกการสอบ</q-tooltip>
</q-radio>
</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
v-if="isPositionOld"
v-if="isPosition == 'select'"
v-model="posType"
:options="optionPosType"
option-label="posTypeName"
@ -319,14 +322,14 @@ onMounted(async () => {
>
</q-select>
</div>
<div class="col-3">
<div class="col-2">
<q-select
v-if="isPositionOld"
v-if="isPosition == 'select'"
:readonly="posType == null"
v-model="posLevel"
:options="optionPosLevel"
option-label="posLevelName"
option-value="posLevelName"
option-value="id"
label="ระดับตำแหน่ง"
dense
outlined

View file

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

View file

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