เพิ่ม dialog
This commit is contained in:
parent
4da9bdd7f0
commit
b412634096
17 changed files with 264 additions and 194 deletions
|
|
@ -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 จัดรูปแบบแสดงระหว่างข้อมูลที่แก้ไขหรือแสดงเฉยๆ
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue