no message
This commit is contained in:
parent
d4a59110c0
commit
9ba0bf2468
5 changed files with 88 additions and 90 deletions
|
|
@ -26,6 +26,8 @@ const myFormPosition = ref<any>();
|
|||
const selected = ref<string>("");
|
||||
const selectedFile = ref<string>("");
|
||||
const dataRespone = ref<any>();
|
||||
const search = ref<string>("");
|
||||
const filterRef = ref<any>(null);
|
||||
|
||||
// Set form field
|
||||
let dataForm = reactive({
|
||||
|
|
@ -105,14 +107,6 @@ const fetchplacementPosition = async () => {
|
|||
});
|
||||
};
|
||||
|
||||
const search = ref<string>("");
|
||||
//reset Tree Filter
|
||||
const filterRef = ref<any>(null);
|
||||
// const resetFilter = () => {
|
||||
// search.value = "";
|
||||
// filterRef.value.focus();
|
||||
// };
|
||||
|
||||
const props = defineProps({
|
||||
personalId: String,
|
||||
modal: Boolean,
|
||||
|
|
@ -122,10 +116,9 @@ const props = defineProps({
|
|||
},
|
||||
personal: Object,
|
||||
});
|
||||
|
||||
// filter หน่วยงาน
|
||||
const myFilterMethod = (node: any, filter: string) => {
|
||||
const filt = filter;
|
||||
|
||||
return (
|
||||
// ((node.name && node.name == null) || !node.name) &&
|
||||
(node.name && node.name.indexOf(filt) > -1) ||
|
||||
|
|
@ -156,7 +149,7 @@ const validateData = async () => {
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
// ยืนยันการเลือกหน่วยงาน
|
||||
const saveAppoint = async () => {
|
||||
myFormPosition.value.validate().then(async (result: boolean) => {
|
||||
if (result) {
|
||||
|
|
@ -170,31 +163,29 @@ const saveAppoint = async () => {
|
|||
positionPathSideId: dataForm.positionPathSideId,
|
||||
positionTypeId: dataForm.positionTypeId,
|
||||
};
|
||||
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.placementPass(), dataAppoint)
|
||||
.then(() => {
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await closeAndClear();
|
||||
await fetchPublishFile();
|
||||
await loadTreeData();
|
||||
await fetchplacementPosition();
|
||||
hideLoader();
|
||||
});
|
||||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.placementPass(), dataAppoint)
|
||||
.then(() => {
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await closeAndClear();
|
||||
await fetchPublishFile();
|
||||
await loadTreeData();
|
||||
await fetchplacementPosition();
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const editDataStatus = ref<boolean>(false);
|
||||
const clickEditRow = () => {
|
||||
editDataStatus.value = true;
|
||||
};
|
||||
|
||||
const closeModal = () => {
|
||||
if (editDataStatus.value == true) {
|
||||
|
|
@ -221,7 +212,6 @@ const closeAndClear = async () => {
|
|||
dataForm.positionLineId = "";
|
||||
dataForm.positionPathSideId = "";
|
||||
dataForm.positionTypeId = "";
|
||||
editDataStatus.value = false;
|
||||
};
|
||||
// ตำแหน่งเลขที่
|
||||
const posNoOptions = ref<Object[]>([
|
||||
|
|
@ -265,7 +255,7 @@ const positionLevelOptions = ref<Object[]>([
|
|||
value: "",
|
||||
},
|
||||
]);
|
||||
|
||||
// เลือกหน่วยงาน
|
||||
const selectedPosition = async (data: any) => {
|
||||
if (data.name == null && selected.value != data.keyId) {
|
||||
editDataStatus.value = true;
|
||||
|
|
@ -366,7 +356,6 @@ watch(props, () => {
|
|||
personal.value = data;
|
||||
});
|
||||
}
|
||||
|
||||
if (
|
||||
personal.value &&
|
||||
personal.value.draft === false &&
|
||||
|
|
@ -385,7 +374,7 @@ watch(props, () => {
|
|||
});
|
||||
}
|
||||
});
|
||||
|
||||
// หาตำหน่วยงานที่เลือก
|
||||
function findByPerson(element: any): any {
|
||||
if (
|
||||
element.positionNumId &&
|
||||
|
|
@ -406,6 +395,7 @@ function findByPerson(element: any): any {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
// ยืนยันการคืนตำแหน่ง
|
||||
const clearPosition = () => {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
|
|
@ -414,6 +404,7 @@ const clearPosition = () => {
|
|||
"ต้องการยืนยันการคืนตำแหน่งนี้ใช่หรือไม่ ?"
|
||||
);
|
||||
};
|
||||
// คืนตำแหน่ง
|
||||
const postClearPosition = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -421,7 +412,6 @@ const postClearPosition = async () => {
|
|||
.then(() => {
|
||||
success($q, "คืนตำแหน่งสำเร็จ");
|
||||
})
|
||||
|
||||
.catch((e: Object) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue