ui พ้นราชการ
This commit is contained in:
parent
14e1394128
commit
6f40ad3de8
13 changed files with 2703 additions and 67 deletions
|
|
@ -105,10 +105,10 @@ const fetchplacementPosition = async () => {
|
|||
const search = ref<string>("");
|
||||
//reset Tree Filter
|
||||
const filterRef = ref<any>(null);
|
||||
const resetFilter = () => {
|
||||
search.value = "";
|
||||
filterRef.value.focus();
|
||||
};
|
||||
// const resetFilter = () => {
|
||||
// search.value = "";
|
||||
// filterRef.value.focus();
|
||||
// };
|
||||
|
||||
const props = defineProps({
|
||||
personalId: String,
|
||||
|
|
@ -155,6 +155,8 @@ const validateData = async () => {
|
|||
};
|
||||
|
||||
const saveAppoint = async () => {
|
||||
console.log("save", dataForm);
|
||||
|
||||
myFormPosition.value.validate().then(async (result: boolean) => {
|
||||
if (result) {
|
||||
const dataAppoint = await {
|
||||
|
|
@ -170,8 +172,7 @@ const saveAppoint = async () => {
|
|||
// mouthSalaryAmount: dataForm.mouthSalaryAmount,
|
||||
// positionSalaryAmount: dataForm.positionSalaryAmount,
|
||||
};
|
||||
// console.log("save appoint===>", dataAppoint);
|
||||
|
||||
console.log("save appoint===>", dataAppoint);
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.placementPass(), dataAppoint)
|
||||
|
|
@ -184,7 +185,10 @@ const saveAppoint = async () => {
|
|||
})
|
||||
.finally(async () => {
|
||||
await closeAndClear();
|
||||
await resetFilter();
|
||||
// await resetFilter();
|
||||
await fetchPublishFile();
|
||||
await loadTreeData();
|
||||
await fetchplacementPosition();
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
|
@ -273,8 +277,9 @@ const positionLevelOptions = ref<Object[]>([
|
|||
]);
|
||||
|
||||
const selectedPosition = async (data: any) => {
|
||||
console.log("selecteds", data);
|
||||
if (data.name == null && selected.value != data.keyId) {
|
||||
console.log("selecteds", data);
|
||||
// console.log("selecteds", data);
|
||||
|
||||
editDataStatus.value = true;
|
||||
selected.value = data.keyId;
|
||||
|
|
@ -299,9 +304,9 @@ const selectedPosition = async (data: any) => {
|
|||
|
||||
// positionPathSide Options
|
||||
let positionPathSideArr: any = [];
|
||||
if (data.positionSideNameObj != null) {
|
||||
if (data.positionSideNameObj && data.positionSideNameObj != null) {
|
||||
data.positionSideNameObj.map((x: any) => {
|
||||
positionLevelsArr.push({
|
||||
positionPathSideArr.push({
|
||||
label: x.Name,
|
||||
value: x.Id,
|
||||
});
|
||||
|
|
@ -345,6 +350,7 @@ const selectedPosition = async (data: any) => {
|
|||
positionLevelsArr.length > 1 || positionLevelsArr.length == 0
|
||||
? ""
|
||||
: positionLevelsArr[0].value;
|
||||
dataForm.positionLevelId = data.positionLevelObj[0].Id;
|
||||
}
|
||||
} else if (selected.value == data.keyId) {
|
||||
selected.value = "";
|
||||
|
|
@ -355,6 +361,7 @@ const selectedPosition = async (data: any) => {
|
|||
dataForm.positionPathSideId = "";
|
||||
dataForm.positionTypeId = "";
|
||||
}
|
||||
console.log("dataForm", dataForm);
|
||||
};
|
||||
|
||||
const checkPosition = (val: string) => {
|
||||
|
|
@ -374,14 +381,14 @@ watch(props, () => {
|
|||
console.log("personal", personal.value);
|
||||
}
|
||||
// console.log("draft===>", personal.value.draft);
|
||||
|
||||
|
||||
if (personal.value && personal.value.draft === false) {
|
||||
// const findData = dataRespone.value.find(findByPerson);
|
||||
let findData: any = null;
|
||||
console.log(dataRespone.value);
|
||||
|
||||
dataRespone.value.map((x: any) => {
|
||||
findData = findByPerson(x);
|
||||
console.log(findData);
|
||||
|
||||
if (findData != null) {
|
||||
console.log("findData===>", findData);
|
||||
selectedPosition(findData);
|
||||
|
|
@ -403,9 +410,7 @@ function findByPerson(element: any): any {
|
|||
element.positionTypeId === personal.value.positionTypeId &&
|
||||
element.positionNumId === personal.value.posNoId &&
|
||||
(element.positionLevelObj === null ||
|
||||
element.positionLevelObj[0].Id === personal.value.positionLevelId) &&
|
||||
(element.positionSideNameObj === null ||
|
||||
element.positionSideNameObj[0].Id === personal.value.positionPathSideId)
|
||||
element.positionLevelObj[0].Id === personal.value.positionLevelId)
|
||||
) {
|
||||
return element;
|
||||
} else if (element.children) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue