เพิ่ม dialog

This commit is contained in:
setthawutttty 2023-08-18 11:11:37 +07:00
parent 4da9bdd7f0
commit b412634096
17 changed files with 264 additions and 194 deletions

View file

@ -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 ดรปแบบแสดงระหวางขอมลทแกไขหรอแสดงเฉยๆ