เพิ่ม dialog
This commit is contained in:
parent
4da9bdd7f0
commit
b412634096
17 changed files with 264 additions and 194 deletions
|
|
@ -260,7 +260,6 @@
|
|||
:cancel="clickCancel"
|
||||
:edit="clickEdit"
|
||||
:save="clickSave"
|
||||
:validate="validateData"
|
||||
:clickNext="clickNext"
|
||||
:clickPrevious="clickPrevious"
|
||||
:clickDelete="clickDelete"
|
||||
|
|
@ -340,7 +339,7 @@ const store = useProfileDataStore();
|
|||
const { profileData, changeProfileColumns } = store;
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
|
||||
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader,dialogConfirm } =
|
||||
mixin;
|
||||
const route = useRoute();
|
||||
const id = ref<string>("");
|
||||
|
|
@ -700,8 +699,11 @@ const clickAdd = async () => {
|
|||
/**
|
||||
* กดบันทึกใน dialog
|
||||
*/
|
||||
const clickSave = async () => {
|
||||
myForm.value.validate().then(async (result: boolean) => {
|
||||
const clickSave = () =>{
|
||||
dialogConfirm($q,()=>SaveData())
|
||||
}
|
||||
const SaveData = async () => {
|
||||
await myForm.value.validate().then(async (result: boolean) => {
|
||||
if (result) {
|
||||
if (modalEdit.value) {
|
||||
await editData();
|
||||
|
|
@ -934,14 +936,14 @@ const clickHistory = async (row: RequestItemsObject) => {
|
|||
/**
|
||||
* validate input ใน dialog
|
||||
*/
|
||||
const validateData = async () => {
|
||||
checkValidate.value = true;
|
||||
await myForm.value.validate().then((result: boolean) => {
|
||||
if (result == false) {
|
||||
checkValidate.value = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
// const validateData = async () => {
|
||||
// checkValidate.value = true;
|
||||
// await myForm.value.validate().then((result: boolean) => {
|
||||
// if (result == false) {
|
||||
// checkValidate.value = false;
|
||||
// }
|
||||
// });
|
||||
// };
|
||||
|
||||
/**
|
||||
* class จัดรูปแบบแสดงระหว่างข้อมูลที่แก้ไขหรือแสดงเฉยๆ
|
||||
|
|
|
|||
|
|
@ -230,7 +230,6 @@
|
|||
:cancel="clickCancel"
|
||||
:edit="clickEdit"
|
||||
:save="clickSave"
|
||||
:validate="validateData"
|
||||
:clickNext="clickNext"
|
||||
:clickPrevious="clickPrevious"
|
||||
:clickDelete="clickDelete"
|
||||
|
|
@ -309,7 +308,7 @@ const store = useProfileDataStore();
|
|||
const { profileData, changeProfileColumns } = store;
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
|
||||
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader, dialogConfirm } =
|
||||
mixin;
|
||||
const route = useRoute();
|
||||
const id = ref<string>("");
|
||||
|
|
@ -689,8 +688,11 @@ const clickAdd = async () => {
|
|||
/**
|
||||
* กดบันทึกใน dialog
|
||||
*/
|
||||
const clickSave = async () => {
|
||||
myForm.value.validate().then(async (result: boolean) => {
|
||||
const clickSave = () => {
|
||||
dialogConfirm($q,()=>SaveData())
|
||||
}
|
||||
const SaveData = async () => {
|
||||
await myForm.value.validate().then(async (result: boolean) => {
|
||||
if (result) {
|
||||
if (modalEdit.value) {
|
||||
await editData();
|
||||
|
|
@ -915,14 +917,14 @@ const clickHistory = async (row: RequestItemsObject) => {
|
|||
/**
|
||||
* validate input ใน dialog
|
||||
*/
|
||||
const validateData = async () => {
|
||||
checkValidate.value = true;
|
||||
await myForm.value.validate().then((result: boolean) => {
|
||||
if (result == false) {
|
||||
checkValidate.value = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
// const validateData = async () => {
|
||||
// checkValidate.value = true;
|
||||
// await myForm.value.validate().then((result: boolean) => {
|
||||
// if (result == false) {
|
||||
// checkValidate.value = false;
|
||||
// }
|
||||
// });
|
||||
// };
|
||||
|
||||
/**
|
||||
* class จัดรูปแบบแสดงระหว่างข้อมูลที่แก้ไขหรือแสดงเฉยๆ
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
<template>
|
||||
<q-card flat bordered class="col-12 row q-px-lg q-py-md">
|
||||
<q-form ref="myform" class="col-12">
|
||||
<HeaderTop
|
||||
v-model:edit="edit"
|
||||
header="เอกสารหลักฐาน"
|
||||
icon="mdi-file-document"
|
||||
:history="false"
|
||||
:changeBtn="changeBtn"
|
||||
:cancel="onCancel"
|
||||
:disable="statusEdit"
|
||||
:save="uploadData"
|
||||
/>
|
||||
|
|
@ -48,6 +50,7 @@
|
|||
</q-item>
|
||||
</q-list>
|
||||
</q-card>
|
||||
|
||||
<q-input
|
||||
v-if="edit"
|
||||
class="q-mt-sm col-12 q-pb-xs"
|
||||
|
|
@ -131,6 +134,7 @@
|
|||
</template>
|
||||
</q-uploader>
|
||||
</div>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
|
@ -153,13 +157,17 @@ const props = defineProps({
|
|||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
statusAdd: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(["update:statusEdit"]);
|
||||
|
||||
const $q = useQuasar(); // show dialog
|
||||
const mixin = useCounterMixin();
|
||||
const route = useRoute();
|
||||
const { success, messageError, showLoader, hideLoader } = mixin;
|
||||
const { success, messageError, showLoader, hideLoader ,dialogConfirm} = mixin;
|
||||
const profileId = ref<string>(
|
||||
route.params.id ? route.params.id.toString() : ""
|
||||
);
|
||||
|
|
@ -168,7 +176,7 @@ const uploader = ref<any>();
|
|||
const files = ref<any>([]);
|
||||
const file = ref<any>([]);
|
||||
const name = ref<string>("");
|
||||
|
||||
const myform = ref<QForm | null>(null);
|
||||
onMounted(async () => {
|
||||
await getData();
|
||||
});
|
||||
|
|
@ -205,8 +213,30 @@ const deleteData = async (id: string) => {
|
|||
await getData();
|
||||
});
|
||||
};
|
||||
|
||||
const uploadData = async () => {
|
||||
const uploadData = () =>{
|
||||
dialogConfirm($q,()=> Datasave())
|
||||
}
|
||||
const Datasave = async () => {
|
||||
if (myform.value != null) {
|
||||
await myform.value.validate().then(async (success: boolean) => {
|
||||
if (success) {
|
||||
if (props.statusAdd) {
|
||||
// await addData();
|
||||
} else {
|
||||
await Dataupload();
|
||||
}
|
||||
} else {
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
const onCancel = async () => {
|
||||
if (myform.value != null) {
|
||||
myform.value.reset();
|
||||
}
|
||||
await getData();
|
||||
};
|
||||
const Dataupload = async () => {
|
||||
if (profileId.value) {
|
||||
if (file.value.length > 0) {
|
||||
const blob = file.value.slice(0, file.value[0].size);
|
||||
|
|
|
|||
|
|
@ -611,7 +611,7 @@ const store = useProfileDataStore();
|
|||
const { profileData, changeProfileColumns } = store;
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { success, dateToISO, date2Thai, messageError, showLoader, hideLoader } =
|
||||
const { success, dateToISO, date2Thai, messageError, showLoader, hideLoader,dialogConfirm } =
|
||||
mixin;
|
||||
const route = useRoute();
|
||||
const id = ref<string>("");
|
||||
|
|
@ -1235,8 +1235,11 @@ const clickAdd = async () => {
|
|||
/**
|
||||
* กดบันทึกใน dialog
|
||||
*/
|
||||
const clickSave = async () => {
|
||||
myForm.value.validate().then(async (result: boolean) => {
|
||||
const clickSave = () => {
|
||||
dialogConfirm($q,() => SaveData() )
|
||||
}
|
||||
const SaveData = async () => {
|
||||
await myForm.value.validate().then(async (result: boolean) => {
|
||||
if (result) {
|
||||
if (modalEdit.value) {
|
||||
await editData();
|
||||
|
|
@ -1537,14 +1540,14 @@ const clickHistory = async (row: RequestItemsObject) => {
|
|||
/**
|
||||
* validate input ใน dialog
|
||||
*/
|
||||
const validateData = async () => {
|
||||
checkValidate.value = true;
|
||||
await myForm.value.validate().then((result: boolean) => {
|
||||
if (result == false) {
|
||||
checkValidate.value = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
// const validateData = async () => {
|
||||
// checkValidate.value = true;
|
||||
// await myForm.value.validate().then((result: boolean) => {
|
||||
// if (result == false) {
|
||||
// checkValidate.value = false;
|
||||
// }
|
||||
// });
|
||||
// };
|
||||
|
||||
/**
|
||||
* class จัดรูปแบบแสดงระหว่างข้อมูลที่แก้ไขหรือแสดงเฉยๆ
|
||||
|
|
|
|||
|
|
@ -323,7 +323,7 @@ const route = useRoute();
|
|||
const $q = useQuasar();
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, success, messageError, showLoader, hideLoader } = mixin;
|
||||
const { date2Thai, success, messageError, showLoader, hideLoader, dialogConfirm } = mixin;
|
||||
const edit = ref<boolean>(false);
|
||||
const addressData = ref<Address>(defaultAddress);
|
||||
const myform = ref<any>();
|
||||
|
|
@ -714,8 +714,10 @@ const addData = async () => {
|
|||
// await changeBirth(informaData.value.birthDate ?? new Date());
|
||||
// });
|
||||
};
|
||||
|
||||
const saveData = async () => {
|
||||
dialogConfirm($q,() => Datasave())
|
||||
}
|
||||
const Datasave = async () => {
|
||||
await myform.value.validate().then(async (success: boolean) => {
|
||||
if (success) {
|
||||
if (props.statusAdd) {
|
||||
|
|
|
|||
|
|
@ -213,7 +213,6 @@
|
|||
:cancel="clickCancel"
|
||||
:edit="clickEdit"
|
||||
:save="clickSave"
|
||||
:validate="validateData"
|
||||
:clickNext="clickNext"
|
||||
:clickPrevious="clickPrevious"
|
||||
:clickDelete="clickDelete"
|
||||
|
|
@ -292,7 +291,7 @@ const store = useProfileDataStore();
|
|||
const { profileData, changeProfileColumns } = store;
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
|
||||
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader ,dialogConfirm} =
|
||||
mixin;
|
||||
const route = useRoute();
|
||||
const id = ref<string>("");
|
||||
|
|
@ -583,8 +582,11 @@ const clickAdd = async () => {
|
|||
/**
|
||||
* กดบันทึกใน dialog
|
||||
*/
|
||||
const clickSave = async () => {
|
||||
myForm.value.validate().then(async (result: boolean) => {
|
||||
const clickSave = () => {
|
||||
dialogConfirm($q,() => SaveData())
|
||||
}
|
||||
const SaveData = async () => {
|
||||
await myForm.value?.validate().then(async (result: boolean) => {
|
||||
if (result) {
|
||||
if (modalEdit.value) {
|
||||
await editData();
|
||||
|
|
@ -803,14 +805,14 @@ const clickHistory = async (row: RequestItemsObject) => {
|
|||
/**
|
||||
* validate input ใน dialog
|
||||
*/
|
||||
const validateData = async () => {
|
||||
checkValidate.value = true;
|
||||
await myForm.value.validate().then((result: boolean) => {
|
||||
if (result == false) {
|
||||
checkValidate.value = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
// const validateData = async () => {
|
||||
// checkValidate.value = true;
|
||||
// await myForm.value.validate().then((result: boolean) => {
|
||||
// if (result == false) {
|
||||
// checkValidate.value = false;
|
||||
// }
|
||||
// });
|
||||
// };
|
||||
|
||||
/**
|
||||
* class จัดรูปแบบแสดงระหว่างข้อมูลที่แก้ไขหรือแสดงเฉยๆ
|
||||
|
|
|
|||
|
|
@ -1126,7 +1126,7 @@ const route = useRoute();
|
|||
const $q = useQuasar();
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, success, messageError, showLoader, hideLoader } = mixin;
|
||||
const { date2Thai, success, messageError, showLoader, hideLoader ,dialogConfirm} = mixin;
|
||||
const edit = ref<boolean>(false);
|
||||
const fix = ref<boolean>(true);
|
||||
const myform = ref<QForm | null>(null);
|
||||
|
|
@ -1456,8 +1456,10 @@ const addData = async () => {
|
|||
// await changeBirth(informaData.value.birthDate ?? new Date());
|
||||
// });
|
||||
};
|
||||
|
||||
const saveData = async () => {
|
||||
const saveData = () =>{
|
||||
dialogConfirm($q,() => Datasave())
|
||||
}
|
||||
const Datasave = async () => {
|
||||
await myform.value?.validate().then(async (success: boolean) => {
|
||||
if (success) {
|
||||
if (props.statusAdd) {
|
||||
|
|
|
|||
|
|
@ -458,6 +458,7 @@ const {
|
|||
dialogMessage,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
dialogConfirm
|
||||
} = mixin;
|
||||
|
||||
const profileStore = useProfileDataStore();
|
||||
|
|
@ -1103,7 +1104,10 @@ const addData = async () => {
|
|||
// });
|
||||
};
|
||||
|
||||
const saveData = async () => {
|
||||
const saveData = async () =>{
|
||||
dialogConfirm($q,()=>Datasave())
|
||||
}
|
||||
const Datasave = async () => {
|
||||
if (myform.value != null) {
|
||||
await myform.value.validate().then(async (success: boolean) => {
|
||||
if (success) {
|
||||
|
|
|
|||
|
|
@ -233,7 +233,6 @@
|
|||
:cancel="clickCancel"
|
||||
:edit="clickEdit"
|
||||
:save="clickSave"
|
||||
:validate="validateData"
|
||||
:clickNext="clickNext"
|
||||
:clickPrevious="clickPrevious"
|
||||
:clickDelete="clickDelete"
|
||||
|
|
@ -391,6 +390,7 @@ const {
|
|||
dateToISO,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
dialogConfirm
|
||||
} = mixin;
|
||||
const route = useRoute();
|
||||
|
||||
|
|
@ -951,8 +951,11 @@ const clickCancel = async () => {
|
|||
// /**
|
||||
// * กดบันทึกใน dialog
|
||||
// */
|
||||
const clickSave = async () => {
|
||||
myFormAdd.value.validate().then(async (result: boolean) => {
|
||||
const clickSave = () => {
|
||||
dialogConfirm($q,() => SaveData())
|
||||
}
|
||||
const SaveData = async () => {
|
||||
await myFormAdd.value.validate().then(async (result: boolean) => {
|
||||
if (result) {
|
||||
if (modalEdit.value) {
|
||||
await editData();
|
||||
|
|
@ -1220,14 +1223,14 @@ const clickTotal = async () => {
|
|||
// /**
|
||||
// * validate input ใน dialog
|
||||
// */
|
||||
const validateData = async () => {
|
||||
checkValidate.value = true;
|
||||
await myFormAdd.value.validate().then((result: boolean) => {
|
||||
if (result == false) {
|
||||
checkValidate.value = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
// const validateData = async () => {
|
||||
// checkValidate.value = true;
|
||||
// await myFormAdd.value.validate().then((result: boolean) => {
|
||||
// if (result == false) {
|
||||
// checkValidate.value = false;
|
||||
// }
|
||||
// });
|
||||
// };
|
||||
|
||||
// /**
|
||||
// * class จัดรูปแบบแสดงระหว่างข้อมูลที่แก้ไขหรือแสดงเฉยๆ
|
||||
|
|
|
|||
|
|
@ -491,6 +491,9 @@ const {
|
|||
hideLoader,
|
||||
date2Thai,
|
||||
dialogMessage,
|
||||
dialogRemove,
|
||||
dialogConfirm,
|
||||
dialogMessageNotify
|
||||
} = mixin;
|
||||
|
||||
const modaladdOrder = ref<boolean>(false);
|
||||
|
|
@ -1256,38 +1259,42 @@ const clickAddOrder = () => {
|
|||
const clickCloseSendModal = () => {
|
||||
modaladdOrder.value = false;
|
||||
};
|
||||
|
||||
const checkSave = async () => {
|
||||
const checkSave = () =>{
|
||||
dialogConfirm($q,async() => await saveData())
|
||||
}
|
||||
const saveData = async () => {
|
||||
if (selectedPosition.value.length == 0) {
|
||||
dialogMessage(
|
||||
dialogMessageNotify(
|
||||
$q,
|
||||
"ไม่สามารถบันทึกข้อมูลได้",
|
||||
"กรุณาเลือกตำแหน่ง",
|
||||
"warning",
|
||||
undefined,
|
||||
"orange",
|
||||
undefined,
|
||||
undefined,
|
||||
true
|
||||
"ไม่สามารถบันทึกข้อมูลได้ กรุณาเลือกตำแหน่ง",
|
||||
// "กรุณาเลือกตำแหน่ง",
|
||||
// "warning",
|
||||
// undefined,
|
||||
// "orange",
|
||||
// undefined,
|
||||
// undefined,
|
||||
// true
|
||||
);
|
||||
return;
|
||||
} else {
|
||||
await savePosition();
|
||||
}
|
||||
};
|
||||
|
||||
const checkSaveOrder = async () => {
|
||||
const checkSaveOrder = () =>{
|
||||
dialogConfirm($q,async() => await SaveOrder())
|
||||
}
|
||||
const SaveOrder = async () => {
|
||||
if (selectedToOrder.value.length == 0) {
|
||||
dialogMessage(
|
||||
dialogMessageNotify(
|
||||
$q,
|
||||
"ไม่สามารถบันทึกข้อมูลได้",
|
||||
"กรุณาเลือกตำแหน่ง",
|
||||
"warning",
|
||||
undefined,
|
||||
"orange",
|
||||
undefined,
|
||||
undefined,
|
||||
true
|
||||
"ไม่สามารถบันทึกข้อมูลได้ กรุณาเลือกตำแหน่ง",
|
||||
// "กรุณาเลือกตำแหน่ง",
|
||||
// "warning",
|
||||
// undefined,
|
||||
// "orange",
|
||||
// undefined,
|
||||
// undefined,
|
||||
// true
|
||||
);
|
||||
return;
|
||||
} else {
|
||||
|
|
@ -1396,17 +1403,12 @@ const editDetail = async (row: any) => {
|
|||
modal.value = true;
|
||||
};
|
||||
|
||||
const clickDelete = (id: string) => {
|
||||
$q.dialog({
|
||||
title: "ยืนยันการลบข้อมูล",
|
||||
message: "ต้องการลบข้อมูลนี้ใช่หรือไม่?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
|
||||
const clickDelete = (id: string) =>{
|
||||
dialogRemove($q,async () => await deleteData(id))
|
||||
}
|
||||
|
||||
const deleteData = async(id: string) => {
|
||||
showLoader();
|
||||
await http
|
||||
.delete(config.API.profileInforId(id))
|
||||
|
|
@ -1419,10 +1421,7 @@ const clickDelete = (id: string) => {
|
|||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
})
|
||||
};
|
||||
|
||||
const nodeTree = async () => {
|
||||
|
|
@ -1578,6 +1577,5 @@ const onSelected = async (id: string) => {
|
|||
// await fetchPositionNumber(id);
|
||||
};
|
||||
|
||||
const deleteData = async (id: string) => {};
|
||||
</script>
|
||||
<style lang="scss"></style>
|
||||
|
|
|
|||
|
|
@ -122,7 +122,6 @@
|
|||
:cancel="clickCancel"
|
||||
:edit="clickEdit"
|
||||
:save="clickSave"
|
||||
:validate="validateData"
|
||||
:clickNext="clickNext"
|
||||
:clickPrevious="clickPrevious"
|
||||
:clickDelete="clickDelete"
|
||||
|
|
@ -193,7 +192,7 @@ const store = useProfileDataStore();
|
|||
const { profileData, changeProfileColumns } = store;
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, success, messageError, showLoader, hideLoader } = mixin;
|
||||
const { date2Thai, success, messageError, showLoader, hideLoader ,dialogConfirm} = mixin;
|
||||
const route = useRoute();
|
||||
const id = ref<string>("");
|
||||
const date = ref<Date>(new Date());
|
||||
|
|
@ -394,7 +393,10 @@ const clickAdd = async () => {
|
|||
/**
|
||||
* กดบันทึกใน dialog
|
||||
*/
|
||||
const clickSave = async () => {
|
||||
const clickSave = () => {
|
||||
dialogConfirm($q,()=>SaveData())
|
||||
}
|
||||
const SaveData = async () => {
|
||||
myForm.value.validate().then(async (result: boolean) => {
|
||||
if (result) {
|
||||
if (modalEdit.value) {
|
||||
|
|
@ -597,14 +599,14 @@ const clickHistory = async (row: RequestItemsObject) => {
|
|||
/**
|
||||
* validate input ใน dialog
|
||||
*/
|
||||
const validateData = async () => {
|
||||
checkValidate.value = true;
|
||||
await myForm.value.validate().then((result: boolean) => {
|
||||
if (result == false) {
|
||||
checkValidate.value = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
// const validateData = async () => {
|
||||
// checkValidate.value = true;
|
||||
// await myForm.value.validate().then((result: boolean) => {
|
||||
// if (result == false) {
|
||||
// checkValidate.value = false;
|
||||
// }
|
||||
// });
|
||||
// };
|
||||
|
||||
/**
|
||||
* class จัดรูปแบบแสดงระหว่างข้อมูลที่แก้ไขหรือแสดงเฉยๆ
|
||||
|
|
|
|||
|
|
@ -204,6 +204,7 @@
|
|||
:borderless="!edit"
|
||||
v-model="posNoEmployee"
|
||||
:label="`${'ตำแหน่งเลขที่'}`"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกตำแหน่งเลขที่'}`]"
|
||||
@update:modelValue="clickEditRow"
|
||||
hide-bottom-space
|
||||
autogrow
|
||||
|
|
@ -242,6 +243,7 @@
|
|||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
:rules="[(val:string) => !!val || `${'กรุณาเลือกด้านของตำแหน่ง'}`]"
|
||||
v-model="employeePositionSideId"
|
||||
:label="`${'ด้านของตำแหน่ง'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
|
|
@ -271,6 +273,7 @@
|
|||
@update:modelValue="clickEditRow"
|
||||
emit-value
|
||||
map-options
|
||||
:rules="[(val:string) => !!val || `${'กรุณาเลือกระดับ'}`]"
|
||||
option-label="name"
|
||||
:options="employeeLevelOptions"
|
||||
option-value="id"
|
||||
|
|
@ -297,6 +300,7 @@
|
|||
map-options
|
||||
option-label="name"
|
||||
:options="employeeGroupOptions"
|
||||
:rules="[(val:string) => !!val || `${'กรุณาเลือกกุ่มงาน'}`]"
|
||||
option-value="id"
|
||||
hide-bottom-space
|
||||
use-input
|
||||
|
|
@ -339,6 +343,7 @@
|
|||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="amount"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกค่าจ้าง'}`]"
|
||||
:label="`${'ค่าจ้าง'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
type="number"
|
||||
|
|
@ -429,6 +434,7 @@
|
|||
option-label="name"
|
||||
:options="refOptions"
|
||||
option-value="id"
|
||||
:rules="[(val:string) => !!val || `${'กรุณาเลือกต้นแบบ (template) เอกสารอ้างอิง'}`]"
|
||||
hide-bottom-space
|
||||
use-input
|
||||
input-debounce="0"
|
||||
|
|
@ -447,6 +453,7 @@
|
|||
:borderless="!edit"
|
||||
v-model="salaryRef"
|
||||
:label="`${'เอกสารอ้างอิง'}`"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกเอกสารอ้างอิง'}`]"
|
||||
@update:modelValue="clickEditRow"
|
||||
type="textarea"
|
||||
hide-bottom-space
|
||||
|
|
@ -509,7 +516,6 @@
|
|||
:cancel="clickCancel"
|
||||
:edit="clickEdit"
|
||||
:save="clickSave"
|
||||
:validate="validateData"
|
||||
:clickNext="clickNext"
|
||||
:clickPrevious="clickPrevious"
|
||||
:clickDelete="clickDelete"
|
||||
|
|
@ -602,6 +608,7 @@ const {
|
|||
dialogMessage,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
dialogConfirm
|
||||
} = mixin;
|
||||
const route = useRoute();
|
||||
const id = ref<string>("");
|
||||
|
|
@ -1686,8 +1693,11 @@ const templateDetail = async () => {
|
|||
/**
|
||||
* กดบันทึกใน dialog
|
||||
*/
|
||||
const clickSave = async () => {
|
||||
myForm.value.validate().then(async (result: boolean) => {
|
||||
const clickSave = () =>{
|
||||
dialogConfirm($q,() => SaveData())
|
||||
}
|
||||
const SaveData = async () => {
|
||||
await myForm.value.validate().then(async (result: boolean) => {
|
||||
if (result) {
|
||||
if (modalEdit.value) {
|
||||
await editData();
|
||||
|
|
@ -1988,14 +1998,14 @@ const clickHistory = async (row: RequestItemsEmployee) => {
|
|||
/**
|
||||
* validate input ใน dialog
|
||||
*/
|
||||
const validateData = async () => {
|
||||
checkValidate.value = true;
|
||||
await myForm.value.validate().then((result: boolean) => {
|
||||
if (result == false) {
|
||||
checkValidate.value = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
// const validateData = async () => {
|
||||
// checkValidate.value = true;
|
||||
// await myForm.value.validate().then((result: boolean) => {
|
||||
// if (result == false) {
|
||||
// checkValidate.value = false;
|
||||
// }
|
||||
// });
|
||||
// };
|
||||
|
||||
/**
|
||||
* class จัดรูปแบบแสดงระหว่างข้อมูลที่แก้ไขหรือแสดงเฉยๆ
|
||||
|
|
|
|||
|
|
@ -123,7 +123,6 @@
|
|||
:cancel="clickCancel"
|
||||
:edit="clickEdit"
|
||||
:save="clickSave"
|
||||
:validate="validateData"
|
||||
:clickNext="clickNext"
|
||||
:clickPrevious="clickPrevious"
|
||||
:clickDelete="clickDelete"
|
||||
|
|
@ -191,7 +190,7 @@ const store = useProfileDataStore();
|
|||
const { profileData, changeProfileColumns } = store;
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
|
||||
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader,dialogConfirm } =
|
||||
mixin;
|
||||
const route = useRoute();
|
||||
const id = ref<string>("");
|
||||
|
|
@ -449,8 +448,11 @@ const clickAdd = async () => {
|
|||
/**
|
||||
* กดบันทึกใน dialog
|
||||
*/
|
||||
const clickSave = async () => {
|
||||
myForm.value.validate().then(async (result: boolean) => {
|
||||
const clickSave = () => {
|
||||
dialogConfirm($q,()=>SaveData())
|
||||
}
|
||||
const SaveData = async () => {
|
||||
await myForm.value.validate().then(async (result: boolean) => {
|
||||
if (result) {
|
||||
if (modalEdit.value) {
|
||||
await editData();
|
||||
|
|
@ -662,14 +664,14 @@ const clickHistory = async (row: RequestItemsObject) => {
|
|||
/**
|
||||
* validate input ใน dialog
|
||||
*/
|
||||
const validateData = async () => {
|
||||
checkValidate.value = true;
|
||||
await myForm.value.validate().then((result: boolean) => {
|
||||
if (result == false) {
|
||||
checkValidate.value = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
// const validateData = async () => {
|
||||
// checkValidate.value = true;
|
||||
// await myForm.value.validate().then((result: boolean) => {
|
||||
// if (result == false) {
|
||||
// checkValidate.value = false;
|
||||
// }
|
||||
// });
|
||||
// };
|
||||
|
||||
/**
|
||||
* class จัดรูปแบบแสดงระหว่างข้อมูลที่แก้ไขหรือแสดงเฉยๆ
|
||||
|
|
|
|||
|
|
@ -351,7 +351,6 @@
|
|||
:cancel="clickCancel"
|
||||
:edit="clickEdit"
|
||||
:save="clickSave"
|
||||
:validate="validateData"
|
||||
:clickNext="clickNext"
|
||||
:clickPrevious="clickPrevious"
|
||||
:clickDelete="clickDelete"
|
||||
|
|
@ -430,7 +429,7 @@ const store = useProfileDataStore();
|
|||
const { profileData, changeProfileColumns } = store;
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
|
||||
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader,dialogConfirm } =
|
||||
mixin;
|
||||
const route = useRoute();
|
||||
const id = ref<string>("");
|
||||
|
|
@ -860,8 +859,8 @@ const clickAdd = async () => {
|
|||
/**
|
||||
* กดบันทึกใน dialog
|
||||
*/
|
||||
const clickSave = async () => {
|
||||
myForm.value.validate().then(async (result: boolean) => {
|
||||
const SaveData = async () => {
|
||||
await myForm.value.validate().then(async (result: boolean) => {
|
||||
if (result) {
|
||||
if (modalEdit.value) {
|
||||
await editData();
|
||||
|
|
@ -875,6 +874,9 @@ const clickSave = async () => {
|
|||
/**
|
||||
* บันทึกเพิ่มข้อมูล
|
||||
*/
|
||||
const clickSave = () => {
|
||||
dialogConfirm($q,() => SaveData())
|
||||
}
|
||||
const saveData = async () => {
|
||||
if (profileId.value) {
|
||||
showLoader();
|
||||
|
|
@ -1103,14 +1105,14 @@ const clickHistory = async (row: RequestItemsObject) => {
|
|||
/**
|
||||
* validate input ใน dialog
|
||||
*/
|
||||
const validateData = async () => {
|
||||
checkValidate.value = true;
|
||||
await myForm.value.validate().then((result: boolean) => {
|
||||
if (result == false) {
|
||||
checkValidate.value = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
// const validateData = async () => {
|
||||
// checkValidate.value = true;
|
||||
// await myForm.value.validate().then((result: boolean) => {
|
||||
// if (result == false) {
|
||||
// checkValidate.value = false;
|
||||
// }
|
||||
// });
|
||||
// };
|
||||
|
||||
/**
|
||||
* class จัดรูปแบบแสดงระหว่างข้อมูลที่แก้ไขหรือแสดงเฉยๆ
|
||||
|
|
|
|||
|
|
@ -255,7 +255,6 @@
|
|||
:cancel="clickCancel"
|
||||
:edit="clickEdit"
|
||||
:save="clickSave"
|
||||
:validate="validateData"
|
||||
:clickNext="clickNext"
|
||||
:clickPrevious="clickPrevious"
|
||||
:clickDelete="clickDelete"
|
||||
|
|
@ -331,7 +330,7 @@ const store = useProfileDataStore();
|
|||
const { profileData, changeProfileColumns } = store;
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
|
||||
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader,dialogConfirm } =
|
||||
mixin;
|
||||
const route = useRoute();
|
||||
const id = ref<string>("");
|
||||
|
|
@ -654,8 +653,11 @@ const clickAdd = async () => {
|
|||
/**
|
||||
* กดบันทึกใน dialog
|
||||
*/
|
||||
const clickSave = async () => {
|
||||
myForm.value.validate().then(async (result: boolean) => {
|
||||
const clickSave = () => {
|
||||
dialogConfirm($q,() => SaveData())
|
||||
}
|
||||
const SaveData = async () => {
|
||||
await myForm.value.validate().then(async (result: boolean) => {
|
||||
if (result) {
|
||||
if (modalEdit.value) {
|
||||
await editData();
|
||||
|
|
@ -880,14 +882,14 @@ const clickHistory = async (row: RequestItemsObject) => {
|
|||
/**
|
||||
* validate input ใน dialog
|
||||
*/
|
||||
const validateData = async () => {
|
||||
checkValidate.value = true;
|
||||
await myForm.value.validate().then((result: boolean) => {
|
||||
if (result == false) {
|
||||
checkValidate.value = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
// const validateData = async () => {
|
||||
// checkValidate.value = true;
|
||||
// await myForm.value.validate().then((result: boolean) => {
|
||||
// if (result == false) {
|
||||
// checkValidate.value = false;
|
||||
// }
|
||||
// });
|
||||
// };
|
||||
|
||||
/**
|
||||
* class จัดรูปแบบแสดงระหว่างข้อมูลที่แก้ไขหรือแสดงเฉยๆ
|
||||
|
|
|
|||
|
|
@ -439,6 +439,7 @@ const {
|
|||
dialogMessage,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
dialogConfirm
|
||||
} = mixin;
|
||||
|
||||
const profileStore = useProfileDataStore();
|
||||
|
|
@ -1090,6 +1091,7 @@ const addData = async () => {
|
|||
emit("update:statusEdit", false);
|
||||
await fetchData();
|
||||
await changeBirth(informaData.value.birthDate ?? new Date());
|
||||
await clickBack()
|
||||
hideLoader();
|
||||
});
|
||||
console.log(body);
|
||||
|
|
@ -1101,8 +1103,10 @@ const saveData = async () => {
|
|||
if (myform.value != null) {
|
||||
await myform.value.validate().then(async (saveDataTest: Boolean) => {
|
||||
if (saveDataTest) {
|
||||
await addData();
|
||||
await clickBack();
|
||||
dialogConfirm(
|
||||
$q,
|
||||
() => addData()
|
||||
)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue