From 67379b667fed90949d1c45b606148f59cc4d0ca0 Mon Sep 17 00:00:00 2001 From: "STW_TTTY\\stwtt" Date: Wed, 26 Jun 2024 14:15:48 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=9B=E0=B8=A5=E0=B8=B5=E0=B9=88?= =?UTF-8?q?=E0=B8=A2=E0=B8=99=E0=B9=80=E0=B8=9B=E0=B9=87=E0=B8=99=E0=B8=84?= =?UTF-8?q?=E0=B8=B0=E0=B9=81=E0=B8=99=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Tab/Dialog/DialogCommentProgress.vue | 99 ++++++++++++------- 1 file changed, 65 insertions(+), 34 deletions(-) diff --git a/src/modules/08_KPI/components/Tab/Dialog/DialogCommentProgress.vue b/src/modules/08_KPI/components/Tab/Dialog/DialogCommentProgress.vue index 2a0dfb6..b2ba7bc 100644 --- a/src/modules/08_KPI/components/Tab/Dialog/DialogCommentProgress.vue +++ b/src/modules/08_KPI/components/Tab/Dialog/DialogCommentProgress.vue @@ -18,8 +18,9 @@ const numLevel = ref(""); const store = useKpiDataStore(); const $q = useQuasar(); const mixin = useCounterMixin(); -const { dialogConfirm, showLoader, hideLoader, messageError, success } = mixin; +const { dialogConfirm, showLoader, hideLoader, messageError, success,dialogMessageNotify } = mixin; +const check = ref(""); const rows = defineModel("rows"); const modal = defineModel("modal", { required: true }); const type = defineModel("type", { required: true }); @@ -85,34 +86,39 @@ function clickList(index: string, data: any) { } function onSubmitAdd() { - dialogConfirm($q, () => { - showLoader(); - http - .put( - config.API.kpiCommentP( - "progress", - type.value, - store.rolePerson.toLocaleLowerCase(), - idList.value - ), - { - reason: formDataAdd.reason, - topic: formDataAdd.topic, - score: type.value == "capacity" ? undefined : numLevel.value, - } - ) - .then((res) => { - success($q, "บันทึกข้อมูลสำเร็จ"); - getList(); - closeAdd(); - }) - .catch((e) => { - messageError($q, e); - }) - .finally(() => { - hideLoader(); - }); - }); + // type + if (numLevel.value == "") { + dialogMessageNotify($q,'กรุณาเลือกคะแนน') + } else { + dialogConfirm($q, () => { + showLoader(); + http + .put( + config.API.kpiCommentP( + "progress", + type.value, + store.rolePerson.toLocaleLowerCase(), + idList.value + ), + { + reason: formDataAdd.reason, + topic: formDataAdd.topic, + score: type.value == "capacity" ? undefined : numLevel.value, + } + ) + .then((res) => { + success($q, "บันทึกข้อมูลสำเร็จ"); + getList(); + closeAdd(); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); + }); + } } function onSubmit() {} @@ -204,6 +210,10 @@ function onSubmitComment(role: string) { }); } +function onCheckNumber(num: number) { + numLevel.value = num.toString(); +} + watch( () => modal.value, () => { @@ -257,10 +267,10 @@ watch(
{{ - type == "capacity" || type == "development" - ? "เหตุการณ์/พฤติกรรม" - : "ความก้าวหน้า" - }} + type == "capacity" || type == "development" + ? "เหตุการณ์/พฤติกรรม" + : "ความก้าวหน้า" + }}
@@ -541,7 +551,7 @@ watch( :rules="[(val:string) => !!val || `${type == 'capacity'||type == 'development' ? 'กรุณากรอกเหตุการณ์/พฤติกรรม':'กรุณากรอกหัวข้อความก้าวหน้า' }`,]" /> -
@@ -555,6 +565,27 @@ watch( hide-bottom-space :rules="[(val:string) => !!val || `${'กรุณากรอกคะแนน'}`,]" /> +
--> +
+ + + +
+ {{ i }} +
+
+
+