updated develop project save step

This commit is contained in:
Warunee Tamkoo 2024-08-14 11:48:52 +07:00
parent f2a1d55ada
commit 8e3de78a85
6 changed files with 27 additions and 14 deletions

View file

@ -16,7 +16,7 @@ import { useCounterMixin } from "@/stores/mixin";
const $q = useQuasar();
const route = useRoute();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError } = mixin;
const { showLoader, hideLoader, messageError, success } = mixin;
/**
* props
@ -93,6 +93,7 @@ function onSubmit() {
.then(() => {
fetchData(projectId.value);
isChangeData.value = false;
success($q, "บันทึกข้อมูลแล้ว");
})
.catch((err) => {
messageError($q, err);

View file

@ -20,7 +20,7 @@ import { useCounterMixin } from "@/stores/mixin";
* use
*/
const $q = useQuasar();
const { showLoader, hideLoader, messageError } = useCounterMixin();
const { showLoader, hideLoader, messageError, success } = useCounterMixin();
const route = useRoute();
/**
@ -123,7 +123,9 @@ function onSubmit() {
: formData.budgetPay;
http
.put(config.API.developmentMainTab("tab7", projectId.value), formData)
.then(() => {})
.then(() => {
success($q, "บันทึกข้อมูลแล้ว");
})
.catch((err) => {
messageError($q, err);
})

View file

@ -179,7 +179,9 @@ function onSubmit() {
progressTracking: progressTracking.value,
projectEvaluation: projectEvaluation.value,
})
.then(() => {})
.then(() => {
!modalDialog.value && success($q, "บันทึกข้อมูลแล้ว");
})
.catch((err) => {
messageError($q, err);
})
@ -199,6 +201,8 @@ function onClickAddIndicator(
data: DevelopmentEvaluations | null = null,
type: string = ""
) {
modalDialog.value = true;
isChangeData.value && onSubmit();
isEdit.value = statusEdit;
typeAction.value = type;
if (statusEdit) {
@ -214,7 +218,6 @@ function onClickAddIndicator(
formIndicators.suggestions = data.suggestions;
}
}
modalDialog.value = true;
}
/**

View file

@ -195,7 +195,9 @@ function onSubmit() {
http
.put(config.API.developmentMainTab("tab5", projectId.value), formData)
.then(() => {})
.then(() => {
!modalAcademic.value && success($q, "บันทึกข้อมูลแล้ว");
})
.catch((err) => {
messageError($q, err);
})
@ -207,6 +209,7 @@ function onSubmit() {
function onClickAddAcademic(status: boolean = false, data: any | null = null) {
modalAcademic.value = true;
isChangeData.value && onSubmit();
isEdit.value = status;
if (data && status) {
academicId.value = data.id;
@ -272,7 +275,7 @@ defineExpose({
});
</script>
<template>
<q-form greedy @submit.prevent @validation-success="props.prevStep()">
<q-form greedy @submit.prevent @validation-success="onSubmit">
<div class="q-pa-sm q-my-sm">
<q-card bordered style="border: 1px solid #d6dee1">
<div
@ -492,13 +495,12 @@ defineExpose({
color="public"
class="q-mr-xs"
style="width: 120px"
@click="() => props.prevStep()"
>
</q-btn>
<q-btn
disabled
rounded
label="ถัดไป"
icon-right="mdi-chevron-right"
label="บันทึก"
id="onSubmit"
type="submit"
color="public"

View file

@ -56,7 +56,7 @@ const $q = useQuasar();
const store = useDevelopmentDataStore();
const route = useRoute();
const projectId = ref<string>(route.params.id.toLocaleString());
const { showLoader, hideLoader, messageError, date2Thai, diffDay } =
const { showLoader, hideLoader, messageError, date2Thai, diffDay, success } =
useCounterMixin();
const checkRoutePermission = ref<boolean>(
route.name == "developmentDetailPage"
@ -322,7 +322,9 @@ function onSubmit() {
reasonActual20: reasonActual20.value,
reasonActual10: reasonActual10.value,
})
.then(() => {})
.then(() => {
success($q, "บันทึกข้อมูลแล้ว");
})
.catch((err) => {
messageError($q, err);
hideLoader();
@ -567,7 +569,7 @@ defineExpose({
<div
class="col-xs-12 col-sm-12 text-weight-medium bg-grey-1 q-py-xs q-px-md"
>
ระยะเวลาและสถานทดำเนนการ
ระยะเวลาและสถานทดำเนนการ
</div>
<q-separator />
<q-card-section>

View file

@ -173,7 +173,9 @@ function onSubmit() {
.put(config.API.developmentMainTab("tab8", projectId.value), {
expect: expect.value,
})
.then(() => {})
.then(() => {
!modalRisk.value && success($q, "บันทึกข้อมูลแล้ว");
})
.catch((err) => {
messageError($q, err);
})
@ -190,6 +192,7 @@ function onSubmit() {
*/
function onClickAddRisk(status: boolean = false, data: ResRisk | null = null) {
modalRisk.value = true;
isChangeData.value && onSubmit();
isEdit.value = status;
if (data) {
riskId.value = data.id;