update KPI

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-11-28 13:44:28 +07:00
parent 48cdac3326
commit 7084c9e839
38 changed files with 473 additions and 416 deletions

View file

@ -110,7 +110,7 @@ async function fetchListRole() {
messageError($q, err);
});
}
/** ดึงข้อมูล งานอื่น ๆ ที่ได้รับมอบหมาย */
/** ดึงข้อมูล งานอื่นๆ ที่ได้รับมอบหมาย */
async function fetchAssigned() {
await http
.get(config.API.kpiAchievement("special") + `?id=${evaluationId.value}`)
@ -360,7 +360,7 @@ onMounted(async () => {
/>
<Work
v-model:data="rows_03"
:title="`3. งานอื่น ๆ ที่ได้รับมอบหมาย`"
:title="`3. งานอื่นๆ ที่ได้รับมอบหมาย`"
:page="3"
:fetchList="fetchAssigned"
:total="totalResults3"

View file

@ -97,8 +97,8 @@ const title = computed(() => {
: "เพิ่มตัวชี้วัดตามหน้าที่ความรับผิดชอบ";
} else if (numpage.value === 3) {
name = isStatusEdit.value
? "แก้ไขตัวชี้วัดงานอื่น ๆ ที่ได้รับมอบหมาย"
: "เพิ่มตัวชี้วัดงานอื่น ๆ ที่ได้รับมอบหมาย";
? "แก้ไขตัวชี้วัดงานอื่นๆ ที่ได้รับมอบหมาย"
: "เพิ่มตัวชี้วัดงานอื่นๆ ที่ได้รับมอบหมาย";
}
return name;
});
@ -212,7 +212,7 @@ function fetchRoleByid(id: string) {
});
}
/** ดึงข้อมูล งานอื่น ๆ ที่ได้รับมอบหมาย */
/** ดึงข้อมูล งานอื่นๆ ที่ได้รับมอบหมาย */
function fetchListSpecial() {
formFilter.nodeId = store.dataProfile.nodeId;
formFilter.node = store.dataProfile.node;
@ -242,7 +242,7 @@ function fetchListSpecial() {
});
}
/** ดึงข้อมูล งานอื่น ๆ ที่ได้รับมอบหมายตาม id */
/** ดึงข้อมูล งานอื่นๆ ที่ได้รับมอบหมายตาม id */
function fetchspecialByid(id: string) {
showLoader();
http

View file

@ -8,9 +8,7 @@ import { useCounterMixin } from "@/stores/mixin";
import { useKpiDataStore } from "@/modules/14_KPI/store";
import { checkPermission } from "@/utils/permissions";
/**
* importType
*/
/** importType*/
import type { QTableProps } from "quasar";
import type { DataOption } from "@/modules/14_KPI/interface/index/Main";
import type {
@ -18,21 +16,15 @@ import type {
ResDevelopment,
} from "@/modules/14_KPI/interface/response/index";
/**
* importComponents
*/
/** importComponents*/
import DialogIndividual from "@/modules/14_KPI/components/results/dialogIndividual.vue";
/**
* use
*/
/** use*/
const $q = useQuasar();
const { showLoader, messageError, hideLoader } = useCounterMixin();
const store = useKpiDataStore();
/**
* props
*/
/** props*/
const tab = defineModel<string>("tab", { required: true });
/**
@ -47,9 +39,7 @@ const keyword = ref<string>("");
const modalDetail = ref<boolean>(false);
const devId = ref<string>("");
/**
* Table
*/
/** Table*/
const columns = ref<QTableProps["columns"]>([
{
name: "no",
@ -142,26 +132,22 @@ const pagination = ref({
rowsPerPage: pageSize.value,
});
/**
* วแปร
*/
/** ตัวแปร*/
const year = ref<number | null>(new Date().getFullYear()); //
const roundOp = ref<DataOption[]>([]); //
/**
* function fetch รายการแผนพฒนาการปฏราชการรายบคคลยอนหล
*/
function fetcDataList() {
/** function fetch รายการแผนพัฒนาการปฏิบัติราชการรายบุคคลย้อนหลัง*/
async function fetcDataList() {
showLoader();
http
await http
.post(config.API.achievementDev, {
page: page.value,
pageSize: pageSize.value,
keyword: keyword.value,
kpiPeriodId: store.formQuery.round ? store.formQuery.round : "",
})
.then((res) => {
const data = res.data.result;
.then(async (res) => {
const data = await res.data.result;
rows.value = data.data;
total.value = data.total;
maxPage.value = Math.ceil(total.value / pageSize.value);
@ -174,20 +160,16 @@ function fetcDataList() {
});
}
/**
* function fetch รอบการประเม
*/
function fetchRoundOption() {
/** function fetch รอบการประเมิน*/
async function fetchRoundOption() {
showLoader();
http
await http
.get(
config.API.kpiPeriod +
`?page=${1}&pageSize=${10}&keyword=${""}&year=${year.value}`
)
.then(async (res) => {
const data = await res.data.result.data;
console.log(res.data.result.data);
if (res.data.result.data.length > 0) {
const list = await data.map((e: ResRound) => ({
id: e.id,
@ -201,7 +183,7 @@ function fetchRoundOption() {
roundOp.value = list;
store.formQuery.round = list[0].id;
fetcDataList();
await fetcDataList();
} else {
roundOp.value = [];
store.formQuery.round = "";
@ -216,17 +198,13 @@ function fetchRoundOption() {
});
}
/**
* function เปลยนรอบการประเม และ เรยกขอมลรายการแผนพฒนาการปฏราชการรายบคคลยอนหล
*/
/** function เปลี่ยนรอบการประเมิน และ เรียกข้อมูลรายการแผนพัฒนาการปฏิบัติราชการรายบุคคลย้อนหลัง*/
function changRound() {
store.formQuery.page = 1;
fetcDataList();
}
/**
* นหาขอม
*/
/** ค้นหาข้อมูล*/
function onSearchData() {
page.value = 1;
fetcDataList();
@ -241,20 +219,16 @@ function onClickView(id: string) {
devId.value = id;
}
/**
* ทำงานเมอมการเปลยนแถวตอหน
*/
/** ทำงานเมื่อมีการเปลี่ยนแถวต่อหน้า*/
watch(pagination, () => {
page.value = 1;
pageSize.value = pagination.value.rowsPerPage;
});
/**
* HookLifecycle
*/
onMounted(() => {
/** HookLifecycle*/
onMounted(async () => {
store.formQuery.round = "";
fetchRoundOption();
await fetchRoundOption();
});
</script>
@ -343,7 +317,6 @@ onMounted(() => {
:options="columns"
option-value="name"
style="min-width: 140px"
/>
</div>
<d-table

View file

@ -8,9 +8,7 @@ import { useCounterMixin } from "@/stores/mixin";
import { useKpiDataStore } from "@/modules/14_KPI/store";
import { checkPermission } from "@/utils/permissions";
/**
* importType
*/
/** importType*/
import type { QTableProps } from "quasar";
import type {
ResResults,
@ -18,9 +16,7 @@ import type {
} from "@/modules/14_KPI/interface/response/Main";
import type { DataOption } from "@/modules/14_KPI/interface/index/Main";
/**
* use
*/
/** use*/
const $q = useQuasar();
const {
showLoader,
@ -33,9 +29,7 @@ const {
const { convertResults, convertStatus } = useKpiDataStore();
const store = useKpiDataStore();
/**
* props
*/
/** props*/
const tab = defineModel<string>("tab", { required: true });
const rows = defineModel<ResResults[]>("row", { required: true });
const page = defineModel<number>("page", { required: true });
@ -47,9 +41,7 @@ const porps = defineProps({
fetchData: { type: Function, required: true }, // function
});
/**
* Table
*/
/** Table*/
const selected = ref<ResResults[]>([]);
const columns = ref<QTableProps["columns"]>([
{
@ -85,18 +77,18 @@ const columns = ref<QTableProps["columns"]>([
},
style: "font-size: 14px",
},
{
name: "evaluationStatus",
align: "left",
label: "สถานะการประเมิน",
sortable: true,
field: "evaluationStatus",
format(val, row) {
return val === "KP7" ? "ประการผลแล้ว" : convertStatus(val);
},
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
// {
// name: "evaluationStatus",
// align: "left",
// label: "",
// sortable: true,
// field: "evaluationStatus",
// format(val, row) {
// return val === "KP7" ? "" : convertStatus(val);
// },
// headerStyle: "font-size: 14px",
// style: "font-size: 14px",
// },
{
name: "evaluationResults",
align: "left",
@ -159,7 +151,7 @@ const visibleColumns = ref<string[]>([
"no",
"fullName",
"createdAt",
"evaluationStatus",
// "evaluationStatus",
"evaluationResults",
"organization",
"position",
@ -172,22 +164,18 @@ const pagination = ref({
rowsPerPage: pageSize.value,
});
/**
* วแปร
*/
/** ตัวแปร*/
const year = ref<number | null>(new Date().getFullYear()); //
const roundOp = ref<DataOption[]>([]); //
/**
* function นทกการประกาศผล
*/
/** function บันทึกการประกาศผล*/
function onAnnounce() {
const ids = selected.value.map((item) => item.id);
dialogConfirm(
$q,
() => {
async () => {
showLoader();
http
await http
.post(config.API.evaluationUserDone, {
id: ids,
})
@ -198,6 +186,8 @@ function onAnnounce() {
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
},
@ -206,12 +196,10 @@ function onAnnounce() {
);
}
/**
* function fetch รอบการประเม
*/
function fetchRoundOption() {
/** function fetch รอบการประเมิน*/
async function fetchRoundOption() {
showLoader();
http
await http
.get(
config.API.kpiPeriod +
`?page=${1}&pageSize=${10}&keyword=${""}&year=${year.value}`
@ -231,7 +219,7 @@ function fetchRoundOption() {
roundOp.value = list;
store.formQuery.round = list[0].id;
porps.fetchData();
await porps.fetchData();
} else {
roundOp.value = [];
store.formQuery.round = "";
@ -246,36 +234,28 @@ function fetchRoundOption() {
});
}
/**
* function เปลยนรอบการประเม และ เรยกขอมลรายการแผนพฒนาการปฏราชการรายบคคลยอนหล
*/
/** function เปลี่ยนรอบการประเมิน และ เรียกข้อมูลรายการแผนพัฒนาการปฏิบัติราชการรายบุคคลย้อนหลัง*/
function changRound() {
store.formQuery.page = 1;
porps.fetchData();
}
/**
* นหาขอม
*/
/** ค้นหาข้อมูล*/
function onSearchData() {
page.value = 1;
porps.fetchData();
}
/**
* ทำงานเมอมการเปลยนแถวตอหน
*/
/** ทำงานเมื่อมีการเปลี่ยนแถวต่อหน้า*/
watch(pagination, () => {
page.value = 1;
pageSize.value = pagination.value.rowsPerPage;
});
/**
* ทำงานเมอมการเปลยนแถวตอหน
*/
onMounted(() => {
/** ทำงานเมื่อมีการเปลี่ยนแถวต่อหน้า*/
onMounted(async () => {
store.formQuery.round = "";
fetchRoundOption();
await fetchRoundOption();
});
</script>
@ -364,7 +344,6 @@ onMounted(() => {
:options="columns"
option-value="name"
style="min-width: 140px"
/>
</div>
<d-table