แก้บรรจุแต่งตั้ง ตามโครงสร้างใหม่ (change req)

This commit is contained in:
Warunee Tamkoo 2024-04-30 16:21:03 +07:00
parent 8e11c4f539
commit 85dd0628f4
3 changed files with 188 additions and 92 deletions

View file

@ -29,7 +29,6 @@ const {
showLoader,
hideLoader,
messageError,
date2Thai,
dialogMessageNotify,
dialogConfirm,
} = useCounterMixin();
@ -67,6 +66,7 @@ const seletcId = ref<string>("");
const selectedPos = ref<any[]>([]);
const datePos = ref<Date>(new Date());
const posMasterMain = ref<any>([]);
const orgRevisionId = ref<string>("");
/** function เรียกข้อมูลโครงสร้าง แบบปัจุบันและ แบบร่าง*/
async function fetchOrganizationActive() {
@ -76,6 +76,7 @@ async function fetchOrganizationActive() {
.then((res) => {
const data = res.data.result;
if (data) {
orgRevisionId.value = data.activeId;
fetchDataTree(data.activeId);
}
})
@ -135,14 +136,23 @@ function updateSelected(data: TreeMain) {
* @param id idTree
* @param level levelTree
*/
const isAll = ref<boolean>(false);
const isBlank = ref<boolean>(false);
async function fetchDataTable(id: string, level: number = 0) {
console.log(props.dataRow);
showLoader();
const body = {
node: level,
nodeId: id,
position: props?.dataRow?.positionCandidate,
typeCommand: props.typeCommand,
posLevel: props.dataRow?.posLevelId,
posType: props.dataRow?.posTypeId,
isAll: isAll.value,
isBlank: isBlank.value,
};
await http
.post(config.API.orgPosPlacement, body)
.then((res) => {
@ -211,17 +221,21 @@ async function onClickSubmit() {
} else {
dialogConfirm($q, async () => {
showLoader();
const body = {
PersonalId: props?.dataRow?.personalId,
personalId: props?.dataRow?.personalId,
node: nodeLevel.value,
nodeId: nodeId.value,
posmasterId: positionId.value,
orgRevisionId: orgRevisionId.value,
positionId: selectedPos.value[0].id,
posMasterNo: dataPosMaster.posMasterNo, //()
positionName: selectedPos.value[0].positionName, //
positionField: selectedPos.value[0].positionField, //
posTypeId: selectedPos.value[0].posTypeId, //
posTypeName: selectedPos.value[0].posTypeName, //
posLevelId: selectedPos.value[0].posLevelId, //
posLevelName: selectedPos.value[0].posLevelName, //
reportingDate: datePos.value,
organizationName: dataNode.orgTreeName, //
orgTreeShortName: dataNode.orgTreeShortName, //
posPath: selectedPos.value[0].positionName, //
posNumber: dataPosMaster.posMasterNo, //()
typeCommand: props.typeCommand,
};
@ -296,7 +310,30 @@ function filterNodeFn(data: any, id: string) {
}
return null;
}
watch(
() => isAll.value,
(value, oldVal) => {
console.log("value", value);
console.log("oldVal", oldVal);
isAll.value = value;
fetchDataTable(nodeId.value, nodeLevel.value);
}
);
watch(
() => isBlank.value,
(value, oldVal) => {
console.log("isBlank value", value);
console.log("isBlank oldVal", oldVal);
isBlank.value = value;
fetchDataTable(nodeId.value, nodeLevel.value);
}
);
</script>
<template>
<q-dialog v-model="modal" full-width persistent>
<q-card>
@ -388,6 +425,8 @@ function filterNodeFn(data: any, id: string) {
v-model:datePos="datePos"
v-model:positionId="positionId"
v-model:seletcId="seletcId"
v-model:is-all="isAll"
v-model:is-blank="isBlank"
/>
</q-tab-panel>
</q-tab-panels>