รายการโครงการ => เพิ่ม Dialogconfrim
This commit is contained in:
parent
ca213d6c76
commit
efc6b4db98
1 changed files with 23 additions and 16 deletions
|
|
@ -28,8 +28,13 @@ import { useCounterMixin } from "@/stores/mixin";
|
||||||
/** use*/
|
/** use*/
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { showLoader, hideLoader, messageError, dialogMessageNotify } =
|
const {
|
||||||
useCounterMixin();
|
showLoader,
|
||||||
|
hideLoader,
|
||||||
|
messageError,
|
||||||
|
dialogMessageNotify,
|
||||||
|
dialogConfirm,
|
||||||
|
} = useCounterMixin();
|
||||||
|
|
||||||
const node = ref<any>([]);
|
const node = ref<any>([]);
|
||||||
const expanded = ref<string[]>([]);
|
const expanded = ref<string[]>([]);
|
||||||
|
|
@ -177,19 +182,21 @@ function closeDialog() {
|
||||||
/** dialog submit */
|
/** dialog submit */
|
||||||
async function onSubmit() {
|
async function onSubmit() {
|
||||||
if (formProject.nodeId) {
|
if (formProject.nodeId) {
|
||||||
await showLoader();
|
dialogConfirm($q, async () => {
|
||||||
await http
|
await showLoader();
|
||||||
.post(config.API.developmentMain, formProject)
|
await http
|
||||||
.then((res) => {
|
.post(config.API.developmentMain, formProject)
|
||||||
router.push(`/development/${res.data.result}`);
|
.then(async (res) => {
|
||||||
})
|
await closeDialog();
|
||||||
.catch((e) => {
|
await router.push(`/development/${res.data.result}`);
|
||||||
messageError($q, e);
|
})
|
||||||
})
|
.catch((e) => {
|
||||||
.finally(async () => {
|
messageError($q, e);
|
||||||
await closeDialog();
|
})
|
||||||
await hideLoader();
|
.finally(() => {
|
||||||
});
|
hideLoader();
|
||||||
|
});
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
dialogMessageNotify($q, "กรุณาเลือกหน่วยงานที่รับผิดชอบ");
|
dialogMessageNotify($q, "กรุณาเลือกหน่วยงานที่รับผิดชอบ");
|
||||||
}
|
}
|
||||||
|
|
@ -513,7 +520,7 @@ onMounted(() => {
|
||||||
|
|
||||||
<q-dialog persistent v-model="modal">
|
<q-dialog persistent v-model="modal">
|
||||||
<q-card flat bordered style="min-width: 60vw">
|
<q-card flat bordered style="min-width: 60vw">
|
||||||
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
<q-form greedy @submit.prevent @validation-success="onSubmit()">
|
||||||
<DialogHeader
|
<DialogHeader
|
||||||
tittle="เพิ่มโครงการ/หลักสูตรการฝึกอบรม"
|
tittle="เพิ่มโครงการ/หลักสูตรการฝึกอบรม"
|
||||||
:close="closeDialog"
|
:close="closeDialog"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue