แก้บรรจุแต่งตั้ง ตามโครงสร้างใหม่ (change req)
This commit is contained in:
parent
8e11c4f539
commit
85dd0628f4
3 changed files with 188 additions and 92 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue