update KPI
This commit is contained in:
parent
48cdac3326
commit
7084c9e839
38 changed files with 473 additions and 416 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue