updated develop project save step
This commit is contained in:
parent
f2a1d55ada
commit
8e3de78a85
6 changed files with 27 additions and 14 deletions
|
|
@ -16,7 +16,7 @@ import { useCounterMixin } from "@/stores/mixin";
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { showLoader, hideLoader, messageError } = mixin;
|
const { showLoader, hideLoader, messageError, success } = mixin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* props
|
* props
|
||||||
|
|
@ -93,6 +93,7 @@ function onSubmit() {
|
||||||
.then(() => {
|
.then(() => {
|
||||||
fetchData(projectId.value);
|
fetchData(projectId.value);
|
||||||
isChangeData.value = false;
|
isChangeData.value = false;
|
||||||
|
success($q, "บันทึกข้อมูลแล้ว");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import { useCounterMixin } from "@/stores/mixin";
|
||||||
* use
|
* use
|
||||||
*/
|
*/
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const { showLoader, hideLoader, messageError } = useCounterMixin();
|
const { showLoader, hideLoader, messageError, success } = useCounterMixin();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -123,7 +123,9 @@ function onSubmit() {
|
||||||
: formData.budgetPay;
|
: formData.budgetPay;
|
||||||
http
|
http
|
||||||
.put(config.API.developmentMainTab("tab7", projectId.value), formData)
|
.put(config.API.developmentMainTab("tab7", projectId.value), formData)
|
||||||
.then(() => {})
|
.then(() => {
|
||||||
|
success($q, "บันทึกข้อมูลแล้ว");
|
||||||
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,9 @@ function onSubmit() {
|
||||||
progressTracking: progressTracking.value,
|
progressTracking: progressTracking.value,
|
||||||
projectEvaluation: projectEvaluation.value,
|
projectEvaluation: projectEvaluation.value,
|
||||||
})
|
})
|
||||||
.then(() => {})
|
.then(() => {
|
||||||
|
!modalDialog.value && success($q, "บันทึกข้อมูลแล้ว");
|
||||||
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
})
|
})
|
||||||
|
|
@ -199,6 +201,8 @@ function onClickAddIndicator(
|
||||||
data: DevelopmentEvaluations | null = null,
|
data: DevelopmentEvaluations | null = null,
|
||||||
type: string = ""
|
type: string = ""
|
||||||
) {
|
) {
|
||||||
|
modalDialog.value = true;
|
||||||
|
isChangeData.value && onSubmit();
|
||||||
isEdit.value = statusEdit;
|
isEdit.value = statusEdit;
|
||||||
typeAction.value = type;
|
typeAction.value = type;
|
||||||
if (statusEdit) {
|
if (statusEdit) {
|
||||||
|
|
@ -214,7 +218,6 @@ function onClickAddIndicator(
|
||||||
formIndicators.suggestions = data.suggestions;
|
formIndicators.suggestions = data.suggestions;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
modalDialog.value = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -195,7 +195,9 @@ function onSubmit() {
|
||||||
|
|
||||||
http
|
http
|
||||||
.put(config.API.developmentMainTab("tab5", projectId.value), formData)
|
.put(config.API.developmentMainTab("tab5", projectId.value), formData)
|
||||||
.then(() => {})
|
.then(() => {
|
||||||
|
!modalAcademic.value && success($q, "บันทึกข้อมูลแล้ว");
|
||||||
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
})
|
})
|
||||||
|
|
@ -207,6 +209,7 @@ function onSubmit() {
|
||||||
|
|
||||||
function onClickAddAcademic(status: boolean = false, data: any | null = null) {
|
function onClickAddAcademic(status: boolean = false, data: any | null = null) {
|
||||||
modalAcademic.value = true;
|
modalAcademic.value = true;
|
||||||
|
isChangeData.value && onSubmit();
|
||||||
isEdit.value = status;
|
isEdit.value = status;
|
||||||
if (data && status) {
|
if (data && status) {
|
||||||
academicId.value = data.id;
|
academicId.value = data.id;
|
||||||
|
|
@ -272,7 +275,7 @@ defineExpose({
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<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">
|
<div class="q-pa-sm q-my-sm">
|
||||||
<q-card bordered style="border: 1px solid #d6dee1">
|
<q-card bordered style="border: 1px solid #d6dee1">
|
||||||
<div
|
<div
|
||||||
|
|
@ -492,13 +495,12 @@ defineExpose({
|
||||||
color="public"
|
color="public"
|
||||||
class="q-mr-xs"
|
class="q-mr-xs"
|
||||||
style="width: 120px"
|
style="width: 120px"
|
||||||
|
@click="() => props.prevStep()"
|
||||||
>
|
>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<q-btn
|
<q-btn
|
||||||
disabled
|
|
||||||
rounded
|
rounded
|
||||||
label="ถัดไป"
|
label="บันทึก"
|
||||||
icon-right="mdi-chevron-right"
|
|
||||||
id="onSubmit"
|
id="onSubmit"
|
||||||
type="submit"
|
type="submit"
|
||||||
color="public"
|
color="public"
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ const $q = useQuasar();
|
||||||
const store = useDevelopmentDataStore();
|
const store = useDevelopmentDataStore();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const projectId = ref<string>(route.params.id.toLocaleString());
|
const projectId = ref<string>(route.params.id.toLocaleString());
|
||||||
const { showLoader, hideLoader, messageError, date2Thai, diffDay } =
|
const { showLoader, hideLoader, messageError, date2Thai, diffDay, success } =
|
||||||
useCounterMixin();
|
useCounterMixin();
|
||||||
const checkRoutePermission = ref<boolean>(
|
const checkRoutePermission = ref<boolean>(
|
||||||
route.name == "developmentDetailPage"
|
route.name == "developmentDetailPage"
|
||||||
|
|
@ -322,7 +322,9 @@ function onSubmit() {
|
||||||
reasonActual20: reasonActual20.value,
|
reasonActual20: reasonActual20.value,
|
||||||
reasonActual10: reasonActual10.value,
|
reasonActual10: reasonActual10.value,
|
||||||
})
|
})
|
||||||
.then(() => {})
|
.then(() => {
|
||||||
|
success($q, "บันทึกข้อมูลแล้ว");
|
||||||
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
hideLoader();
|
hideLoader();
|
||||||
|
|
@ -567,7 +569,7 @@ defineExpose({
|
||||||
<div
|
<div
|
||||||
class="col-xs-12 col-sm-12 text-weight-medium bg-grey-1 q-py-xs q-px-md"
|
class="col-xs-12 col-sm-12 text-weight-medium bg-grey-1 q-py-xs q-px-md"
|
||||||
>
|
>
|
||||||
ระยะเวลาและสถานที่ดำเนินการ
|
ระยะเวลาและสถานที่ดำเนินการ
|
||||||
</div>
|
</div>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<q-card-section>
|
<q-card-section>
|
||||||
|
|
|
||||||
|
|
@ -173,7 +173,9 @@ function onSubmit() {
|
||||||
.put(config.API.developmentMainTab("tab8", projectId.value), {
|
.put(config.API.developmentMainTab("tab8", projectId.value), {
|
||||||
expect: expect.value,
|
expect: expect.value,
|
||||||
})
|
})
|
||||||
.then(() => {})
|
.then(() => {
|
||||||
|
!modalRisk.value && success($q, "บันทึกข้อมูลแล้ว");
|
||||||
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
})
|
})
|
||||||
|
|
@ -190,6 +192,7 @@ function onSubmit() {
|
||||||
*/
|
*/
|
||||||
function onClickAddRisk(status: boolean = false, data: ResRisk | null = null) {
|
function onClickAddRisk(status: boolean = false, data: ResRisk | null = null) {
|
||||||
modalRisk.value = true;
|
modalRisk.value = true;
|
||||||
|
isChangeData.value && onSubmit();
|
||||||
isEdit.value = status;
|
isEdit.value = status;
|
||||||
if (data) {
|
if (data) {
|
||||||
riskId.value = data.id;
|
riskId.value = data.id;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue