- add common dialog (remove, confirm & message notify) และลองใช้ในส่วนของออกคำสั่ง

- เพิ่ม action สร้างข้อมูลทุกอันที่ส่งจากทะเบียนประวัติ
- fix bug call function in certificate
This commit is contained in:
Warunee Tamkoo 2023-08-11 23:47:18 +07:00
parent d09dbda153
commit d163ac8e1c
9 changed files with 341 additions and 1422 deletions

View file

@ -183,7 +183,7 @@ const props = defineProps({
const next = () => props.next();
const previous = () => props.previous();
const mixin = useCounterMixin(); //
const { dialogMessage, messageError, showLoader, hideLoader, success } = mixin;
const { dialogMessageNotify, dialogConfirm, dialogRemove, messageError, showLoader, hideLoader, success } = mixin;
const route = useRoute();
const $q = useQuasar();
@ -306,15 +306,9 @@ const getData = async (id: string) => {
// };
const dialogDeleteData = async (id: string) => {
dialogMessage(
dialogRemove(
$q,
"ยืนยันการลบข้อมูล",
"ต้องการลบข้อมูลนี้ใช่หรือไม่?",
"mdi-delete",
"ตกลง",
"red",
() => deleteData(id),
undefined
);
};
@ -442,14 +436,10 @@ const putSalary = async (salary: any) => {
positionSalaryAmount: Number(salary.positionSalaryAmount),
monthSalaryAmount: Number(salary.mouthSalaryAmount),
};
dialogMessage(
dialogConfirm(
$q,
"ยืนยันการบันทึกข้อมูล",
"ต้องการบันทึกข้อมูลนี้ใช่หรือไม่?",
"info",
"ตกลง",
"public",
async () => {
showLoader()
await http
.put(config.API.salaryOrder(personalId.value), modalData.value)
.then((res: any) => {
@ -463,9 +453,9 @@ const putSalary = async (salary: any) => {
.finally(async () => {
await conditionData();
modal.value = false;
hideLoader()
});
},
undefined
);
};
@ -514,20 +504,15 @@ const saveModalAdd = () => {
if (myFormAdd.value !== null) {
myFormAdd.value.validate().then(async (result: boolean) => {
if (result && selected.value.length !== 0) {
dialogMessage(
dialogConfirm(
$q,
"ยืนยันการเพิ่มรายชื่อออกคำสั่ง",
"ต้องการยืนยันการเพิ่มรายชื่อออกคำสั่งนี้ใช่หรือไม่?",
"info",
"ตกลง",
"public",
() => {
let data = [];
data.push(...selected.value.map((e: any) => e.refRecordId));
// console.log(data);
addlist(data);
},
undefined
"ยืนยันการเพิ่มรายชื่อออกคำสั่ง",
"ต้องการยืนยันการเพิ่มรายชื่อออกคำสั่งนี้ใช่หรือไม่?",
);
}
@ -563,31 +548,18 @@ const click = (e: any) => {
const save = () => {
if (selected.value.length > 0) {
dialogMessage(
dialogConfirm(
$q,
"ยืนยันการบันทึกข้อมูล",
"ต้องการยืนยันการบันทึกข้อมูลนี้ใช่หรือไม่?",
"info",
"ตกลง",
"public",
() => {
success($q, "บันทึกข้อมูลสำเร็จ");
next();
},
undefined
);
} else {
dialogMessage(
dialogMessageNotify(
$q,
"ข้อความแจ้งเตือน",
"กรุณาเลือกรายชื่อ",
"warning",
undefined,
"orange",
undefined,
undefined,
true
);
}
};