Merge branch 'develop' into nice

# Conflicts:
#	src/modules/14_KPI/store.ts
This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-07-04 09:33:16 +07:00
commit b1653d75f2
17 changed files with 668 additions and 608 deletions

View file

@ -137,7 +137,7 @@ const API = {
...file,
};
const path = "http://localhost:3008";
const path = "http://chamomind.ddns.net:20006";
const generatePopupPath = (routeName: any) => {
if (routeName.includes("metadata")) {
@ -218,7 +218,7 @@ const manualConfig = {
KPIIndicatorByRole: `${path}/manual/chapter-3-admin-evaluate`,
KPICompetencyAdd: `${path}/manual/chapter-3-admin-evaluate`,
KPICompetencyByid: `${path}/manual/chapter-3-admin-evaluate`,
organizationNew: `${path}/manual/chapter-4-admin-organization`,
organizationalNew: `${path}/manual/chapter-4-admin-organization`,
organization: `${path}/manual/chapter-7-admin-registry`,
registry: `${path}/manual/chapter-7-admin-registry`,
registryDetail: `${path}/manual/chapter-7-admin-registry`,

View file

@ -493,31 +493,33 @@ const fetchData = async (loading: boolean = true) => {
)
.then(async (res) => {
const data = res.data.result;
total.value = data.total;
maxPage.value = await Math.ceil(data.total / pageSize.value);
maxPage.value = maxPage.value < 1 ? 1 : maxPage.value;
if (data.data) {
total.value = data.total;
maxPage.value = await Math.ceil(data.total / pageSize.value);
maxPage.value = maxPage.value < 1 ? 1 : maxPage.value;
rows.value = [];
data.data.map((r: any) => {
rows.value.push({
id: r.id,
fullname: `${r.prefixName}${r.firstName} ${r.lastName}`,
avatar: r.profileImg != null ? r.profileImg.detail : "",
citizenId: r.citizenId,
number: r.number,
registerDate: date2Thai(r.registerDate, false, true),
examIdenNumber: r.examIdenNumber,
seatNumber: r.seatNumber,
resultC: r.resultC,
resultB: r.resultB,
pass: r.pass,
email: r.email,
status: r.status,
position: `${r.positionName}${r.positionLevelName}`,
positionLevel: r.positionLevelName,
check: false,
rows.value = [];
data.data.map((r: any) => {
rows.value.push({
id: r.id,
fullname: `${r.prefixName}${r.firstName} ${r.lastName}`,
avatar: r.profileImg != null ? r.profileImg.detail : "",
citizenId: r.citizenId,
number: r.number,
registerDate: date2Thai(r.registerDate, false, true),
examIdenNumber: r.examIdenNumber,
seatNumber: r.seatNumber,
resultC: r.resultC,
resultB: r.resultB,
pass: r.pass,
email: r.email,
status: r.status,
position: `${r.positionName}${r.positionLevelName}`,
positionLevel: r.positionLevelName,
check: false,
});
});
});
}
})
.catch((e) => {
messageError($q, e);

View file

@ -786,7 +786,6 @@ onMounted(() => {
<q-dialog v-model="modal" class="dialog" persistent>
<q-card style="min-width: 80%">
<q-form @submit.prevent greedy @validation-success="onSubmit(typeForm)">
{{ typeForm }} {{ isEdit }}
<DialogHeader
:tittle="
isEdit

View file

@ -5,6 +5,8 @@ import { useCounterMixin } from "@/stores/mixin";
import { useRoute, useRouter } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
import { useProbationDataStore } from "@/modules/05_placement/storeProbation";
const probationStore = useProbationDataStore();
const $q = useQuasar();
const myForm = ref<any>(null);
@ -39,7 +41,7 @@ const reson52 = ref<string>("");
const chairman_dated = ref<Date>();
const director1_dated = ref<any>("");
const director2_dated = ref<any>("");
const fullname = ref<string>("");
// const fullname = ref<string>("");
const director_id = ref<any>(null);
const director_id2 = ref<any>(null);
const director_id3 = ref<any>(null);
@ -158,7 +160,10 @@ async function clickdownloadFile(type: string) {
responseType: "blob",
})
.then((res) => {
downloadFile(res, `แบบรายงานการประเมินฯ_${fullname.value}.${type}`);
downloadFile(
res,
`แบบรายงานการประเมินฯ_${probationStore.person.name}.${type}`
);
})
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));

View file

@ -29,7 +29,7 @@ const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError } = mixin;
const assignId = ref<string>(route.params.form.toString());
const personalId = ref<string>(route.params.personalId.toString());
const fullname = ref<string>("");
// const fullname = ref<string>("");
const tab = ref<string>("save1");
const dataArrayNumber = ref<number>();
const dataRole = ref<string>("mentor");
@ -43,9 +43,9 @@ async function fecthAssign(id: string) {
.get(config.API.formevaluate(id))
.then(async (res: any) => {
await fecthdataAssign(res.data.data);
fullname.value = res.data.data.experimentee
? res.data.data.experimentee.name
: "";
// fullname.value = res.data.data.experimentee
// ? res.data.data.experimentee.name
// : "";
dataArrayNumber.value = 1;
})
.catch((e: any) => {
@ -91,7 +91,7 @@ async function FileDownload(type: string) {
.then(async (res) => {
downloadFile(
res,
`แบบบันทึกผล(ผู้ดูเเล)_${fullname.value}_ครั้งที่${numTab.no}.${type}`
`แบบบันทึกผล(ผู้ดูเเล)_${probationStore.person.name}_ครั้งที่${numTab.no}.${type}`
);
})
.catch(async (e) => {
@ -110,7 +110,7 @@ async function FileDownload(type: string) {
.then(async (res) => {
downloadFile(
res,
`แบบบันทึกผล(ผู้บังคับบัญชา)_${fullname.value}_ครั้งที่${numTab.no}.${type}`
`แบบบันทึกผล(ผู้บังคับบัญชา)_${probationStore.person.name}_ครั้งที่${numTab.no}.${type}`
);
})
.catch(async (e) => {

View file

@ -29,7 +29,7 @@ const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError } = mixin;
const assignId = ref<string>(route.params.form.toString());
const personalId = ref<string>(route.params.personalId.toString());
const fullname = ref<string>("");
// const fullname = ref<string>("");
const tab = ref<string>("save1");
const dataArrayNumber = ref<number>();
const dataRole = ref<string>("mentor");
@ -48,9 +48,7 @@ async function fecthAssign(id: string) {
.get(config.API.formevaluateCommander(id))
.then(async (res: any) => {
await fecthdataAssign(res.data.data);
fullname.value = res.data.data.experimentee
? res.data.data.experimentee.name
: "";
// fullname.value = res.data.person ? res.data.person.name : "";
dataArrayNumber.value = 1;
})
.catch((e: any) => {
@ -99,7 +97,7 @@ async function FileDownload(type: string) {
.then(async (res) => {
downloadFile(
res,
`แบบบันทึกผล(ผู้บังคับบัญชา)_${fullname.value}_ครั้งที่${numTab.no}.${type}`
`แบบบันทึกผล(ผู้บังคับบัญชา)_${probationStore.person.name}_ครั้งที่${numTab.no}.${type}`
);
})
.catch(async (e) => {
@ -118,7 +116,7 @@ async function FileDownload(type: string) {
.then(async (res) => {
downloadFile(
res,
`แบบบันทึกผล(ผู้บังคับบัญชา)_${fullname.value}_ครั้งที่${numTab.no}.${type}`
`แบบบันทึกผล(ผู้บังคับบัญชา)_${probationStore.person.name}_ครั้งที่${numTab.no}.${type}`
);
})
.catch(async (e) => {

View file

@ -29,7 +29,7 @@ const probationStore = useProbationDataStore();
const { fecthdataAssign } = probationStore;
const assignId = ref<string>(route.params.form.toString());
const personalId = ref<string>(route.params.personalId.toString());
const fullname = ref<string>("");
// const fullname = ref<string>("");
const tab = ref<string>("save1");
const tabs = ref<any>([]);
const dataArrayNumber = ref<number>(1);
@ -60,9 +60,7 @@ async function fecthAssign(id: string) {
await fecthdataAssign(res.data.data);
evaluate.value = probationStore.evaluate;
tabs.value = evaluate.value;
fullname.value = res.data.data.experimentee
? res.data.data.experimentee.name
: "";
// fullname.value = res.data.data.person ? res.data.data.person.name : "";
dataArrayNumber.value = 1;
})
.catch((e: any) => {
@ -98,7 +96,7 @@ async function FileDownload(type: string) {
.then(async (res) => {
downloadFile(
res,
`แบบประเมินผล(ผู้บังคับบัญชา)_${fullname.value}_ครั้งที่${numTab.no}.${type}`
`แบบประเมินผล(ผู้บังคับบัญชา)_${probationStore.person.name}_ครั้งที่${numTab.no}.${type}`
);
})
.catch(async (e) => {

View file

@ -30,7 +30,7 @@ const { showLoader, hideLoader, messageError, success } = mixin;
const assignId = ref<string>(route.params.form.toString());
const personalId = ref<string>(route.params.personalId.toString());
const fullname = ref<string>("");
// const fullname = ref<string>("");
const tab = ref<string>("save1");
const tabs = ref<any>([]);
const dataArrayNumber = ref<number>(1);
@ -47,9 +47,7 @@ const fecthAssign = async (id: string) => {
.then(async (res: any) => {
await fecthdataAssign(res.data.data);
evaluate.value = probationStore.evaluate;
fullname.value = res.data.data.experimentee
? res.data.data.experimentee.name
: "";
// fullname.value = res.data.data.person ? res.data.data.person.name : "";
tabs.value = evaluate.value;
dataArrayNumber.value = 1;
})
@ -80,7 +78,7 @@ const FileDownload = async (type: string) => {
.then(async (res) => {
downloadFile(
res,
`แบบประเมินผล(คณะกรรมการ)_${fullname.value}_ครั้งที่${numTab.no}.${type}`
`แบบประเมินผล(คณะกรรมการ)_${probationStore.person.name}_ครั้งที่${numTab.no}.${type}`
);
})
.catch(async (e) => {

View file

@ -34,6 +34,8 @@ const {
} = useCounterMixin();
const isActive = ref<boolean>(false);
const posType = ref<string>("");
const salaryId = ref<string>(route.params.id.toString());
/** modalDialog*/
@ -209,9 +211,11 @@ function fetchList() {
.get(config.API.salaryChartByid(salaryId.value))
.then((res) => {
isActive.value = res.data.result.isActive;
posType.value = `${res.data.result.posTypeName}(${res.data.result.posLevelName})`;
})
.catch((e) => {})
.finally(() => {});
.catch((e) => {
messageError($q, e);
});
}
onMounted(async () => {
await fetchList();
@ -236,7 +240,7 @@ watch([() => formQuery.page, () => formQuery.pageSize], async () => {
class="q-mr-sm"
@click="router.go(-1)"
/>
ตราเงนเดอน
ตราเงนเดอน ของ{{ posType }}
</div>
</div>
<q-card flat bordered class="q-pa-md">

View file

@ -136,7 +136,7 @@ function getData(type: any) {
.then(async (res) => {
const data = res.data.result.data;
rows.value[type] = data;
lists.value = await lists.value.filter((x: any) => x.type != type);
lists.value = lists.value.filter((x: any) => x.type != type);
lists.value.push({ type: type, data });
})
.catch((e) => {
@ -349,7 +349,7 @@ onMounted(() => {
<d-table
ref="table"
:columns="columns"
:rows="rows[item.id]"
:rows="rows.length !== 0 ? rows[item.id]:[]"
row-key="id"
flat
bordered

View file

@ -144,16 +144,6 @@ export const useKpiDataStore = defineStore("KPIDataAdmin", () => {
return "ผ่านการประเมิน";
case "NOTPASSED":
return "ไม่ผ่านการประเมิน";
case "EXCELLENT":
return "ดีเด่น";
case "VERY_GOOD":
return "ดีเด่น";
case "GOOD":
return "ดี";
case "FAIR":
return "พอใช้";
case "IMPROVEMENT":
return "ต้องปรับปรุง";
default:
break;
}

View file

@ -156,7 +156,30 @@ async function onSubmit() {
dialogConfirm($q, async () => {
showLoader();
await http
.put(config.API.developmentMainTab("tab3", projectId.value), formData)
.put(config.API.developmentMainTab("tab3", projectId.value), {
developmentProjectTypes: formData.developmentProjectTypes,
projectModal: formData.projectModal,
isBackPlanned: formData.isBackPlanned,
isHoldPlanned: formData.isHoldPlanned,
projectDayBackPlanned: formData.isBackPlanned ? formData.projectDayBackPlanned:null,
projectDayHoldPlanned: formData.projectDayHoldPlanned,
projectNigthHoldPlanned: formData.projectNigthHoldPlanned,
developmentProjectTechniquePlanneds:
formData.developmentProjectTechniquePlanneds,
isBackActual: formData.isBackActual,
isHoldActual: formData.isHoldActual,
projectDayBackActual: formData.projectDayBackActual,
projectDayHoldActual: formData.projectDayHoldActual,
projectNigthHoldActual: formData.projectNigthHoldActual,
developmentProjectTechniqueActuals:
formData.developmentProjectTechniqueActuals,
projectModalActual: formData.projectModalActual,
projectModalPlanned: formData.projectModalPlanned,
strategyChildPlannedId: formData.strategyChildPlannedId,
strategyChildPlannedNode: formData.strategyChildPlannedNode,
strategyChildActualId: formData.strategyChildActualId,
strategyChildActualNode: formData.strategyChildActualNode,
})
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
fetchData();
@ -210,322 +233,322 @@ onMounted(() => {
</div>
<q-card bordered class="col-12 q-my-sm">
<div
class="col-xs-12 col-sm-12 text-weight-medium bg-grey-3 q-py-xs q-px-md"
>
ความสอดคลองหรอเชอมโยงกบยทธศาสตร/แผน
</div>
<q-separator />
<q-card bordered class="col-12 q-my-sm">
<div
class="col-xs-12 col-sm-12 text-weight-medium bg-grey-3 q-py-xs q-px-md"
>
ความสอดคลองหรอเชอมโยงกบยทธศาสตร/แผน
</div>
<q-separator />
<q-card-section>
<div class="row col-12 q-col-gutter-sm">
<div class="col-6">
<q-card bordered class="col-12">
<div
class="col-xs-12 col-sm-12 text-weight-medium bg-grey-1 q-py-xs q-px-md"
>
ทธศาสตร/แผน
</div>
<q-separator />
<q-card-section>
<div class="row col-12 q-col-gutter-sm">
<div class="col-6">
<q-card bordered class="col-12">
<div
class="col-xs-12 col-sm-12 text-weight-medium bg-grey-1 q-py-xs q-px-md"
>
ทธศาสตร/แผน
</div>
<q-separator />
<q-card-section class="q-pa-sm">
<q-input
dense
outlined
v-model="filter"
label="ค้นหา"
class="inputgreen"
>
<template v-slot:append>
<q-icon
v-if="filter !== ''"
name="clear"
class="cursor-pointer"
@click="filter = ''"
/>
<q-icon v-else name="search" color="grey-5" />
</template>
</q-input>
<q-tree
dense
:nodes="nodes"
selected-color="primary"
node-key="id"
label-key="name"
:filter="filter"
:no-results-label="notFound"
:no-nodes-label="noData"
v-model:expanded="expanded"
>
<template v-slot:default-header="prop">
<q-item
clickable
@click.stop="updateSelected(prop.node, '1')"
<q-card-section class="q-pa-sm">
<q-input
dense
outlined
v-model="filter"
label="ค้นหา"
class="inputgreen"
>
<template v-slot:append>
<q-icon
v-if="filter !== ''"
name="clear"
class="cursor-pointer"
@click="filter = ''"
/>
<q-icon v-else name="search" color="grey-5" />
</template>
</q-input>
<q-tree
dense
:nodes="nodes"
selected-color="primary"
node-key="id"
label-key="name"
:filter="filter"
:no-results-label="notFound"
:no-nodes-label="noData"
v-model:expanded="expanded"
>
<template v-slot:default-header="prop">
<q-item
clickable
@click.stop="updateSelected(prop.node, '1')"
:active="formData.strategyChildPlannedId == prop.node.id"
active-class="my-list-link text-primary text-weight-medium"
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
>
<div>
<div class="text-weight-medium">
{{ prop.node.name }}
active-class="my-list-link text-primary text-weight-medium"
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
>
<div>
<div class="text-weight-medium">
{{ prop.node.name }}
</div>
</div>
</div>
</q-item>
</template>
</q-tree>
</q-card-section>
</q-card>
</div>
<div class="col-6">
<q-card bordered class="col-12">
<div
class="col-xs-12 col-sm-12 text-weight-medium bg-grey-1 q-py-xs q-px-md"
>
ทธศาสตร/แผน
</div>
<q-separator />
</q-item>
</template>
</q-tree>
</q-card-section>
</q-card>
</div>
<div class="col-6">
<q-card bordered class="col-12">
<div
class="col-xs-12 col-sm-12 text-weight-medium bg-grey-1 q-py-xs q-px-md"
>
ทธศาสตร/แผน
</div>
<q-separator />
<q-card-section class="q-pa-sm">
<q-input
dense
outlined
v-model="filter2"
label="ค้นหา"
class="inputgreen"
>
<template v-slot:append>
<q-icon
v-if="filter2 !== ''"
name="clear"
class="cursor-pointer"
@click="filter2 = ''"
/>
<q-icon v-else name="search" color="grey-5" />
</template>
</q-input>
<q-tree
dense
:nodes="nodes"
node-key="id"
label-key="name"
:filter="filter2"
:no-results-label="notFound"
:no-nodes-label="noData"
v-model:expanded="expanded2"
>
<template v-slot:default-header="prop">
<q-item
clickable
@click.stop="updateSelected(prop.node, '2')"
:active="formData.strategyChildActualId == prop.node.id"
active-class="my-list-link text-primary text-weight-medium"
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
>
<div>
<div class="text-weight-medium">
{{ prop.node.name }}
<q-card-section class="q-pa-sm">
<q-input
dense
outlined
v-model="filter2"
label="ค้นหา"
class="inputgreen"
>
<template v-slot:append>
<q-icon
v-if="filter2 !== ''"
name="clear"
class="cursor-pointer"
@click="filter2 = ''"
/>
<q-icon v-else name="search" color="grey-5" />
</template>
</q-input>
<q-tree
dense
:nodes="nodes"
node-key="id"
label-key="name"
:filter="filter2"
:no-results-label="notFound"
:no-nodes-label="noData"
v-model:expanded="expanded2"
>
<template v-slot:default-header="prop">
<q-item
clickable
@click.stop="updateSelected(prop.node, '2')"
:active="formData.strategyChildActualId == prop.node.id"
active-class="my-list-link text-primary text-weight-medium"
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
>
<div>
<div class="text-weight-medium">
{{ prop.node.name }}
</div>
</div>
</div>
</q-item>
</template>
</q-tree>
</q-card-section>
</q-card>
</q-item>
</template>
</q-tree>
</q-card-section>
</q-card>
</div>
</div>
</q-card-section>
</q-card>
<q-card bordered class="col-12 q-my-sm">
<div
class="col-xs-12 col-sm-12 text-weight-medium bg-grey-3 q-py-xs q-px-md"
>
ปแบบโครงการ
</div>
</q-card-section>
</q-card>
<q-separator />
<q-card bordered class="col-12 q-my-sm">
<div
class="col-xs-12 col-sm-12 text-weight-medium bg-grey-3 q-py-xs q-px-md"
>
ปแบบโครงการ
</div>
<q-separator />
<q-card-section>
<div class="row col-12 q-col-gutter-sm">
<div class="col-6 q-col-gutter-sm">
<div class="col-12 text-bold">ปแบบโครงการตามแผน</div>
<q-card-section>
<div class="row col-12 q-col-gutter-sm">
<div class="col-6 q-col-gutter-sm">
<div class="col-12 text-bold">ปแบบโครงการตามแผน</div>
<div class="row col-12 q-col-gutter-sm">
<div class="col-12 col-md-3">
<q-checkbox
:disable="store.projectStatus === 'FINISH'"
keep-color
color="primary"
dense
value="GO_BLACK"
label="ไป-กลับ"
v-model="formData.isBackPlanned"
></q-checkbox>
</div>
<div class="col-12 col-md-4">
<q-input
:readonly="store.projectStatus === 'FINISH'"
dense
outlined
v-model="formData.projectDayBackPlanned"
label="จำนวน (วัน)"
mask="#"
reverse-fill-mask
class="inputgreen"
/>
</div>
</div>
<div class="row col-12 q-col-gutter-sm">
<div class="col-12 col-md-3">
<q-checkbox
:disable="store.projectStatus === 'FINISH'"
keep-color
color="primary"
dense
value="HOLD"
label="พักค้าง"
v-model="formData.isHoldPlanned"
></q-checkbox>
</div>
<div class="col-12 col-md-4">
<q-input
:readonly="store.projectStatus === 'FINISH'"
dense
outlined
v-model="formData.projectDayHoldPlanned"
label="จำนวน (วัน)"
mask="#"
reverse-fill-mask
class="inputgreen"
/>
</div>
<div class="col-12 col-md-4">
<q-input
:readonly="store.projectStatus === 'FINISH'"
dense
outlined
v-model="formData.projectNigthHoldPlanned"
label="จำนวน (คืน)"
mask="#"
class="inputgreen"
reverse-fill-mask
/>
</div>
</div>
<div class="row col-12 q-col-gutter-sm">
<div class="col-12 col-md-3">
<q-checkbox
<div class="col-12 q-py-md">
<q-label class="q-mb-sm">เทคนควการทใชในการพฒนา</q-label>
<q-option-group
:disable="store.projectStatus === 'FINISH'"
keep-color
color="primary"
dense
value="GO_BLACK"
label="ไป-กลับ"
v-model="formData.isBackPlanned"
></q-checkbox>
</div>
<div class="col-12 col-md-4">
<q-input
:readonly="store.projectStatus === 'FINISH'"
dense
outlined
v-model="formData.projectDayBackPlanned"
label="จำนวน (วัน)"
mask="#"
reverse-fill-mask
class="inputgreen"
v-model="formData.developmentProjectTechniquePlanneds"
:options="projectTechniquesOp"
type="checkbox"
/>
</div>
</div>
<div class="row col-12 q-col-gutter-sm">
<div class="col-12 col-md-3">
<q-checkbox
<div class="col-12 col-sm-6 col-md-4">
<q-input
:disable="store.projectStatus === 'FINISH'"
keep-color
color="primary"
dense
value="HOLD"
label="พักค้าง"
v-model="formData.isHoldPlanned"
></q-checkbox>
</div>
<div class="col-12 col-md-4">
<q-input
:readonly="store.projectStatus === 'FINISH'"
dense
outlined
v-model="formData.projectDayHoldPlanned"
label="จำนวน (วัน)"
v-model="formData.projectModalPlanned"
label="จำนวน (รุ่น)"
mask="#"
reverse-fill-mask
class="inputgreen"
/>
</div>
<div class="col-12 col-md-4">
<q-input
:readonly="store.projectStatus === 'FINISH'"
dense
outlined
v-model="formData.projectNigthHoldPlanned"
label="จำนวน (คืน)"
mask="#"
class="inputgreen"
reverse-fill-mask
/>
</div>
<div
v-if="store.projectStatus === 'FINISH'"
class="col-6 q-col-gutter-sm"
>
<div class="col-12 text-bold">ปแบบโครงการตามจร</div>
<div class="row col-12 q-col-gutter-sm">
<div class="col-md-3">
<q-checkbox
keep-color
color="primary"
dense
value="GO_BLACK"
label="ไป-กลับ"
v-model="formData.isBackActual"
></q-checkbox>
</div>
<div class="col-12 col-md-4">
<q-input
dense
outlined
v-model="formData.projectDayBackActual"
label="จำนวน (วัน)"
mask="#"
reverse-fill-mask
/>
</div>
</div>
</div>
<div class="col-12 q-py-md">
<q-label class="q-mb-sm">เทคนควการทใชในการพฒนา</q-label>
<q-option-group
:disable="store.projectStatus === 'FINISH'"
keep-color
color="primary"
dense
v-model="formData.developmentProjectTechniquePlanneds"
:options="projectTechniquesOp"
type="checkbox"
/>
</div>
<div class="col-12 col-sm-6 col-md-4">
<q-input
:disable="store.projectStatus === 'FINISH'"
dense
outlined
v-model="formData.projectModalPlanned"
label="จำนวน (รุ่น)"
mask="#"
reverse-fill-mask
class="inputgreen"
/>
</div>
</div>
<div
v-if="store.projectStatus === 'FINISH'"
class="col-6 q-col-gutter-sm"
>
<div class="col-12 text-bold">ปแบบโครงการตามจร</div>
<div class="row col-12 q-col-gutter-sm">
<div class="col-md-3">
<q-checkbox
<div class="row col-12 q-col-gutter-sm">
<div class="col-12 col-md-3">
<q-checkbox
keep-color
color="primary"
dense
value="HOLD"
label="พักค้าง"
v-model="formData.isHoldActual"
></q-checkbox>
</div>
<div class="col-12 col-md-4">
<q-input
dense
outlined
v-model="formData.projectDayHoldActual"
label="จำนวน (วัน)"
mask="#"
reverse-fill-mask
/>
</div>
<div class="col-12 col-md-4">
<q-input
dense
outlined
v-model="formData.projectNigthHoldActual"
label="จำนวน (คืน)"
mask="#"
reverse-fill-mask
/>
</div>
</div>
<div class="col-12 q-py-md">
<q-label class="q-mb-sm">เทคนควการทใชในการพฒนา</q-label>
<q-option-group
keep-color
color="primary"
dense
value="GO_BLACK"
label="ไป-กลับ"
v-model="formData.isBackActual"
></q-checkbox>
v-model="formData.developmentProjectTechniqueActuals"
:options="projectTechniquesOp"
type="checkbox"
/>
</div>
<div class="col-12 col-md-4">
<div class="col-12 col-sm-6 col-md-4">
<q-input
dense
outlined
v-model="formData.projectDayBackActual"
label="จำนวน (วัน)"
v-model="formData.projectModalActual"
label="จำนวน (รุ่น)"
mask="#"
reverse-fill-mask
/>
</div>
</div>
<div class="row col-12 q-col-gutter-sm">
<div class="col-12 col-md-3">
<q-checkbox
keep-color
color="primary"
dense
value="HOLD"
label="พักค้าง"
v-model="formData.isHoldActual"
></q-checkbox>
</div>
<div class="col-12 col-md-4">
<q-input
dense
outlined
v-model="formData.projectDayHoldActual"
label="จำนวน (วัน)"
mask="#"
reverse-fill-mask
/>
</div>
<div class="col-12 col-md-4">
<q-input
dense
outlined
v-model="formData.projectNigthHoldActual"
label="จำนวน (คืน)"
mask="#"
reverse-fill-mask
/>
</div>
</div>
<div class="col-12 q-py-md">
<q-label class="q-mb-sm">เทคนควการทใชในการพฒนา</q-label>
<q-option-group
keep-color
color="primary"
dense
v-model="formData.developmentProjectTechniqueActuals"
:options="projectTechniquesOp"
type="checkbox"
/>
</div>
<div class="col-12 col-sm-6 col-md-4">
<q-input
dense
outlined
v-model="formData.projectModalActual"
label="จำนวน (รุ่น)"
mask="#"
reverse-fill-mask
/>
</div>
</div>
</div>
</q-card-section>
</q-card>
</div>
</q-card-section>
</q-card>
</div>
<q-separator />
<div class="text-right q-pa-sm">
<q-btn

View file

@ -29,7 +29,14 @@ const route = useRoute();
const projectId = ref<string>(route.params.id.toLocaleString());
const $q = useQuasar();
const mixin = useCounterMixin();
const { dialogRemove, showLoader, hideLoader, messageError, success } = mixin;
const {
dialogRemove,
showLoader,
hideLoader,
messageError,
success,
dialogConfirm,
} = mixin;
const groupTargetData: any = reactive({
targetData: [{}],
});
@ -269,123 +276,127 @@ function onClickOpenDialog(type: string, target: string) {
}
/** เพิ่ม/แก้ไขกลุ่มเป้าหมาย */
async function onSubmitGroup() {
if (isTarget.value === "planned") {
await http
.put(
config.API.developmentMainTab(
isEdit.value ? "tab2_1_edit" : "tab2_1_add",
isEdit.value ? editId.value : projectId.value
),
{
groupTarget: formGroupTarget.groupTarget,
groupTargetSub: formGroupTarget.groupTargetSub,
positions:
formGroupTarget.groupTarget !== "OUTSIDERS"
? formGroupTarget.positions.map((v) => ({
position: v.position ? v.position : "",
posTypePlannedId: v.posTypeId ? v.posTypeId : "",
posLevelPlannedId: v.posLevelId ? v.posLevelId : "",
}))
: [],
type:
formGroupTarget.groupTarget === "OUTSIDERS"
? formGroupTarget.type
: "",
amount: formGroupTarget.amount,
}
)
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
} else {
await http
.put(
config.API.developmentMainTab(
isEdit.value ? "tab2_3_edit" : "tab2_3_add",
isEdit.value ? editId.value : projectId.value
),
{
groupTarget: formGroupTarget.groupTarget,
groupTargetSub: formGroupTarget.groupTargetSub,
position: formGroupTarget.position,
posTypeActualId: formGroupTarget.posType,
posLevelActualId: formGroupTarget.posLevel,
type: formGroupTarget.type,
amount: formGroupTarget.amount,
}
)
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
setTimeout(() => {
fetchData(projectId.value);
onClickCloseDialog();
}, 100);
function onSubmitGroup() {
dialogConfirm($q, async () => {
if (isTarget.value === "planned") {
await http
.put(
config.API.developmentMainTab(
isEdit.value ? "tab2_1_edit" : "tab2_1_add",
isEdit.value ? editId.value : projectId.value
),
{
groupTarget: formGroupTarget.groupTarget,
groupTargetSub: formGroupTarget.groupTargetSub,
positions:
formGroupTarget.groupTarget !== "OUTSIDERS"
? formGroupTarget.positions.map((v) => ({
position: v.position ? v.position : "",
posTypePlannedId: v.posTypeId ? v.posTypeId : "",
posLevelPlannedId: v.posLevelId ? v.posLevelId : "",
}))
: [],
type:
formGroupTarget.groupTarget === "OUTSIDERS"
? formGroupTarget.type
: "",
amount: formGroupTarget.amount,
}
)
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
} else {
await http
.put(
config.API.developmentMainTab(
isEdit.value ? "tab2_3_edit" : "tab2_3_add",
isEdit.value ? editId.value : projectId.value
),
{
groupTarget: formGroupTarget.groupTarget,
groupTargetSub: formGroupTarget.groupTargetSub,
position: formGroupTarget.position,
posTypeActualId: formGroupTarget.posType,
posLevelActualId: formGroupTarget.posLevel,
type: formGroupTarget.type,
amount: formGroupTarget.amount,
}
)
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
setTimeout(() => {
fetchData(projectId.value);
onClickCloseDialog();
}, 100);
});
}
/** เพิ่มผู้เกี่ยวข้อง */
async function onSubmitRelate() {
if (isTarget.value === "planned") {
await http
.put(
config.API.developmentMainTab(
isEdit.value ? "tab2_2_edit" : "tab2_2_add",
isEdit.value ? editId.value : projectId.value
),
{
groupTarget: formGroupRelate.relate,
amount: formGroupRelate.amount,
}
)
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
} else {
await http
.put(
config.API.developmentMainTab(
isEdit.value ? "tab2_4_edit" : "tab2_4_add",
isEdit.value ? editId.value : projectId.value
),
{
groupTarget: formGroupRelate.relate,
amount: formGroupRelate.amount,
}
)
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
setTimeout(() => {
fetchData(projectId.value);
onClickCloseDialog();
}, 100);
function onSubmitRelate() {
dialogConfirm($q, async () => {
if (isTarget.value === "planned") {
await http
.put(
config.API.developmentMainTab(
isEdit.value ? "tab2_2_edit" : "tab2_2_add",
isEdit.value ? editId.value : projectId.value
),
{
groupTarget: formGroupRelate.relate,
amount: formGroupRelate.amount,
}
)
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
} else {
await http
.put(
config.API.developmentMainTab(
isEdit.value ? "tab2_4_edit" : "tab2_4_add",
isEdit.value ? editId.value : projectId.value
),
{
groupTarget: formGroupRelate.relate,
amount: formGroupRelate.amount,
}
)
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
setTimeout(() => {
fetchData(projectId.value);
onClickCloseDialog();
}, 100);
});
}
/** clear form */
@ -409,6 +420,8 @@ function onClickCloseDialog() {
groupTargetData.targetData = [{}];
modalRelate.value = false;
cleanFormData();
fetchType();
fetchData(projectId.value);
}
/**
@ -533,7 +546,7 @@ onMounted(() => {
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-tr :props="props" class="cursor-pointer vertical-top">
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div v-if="col.name === 'posTypePlannedId'">
<div

View file

@ -36,7 +36,7 @@ const pagination = ref({
});
const rows = ref<any[]>([]);
const agencyOp = ref<[]>([]);
const agencyOp = ref<any[]>([]);
const itemMenu = ref<ItemsMenu[]>([
{
label: "ไฟล์ .xlsx",
@ -136,11 +136,18 @@ function fetchListOrg() {
showLoader();
http
.get(config.API.developmentHistoryListOrg("employee", formFilter.year))
.then((res) => {
.then(async (res) => {
formFilter.root = null;
rows.value = [];
agencyOp.value = res.data.result;
getData();
const option = [{ name: "ทั้งหมด", id: null }];
const optionNew = await res.data.result.map((e: string) => ({
name: e,
id: e,
}));
option.push(...optionNew);
agencyOp.value = option;
// agencyOp.value = res.data.result;
await getData();
})
.catch((err) => {
messageError($q, err);
@ -296,7 +303,17 @@ onMounted(() => {
option-label="name"
@update:model-value="(formFilter.page = 1), getData()"
style="min-width: 150px"
/>
map-options
emit-value
>
<template v-if="formFilter.root" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="(formFilter.root = null), fetchListOrg()"
class="cursor-pointer"
/>
</template>
</q-select>
<!-- <q-btn flat round dense icon="add" color="primary" @click="onAdd()">
<q-tooltip>เพ</q-tooltip>

View file

@ -38,7 +38,7 @@ const router = useRouter();
const store = useDevelopmentDataStore();
const $q = useQuasar();
const { showLoader, hideLoader, messageError } = useCounterMixin();
const agencyOp = ref<[]>([]);
const agencyOp = ref<any[]>([]);
const rows = ref<any[]>([]);
const visibleColumns = ref<string[]>([
@ -149,12 +149,19 @@ function fetchListOrg() {
showLoader();
http
.get(config.API.developmentHistoryListOrg("officer", formFilter.year))
.then((res) => {
.then(async (res) => {
console.log(res);
formFilter.root = null;
formFilter.page = 1;
rows.value = [];
agencyOp.value = res.data.result;
getData();
const option = [{ name: "ทั้งหมด", id: null }];
const optionNew = await res.data.result.map((e: string) => ({
name: e,
id: e,
}));
option.push(...optionNew);
agencyOp.value = option;
await getData();
})
.catch((err) => {
messageError($q, err);
@ -313,7 +320,16 @@ onMounted(() => {
option-label="name"
@update:model-value="(formFilter.page = 1), getData()"
style="min-width: 150px"
/>
map-options
emit-value
>
<template v-if="formFilter.root" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="(formFilter.root = null), fetchListOrg()"
class="cursor-pointer"
/> </template
></q-select>
</q-toolbar>
<q-toolbar class="col-4 q-pa-none q-gutter-x-sm">
<q-space />

View file

@ -28,8 +28,13 @@ import { useCounterMixin } from "@/stores/mixin";
/** use*/
const $q = useQuasar();
const router = useRouter();
const { showLoader, hideLoader, messageError, dialogMessageNotify } =
useCounterMixin();
const {
showLoader,
hideLoader,
messageError,
dialogMessageNotify,
dialogConfirm,
} = useCounterMixin();
const node = ref<any>([]);
const expanded = ref<string[]>([]);
@ -168,7 +173,6 @@ function onDownload() {
/** function ปิด Dialog เพิ่มโครงการ/หลักสูตรการฝึกอบรม*/
function closeDialog() {
modal.value = false;
formProject.year = null;
formProject.projectName = "";
formProject.orgRevisionId = "";
@ -176,18 +180,23 @@ function closeDialog() {
}
/** dialog submit */
function onSubmit() {
async function onSubmit() {
if (formProject.nodeId) {
http
.post(config.API.developmentMain, formProject)
.then((res) => {
closeDialog();
router.push(`/development/${res.data.result}`);
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {});
dialogConfirm($q, async () => {
await showLoader();
await http
.post(config.API.developmentMain, formProject)
.then(async (res) => {
await closeDialog();
await router.push(`/development/${res.data.result}`);
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
});
} else {
dialogMessageNotify($q, "กรุณาเลือกหน่วยงานที่รับผิดชอบ");
}
@ -213,7 +222,6 @@ function fetchActive() {
* @param id โครงสรางปจ
*/
function fetchTree(id: string) {
showLoader();
http
.get(config.API.orgByid(id.toString()))
.then((res) => {
@ -223,8 +231,6 @@ function fetchTree(id: string) {
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
@ -338,135 +344,122 @@ onMounted(() => {
</div>
<div class="col-xs-12 col-sm-9 q-pa-md row">
<div class="col-12">
<q-toolbar style="padding: 0">
<div class="row items-center q-gutter-sm">
<datepicker
menu-class-name="modalfix"
v-model="formQuery.year"
:locale="'th'"
autoApply
year-picker
:enableTimePicker="false"
style="width: 150px"
@update:model-value="fetchListProjectNew"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
dense
lazy-rules
outlined
:model-value="
formQuery.year === 0
? 'ทั้งหมด'
: Number(formQuery.year) + 543
"
:label="`${'ปีงบประมาณ'}`"
>
<template v-if="formQuery.year" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="
(formQuery.year = 0), fetchListProjectNew()
"
class="cursor-pointer"
/>
</template>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
<q-select
dense
outlined
v-model="formQuery.status"
:options="statusOpt"
label="สถานะโครงการ"
option-label="name"
option-value="id"
emit-value
map-options
@update:model-value="fetchListProjectNew"
/>
<q-toolbar-title>
<q-btn
flat
round
dense
icon="add"
color="primary"
@click="onAdd()"
>
<q-tooltip>เพ</q-tooltip>
</q-btn>
</q-toolbar-title>
</div>
<q-space />
<div class="row q-gutter-sm">
<div>
<q-btn
flat
round
dense
icon="mdi-arrow-down-bold-circle-outline"
color="blue"
@click="onDownload"
>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
</div>
<div>
<q-toolbar class="row col-8 q-pa-none q-gutter-x-sm" style="padding: 0">
<datepicker
menu-class-name="modalfix"
v-model="formQuery.year"
:locale="'th'"
autoApply
year-picker
:enableTimePicker="false"
style="width: 150px"
@update:model-value="fetchListProjectNew"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
standout
dense
v-model="formQuery.keyword"
ref="filterRef"
lazy-rules
outlined
placeholder="ค้นหา"
@keyup.enter="fetchListProjectNew"
:model-value="
formQuery.year === 0
? 'ทั้งหมด'
: Number(formQuery.year) + 543
"
:label="`${'ปีงบประมาณ'}`"
>
<template v-slot:append>
<q-icon v-if="formQuery.keyword == ''" name="search" />
<template v-if="formQuery.year" v-slot:append>
<q-icon
v-if="formQuery.keyword !== ''"
name="clear"
class="cursor-pointer"
@click="
(formQuery.keyword = ''),
fetchListProject(),
(formQuery.page = 1)
name="cancel"
@click.stop.prevent="
(formQuery.year = 0), fetchListProjectNew()
"
class="cursor-pointer"
/>
</template>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</div>
<div>
<q-select
v-model="visibleColumns"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
options-cover
style="min-width: 150px"
</template>
</datepicker>
<q-select
dense
outlined
v-model="formQuery.status"
:options="statusOpt"
label="สถานะโครงการ"
option-label="name"
option-value="id"
emit-value
map-options
@update:model-value="fetchListProjectNew"
/>
<q-toolbar-title>
<q-btn flat round dense icon="add" color="primary" @click="onAdd()">
<q-tooltip>เพ</q-tooltip>
</q-btn>
</q-toolbar-title>
<q-space />
<!-- <q-btn
flat
round
dense
icon="mdi-arrow-down-bold-circle-outline"
color="blue"
@click="onDownload"
>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn> -->
<q-input
standout
dense
v-model="formQuery.keyword"
ref="filterRef"
outlined
placeholder="ค้นหา"
@keyup.enter="fetchListProjectNew"
>
<template v-slot:append>
<q-icon v-if="formQuery.keyword == ''" name="search" />
<q-icon
v-if="formQuery.keyword !== ''"
name="clear"
class="cursor-pointer"
@click="
(formQuery.keyword = ''),
fetchListProject(),
(formQuery.page = 1)
"
/>
</div>
</div>
</template>
</q-input>
<q-select
v-model="visibleColumns"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
options-cover
style="min-width: 150px"
/>
</q-toolbar>
<div class="col-12">
@ -527,7 +520,7 @@ onMounted(() => {
<q-dialog persistent v-model="modal">
<q-card flat bordered style="min-width: 60vw">
<q-form greedy @submit.prevent @validation-success="onSubmit">
<q-form greedy @submit.prevent @validation-success="onSubmit()">
<DialogHeader
tittle="เพิ่มโครงการ/หลักสูตรการฝึกอบรม"
:close="closeDialog"
@ -673,7 +666,7 @@ onMounted(() => {
.tree-container {
overflow: auto;
height: 80vh;
height: 75vh;
border: 1px solid #e6e6e7;
border-radius: 10px;
}

View file

@ -270,7 +270,11 @@ onMounted(() => {
label="เลือกประเภททุน"
@update:model-value="fetchNewList"
class="select_ellipsis"
/>
>
<q-tooltip>{{
scholarshipTypeOp.find((e) => e.id === formQuery.type)?.name
}}</q-tooltip>
</q-select>
</div>
<q-btn