Merge branch 'nice_dev' into develop
This commit is contained in:
commit
7cdcebf5e0
8 changed files with 588 additions and 175 deletions
|
|
@ -11,4 +11,5 @@ export default {
|
||||||
developmentProjectSearch: () => `${development}/main/search`,
|
developmentProjectSearch: () => `${development}/main/search`,
|
||||||
/** รายการโครงการ*/
|
/** รายการโครงการ*/
|
||||||
developmentMain: `${development}/main`,
|
developmentMain: `${development}/main`,
|
||||||
|
developmentMainById: (id: string) => `${development}/main/${id}`,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,10 @@ import type { FormBasicinfo } from "@/modules/15_development/interface/request/M
|
||||||
import DialogSelectAgency from "@/modules/15_development/components/DialogSelectAgency.vue";
|
import DialogSelectAgency from "@/modules/15_development/components/DialogSelectAgency.vue";
|
||||||
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
const store = useDevelopmentDataStore();
|
||||||
const { showLoader, hideLoader, dialogConfirm } = useCounterMixin();
|
const { showLoader, hideLoader, dialogConfirm } = useCounterMixin();
|
||||||
|
|
||||||
const formData = reactive<FormBasicinfo>({
|
const formData = reactive<FormBasicinfo>({
|
||||||
|
|
@ -19,14 +21,6 @@ const formData = reactive<FormBasicinfo>({
|
||||||
objective: "",
|
objective: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
const options = ref<any>([
|
|
||||||
"สำนักงานคณะกรรมการข้าราชการกรุงเทพมหานครกองบริหารทั้วไป",
|
|
||||||
"สำนักงานคณะกรรมการข้าราชการกรุงเทพมหานคร",
|
|
||||||
]);
|
|
||||||
function onSubmit() {
|
|
||||||
dialogConfirm($q, () => {});
|
|
||||||
}
|
|
||||||
|
|
||||||
const modalDialogSelect = ref<boolean>(false);
|
const modalDialogSelect = ref<boolean>(false);
|
||||||
function selectAgency() {
|
function selectAgency() {
|
||||||
modalDialogSelect.value = true;
|
modalDialogSelect.value = true;
|
||||||
|
|
@ -34,111 +28,99 @@ function selectAgency() {
|
||||||
function updateAgency(name: string) {
|
function updateAgency(name: string) {
|
||||||
formData.org = name;
|
formData.org = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
console.log("ข้อมูลเบื้องต้น");
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<!-- <q-form greedy @submit.prevent @validation-success="onSubmit"> -->
|
<!-- <q-form greedy @submit.prevent @validation-success="onSubmit"> -->
|
||||||
<div class="row col-12 q-col-gutter-md q-pa-md">
|
<div class="row col-12 q-col-gutter-md q-pa-md">
|
||||||
<div class="col-xs-6 col-sm-2 col-md-2">
|
<div class="col-xs-6 col-sm-2 col-md-2">
|
||||||
<datepicker
|
<datepicker
|
||||||
menu-class-name="modalfix"
|
menu-class-name="modalfix"
|
||||||
v-model="formData.year"
|
v-model="store.formAddProject.year"
|
||||||
:locale="'th'"
|
:locale="'th'"
|
||||||
autoApply
|
autoApply
|
||||||
year-picker
|
year-picker
|
||||||
:enableTimePicker="false"
|
:enableTimePicker="false"
|
||||||
>
|
>
|
||||||
<template #year="{ year }">{{ year + 543 }}</template>
|
<template #year="{ year }">{{ year + 543 }}</template>
|
||||||
<template #year-overlay-value="{ value }">{{
|
<template #year-overlay-value="{ value }">{{
|
||||||
parseInt(value + 543)
|
parseInt(value + 543)
|
||||||
}}</template>
|
}}</template>
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<q-input
|
<q-input
|
||||||
dense
|
dense
|
||||||
lazy-rules
|
lazy-rules
|
||||||
outlined
|
outlined
|
||||||
:model-value="Number(formData.year) + 543"
|
:model-value="Number(store.formAddProject.year) + 543"
|
||||||
:label="`${'ปีงบประมาณ'}`"
|
:label="`${'ปีงบประมาณ'}`"
|
||||||
>
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<q-icon
|
<q-icon
|
||||||
name="event"
|
name="event"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
style="color: var(--q-primary)"
|
style="color: var(--q-primary)"
|
||||||
>
|
>
|
||||||
</q-icon>
|
</q-icon>
|
||||||
</template>
|
</template>
|
||||||
</q-input>
|
</q-input>
|
||||||
</template>
|
</template>
|
||||||
</datepicker>
|
</datepicker>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-10 col-sm-10 col-md-10">
|
<div class="col-xs-10 col-sm-10 col-md-10">
|
||||||
<q-input
|
<q-input
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
v-model="formData.org"
|
v-model="formData.org"
|
||||||
label="ชื่อหน่วยงานที่รับผิดชอบ"
|
label="ชื่อหน่วยงานที่รับผิดชอบ"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
lazy-rules
|
lazy-rules
|
||||||
@click="selectAgency"
|
@click="selectAgency"
|
||||||
:rules="[
|
/>
|
||||||
(val:string) =>
|
<!-- :rules="[
|
||||||
!!val || `${'กรุณาเลือกหน่วยงานที่รับผิดชอบ'}`,
|
(val:string) =>
|
||||||
]"
|
!!val || `${'กรุณาเลือกหน่วยงานที่รับผิดชอบ'}`,
|
||||||
/>
|
]" -->
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||||
<q-input
|
<q-input
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
v-model="formData.projectName"
|
v-model="store.formAddProject.projectName"
|
||||||
label="ชื่อโครงการ/กิจกรรม/หลักสูตร"
|
label="ชื่อโครงการ/กิจกรรม/หลักสูตร"
|
||||||
rows="6"
|
rows="6"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:rules="[
|
:rules="[
|
||||||
(val:string) =>
|
(val:string) =>
|
||||||
!!val || `${'กรุณากรอกชื่อโครงการ/กิจกรรม/หลักสูตร'}`,
|
!!val || `${'กรุณากรอกชื่อโครงการ/กิจกรรม/หลักสูตร'}`,
|
||||||
|
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</div>
|
|
||||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
|
||||||
<q-input
|
|
||||||
outlined
|
|
||||||
dense
|
|
||||||
v-model="formData.reason"
|
|
||||||
label="หลักการและเหตุผล"
|
|
||||||
rows="6"
|
|
||||||
hide-bottom-space
|
|
||||||
type="textarea"
|
|
||||||
:rules="[
|
|
||||||
(val:string) =>
|
|
||||||
!!val || `${'กรุณากรอกหลักการและเหตุผล'}`,
|
|
||||||
]"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
|
||||||
<q-input
|
|
||||||
outlined
|
|
||||||
dense
|
|
||||||
v-model="formData.objective"
|
|
||||||
label="วัตถุประสงค์"
|
|
||||||
rows="6"
|
|
||||||
hide-bottom-space
|
|
||||||
type="textarea"
|
|
||||||
:rules="[
|
|
||||||
(val:string) =>
|
|
||||||
!!val || `${'กรุณากรอกวัตถุประสงค์'}`,
|
|
||||||
]"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||||
|
<q-input
|
||||||
|
outlined
|
||||||
|
dense
|
||||||
|
v-model="store.formAddProject.reason"
|
||||||
|
label="หลักการและเหตุผล"
|
||||||
|
rows="6"
|
||||||
|
hide-bottom-space
|
||||||
|
type="textarea"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||||
|
<q-input
|
||||||
|
outlined
|
||||||
|
dense
|
||||||
|
v-model="store.formAddProject.objective"
|
||||||
|
label="วัตถุประสงค์"
|
||||||
|
rows="6"
|
||||||
|
hide-bottom-space
|
||||||
|
type="textarea"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- <q-separator />
|
<!-- <q-separator />
|
||||||
<div class="text-right q-pa-sm">
|
<div class="text-right q-pa-sm">
|
||||||
<q-btn
|
<q-btn
|
||||||
dense
|
dense
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from "vue";
|
import { ref, onMounted, onUnmounted } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import { useRouter, useRoute } from "vue-router";
|
import { useRouter, useRoute } from "vue-router";
|
||||||
|
import http from "@/plugins/http";
|
||||||
|
import config from "@/app.config";
|
||||||
|
|
||||||
import BasicInfo from "@/modules/15_development/components/BasicInfo.vue";
|
import BasicInfo from "@/modules/15_development/components/BasicInfo.vue";
|
||||||
import Target from "@/modules/15_development/components/Target.vue";
|
import Target from "@/modules/15_development/components/Target.vue";
|
||||||
|
|
@ -10,18 +12,115 @@ import FollowResult from "@/modules/15_development/components/FollowResult.vue";
|
||||||
import Other from "@/modules/15_development/components/Other.vue";
|
import Other from "@/modules/15_development/components/Other.vue";
|
||||||
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { showLoader, hideLoader, dialogConfirm } = useCounterMixin();
|
const store = useDevelopmentDataStore();
|
||||||
|
const {
|
||||||
|
success,
|
||||||
|
showLoader,
|
||||||
|
hideLoader,
|
||||||
|
messageError,
|
||||||
|
dialogConfirm,
|
||||||
|
dialogMessageNotify,
|
||||||
|
} = useCounterMixin();
|
||||||
|
|
||||||
const title = ref<string>(route.params.id ? "แก้ไข" : "เพิ่ม");
|
const title = ref<string>(route.params.id ? "แก้ไข" : "เพิ่ม");
|
||||||
|
const projectId = ref<string | null>(
|
||||||
|
route.params.id ? route.params.id.toLocaleString() : null
|
||||||
|
);
|
||||||
const tab = ref<string>("BasicInfo");
|
const tab = ref<string>("BasicInfo");
|
||||||
|
|
||||||
function onSubmit() {
|
function fetchDataProject(id: string) {
|
||||||
dialogConfirm($q, () => {});
|
showLoader();
|
||||||
|
http
|
||||||
|
.get(config.API.developmentMainById(id))
|
||||||
|
.then((res) => {
|
||||||
|
const data = res.data.result;
|
||||||
|
console.log(data);
|
||||||
|
/** ข้อมูลเบื้องต้น*/
|
||||||
|
store.formAddProject.year = data.year;
|
||||||
|
store.formAddProject.projectName = data.projectName;
|
||||||
|
store.formAddProject.reason = data.reason;
|
||||||
|
store.formAddProject.objective = data.objective;
|
||||||
|
|
||||||
|
/**เป้าหมาย*/
|
||||||
|
const plannedGoals = data.plannedGoals.map((e: any) => ({
|
||||||
|
groupTarget: e.groupTarget,
|
||||||
|
groupTargetSub: e.groupTargetSub,
|
||||||
|
position: e.position,
|
||||||
|
posTypePlannedId: e.posTypePlannedId,
|
||||||
|
posLevelPlannedId: e.posLevelPlannedId,
|
||||||
|
type: e.type,
|
||||||
|
amount: e.amount,
|
||||||
|
}));
|
||||||
|
const plannedPeoples = data.plannedPeoples.map((e: any) => ({
|
||||||
|
groupTarget: e.groupTarget,
|
||||||
|
amount: e.amount,
|
||||||
|
}));
|
||||||
|
store.formAddProject.plannedGoals = plannedGoals;
|
||||||
|
store.formAddProject.plannedPeoples = plannedPeoples;
|
||||||
|
|
||||||
|
const actualGoals = data.actualGoals.map((e: any) => ({
|
||||||
|
groupTarget: e.groupTarget,
|
||||||
|
groupTargetSub: e.groupTargetSub,
|
||||||
|
position: e.position,
|
||||||
|
posTypeActualId: e.posTypeActualId,
|
||||||
|
posLevelActualId: e.posLevelActualId,
|
||||||
|
type: e.type,
|
||||||
|
amount: e.amount,
|
||||||
|
}));
|
||||||
|
const actualPeoples = data.actualPeoples.map((e: any) => ({
|
||||||
|
groupTarget: e.groupTarget,
|
||||||
|
amount: e.amount,
|
||||||
|
}));
|
||||||
|
store.formAddProject.actualGoals = actualGoals;
|
||||||
|
store.formAddProject.actualPeoples = actualPeoples;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
hideLoader();
|
||||||
|
}, 1000);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onSubmit() {
|
||||||
|
if (store.formAddProject.projectName === "" && tab.value !== "BasicInfo") {
|
||||||
|
dialogMessageNotify($q, "ชื่อโครงการ/กิจกรรม/หลักสูตร");
|
||||||
|
tab.value = "BasicInfo";
|
||||||
|
} else {
|
||||||
|
dialogConfirm($q, async () => {
|
||||||
|
showLoader();
|
||||||
|
const url = projectId.value
|
||||||
|
? config.API.developmentMainById(projectId.value)
|
||||||
|
: config.API.developmentMain;
|
||||||
|
const method = projectId.value ? "put" : "post";
|
||||||
|
try {
|
||||||
|
const res = await http[method](url, store.formAddProject);
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
!projectId.value && router.push(`/development/${res.data.result}`);
|
||||||
|
projectId.value && fetchDataProject(projectId.value);
|
||||||
|
} catch (e) {
|
||||||
|
messageError($q, e);
|
||||||
|
} finally {
|
||||||
|
hideLoader();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
projectId.value && fetchDataProject(projectId.value);
|
||||||
|
});
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
store.clearFormAddProject();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
||||||
|
|
@ -33,7 +132,7 @@ function onSubmit() {
|
||||||
class="q-mr-sm"
|
class="q-mr-sm"
|
||||||
icon="mdi-arrow-left"
|
icon="mdi-arrow-left"
|
||||||
color="primary"
|
color="primary"
|
||||||
@click="router.go(-1)"
|
@click="router.push('/development')"
|
||||||
/>
|
/>
|
||||||
{{ `${title}รายการโครงการ/หลักสูตรการฝึกอบรม` }}
|
{{ `${title}รายการโครงการ/หลักสูตรการฝึกอบรม` }}
|
||||||
<q-space />
|
<q-space />
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,11 @@ import type {
|
||||||
|
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
|
|
||||||
|
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
const store = useDevelopmentDataStore();
|
||||||
const {
|
const {
|
||||||
showLoader,
|
showLoader,
|
||||||
hideLoader,
|
hideLoader,
|
||||||
|
|
@ -29,7 +31,7 @@ const {
|
||||||
messageError,
|
messageError,
|
||||||
} = useCounterMixin();
|
} = useCounterMixin();
|
||||||
|
|
||||||
const columnsGroup = ref<QTableProps["columns"]>([
|
const columnsPlannedGoals = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "groupTarget",
|
name: "groupTarget",
|
||||||
align: "left",
|
align: "left",
|
||||||
|
|
@ -38,15 +40,17 @@ const columnsGroup = ref<QTableProps["columns"]>([
|
||||||
field: "groupTarget",
|
field: "groupTarget",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
|
format: (val) => convertNameGoals(val),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "type",
|
name: "posTypePlannedId",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ประเภท",
|
label: "ประเภท",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "type",
|
field: "posTypePlannedId",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
|
format: (val) => convertTypeGoals(val),
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
@ -59,15 +63,50 @@ const columnsGroup = ref<QTableProps["columns"]>([
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
const columnsActualGoals = ref<QTableProps["columns"]>([
|
||||||
|
{
|
||||||
|
name: "groupTarget",
|
||||||
|
align: "left",
|
||||||
|
label: "กลุ่มเป้าหมาย ",
|
||||||
|
sortable: true,
|
||||||
|
field: "groupTarget",
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
format: (val) => convertNameGoals(val),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "posTypeActualId",
|
||||||
|
align: "left",
|
||||||
|
label: "ประเภท",
|
||||||
|
sortable: true,
|
||||||
|
field: "posTypeActualId",
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
format: (val) => convertTypeGoals(val),
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name: "amount",
|
||||||
|
align: "left",
|
||||||
|
label: "จำนวน(คน)",
|
||||||
|
sortable: true,
|
||||||
|
field: "amount",
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
const columnsRelated = ref<QTableProps["columns"]>([
|
const columnsRelated = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "related",
|
name: "groupTarget",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ผู้เกี่ยวข้อง ",
|
label: "ผู้เกี่ยวข้อง ",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "related",
|
field: "groupTarget",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
|
format: (val) => convertNamePeoples(val),
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
@ -81,40 +120,32 @@ const columnsRelated = ref<QTableProps["columns"]>([
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const rows1 = ref<any>([
|
const plannedGoals = ref<any>([]);
|
||||||
{
|
const plannedPeoples = ref<any>([]);
|
||||||
groupTarget: "ข้าราชการ",
|
const actualGoals = ref<any>([]);
|
||||||
type: "บริหาร",
|
const actualPeoples = ref<any>([]);
|
||||||
amount: 20,
|
|
||||||
},
|
const peoplesOp = ref<DataOption[]>([
|
||||||
]);
|
{ id: "OPERATOR", name: "เจ้าหน้าที่ดําเนินการ" },
|
||||||
const rows2 = ref<any>([{ related: "เจ้าหน้าที่", amount: 10 }]);
|
{ id: "LECTURER", name: "วิทยากร" },
|
||||||
const rows3 = ref<any>([
|
{ id: "OBSERVER", name: "ผู้สังเกตการณ์" },
|
||||||
{
|
|
||||||
groupTarget: "ข้าราชการ",
|
|
||||||
type: "บริหาร",
|
|
||||||
amount: 20,
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
const rows4 = ref<any>([{ related: "เจ้าหน้าที่", amount: 10 }]);
|
|
||||||
const options = ref<any>([
|
|
||||||
// "ข้าราชการกรุงเทพมหานคร",
|
|
||||||
// "ข้าราชการกรุงเทพมหานครสามัญ",
|
|
||||||
// "เจ้าหน้าที่ดำเนิดการ",
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const groupOp = ref<DataOption[]>([
|
const groupOp = ref<DataOption[]>([
|
||||||
{ id: "1", name: "ข้าราชการกรุงเทพมหานคร" },
|
{ id: "OFFICER", name: "ข้าราชการกรุงเทพมหานคร" },
|
||||||
{ id: "2", name: "บุคลากรกรุงเทพมหานคร" },
|
{ id: "PERSONNEL", name: "บุคลากรกรุงเทพมหานคร" },
|
||||||
{ id: "3", name: "บุคคลภายนอก" },
|
{ id: "OUTSIDERS", name: "บุคคลภายนอก" },
|
||||||
]);
|
]);
|
||||||
const groupSubOp = ref<DataOption[]>([
|
const groupSubOp = ref<DataOption[]>([
|
||||||
{ id: "1", name: "ข้าราชการกรุงเทพมหานครสามัญ" },
|
{ id: "OFFICER", name: "ข้าราชการกรุงเทพมหานครสามัญ" },
|
||||||
{ id: "2", name: "ข้าราชการครู" },
|
{ id: "TEACHER", name: "ข้าราชการครู" },
|
||||||
|
{ id: "EMPLOYEE", name: "กรุงเทพมหานคร(ลูกจ้างประจำ ลูกจ้างชั่วคราว)" },
|
||||||
|
{ id: "EDUCATIONAL", name: "บุคลากรทางการศึกษากรุงเทพมหานคร" },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const modalGroupTarget = ref<boolean>(false);
|
const modalGroupTarget = ref<boolean>(false);
|
||||||
const modalRelate = ref<boolean>(false);
|
const modalRelate = ref<boolean>(false);
|
||||||
|
const isTarget = ref<string>("");
|
||||||
|
|
||||||
const formGroupTarget = reactive<FormGroupTarget>({
|
const formGroupTarget = reactive<FormGroupTarget>({
|
||||||
groupTarget: "",
|
groupTarget: "",
|
||||||
|
|
@ -154,10 +185,10 @@ function fetchType() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onClickOpenDialog(type: string) {
|
function onClickOpenDialog(type: string, target: string) {
|
||||||
|
isTarget.value = target;
|
||||||
if (type === "group") {
|
if (type === "group") {
|
||||||
modalGroupTarget.value = true;
|
modalGroupTarget.value = true;
|
||||||
fetchType();
|
|
||||||
} else {
|
} else {
|
||||||
modalRelate.value = true;
|
modalRelate.value = true;
|
||||||
}
|
}
|
||||||
|
|
@ -165,20 +196,88 @@ function onClickOpenDialog(type: string) {
|
||||||
|
|
||||||
function onSubmitGroup() {
|
function onSubmitGroup() {
|
||||||
dialogConfirm($q, () => {
|
dialogConfirm($q, () => {
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
if (isTarget.value === "planned") {
|
||||||
onClickCloseDialog();
|
const data = [];
|
||||||
|
data.push(formGroupTarget);
|
||||||
|
const list = data.map((e) => ({
|
||||||
|
groupTarget: e.groupTarget,
|
||||||
|
groupTargetSub: e.groupTargetSub,
|
||||||
|
position: e.position,
|
||||||
|
posTypePlannedId: e.posType,
|
||||||
|
posLevelPlannedId: e.level,
|
||||||
|
type: e.type,
|
||||||
|
amount: Number(e.amount),
|
||||||
|
}));
|
||||||
|
plannedGoals.value.push(...list);
|
||||||
|
store.formAddProject.plannedGoals = plannedGoals.value;
|
||||||
|
} else {
|
||||||
|
const data = [];
|
||||||
|
data.push(formGroupTarget);
|
||||||
|
const list = data.map((e) => ({
|
||||||
|
groupTarget: e.groupTarget,
|
||||||
|
groupTargetSub: e.groupTargetSub,
|
||||||
|
position: e.position,
|
||||||
|
posTypeActualId: e.posType,
|
||||||
|
posLevelActualId: e.level,
|
||||||
|
type: e.type,
|
||||||
|
amount: Number(e.amount),
|
||||||
|
}));
|
||||||
|
actualGoals.value.push(...list);
|
||||||
|
store.formAddProject.actualGoals = actualGoals.value;
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
onClickCloseDialog();
|
||||||
|
}, 500);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSubmitRelate() {
|
function onSubmitRelate() {
|
||||||
dialogConfirm($q, () => {
|
dialogConfirm($q, () => {
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
if (isTarget.value === "planned") {
|
||||||
|
const data = [];
|
||||||
|
data.push(formGroupRelate);
|
||||||
|
const list = data.map((e) => ({
|
||||||
|
groupTarget: e.relate,
|
||||||
|
amount: Number(e.amount),
|
||||||
|
}));
|
||||||
|
plannedPeoples.value.push(...list);
|
||||||
|
store.formAddProject.plannedPeoples = plannedPeoples.value;
|
||||||
|
} else {
|
||||||
|
const data = [];
|
||||||
|
data.push(formGroupRelate);
|
||||||
|
const list = data.map((e) => ({
|
||||||
|
groupTarget: e.relate,
|
||||||
|
amount: Number(e.amount),
|
||||||
|
}));
|
||||||
|
actualPeoples.value.push(...list);
|
||||||
|
store.formAddProject.actualPeoples = actualPeoples.value;
|
||||||
|
}
|
||||||
onClickCloseDialog();
|
onClickCloseDialog();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function onclickDelete() {
|
function onclickDelete(index: number, type: string) {
|
||||||
dialogRemove($q, () => {
|
dialogRemove($q, () => {
|
||||||
|
switch (type) {
|
||||||
|
case "plannedGoals":
|
||||||
|
plannedGoals.value.splice(index, 1);
|
||||||
|
break;
|
||||||
|
case "plannedPeoples":
|
||||||
|
plannedPeoples.value.splice(index, 1);
|
||||||
|
break;
|
||||||
|
case "actualGoals":
|
||||||
|
actualGoals.value.splice(index, 1);
|
||||||
|
break;
|
||||||
|
case "actualPeoples":
|
||||||
|
actualPeoples.value.splice(index, 1);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
success($q, "ลบข้อมูลสำเร็จ");
|
success($q, "ลบข้อมูลสำเร็จ");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -211,8 +310,47 @@ function updatePosTypeName(id: string) {
|
||||||
formGroupTarget.level = "";
|
formGroupTarget.level = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateGroupTarget(val: string) {
|
||||||
|
if (val === "OUTSIDERS") {
|
||||||
|
formGroupTarget.groupTargetSub = "NONE";
|
||||||
|
formGroupTarget.position = "";
|
||||||
|
formGroupTarget.posType = null;
|
||||||
|
formGroupTarget.level = null;
|
||||||
|
} else formGroupTarget.groupTargetSub = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
function convertNameGoals(id: string) {
|
||||||
|
const data = groupOp.value.find((e: DataOption) => e.id === id);
|
||||||
|
return data && data?.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
function convertNamePeoples(id: string) {
|
||||||
|
const data = peoplesOp.value.find((e: DataOption) => e.id === id);
|
||||||
|
return data && data?.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
function convertTypeGoals(id: string) {
|
||||||
|
const data = posTypeMain.value.find((e: ResGroup) => e.id === id);
|
||||||
|
return data && data?.posTypeName;
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
console.log("เป้าหมาย");
|
fetchType();
|
||||||
|
plannedGoals.value = store.formAddProject.plannedGoals
|
||||||
|
? store.formAddProject.plannedGoals
|
||||||
|
: [];
|
||||||
|
|
||||||
|
plannedPeoples.value = store.formAddProject.plannedPeoples
|
||||||
|
? store.formAddProject.plannedPeoples
|
||||||
|
: [];
|
||||||
|
|
||||||
|
actualGoals.value = store.formAddProject.actualGoals
|
||||||
|
? store.formAddProject.actualGoals
|
||||||
|
: [];
|
||||||
|
|
||||||
|
actualPeoples.value = store.formAddProject.actualPeoples
|
||||||
|
? store.formAddProject.actualPeoples
|
||||||
|
: [];
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -223,13 +361,17 @@ onMounted(() => {
|
||||||
<q-btn flat round dense icon="add" color="primary">
|
<q-btn flat round dense icon="add" color="primary">
|
||||||
<q-menu>
|
<q-menu>
|
||||||
<q-list style="min-width: 100px">
|
<q-list style="min-width: 100px">
|
||||||
<q-item clickable v-close-popup @click="onClickOpenDialog('group')">
|
<q-item
|
||||||
|
clickable
|
||||||
|
v-close-popup
|
||||||
|
@click="onClickOpenDialog('group', 'planned')"
|
||||||
|
>
|
||||||
<q-item-section>กลุ่มเป้าหมาย</q-item-section>
|
<q-item-section>กลุ่มเป้าหมาย</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
<q-item
|
<q-item
|
||||||
clickable
|
clickable
|
||||||
v-close-popup
|
v-close-popup
|
||||||
@click="onClickOpenDialog('relate')"
|
@click="onClickOpenDialog('relate', 'planned')"
|
||||||
>
|
>
|
||||||
<q-item-section>ผู้เกี่ยวข้อง</q-item-section>
|
<q-item-section>ผู้เกี่ยวข้อง</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
|
|
@ -245,8 +387,8 @@ onMounted(() => {
|
||||||
<d-table
|
<d-table
|
||||||
for="table"
|
for="table"
|
||||||
ref="table"
|
ref="table"
|
||||||
:columns="columnsGroup"
|
:columns="columnsPlannedGoals"
|
||||||
:rows="rows1"
|
:rows="plannedGoals"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
flat
|
flat
|
||||||
bordered
|
bordered
|
||||||
|
|
@ -276,7 +418,7 @@ onMounted(() => {
|
||||||
dense
|
dense
|
||||||
icon="delete"
|
icon="delete"
|
||||||
color="red"
|
color="red"
|
||||||
@click="onclickDelete"
|
@click="onclickDelete(props.rowIndex, 'plannedGoals')"
|
||||||
>
|
>
|
||||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
@ -291,7 +433,7 @@ onMounted(() => {
|
||||||
for="table"
|
for="table"
|
||||||
ref="table"
|
ref="table"
|
||||||
:columns="columnsRelated"
|
:columns="columnsRelated"
|
||||||
:rows="rows2"
|
:rows="plannedPeoples"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
flat
|
flat
|
||||||
bordered
|
bordered
|
||||||
|
|
@ -321,7 +463,7 @@ onMounted(() => {
|
||||||
dense
|
dense
|
||||||
icon="delete"
|
icon="delete"
|
||||||
color="red"
|
color="red"
|
||||||
@click="onclickDelete"
|
@click="onclickDelete(props.rowIndex, 'plannedPeoples')"
|
||||||
>
|
>
|
||||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
@ -340,13 +482,17 @@ onMounted(() => {
|
||||||
<q-btn flat round dense icon="add" color="primary">
|
<q-btn flat round dense icon="add" color="primary">
|
||||||
<q-menu>
|
<q-menu>
|
||||||
<q-list style="min-width: 100px">
|
<q-list style="min-width: 100px">
|
||||||
<q-item clickable v-close-popup @click="onClickOpenDialog('group')">
|
<q-item
|
||||||
|
clickable
|
||||||
|
v-close-popup
|
||||||
|
@click="onClickOpenDialog('group', 'actual')"
|
||||||
|
>
|
||||||
<q-item-section>กลุ่มเป้าหมาย</q-item-section>
|
<q-item-section>กลุ่มเป้าหมาย</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
<q-item
|
<q-item
|
||||||
clickable
|
clickable
|
||||||
v-close-popup
|
v-close-popup
|
||||||
@click="onClickOpenDialog('relate')"
|
@click="onClickOpenDialog('relate', 'actual')"
|
||||||
>
|
>
|
||||||
<q-item-section>ผู้เกี่ยวข้อง</q-item-section>
|
<q-item-section>ผู้เกี่ยวข้อง</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
|
|
@ -362,8 +508,8 @@ onMounted(() => {
|
||||||
<d-table
|
<d-table
|
||||||
for="table"
|
for="table"
|
||||||
ref="table"
|
ref="table"
|
||||||
:columns="columnsGroup"
|
:columns="columnsActualGoals"
|
||||||
:rows="rows3"
|
:rows="actualGoals"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
flat
|
flat
|
||||||
bordered
|
bordered
|
||||||
|
|
@ -393,7 +539,7 @@ onMounted(() => {
|
||||||
dense
|
dense
|
||||||
icon="delete"
|
icon="delete"
|
||||||
color="red"
|
color="red"
|
||||||
@click="onclickDelete"
|
@click="onclickDelete(props.rowIndex, 'actualGoals')"
|
||||||
>
|
>
|
||||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
@ -408,7 +554,7 @@ onMounted(() => {
|
||||||
for="table"
|
for="table"
|
||||||
ref="table"
|
ref="table"
|
||||||
:columns="columnsRelated"
|
:columns="columnsRelated"
|
||||||
:rows="rows4"
|
:rows="actualPeoples"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
flat
|
flat
|
||||||
bordered
|
bordered
|
||||||
|
|
@ -438,7 +584,7 @@ onMounted(() => {
|
||||||
dense
|
dense
|
||||||
icon="delete"
|
icon="delete"
|
||||||
color="red"
|
color="red"
|
||||||
@click="onclickDelete"
|
@click="onclickDelete(props.rowIndex, 'actualPeoples')"
|
||||||
>
|
>
|
||||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
@ -470,18 +616,26 @@ onMounted(() => {
|
||||||
map-options
|
map-options
|
||||||
emit-value
|
emit-value
|
||||||
lazy-rules
|
lazy-rules
|
||||||
|
@update:model-value="updateGroupTarget"
|
||||||
:rules="[
|
:rules="[
|
||||||
(val:string) =>
|
(val:string) =>
|
||||||
!!val || `${'กรุณาเลือกกลุ่มเป้าหมาย'}`,
|
!!val || `${'กรุณาเลือกกลุ่มเป้าหมาย'}`,
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
<div
|
||||||
|
class="col-xs-6 col-sm-6 col-md-6"
|
||||||
|
v-if="formGroupTarget.groupTarget !== 'OUTSIDERS'"
|
||||||
|
>
|
||||||
<q-select
|
<q-select
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
v-model="formGroupTarget.groupTargetSub"
|
v-model="formGroupTarget.groupTargetSub"
|
||||||
:options="groupSubOp"
|
:options="
|
||||||
|
formGroupTarget.groupTarget === 'OFFICER'
|
||||||
|
? groupSubOp.slice(0, 2)
|
||||||
|
: groupSubOp.slice(2, 4)
|
||||||
|
"
|
||||||
label="กลุ่มเป้าหมายย่อย"
|
label="กลุ่มเป้าหมายย่อย"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
lazy-rules
|
lazy-rules
|
||||||
|
|
@ -495,7 +649,11 @@ onMounted(() => {
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-6 col-sm-4 col-md-4">
|
|
||||||
|
<div
|
||||||
|
class="col-xs-6 col-sm-4 col-md-4"
|
||||||
|
v-if="formGroupTarget.groupTarget !== 'OUTSIDERS'"
|
||||||
|
>
|
||||||
<q-input
|
<q-input
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
|
|
@ -508,7 +666,10 @@ onMounted(() => {
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-6 col-sm-4 col-md-4">
|
<div
|
||||||
|
class="col-xs-6 col-sm-4 col-md-4"
|
||||||
|
v-if="formGroupTarget.groupTarget !== 'OUTSIDERS'"
|
||||||
|
>
|
||||||
<q-select
|
<q-select
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
|
|
@ -529,7 +690,10 @@ onMounted(() => {
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-6 col-sm-4 col-md-4">
|
<div
|
||||||
|
class="col-xs-6 col-sm-4 col-md-4"
|
||||||
|
v-if="formGroupTarget.groupTarget !== 'OUTSIDERS'"
|
||||||
|
>
|
||||||
<q-select
|
<q-select
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
|
|
@ -549,7 +713,10 @@ onMounted(() => {
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-6 col-sm-6 col-md-8">
|
<div
|
||||||
|
class="col-xs-6 col-sm-6 col-md-8"
|
||||||
|
v-if="formGroupTarget.groupTarget === 'OUTSIDERS'"
|
||||||
|
>
|
||||||
<q-input
|
<q-input
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
|
|
@ -609,10 +776,14 @@ onMounted(() => {
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
v-model="formGroupRelate.relate"
|
v-model="formGroupRelate.relate"
|
||||||
:options="options"
|
:options="peoplesOp"
|
||||||
label="ผู้เกี่ยวข้อง"
|
label="ผู้เกี่ยวข้อง"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
lazy-rules
|
lazy-rules
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
map-options
|
||||||
|
emit-value
|
||||||
:rules="[
|
:rules="[
|
||||||
(val:string) =>
|
(val:string) =>
|
||||||
!!val || `${'กรุณาเลือกผู้เกี่ยวข้อง'}`,
|
!!val || `${'กรุณาเลือกผู้เกี่ยวข้อง'}`,
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,8 @@ interface FormGroupTarget {
|
||||||
groupTarget: string;
|
groupTarget: string;
|
||||||
groupTargetSub: string;
|
groupTargetSub: string;
|
||||||
position: string;
|
position: string;
|
||||||
posType: string;
|
posType: string | null;
|
||||||
level: string;
|
level: string | null;
|
||||||
type: string;
|
type: string;
|
||||||
amount: number | null;
|
amount: number | null;
|
||||||
}
|
}
|
||||||
|
|
@ -95,8 +95,79 @@ interface FormAddHistoryProject {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** form เพิ่มรายการโครงการ/หลักสูตรการฝึกอบรม*/
|
||||||
|
interface FormAddProject {
|
||||||
|
year: number;
|
||||||
|
projectName: string;
|
||||||
|
reason: string;
|
||||||
|
objective: string;
|
||||||
|
metricType: string;
|
||||||
|
indicators: string;
|
||||||
|
target: string;
|
||||||
|
calculation: string;
|
||||||
|
measuRement: string;
|
||||||
|
results: string;
|
||||||
|
obstacles: string;
|
||||||
|
suggestions: string;
|
||||||
|
project: string;
|
||||||
|
isPassAllocate: boolean;
|
||||||
|
isPassNoAllocate: boolean;
|
||||||
|
isNoPass: boolean;
|
||||||
|
isBudget: boolean;
|
||||||
|
isOutBudget: boolean;
|
||||||
|
dateStart: Date | null;
|
||||||
|
dateEnd: Date | null;
|
||||||
|
totalDate: number | null;
|
||||||
|
address: string;
|
||||||
|
provinceId: string | null;
|
||||||
|
budget: string;
|
||||||
|
accept: number | null;
|
||||||
|
receive: number | null;
|
||||||
|
approved: number | null;
|
||||||
|
budgetPay: number | null;
|
||||||
|
issues: string;
|
||||||
|
chance: string;
|
||||||
|
effects: string;
|
||||||
|
riskLevel: string;
|
||||||
|
riskManagement: string;
|
||||||
|
expect: string;
|
||||||
|
topicAcademic: string;
|
||||||
|
addressAcademic: string;
|
||||||
|
provinceActualId: string | null;
|
||||||
|
actualPeoples: People[];
|
||||||
|
plannedPeoples: People[];
|
||||||
|
actualGoals: actualGoals[];
|
||||||
|
plannedGoals: PlannedGoals[];
|
||||||
|
}
|
||||||
|
|
||||||
|
interface People {
|
||||||
|
groupTarget: string;
|
||||||
|
amount: number | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface actualGoals {
|
||||||
|
groupTarget: string;
|
||||||
|
groupTargetSub: string;
|
||||||
|
position: string;
|
||||||
|
posTypeActualId: string | null;
|
||||||
|
posLevelActualId: string | null;
|
||||||
|
type: string;
|
||||||
|
amount: number | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface PlannedGoals {
|
||||||
|
groupTarget: string;
|
||||||
|
groupTargetSub: string;
|
||||||
|
position: string;
|
||||||
|
posTypePlannedId: string | null;
|
||||||
|
posLevelPlannedId: string | null;
|
||||||
|
type: string;
|
||||||
|
amount: number | null;
|
||||||
|
}
|
||||||
|
|
||||||
export type {
|
export type {
|
||||||
FormQueryListProject,
|
FormQueryListProject,
|
||||||
|
FormAddProject,
|
||||||
FormBasicinfo,
|
FormBasicinfo,
|
||||||
FormGroupTarget,
|
FormGroupTarget,
|
||||||
FormGroupRelate,
|
FormGroupRelate,
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,107 @@
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { ref } from "vue";
|
import { reactive, ref } from "vue";
|
||||||
|
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
|
import type { FormAddProject } from "@/modules/15_development/interface/request/Main";
|
||||||
|
|
||||||
// store
|
// store
|
||||||
export const useDevelopmentDataStore = defineStore(
|
export const useDevelopmentDataStore = defineStore(
|
||||||
"developmentDataStore",
|
"developmentDataStore",
|
||||||
() => {
|
() => {
|
||||||
|
const formAddProject = reactive<FormAddProject>({
|
||||||
|
year: new Date().getFullYear(), //ปีงบประมาณ*
|
||||||
|
projectName: "", //ชื่อโครงการ/กิจกรรม/หลักสูตร*
|
||||||
|
reason: "", //หลักการและเหตุผล
|
||||||
|
objective: "", //วัตถุประสงค์
|
||||||
|
metricType: "", //ประเภทตัวชี้วัด
|
||||||
|
indicators: "", //ตัวชี้วัด
|
||||||
|
target: "", //เป้าหมาย
|
||||||
|
calculation: "", //วิธีการคำนวณ/เครื่องมือ
|
||||||
|
measuRement: "", //ระยะเวลาวัดผล
|
||||||
|
results: "", //ผลการดำเนิน
|
||||||
|
obstacles: "", //ปัญหาอุปสรรค
|
||||||
|
suggestions: "", //ข้อเสนอเเนะfalse
|
||||||
|
project: "", //ประเภทโครงการ(โครงการที่เสนอขอ TN->OFFER ,โครงการที่ไม่เสนอขอ TN->NOOFFER)
|
||||||
|
isPassAllocate: false, //ผ่านการพิจาณา ได้รับการจัดสรรงบประมาณตามข้อบัญญัติ
|
||||||
|
isPassNoAllocate: false, //ผ่านการพิจารณา ไม่ได้รับการจัดสรรงบประมาณตามข้อบัญญัติ แต่ได้รับการจัดสรรเงินนอกงบประมาณ
|
||||||
|
isNoPass: false, //ไม่ผ่านการพิจารณา แต่ได้รับการจัดสรรเงินนอกงบประมาณ
|
||||||
|
isBudget: false, //แต่ได้รับการจัดสรรงบประมาณตามข้อบัญญัติ
|
||||||
|
isOutBudget: false, //แต่ได้รับการจัดสรรเงินนอกงบประมาณ
|
||||||
|
dateStart: null, //วันที่เริ่มต้น
|
||||||
|
dateEnd: null, //วันที่สิ้นสุด
|
||||||
|
totalDate: null, //รวมระยะเวลา (วัน)
|
||||||
|
address: "", //ที่อยู่
|
||||||
|
provinceId: null, //จังหวัด
|
||||||
|
budget: "", //ประเภทงบประมาณ(งบตามข้อบัญญัติ->REGULATIONBUDGET, งบประมาณกรุงเทพมหานคร->BANGKOKBUDGET, เงินนอกงบประมาณ->OUTSIDEBUDGET)
|
||||||
|
accept: null, //จํานวนงบประมาณที่ขอรับการจัดสรรฯ
|
||||||
|
receive: null, //จํานวนงบประมาณที่ได้รับการจัดสรรฯ
|
||||||
|
approved: null, //จํานวนงบประมาณที่ได้รับอนุมัติ
|
||||||
|
budgetPay: null, //จํานวนงบประมาณที่จ่ายจริง
|
||||||
|
issues: "", //ประเด็นความเสี่ยง
|
||||||
|
chance: "", //โอกาสที่จะเกิด
|
||||||
|
effects: "", //ผลกระทบจากการเกิด
|
||||||
|
riskLevel: "", //ระดับความเสี่ยง
|
||||||
|
riskManagement: "", //เเนวทางการบริหารความเสี่ยง
|
||||||
|
expect: "", //ประโยชน์ที่คาดว่าจะได้รับ
|
||||||
|
topicAcademic: "", //หัวข้อ/ประเด็นการฝึกอบรม ศึกษาดูงาน
|
||||||
|
addressAcademic: "", //สถานที่ฝึกอบรม ศึกษาดูงาน
|
||||||
|
provinceActualId: null, //จังหวัด(ข้อมูลวิชาการ)
|
||||||
|
actualPeoples: [
|
||||||
|
// {
|
||||||
|
// groupTarget: "", //ผู้เกี่ยวข้อง(เจ้าหน้าที่ดําเนินการ->OPERATOR, วิทยากร->LECTURER, ผู้สังเกตการณ์->OBSERVER)
|
||||||
|
// amount: null, //จำนวน(คน)
|
||||||
|
// },
|
||||||
|
], //เป้าหมายตามจริง ผู้เกี่ยวข้อง
|
||||||
|
plannedPeoples: [
|
||||||
|
// {
|
||||||
|
// groupTarget: "", //ผู้เกี่ยวข้อง(เจ้าหน้าที่ดําเนินการ->OPERATOR, วิทยากร->LECTURER, ผู้สังเกตการณ์->OBSERVER)
|
||||||
|
// amount: null, //จำนวน(คน)
|
||||||
|
// },
|
||||||
|
], //เป้าหมายตามแผน ผู้เกี่ยวข้อง
|
||||||
|
actualGoals: [
|
||||||
|
// {
|
||||||
|
// groupTarget: "", //กลุ่มเป้าหมาย(ข้าราชการกรุงเทพมหานคร->OFFICER, บุคลากรกรุงเทพมหานคร->PERSONNEL, บุคคลภายนอก->OUTSIDERS)
|
||||||
|
// groupTargetSub: "", //กลุ่มเป้าหมายย่อย(ข้าราชการกรุงเทพมหานครสามัญ->OFFICER, ข้าราชการครู->TEACHER, กรุงเทพมหานคร(ลูกจ้างประจํา,ลูกจ้างชวคราว)->EMPLOYEE, บุคลากรทางการศึกษากรุงเทพมหานคร->EDUCATIONAL, ไม่มีกลุ่มเป้าหมายย่อย->NONE)
|
||||||
|
// position: "", //ตำแหน่ง
|
||||||
|
// posTypeActualId: null, //ประเภทตำแหน่ง
|
||||||
|
// posLevelActualId: null, //ระดับ
|
||||||
|
// type: "", //ประเภท(กลุ่มอาชีพ คุณสมบัติ)
|
||||||
|
// amount: null, //จำนวน(คน)
|
||||||
|
// },
|
||||||
|
], //เป้าหมายตามจริง กลุ่มเป้าหมาย
|
||||||
|
plannedGoals: [
|
||||||
|
// {
|
||||||
|
// groupTarget: "", //กลุ่มเป้าหมาย(ข้าราชการกรุงเทพมหานคร->OFFICER, บุคลากรกรุงเทพมหานคร->PERSONNEL, บุคคลภายนอก->OUTSIDERS)
|
||||||
|
// groupTargetSub: "", //กลุ่มเป้าหมายย่อย(ข้าราชการกรุงเทพมหานครสามัญ->OFFICER, ข้าราชการครู->TEACHER, กรุงเทพมหานคร(ลูกจ้างประจํา,ลูกจ้างชวคราว)->EMPLOYEE, บุคลากรทางการศึกษากรุงเทพมหานคร->EDUCATIONAL, ไม่มีกลุ่มเป้าหมายย่อย->NONE)
|
||||||
|
// position: "", //ตำแหน่ง
|
||||||
|
// posTypePlannedId: null, //ประเภทตำแหน่ง
|
||||||
|
// posLevelPlannedId: null, //ระดับ
|
||||||
|
// type: "", //ประเภท(กลุ่มอาชีพ คุณสมบัติ)
|
||||||
|
// amount: null, //จำนวน(คน)
|
||||||
|
// },
|
||||||
|
], //เป้าหมายตามแผน กลุ่มเป้าหมาย
|
||||||
|
});
|
||||||
|
|
||||||
|
function clearFormAddProject() {
|
||||||
|
/** ข้อมูลเบื้องต้น*/
|
||||||
|
formAddProject.year = new Date().getFullYear();
|
||||||
|
formAddProject.projectName = "";
|
||||||
|
formAddProject.reason = " ";
|
||||||
|
formAddProject.objective = "";
|
||||||
|
|
||||||
|
/**เป้าหมาย*/
|
||||||
|
formAddProject.plannedGoals = [];
|
||||||
|
formAddProject.plannedPeoples = [];
|
||||||
|
formAddProject.actualGoals = [];
|
||||||
|
formAddProject.actualPeoples = [];
|
||||||
|
}
|
||||||
|
|
||||||
const visibleColumns = ref<string[]>([]);
|
const visibleColumns = ref<string[]>([]);
|
||||||
const columns = ref<QTableProps["columns"]>([]);
|
const columns = ref<QTableProps["columns"]>([]);
|
||||||
const rows = ref<any[]>([]);
|
const rows = ref<any[]>([]);
|
||||||
return {
|
return {
|
||||||
|
formAddProject,
|
||||||
|
clearFormAddProject,
|
||||||
visibleColumns,
|
visibleColumns,
|
||||||
columns,
|
columns,
|
||||||
rows,
|
rows,
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "year",
|
field: "year",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px ;width: 10%",
|
style: "font-size: 14px ; width:10%",
|
||||||
format: (val) => val + 543,
|
format: (val) => val + 543,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -40,7 +40,7 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "projectName",
|
field: "projectName",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px;width: 45%",
|
style: "font-size: 14px;width:45% ",
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
@ -50,7 +50,7 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "org",
|
field: "org",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px ;width: 45%",
|
style: "font-size: 14px ; width:45% ",
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
const visibleColumns = ref<string[]>(["year", "projectName", "org"]);
|
const visibleColumns = ref<string[]>(["year", "projectName", "org"]);
|
||||||
|
|
@ -114,7 +114,7 @@ function fetchListProject() {
|
||||||
* @param id รายการโครงการ
|
* @param id รายการโครงการ
|
||||||
*/
|
*/
|
||||||
function onClickAddOrView(status: boolean = false, id: string = "") {
|
function onClickAddOrView(status: boolean = false, id: string = "") {
|
||||||
status ? router.push(`development/${id}`) : router.push("development/add");
|
status ? router.push(`/development/${id}`) : router.push("/development/add");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,9 @@ import { useQuasar, type QTableProps } from "quasar";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
|
|
||||||
/** importStore*/
|
/** importStore*/
|
||||||
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
/** use*/
|
/** use*/
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { showLoader, hideLoader } = useCounterMixin();
|
const { showLoader, hideLoader } = useCounterMixin();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue