Merge commit '9135f2362e' into develop
* commit '9135f2362e':
KPI => API เปืด-ปืด รอบการประเมินผลการปฏิบัติหน้าที่ราชการ
This commit is contained in:
commit
16705be9ff
1 changed files with 62 additions and 10 deletions
|
|
@ -5,6 +5,7 @@ import { useRouter } from "vue-router";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
/** importType*/
|
||||
import type {
|
||||
DataOption,
|
||||
ItemsMenu,
|
||||
|
|
@ -16,13 +17,13 @@ import type {
|
|||
} from "@/modules/14_KPI/interface/request/Main";
|
||||
import type { ResRound } from "@/modules/14_KPI/interface/response/Main";
|
||||
|
||||
/** importComponents*/
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
/** importStore*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
/** use*/
|
||||
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const {
|
||||
|
|
@ -72,6 +73,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
]);
|
||||
const visibleColumns = ref<string[]>(["durationKPI", "startDate", "endDate"]);
|
||||
|
||||
/** itemMenu*/
|
||||
const itemMenu = ref<ItemsMenu[]>([
|
||||
{
|
||||
label: "เปิดรอบ",
|
||||
|
|
@ -93,6 +95,7 @@ const itemMenu = ref<ItemsMenu[]>([
|
|||
},
|
||||
]);
|
||||
|
||||
/** Option รอบการประเมิน*/
|
||||
const roundOp = ref<DataOption[]>([
|
||||
{ id: "APR", name: "รอบเมษายน" },
|
||||
{
|
||||
|
|
@ -108,13 +111,15 @@ const formQuery = reactive<FormQueryRound>({
|
|||
keyword: "",
|
||||
});
|
||||
const totalList = ref<number>(1);
|
||||
|
||||
const formData = reactive<FormRound>({
|
||||
durationKPI: "",
|
||||
startDate: null,
|
||||
endDate: null,
|
||||
});
|
||||
const modalDialog = ref<boolean>(false);
|
||||
const isStatusEdit = ref<boolean>(false);
|
||||
|
||||
/** function fetch ข้อมูลรายการรอบการประเมินผลการปฏิบัติหน้าที่ราชการ*/
|
||||
function fetchList() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -135,18 +140,23 @@ function fetchList() {
|
|||
});
|
||||
}
|
||||
|
||||
const modalDialog = ref<boolean>(false);
|
||||
const isStatusEdit = ref<boolean>(false);
|
||||
/**
|
||||
* function opent Dialog เพิ่มรอบการประเมินผลการปฏิบัติหน้าที่ราชการ
|
||||
* @param status เพิ่ม,แก้ไข
|
||||
* @param id
|
||||
*/
|
||||
function onClickAddOrView(status: boolean = false, id: string = "") {
|
||||
isStatusEdit.value = status;
|
||||
modalDialog.value = true;
|
||||
}
|
||||
|
||||
/** function close Dialog*/
|
||||
function closeDialog() {
|
||||
modalDialog.value = false;
|
||||
clearFormData();
|
||||
}
|
||||
|
||||
/** function Clear วันสิ้นสุด*/
|
||||
function changeDateStart() {
|
||||
if (formData?.startDate !== null && formData?.endDate !== null) {
|
||||
const startDate = new Date(formData.startDate);
|
||||
|
|
@ -157,12 +167,14 @@ function changeDateStart() {
|
|||
}
|
||||
}
|
||||
|
||||
/** function ClearForm เพิ่มรอบการประเมิน*/
|
||||
function clearFormData() {
|
||||
formData.durationKPI = "";
|
||||
formData.startDate = null;
|
||||
formData.endDate = null;
|
||||
}
|
||||
|
||||
/** function บันทึกข้อมูลเพิ่มรอบการประเมิน*/
|
||||
function onSubmit() {
|
||||
dialogConfirm($q, async () => {
|
||||
try {
|
||||
|
|
@ -185,10 +197,10 @@ function onSubmit() {
|
|||
function onClickAction(action: string, id: string) {
|
||||
switch (action) {
|
||||
case "open":
|
||||
onOpenRounde();
|
||||
onOpenRounde(id);
|
||||
break;
|
||||
case "close":
|
||||
onCloseRounde();
|
||||
onCloseRounde(id);
|
||||
break;
|
||||
case "delete":
|
||||
onDeleteRound(id);
|
||||
|
|
@ -198,23 +210,62 @@ function onClickAction(action: string, id: string) {
|
|||
}
|
||||
}
|
||||
|
||||
function onOpenRounde() {
|
||||
/**
|
||||
* function เปิดรอบ
|
||||
* @param id รอบการประเมิน
|
||||
*/
|
||||
function onOpenRounde(id: string) {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
() => {},
|
||||
() => {
|
||||
http
|
||||
.get(config.API.kpiPeriod + `/open/${id}`)
|
||||
.then(() => {
|
||||
fetchList();
|
||||
success($q, "เปิดรอบสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
},
|
||||
"ยืนยันการเปิดรอบ",
|
||||
"ต้องการยืนยันการเปิดรอบนี้หรือไม่ ?"
|
||||
);
|
||||
}
|
||||
function onCloseRounde() {
|
||||
|
||||
/**
|
||||
* function ปิดรอบ
|
||||
* @param id รอบการประเมิน
|
||||
*/
|
||||
function onCloseRounde(id: string) {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
() => {},
|
||||
() => {
|
||||
http
|
||||
.get(config.API.kpiPeriod + `/close/${id}`)
|
||||
.then(() => {
|
||||
success($q, "ปิดรอบสำเร็จ");
|
||||
fetchList();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
},
|
||||
"ยืนยันการปิดรอบ",
|
||||
"ต้องการยืนยันการปิดรอบนี้หรือไม่ ?"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* function ลบรอบ
|
||||
* @param id รอบการประเมิน
|
||||
*/
|
||||
function onDeleteRound(id: string) {
|
||||
dialogRemove($q, () => {
|
||||
showLoader();
|
||||
|
|
@ -233,6 +284,7 @@ function onDeleteRound(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
/** function Convertname รอบการประเมิน */
|
||||
function connvertName(val: string) {
|
||||
const findData = roundOp.value.find((e: DataOption) => e.id === val);
|
||||
return findData?.name;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue