- 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

@ -252,7 +252,7 @@ import http from "@/plugins/http";
import config from "@/app.config";
const mixin = useCounterMixin();
const { date2Thai, messageError, showLoader, hideLoader, dialogMessage } = mixin;
const { date2Thai, messageError, showLoader, hideLoader, dialogConfirm } = mixin;
const route = useRoute();
const $q = useQuasar();
@ -382,14 +382,8 @@ const save = () => {
if (myForm.value !== null) {
myForm.value!.validate().then((success: Boolean) => {
if (success) {
// yay, models are correct
dialogMessage(
dialogConfirm(
$q,
"ยืนยันการบันทึกข้อมูล",
"ต้องการยืนยันการบันทึกข้อมูลนี้ใช่หรือไม่?",
"info",
"ตกลง",
"public",
async () => {
await putOrderData();
await postfileOrder();
@ -397,7 +391,6 @@ const save = () => {
await fetchAttachment(orderId.value);
await fecthstatusOrder(orderId.value);
},
undefined
);
}
@ -431,13 +424,8 @@ const postfileTailer = async () => {
await http.post(config.API.attachmentFileId(orderId.value), formData);
};
const clickExecute = async (id: string) => {
dialogMessage(
dialogConfirm(
$q,
"ยืนยันการออกคำสั่ง",
"ต้องการยืนยันการออกคำสั่งนี้ใช่หรือไม่?",
"info",
"ตกลง",
"public",
async () => {
await http
.put(config.API.executeOrder(id))
@ -448,7 +436,8 @@ const clickExecute = async (id: string) => {
messageError($q, e);
});
},
undefined
"ยืนยันการออกคำสั่ง",
"ต้องการยืนยันการออกคำสั่งนี้ใช่หรือไม่?",
);
};