ปรับ dialog บรรจุ
This commit is contained in:
parent
508fb3b02b
commit
1881aa1b2f
23 changed files with 1064 additions and 1072 deletions
|
|
@ -9,7 +9,14 @@ import config from "@/app.config";
|
|||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const { date2Thai, hideLoader, messageError, showLoader, success } = mixin; //ฟังก์ชันกลางที่เรียกใช้
|
||||
const {
|
||||
date2Thai,
|
||||
hideLoader,
|
||||
messageError,
|
||||
showLoader,
|
||||
success,
|
||||
dialogConfirm,
|
||||
} = mixin; //ฟังก์ชันกลางที่เรียกใช้
|
||||
|
||||
const notFound = ref<string>("ไม่พบข้อมูลที่ค้นหา");
|
||||
const noData = ref<string>("ไม่พบข้อมูลผังโครงสร้าง");
|
||||
|
|
@ -204,16 +211,21 @@ const clickEditRow = () => {
|
|||
|
||||
const closeModal = () => {
|
||||
if (editDataStatus.value == true) {
|
||||
$q.dialog({
|
||||
title: `ข้อมูลมีการแก้ไข`,
|
||||
message: `ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่?`,
|
||||
cancel: "ยกเลิก",
|
||||
ok: "ยืนยัน",
|
||||
persistent: true,
|
||||
}).onOk(() => {
|
||||
editDataStatus.value = false;
|
||||
closeAndClear();
|
||||
});
|
||||
dialogConfirm(
|
||||
$q,
|
||||
() => closeAndClear(),
|
||||
"ข้อมูลมีการแก้ไข",
|
||||
"ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่"
|
||||
);
|
||||
// $q.dialog({
|
||||
// title: `ข้อมูลมีการแก้ไข`,
|
||||
// message: `ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่?`,
|
||||
// cancel: "ยกเลิก",
|
||||
// ok: "ยืนยัน",
|
||||
// persistent: true,
|
||||
// }).onOk(() => {
|
||||
// closeAndClear();
|
||||
// });
|
||||
} else {
|
||||
closeAndClear();
|
||||
}
|
||||
|
|
@ -234,6 +246,7 @@ const closeAndClear = async () => {
|
|||
// dataForm.salaryAmount = null;
|
||||
// dataForm.mouthSalaryAmount = null;
|
||||
// dataForm.positionSalaryAmount = null;
|
||||
editDataStatus.value = false;
|
||||
};
|
||||
// ตำแหน่งเลขที่
|
||||
const posNoOptions = ref<Object[]>([
|
||||
|
|
@ -431,32 +444,53 @@ function findByPerson(element: any): any {
|
|||
return null;
|
||||
}
|
||||
const clearPosition = () => {
|
||||
console.log(personal.value);
|
||||
$q.dialog({
|
||||
title: "ยืนยันการคืนตำแหน่ง",
|
||||
message: "ต้องการยืนยันการคืนตำแหน่งนี้ใช่หรือไม่ ?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
const: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.clearPosition(personal.value.personalId), {})
|
||||
.then((res: Object) => success($q, "คืนตำแหน่งสำเร็จ"))
|
||||
|
||||
.catch((e: Object) => {
|
||||
console.log(e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
await closeAndClear();
|
||||
});
|
||||
// console.log(personal.value);
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => postClearPosition(),
|
||||
"ยืนยันการคืนตำแหน่ง",
|
||||
"ต้องการยืนยันการคืนตำแหน่งนี้ใช่หรือไม่ ?"
|
||||
);
|
||||
// $q.dialog({
|
||||
// title: "ยืนยันการคืนตำแหน่ง",
|
||||
// message: "ต้องการยืนยันการคืนตำแหน่งนี้ใช่หรือไม่ ?",
|
||||
// cancel: {
|
||||
// flat: true,
|
||||
// const: "negative",
|
||||
// },
|
||||
// persistent: true,
|
||||
// })
|
||||
// .onOk(async () => {
|
||||
// showLoader();
|
||||
// await http
|
||||
// .post(config.API.clearPosition(personal.value.personalId), {})
|
||||
// .then((res: Object) => success($q, "คืนตำแหน่งสำเร็จ"))
|
||||
// .catch((e: Object) => {
|
||||
// console.log(e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// hideLoader();
|
||||
// await closeAndClear();
|
||||
// });
|
||||
// })
|
||||
// .onCancel(() => {})
|
||||
// .onDismiss(() => {});
|
||||
};
|
||||
const postClearPosition = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.clearPosition(personal.value.personalId), {})
|
||||
.then(() => {
|
||||
success($q, "คืนตำแหน่งสำเร็จ");
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
|
||||
.catch((e: Object) => {
|
||||
console.log(e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
await closeAndClear();
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue