แก้ kpi

This commit is contained in:
STW_TTTY\stwtt 2024-08-08 17:14:22 +07:00
parent ffc11fd929
commit 8c5f1bd5a6

View file

@ -8,7 +8,10 @@ import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
import type { DataOptionTechnique,ProjectYearOp } from "@/modules/08_KPI/interface/index/Main"; import type {
DataOptionTechnique,
ProjectYearOp,
} from "@/modules/08_KPI/interface/index/Main";
const props = defineProps({ const props = defineProps({
getAll: Function, getAll: Function,
@ -181,7 +184,6 @@ function close() {
reasonDevelopment10.value = ""; reasonDevelopment10.value = "";
development.value = []; development.value = [];
props.getAll?.(); props.getAll?.();
} }
@ -237,7 +239,7 @@ watch(
showLoader(); showLoader();
http http
.get(config.API.kpiAchievementDevelop + `/${id.value}`) .get(config.API.kpiAchievementDevelop + `/${id.value}`)
.then(async(res) => { .then(async (res) => {
const data = res.data.result; const data = res.data.result;
formData.year = data.selectTypeYear; formData.year = data.selectTypeYear;
await getDataByYear(); await getDataByYear();
@ -289,7 +291,7 @@ async function getDataByYear() {
showLoader(); showLoader();
http http
.get(config.API.developmentMain + `/done?year=${formData.year}`) .get(config.API.developmentMain + `/done?year=${formData.year}`)
.then(async(res) => { .then(async (res) => {
const data = await res.data.result.data; const data = await res.data.result.data;
projectOpMain.value = data; projectOpMain.value = data;
}) })
@ -310,13 +312,9 @@ function getProjectDetail(val: any) {
const data = res.data.result; const data = res.data.result;
formData.name = val.projectName; formData.name = val.projectName;
formData.group = data.group; formData.group = data.group;
formData.target = data.target;
formData.isDevelopment70 = data.isDevelopment70; formData.isDevelopment70 = data.isDevelopment70;
formData.isDevelopment20 = data.isDevelopment20; formData.isDevelopment20 = data.isDevelopment20;
formData.isDevelopment10 = data.isDevelopment10; formData.isDevelopment10 = data.isDevelopment10;
formData.achievement10 = data.achievement10;
formData.achievement5 = data.achievement5;
formData.achievement0 = data.achievement0;
development.value = data.developmentProjectTechniqueActuals; development.value = data.developmentProjectTechniqueActuals;
reasonDevelopment70.value = reasonDevelopment70.value =
data.developmentProjectTechniqueActuals.includes("other1") data.developmentProjectTechniqueActuals.includes("other1")
@ -344,7 +342,7 @@ function getProjectDetail(val: any) {
* @param val คำคนหา * @param val คำคนหา
* @param update function * @param update function
*/ */
function filterOptionFn(val: string, update: Function) { function filterOptionFn(val: string, update: Function) {
projectName.value = ""; projectName.value = "";
update(() => { update(() => {
projectOp.value = projectOpMain.value.filter( projectOp.value = projectOpMain.value.filter(
@ -352,7 +350,6 @@ function getProjectDetail(val: any) {
); );
}); });
} }
</script> </script>
<template> <template>
<q-dialog persistent v-model="modal"> <q-dialog persistent v-model="modal">
@ -390,7 +387,7 @@ function getProjectDetail(val: any) {
year-picker year-picker
:alt-position="customPosition" :alt-position="customPosition"
:enableTimePicker="false" :enableTimePicker="false"
@update:model-value="getDataByYear(),projectName = ''" @update:model-value="getDataByYear(), (projectName = '')"
> >
<template #year="{ year }">{{ year + 543 }}</template> <template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{ <template #year-overlay-value="{ value }">{{