updated develop form

This commit is contained in:
Warunee Tamkoo 2024-08-06 16:04:29 +07:00
parent 03c41dae6c
commit bdffdc1abf
10 changed files with 1052 additions and 137 deletions

View file

@ -54,6 +54,12 @@ const projectId = ref<string>(route.params.id.toLocaleString());
const checkRoutePermission = ref<boolean>(
route.name == "developmentDetailPage"
);
const status = defineModel<string>("status", { required: true });
const props = defineProps({
prevStep: { type: Function, required: true },
nextStep: { type: Function, required: true },
});
const step = ref<string>("");
/** หัวตาราง */
const rows = ref<DevelopmentEvaluations[]>([]); //
const columns = ref<QTableProps["columns"]>([
@ -248,29 +254,30 @@ function onClickDeleteIndicator(id: string) {
/** save Main data */
function onSubmit() {
dialogConfirm($q, () => {
if (formProject.project === "NOOFFER") {
formProject.isNoPass = false;
formProject.isPassAllocate = false;
formProject.isPassNoAllocate = false;
} else {
formProject.isBudget = false;
formProject.isOutBudget = false;
}
showLoader();
http
.put(config.API.developmentMainTab("tab4", projectId.value), formProject)
.then(() => {
fetchData();
success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
});
// dialogConfirm($q, () => {
if (formProject.project === "NOOFFER") {
formProject.isNoPass = false;
formProject.isPassAllocate = false;
formProject.isPassNoAllocate = false;
} else {
formProject.isBudget = false;
formProject.isOutBudget = false;
}
showLoader();
http
.put(config.API.developmentMainTab("tab4", projectId.value), formProject)
.then(() => {
// fetchData();
// success($q, "");
step.value == "next" ? props.nextStep() : props.prevStep();
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
// });
}
/** fetchData in page */
@ -424,19 +431,34 @@ onMounted(() => {
</div>
</div>
</div>
<q-separator v-if="!checkRoutePermission" />
<q-card-actions align="right">
<q-btn
v-if="!checkRoutePermission"
unelevated
label="บันทึก"
id="onSubmit"
type="submit"
color="public"
class="q-px-md"
>
<q-tooltip>นทกขอม</q-tooltip>
</q-btn>
<q-separator />
<q-card-actions align="center">
<div class="text-center q-pa-sm" v-if="!checkRoutePermission">
<q-btn
rounded
label="ก่อนหน้า"
icon="mdi-chevron-left"
id="onSubmit"
type="submit"
color="public"
class="q-mr-xs"
style="width: 120px"
@click="step = 'prev'"
>
</q-btn>
<q-btn
rounded
label="ถัดไป"
icon-right="mdi-chevron-right"
id="onSubmit"
type="submit"
color="public"
class="q-ml-xs"
style="width: 120px"
@click="step = 'next'"
>
</q-btn>
</div>
</q-card-actions>
</q-form>
</q-card>