เพิ่มข้อความแจ้งเตือน เลือกคุณสมบัติ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-01-17 10:32:17 +07:00
parent c3191c2fb4
commit ecaaacbe1d
4 changed files with 82 additions and 54 deletions

View file

@ -103,10 +103,7 @@ async function fetchDataCalendar() {
const eventData = filterVal.value.map((item: any) => {
return mainData.value
.filter(
(e: DataCalendar) =>
e.keycloakId === item &&
e.status != "REJECT" &&
e.status != "DELETE"
(e: DataCalendar) => e.keycloakId === item && e.status === "APPROVE"
)
.map((e) => ({
id: e.id,
@ -246,10 +243,7 @@ watch(
const eventData = filterVal.value.map((item: any) => {
return mainData.value
.filter(
(e: DataCalendar) =>
e.keycloakId === item &&
e.status != "REJECT" &&
e.status != "DELETE"
(e: DataCalendar) => e.keycloakId === item && e.status === "APPROVE"
)
.map((e) => ({
id: e.id,

View file

@ -41,7 +41,13 @@ const mixin = useCounterMixin();
const $q = useQuasar();
const splitterModel = 20;
const { showLoader, hideLoader, messageError, dialogConfirm } = mixin;
const {
showLoader,
hideLoader,
messageError,
dialogConfirm,
dialogMessageNotify,
} = mixin;
const externalLink =
"https://accreditation.ocsc.go.th/accreditation/search/curriculum";
@ -56,14 +62,18 @@ function onClickPopupHistory() {
/** function NextToStep*/
async function onCilckNextStep() {
const functionCreateDoc: (() => Promise<void>) | null =
store.step === 1
? await saveStep1
: store.step === 3
// store.step === 1
// ? await saveStep1
// :
store.step === 3
? await saveStep3
: store.step === 7
? await saveStep7
: null;
store.step === 2 || store.step === 6
store.step === 1
? checkSelectForm()
: store.step === 2 || store.step === 6
? validateForm()
: store.step == 3 || store.step == 7
? dialogConfirm(
@ -74,16 +84,7 @@ async function onCilckNextStep() {
"ยืนยันการยื่นเอกสาร",
"ต้องการยืนยันการยื่นเอกสารใช่หรือไม่? หากยืนยันแล้วคุณจะไม่สามารถกลับมาแก้ไขเอกสารได้อีก"
)
: store.step < 9 &&
dialogConfirm(
$q,
async () => {
showLoader();
await functionCreateDoc?.();
},
"ยืนยันการดำเนินการ",
"ต้องการยืนยันการดำเนินการต่อใช่หรือไม่?"
);
: null;
}
/** function validateForm Step 2,4*/
@ -187,6 +188,7 @@ const formSpec = reactive<FormSpec>({
});
const formDetail = ref<any>();
const formDataStep1 = ref<PersonInformation>();
/**
* function เรยกขอมลตรวจสอบคณสมบ
* @param id id ประเม
@ -222,6 +224,7 @@ async function updateCheckSpec(data: FormSpec) {
formSpec.isHaveProLicense = data.isHaveProLicense;
formSpec.isHaveMinPeriodOrHoldPos = data.isHaveMinPeriodOrHoldPos;
}
/**
* funciton ปเดทขอมลสวนต
* @param data อมลสวนต
@ -229,6 +232,21 @@ async function updateCheckSpec(data: FormSpec) {
function updateFormDetail(data: any) {
formDetail.value = data;
}
/** function เช็คการการคุณสมบัติ*/
function checkSelectForm() {
const isTrue = Object.keys(formSpec).find((key) => formSpec[key] === true);
isTrue
? dialogConfirm(
$q,
async () => {
showLoader();
saveStep1();
},
"ยืนยันการดำเนินการ",
"ต้องการยืนยันการดำเนินการต่อใช่หรือไม่?"
)
: dialogMessageNotify($q, "กรุณาเลือกคุณสมบัติ");
}
/** function บันทักตรวจสอบคุณสมบัติ*/
async function saveStep1() {
const salaries = formDetail.value.trainings.map((e: any) => ({
@ -579,7 +597,7 @@ onMounted(async () => {
<q-card bordered class="col-12 row caedNone">
<div class="col-xs-12 col-sm-3">
<div class="col-12 row no-wrap">
<div class="col-12 row q-py-md q-px-lg" >
<div class="col-12 row q-py-md q-px-lg">
<div class="col-12 row items-center no-wrap">
<div class="toptitle2">
{{
@ -588,7 +606,7 @@ onMounted(async () => {
: "ประเมินชำนาญการพิเศษ"
}}
</div>
<q-space/>
<q-space />
<div>
<q-btn
flat
@ -597,7 +615,7 @@ onMounted(async () => {
color="primary"
icon="history"
@click="onClickPopupHistory"
>
>
<q-tooltip>ประวการประเม</q-tooltip>
</q-btn>
</div>
@ -607,7 +625,7 @@ onMounted(async () => {
</div>
</div>
<div class="col-12 row">
<q-separator vertical/>
<q-separator vertical />
</div>
</div>
</div>
@ -648,39 +666,33 @@ onMounted(async () => {
"
>
<q-card flat bordered class="col-12 shadow-0">
<Step1
v-if="store.step === 1"
@update:spec="updateCheckSpec"
:data="formDataStep1"
:educations="formDetail?.educations"
/>
<Step2
v-if="store.step === 2"
@update:form="updateformCommand"
/>
<Step3
v-if="store.step === 3"
@update:file="updateFilePDF"
/>
<Step4 v-if="store.step === 4" />
<Step5 v-if="store.step === 5" />
<Step6
v-if="store.step === 6"
@update:form="updateformCommand"
/>
<Step7
v-if="store.step === 7"
@update:file="updateFilePDF"
/>
<Step8 v-if="store.step === 8" />
<Step9 v-if="store.step === 9" />
<Step1
v-if="store.step === 1"
@update:spec="updateCheckSpec"
:data="formDataStep1"
:educations="formDetail?.educations"
/>
<Step2
v-if="store.step === 2"
@update:form="updateformCommand"
/>
<Step3 v-if="store.step === 3" @update:file="updateFilePDF" />
<Step4 v-if="store.step === 4" />
<Step5 v-if="store.step === 5" />
<Step6
v-if="store.step === 6"
@update:form="updateformCommand"
/>
<Step7 v-if="store.step === 7" @update:file="updateFilePDF" />
<Step8 v-if="store.step === 8" />
<Step9 v-if="store.step === 9" />
</q-card>
</div>
<div
class="col-xs-12 col-sm-7 row"
v-if="store.step === 1 || store.step === 3 || store.step === 7"
>
<div class="col-12 ">
<div class="col-12">
<ViewStep1
v-if="store.step === 1"
@update:formDeital="updateFormDetail"

View file

@ -32,6 +32,7 @@ interface FormSpec {
isHaveSpecificQft: boolean;
isHaveProLicense: boolean;
isHaveMinPeriodOrHoldPos: boolean;
[key: string]: any;
}
interface FormCommand {

View file

@ -853,6 +853,26 @@ export const useCounterMixin = defineStore("mixin", () => {
});
};
const dialogMessageNotify = (
q: any,
desc?: string, // ถ้ามี cancel action ใส่เป็น null
cancel?: Function
) => {
q.dialog({
component: CustomComponent,
componentProps: {
title: "ข้อความแจ้งเตือน",
message: desc && desc != null ? desc : "กรุณากรอกข้อมูลให้ครบ",
icon: "warning",
color: "orange",
textOk: "ตกลง",
onlycancel: true,
},
}).onCancel(() => {
if (cancel) cancel();
});
};
/**
* convert arabicNumberToText
* @param Number
@ -1043,6 +1063,7 @@ export const useCounterMixin = defineStore("mixin", () => {
fails,
dialogConfirm,
dialogRemove,
dialogMessageNotify,
arabicNumberToText,
calculateDurationYmd,
};