diff --git a/src/modules/08_KPI/components/Tab/Dialog/01_FormIndicator.vue b/src/modules/08_KPI/components/Tab/Dialog/01_FormIndicator.vue index 352972a..aa871f5 100644 --- a/src/modules/08_KPI/components/Tab/Dialog/01_FormIndicator.vue +++ b/src/modules/08_KPI/components/Tab/Dialog/01_FormIndicator.vue @@ -123,12 +123,14 @@ function fetchListPlanByid(id: string) { formDetail.achievement4 = data.achievement4; formDetail.achievement5 = data.achievement5; formDetail.documentInfoEvidence = data.documentInfoEvidence; + if (data.startDate && data.endDate) { formDetail.date = []; formDetail.date[0] = data.startDate; formDetail.date[1] = data.endDate; } - clickList(data.kpiPlanId, true); + + listCheckID.value = data.kpiPlanId; }) .catch((err) => { messageError($q, err); @@ -183,7 +185,9 @@ function fetchRoleByid(id: string) { formDetail.date[0] = data.startDate; formDetail.date[1] = data.endDate; } - clickList(data.kpiRoleId, true); + + listCheckID.value = data.kpiRoleId; + // clickList(data.kpiRoleId, true); }) .catch((err) => { messageError($q, err); @@ -647,7 +651,7 @@ const title = computed(() => { dense class="inputgreen" :rules="[ - (val) => + (val:string) => !!val || `${'กรุณากรอกลำดับ/รหัสตัวชี้วัด'}`, ]" lazy-rules @@ -668,7 +672,7 @@ const title = computed(() => { dense class="inputgreen" :rules="[ - (val) => !!val || `${'กรุณากรอกชื่อตัวชี้วัด'}`, + (val:string) => !!val || `${'กรุณากรอกชื่อตัวชี้วัด'}`, ]" lazy-rules hide-bottom-space @@ -686,7 +690,7 @@ const title = computed(() => { dense class="inputgreen" :rules="[ - (val) => !!val || `${'กรุณากรอกค่าเป้าหมาย'}`, + (val:string) => !!val || `${'กรุณากรอกค่าเป้าหมาย'}`, ]" hide-bottom-space lazy-rules @@ -703,7 +707,7 @@ const title = computed(() => { dense class="inputgreen" :rules="[ - (val) => !!val || `${'กรุณากรอกหน่วยนับ'}`, + (val:string) => !!val || `${'กรุณากรอกหน่วยนับ'}`, ]" lazy-rules hide-bottom-space @@ -721,7 +725,7 @@ const title = computed(() => { dense class="inputgreen" :rules="[ - (val) => + (val:string) => !!val || `${'กรุณากรอกน้ำหนัก (ร้อยละ)'}`, ]" hide-bottom-space @@ -741,10 +745,8 @@ const title = computed(() => {
ระดับคะแนน
ผลสำเร็จของงาน
- -
+ +
5
{ />
- -
+ +
4
{ />
- -
+ +
3
{ />
- -
+ +
2
{ />
- -
+ +
1
-import { onMounted, ref } from "vue"; -import Dialog from "@/modules/08_KPI/components/Tab/Dialog/04_FormCompetency.vue"; -import DialogEvaluate from "@/modules/08_KPI/components/Tab/DialogEvaluate/02_Competenct.vue"; - -import { useQuasar, type QTableProps } from "quasar"; -import { useCounterMixin } from "@/stores/mixin"; -import { useKpiDataStore } from "@/modules/08_KPI/store"; -import http from "@/plugins/http"; -import config from "@/app.config"; -import { useRoute } from "vue-router"; - -import type { FormCapacityList } from "@/modules/08_KPI/interface/request/index"; - -const modalEvaluate = ref(false); -const store = useKpiDataStore(); - -const route = useRoute(); -const id = ref(route.params.id as string); -const idCapacity = ref(null); - -const $q = useQuasar(); -const mixin = useCounterMixin(); -const { - date2Thai, - messageError, - showLoader, - hideLoader, - dialogRemove, - success, -} = mixin; - -const type = defineModel("type", { required: true }); -const name = defineModel("name", { required: true }); -const lists = defineModel("lists", { required: true }); - -const filterKeyword = ref(""); -const modal = ref(false); - -const visibleColumns = ref([ - "name", - "level", - "point", - "weight", - "summary", -]); - -const columns = ref([ - { - name: "name", - align: "left", - label: "รายการสมรรถนะ", - sortable: true, - field: "name", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "level", - align: "left", - label: "ระดับที่คาดหวัง", - sortable: true, - field: "level", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "point", - align: "left", - label: "ระดับคะแนนตามเกณฑ์การประเมิน", - sortable: true, - field: "point", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "weight", - align: "left", - label: "น้ำหนัก (ร้อยละ)", - sortable: true, - field: "weight", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "summary", - align: "left", - label: "ผลการประเมิน", - sortable: true, - field: "summary", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, -]); - -function onAdd() { - modal.value = true; -} - -const rows = ref([]); - -function getData() { - showLoader(); - http - .get(config.API.kpiUserCapacity + `?id=${id.value}&type=${type.value}`) - .then((res) => { - const data = res.data.result.data; - rows.value = data; - lists.value.push(res.data.result.data); - console.log("lists card===>", lists.value); - }) - .catch((e) => { - messageError($q, e); - }) - .finally(() => { - hideLoader(); - }); -} - -function onEdit(data: FormCapacityList) { - modal.value = true; - idCapacity.value = data.id; -} - -function onDelete(id: string) { - dialogRemove($q, () => { - showLoader(); - http - .delete(config.API.kpiUserCapacity + `/${id}`) - .then((res) => { - success($q, "ลบข้อมูลสำเร็จ"); - getData(); - }) - .catch((e) => { - messageError($q, e); - }) - .finally(() => { - hideLoader(); - }); - }); -} - -function onEvaluate() { - modalEvaluate.value = true; -} - -onMounted(() => { - getData(); -}); - - - - - -->