แก้ list บรรจุแต่งตั้ง & เพิ่ม fact การเจ้าหน้าที่และตำแหน่งใต้ลายเซ็นต์ในโครงสร้าง
This commit is contained in:
parent
15b33b147a
commit
4c89169e9e
4 changed files with 58 additions and 11 deletions
|
|
@ -54,6 +54,7 @@ const props = defineProps({
|
|||
fetchDataTable: Function,
|
||||
getSummary: Function,
|
||||
shortName: { type: String, required: true },
|
||||
dataTree: { type: Object, default: () => [] },
|
||||
});
|
||||
|
||||
const isReadonly = ref<boolean>(false); // อ่านได้อย่างเดียว
|
||||
|
|
@ -83,7 +84,8 @@ const formData = reactive<FormDataPosition>({
|
|||
suffixNo: "",
|
||||
reason: "",
|
||||
isDirector: false,
|
||||
isOfficer: false,
|
||||
isStaff: false,
|
||||
positionSign: "",
|
||||
});
|
||||
|
||||
//ฟอร์มตำแหน่ง
|
||||
|
|
@ -222,7 +224,8 @@ async function fetchPosition(id: string) {
|
|||
formData.suffixNo = data.posMasterNoSuffix;
|
||||
formData.reason = data.reason;
|
||||
formData.isDirector = data.isDirector;
|
||||
formData.isOfficer = data.isOfficer;
|
||||
formData.isStaff = data.isStaff;
|
||||
formData.positionSign = data.positionSign;
|
||||
rows.value = data.positions;
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -263,7 +266,9 @@ function onSubmit() {
|
|||
posMasterNoSuffix: formData.suffixNo, //Suffix หลังตำแหน่งเลขที่ เช่น ช.
|
||||
reason: formData.reason, //Suffix หลังตำแหน่งเลขที่ เช่น ช.
|
||||
isDirector: formData.isDirector,
|
||||
isOfficer: formData.isOfficer ? formData.isOfficer : false,
|
||||
isStaff: formData.isStaff ? formData.isStaff : false,
|
||||
isOfficer: false,
|
||||
positionSign: formData.positionSign,
|
||||
orgRootId: props.orgLevel === 0 ? props.treeId : null, //Id สำนัก
|
||||
orgChild1Id: props.orgLevel === 1 ? props.treeId : null,
|
||||
orgChild2Id: props.orgLevel === 2 ? props.treeId : null,
|
||||
|
|
@ -429,6 +434,8 @@ async function clearFormPositionSelect() {
|
|||
formData.isDirector = false;
|
||||
rowsPositionSelect.value = [];
|
||||
isPosition.value = false;
|
||||
formData.isStaff = false;
|
||||
formData.positionSign = "";
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -478,6 +485,17 @@ watch(
|
|||
}
|
||||
}
|
||||
);
|
||||
|
||||
watch(
|
||||
() => formData.isDirector,
|
||||
(newData, oldData) => {
|
||||
console.log("oldData", oldData);
|
||||
console.log("newData", newData);
|
||||
if (newData === true) {
|
||||
formData.positionSign = "ผู้อำนวยการ" + props.dataTree?.orgTreeName;
|
||||
}
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -644,14 +662,39 @@ watch(
|
|||
</template>
|
||||
</d-table>
|
||||
|
||||
<div class="row col-12 q-mt-sm">
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="formData.isDirector"
|
||||
label="ผู้อำนวยการ/หัวหน้า"
|
||||
/>
|
||||
<div class="row q-mt-sm">
|
||||
<div class="col-12">
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="formData.isDirector"
|
||||
label="ผู้อำนวยการ/หัวหน้า"
|
||||
/>
|
||||
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="formData.isStaff"
|
||||
label="การเจ้าหน้าที่"
|
||||
class="q-ml-sm"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="formData.isDirector"
|
||||
class="col-6 q-mt-sm q-mb-sm"
|
||||
>
|
||||
<q-input
|
||||
v-model="formData.positionSign"
|
||||
:class="inputEdit(isReadonly)"
|
||||
dense
|
||||
outlined
|
||||
for="#positionSign"
|
||||
label="ตำแหน่งใต้ลายเซ็นต์"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue