diff --git a/src/modules/08_KPI/components/Tab/Dialog/DialogCommentProgress.vue b/src/modules/08_KPI/components/Tab/Dialog/DialogCommentProgress.vue index 4a4d0bd..be69cf2 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, () => { @@ -543,7 +553,7 @@ watch( :rules="[(val:string) => !!val || `${type == 'capacity'||type == 'development' ? 'กรุณากรอกเหตุการณ์/พฤติกรรม':'กรุณากรอกหัวข้อความก้าวหน้า' }`,]" /> -
@@ -557,6 +567,27 @@ watch( hide-bottom-space :rules="[(val:string) => !!val || `${'กรุณากรอกคะแนน'}`,]" /> +
--> +
+ + + +
+ {{ i }} +
+
+
+