2024-03-25 18:01:33 +07:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { onMounted, ref, reactive } from "vue";
|
|
|
|
|
import { useQuasar } from "quasar";
|
2024-04-02 16:57:48 +07:00
|
|
|
import http from "@/plugins/http";
|
|
|
|
|
import config from "@/app.config";
|
2024-03-25 18:01:33 +07:00
|
|
|
|
|
|
|
|
import type { QTableProps } from "quasar";
|
2024-04-02 16:57:48 +07:00
|
|
|
import type { DataOption } from "@/modules/15_development/interface/index/Main";
|
2024-03-26 09:56:49 +07:00
|
|
|
import type {
|
|
|
|
|
FormGroupTarget,
|
|
|
|
|
FormGroupRelate,
|
|
|
|
|
} from "@/modules/15_development/interface/request/Main";
|
2024-04-02 16:57:48 +07:00
|
|
|
import type {
|
|
|
|
|
ResGroup,
|
|
|
|
|
ResLevel,
|
|
|
|
|
} from "@/modules/15_development/interface/response/Main";
|
2024-03-25 18:01:33 +07:00
|
|
|
|
|
|
|
|
import DialogHeader from "@/components/DialogHeader.vue";
|
|
|
|
|
|
2024-04-03 17:51:00 +07:00
|
|
|
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
|
2024-03-25 18:01:33 +07:00
|
|
|
import { useCounterMixin } from "@/stores/mixin";
|
|
|
|
|
|
|
|
|
|
const $q = useQuasar();
|
2024-04-03 17:51:00 +07:00
|
|
|
const store = useDevelopmentDataStore();
|
2024-04-02 16:57:48 +07:00
|
|
|
const {
|
|
|
|
|
showLoader,
|
|
|
|
|
hideLoader,
|
|
|
|
|
dialogConfirm,
|
|
|
|
|
dialogRemove,
|
|
|
|
|
success,
|
|
|
|
|
messageError,
|
|
|
|
|
} = useCounterMixin();
|
2024-03-25 18:01:33 +07:00
|
|
|
|
2024-04-03 17:51:00 +07:00
|
|
|
const columnsPlannedGoals = ref<QTableProps["columns"]>([
|
2024-03-25 18:01:33 +07:00
|
|
|
{
|
|
|
|
|
name: "groupTarget",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "กลุ่มเป้าหมาย ",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "groupTarget",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
2024-04-03 17:51:00 +07:00
|
|
|
format: (val) => convertNameGoals(val),
|
2024-03-25 18:01:33 +07:00
|
|
|
},
|
|
|
|
|
{
|
2024-04-03 17:51:00 +07:00
|
|
|
name: "posTypePlannedId",
|
2024-03-25 18:01:33 +07:00
|
|
|
align: "left",
|
|
|
|
|
label: "ประเภท",
|
|
|
|
|
sortable: true,
|
2024-04-03 17:51:00 +07:00
|
|
|
field: "posTypePlannedId",
|
2024-03-25 18:01:33 +07:00
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
2024-04-03 17:51:00 +07:00
|
|
|
format: (val) => convertTypeGoals(val),
|
2024-03-25 18:01:33 +07:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
name: "amount",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "จำนวน(คน)",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "amount",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
]);
|
2024-04-03 17:51:00 +07:00
|
|
|
|
|
|
|
|
const columnsActualGoals = ref<QTableProps["columns"]>([
|
2024-03-25 18:01:33 +07:00
|
|
|
{
|
2024-04-03 17:51:00 +07:00
|
|
|
name: "groupTarget",
|
2024-03-25 18:01:33 +07:00
|
|
|
align: "left",
|
2024-04-03 17:51:00 +07:00
|
|
|
label: "กลุ่มเป้าหมาย ",
|
2024-03-25 18:01:33 +07:00
|
|
|
sortable: true,
|
2024-04-03 17:51:00 +07:00
|
|
|
field: "groupTarget",
|
2024-03-25 18:01:33 +07:00
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
2024-04-03 17:51:00 +07:00
|
|
|
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),
|
2024-03-25 18:01:33 +07:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
name: "amount",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "จำนวน(คน)",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "amount",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
]);
|
|
|
|
|
|
2024-04-03 17:51:00 +07:00
|
|
|
const columnsRelated = ref<QTableProps["columns"]>([
|
2024-03-25 18:01:33 +07:00
|
|
|
{
|
2024-04-03 17:51:00 +07:00
|
|
|
name: "groupTarget",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ผู้เกี่ยวข้อง ",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "groupTarget",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
format: (val) => convertNamePeoples(val),
|
2024-03-25 18:01:33 +07:00
|
|
|
},
|
2024-04-03 17:51:00 +07:00
|
|
|
|
2024-03-25 18:01:33 +07:00
|
|
|
{
|
2024-04-03 17:51:00 +07:00
|
|
|
name: "amount",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "จำนวน(คน)",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "amount",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
2024-03-25 18:01:33 +07:00
|
|
|
},
|
|
|
|
|
]);
|
2024-04-03 17:51:00 +07:00
|
|
|
|
|
|
|
|
const plannedGoals = ref<any>([]);
|
|
|
|
|
const plannedPeoples = ref<any>([]);
|
|
|
|
|
const actualGoals = ref<any>([]);
|
|
|
|
|
const actualPeoples = ref<any>([]);
|
|
|
|
|
|
|
|
|
|
const peoplesOp = ref<DataOption[]>([
|
|
|
|
|
{ id: "OPERATOR", name: "เจ้าหน้าที่ดําเนินการ" },
|
|
|
|
|
{ id: "LECTURER", name: "วิทยากร" },
|
|
|
|
|
{ id: "OBSERVER", name: "ผู้สังเกตการณ์" },
|
2024-04-02 16:57:48 +07:00
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
const groupOp = ref<DataOption[]>([
|
2024-04-03 17:51:00 +07:00
|
|
|
{ id: "OFFICER", name: "ข้าราชการกรุงเทพมหานคร" },
|
|
|
|
|
{ id: "PERSONNEL", name: "บุคลากรกรุงเทพมหานคร" },
|
|
|
|
|
{ id: "OUTSIDERS", name: "บุคคลภายนอก" },
|
2024-04-02 16:57:48 +07:00
|
|
|
]);
|
|
|
|
|
const groupSubOp = ref<DataOption[]>([
|
2024-04-03 17:51:00 +07:00
|
|
|
{ id: "OFFICER", name: "ข้าราชการกรุงเทพมหานครสามัญ" },
|
|
|
|
|
{ id: "TEACHER", name: "ข้าราชการครู" },
|
|
|
|
|
{ id: "EMPLOYEE", name: "กรุงเทพมหานคร(ลูกจ้างประจำ ลูกจ้างชั่วคราว)" },
|
|
|
|
|
{ id: "EDUCATIONAL", name: "บุคลากรทางการศึกษากรุงเทพมหานคร" },
|
2024-03-26 09:56:49 +07:00
|
|
|
]);
|
2024-03-25 18:01:33 +07:00
|
|
|
|
|
|
|
|
const modalGroupTarget = ref<boolean>(false);
|
|
|
|
|
const modalRelate = ref<boolean>(false);
|
2024-04-03 17:51:00 +07:00
|
|
|
const isTarget = ref<string>("");
|
2024-03-25 18:01:33 +07:00
|
|
|
|
2024-03-26 09:56:49 +07:00
|
|
|
const formGroupTarget = reactive<FormGroupTarget>({
|
2024-03-25 18:01:33 +07:00
|
|
|
groupTarget: "",
|
|
|
|
|
groupTargetSub: "",
|
|
|
|
|
position: "",
|
|
|
|
|
posType: "",
|
|
|
|
|
level: "",
|
|
|
|
|
type: "",
|
|
|
|
|
amount: null,
|
|
|
|
|
});
|
|
|
|
|
|
2024-03-26 09:56:49 +07:00
|
|
|
const formGroupRelate = reactive<FormGroupRelate>({
|
2024-03-25 18:01:33 +07:00
|
|
|
relate: "",
|
|
|
|
|
amount: null,
|
|
|
|
|
});
|
|
|
|
|
|
2024-04-02 16:57:48 +07:00
|
|
|
const posTypeOp = ref<DataOption[]>([]);
|
|
|
|
|
const posLevelOp = ref<DataOption[]>([]);
|
|
|
|
|
const posTypeMain = ref<ResGroup[]>([]);
|
|
|
|
|
|
|
|
|
|
/** function เรียกข้อมูลประเภทตำแหน่ง*/
|
|
|
|
|
function fetchType() {
|
|
|
|
|
if (posTypeMain.value.length === 0) {
|
|
|
|
|
http
|
|
|
|
|
.get(config.API.orgPosType)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
const data = res.data.result;
|
|
|
|
|
posTypeMain.value = data;
|
|
|
|
|
posTypeOp.value = data.map((e: ResGroup) => ({
|
|
|
|
|
id: e.id,
|
|
|
|
|
name: e.posTypeName,
|
|
|
|
|
}));
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
messageError($q, err);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-03 17:51:00 +07:00
|
|
|
function onClickOpenDialog(type: string, target: string) {
|
|
|
|
|
isTarget.value = target;
|
2024-03-25 18:01:33 +07:00
|
|
|
if (type === "group") {
|
|
|
|
|
modalGroupTarget.value = true;
|
|
|
|
|
} else {
|
|
|
|
|
modalRelate.value = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onSubmitGroup() {
|
|
|
|
|
dialogConfirm($q, () => {
|
2024-04-03 17:51:00 +07:00
|
|
|
if (isTarget.value === "planned") {
|
|
|
|
|
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);
|
2024-03-25 18:01:33 +07:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onSubmitRelate() {
|
|
|
|
|
dialogConfirm($q, () => {
|
|
|
|
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
2024-04-03 17:51:00 +07:00
|
|
|
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;
|
|
|
|
|
}
|
2024-03-25 18:01:33 +07:00
|
|
|
onClickCloseDialog();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-03 17:51:00 +07:00
|
|
|
function onclickDelete(index: number, type: string) {
|
2024-03-25 18:01:33 +07:00
|
|
|
dialogRemove($q, () => {
|
2024-04-03 17:51:00 +07:00
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-25 18:01:33 +07:00
|
|
|
success($q, "ลบข้อมูลสำเร็จ");
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function cleanFormData() {
|
|
|
|
|
formGroupTarget.groupTarget = "";
|
|
|
|
|
formGroupTarget.groupTargetSub = "";
|
|
|
|
|
formGroupTarget.position = "";
|
|
|
|
|
formGroupTarget.posType = "";
|
|
|
|
|
formGroupTarget.level = "";
|
|
|
|
|
formGroupTarget.type = "";
|
|
|
|
|
formGroupTarget.amount = null;
|
|
|
|
|
formGroupRelate.relate = "";
|
|
|
|
|
formGroupRelate.amount = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onClickCloseDialog() {
|
|
|
|
|
modalGroupTarget.value = false;
|
|
|
|
|
modalRelate.value = false;
|
|
|
|
|
cleanFormData();
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-02 16:57:48 +07:00
|
|
|
function updatePosTypeName(id: string) {
|
|
|
|
|
const posLevel = posTypeMain.value.find((e: ResGroup) => e.id === id);
|
|
|
|
|
posLevelOp.value =
|
|
|
|
|
posLevel?.posLevels.map((e: ResLevel) => ({
|
|
|
|
|
id: e.id,
|
|
|
|
|
name: e.posLevelName.toString(),
|
|
|
|
|
})) ?? [];
|
|
|
|
|
formGroupTarget.level = "";
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-03 17:51:00 +07:00
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-25 18:01:33 +07:00
|
|
|
onMounted(() => {
|
2024-04-03 17:51:00 +07:00
|
|
|
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
|
|
|
|
|
: [];
|
2024-03-25 18:01:33 +07:00
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
<template>
|
|
|
|
|
<!-- CARD เป้าหมายตามแผน -->
|
|
|
|
|
<q-card bordered style="border: 1px solid #d6dee1">
|
|
|
|
|
<div class="text-weight-medium bg-grey-1 q-py-sm q-px-md">
|
|
|
|
|
เป้าหมายตามแผน
|
|
|
|
|
<q-btn flat round dense icon="add" color="primary">
|
|
|
|
|
<q-menu>
|
|
|
|
|
<q-list style="min-width: 100px">
|
2024-04-03 17:51:00 +07:00
|
|
|
<q-item
|
|
|
|
|
clickable
|
|
|
|
|
v-close-popup
|
|
|
|
|
@click="onClickOpenDialog('group', 'planned')"
|
|
|
|
|
>
|
2024-03-25 18:01:33 +07:00
|
|
|
<q-item-section>กลุ่มเป้าหมาย</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
<q-item
|
|
|
|
|
clickable
|
|
|
|
|
v-close-popup
|
2024-04-03 17:51:00 +07:00
|
|
|
@click="onClickOpenDialog('relate', 'planned')"
|
2024-03-25 18:01:33 +07:00
|
|
|
>
|
|
|
|
|
<q-item-section>ผู้เกี่ยวข้อง</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
<q-separator />
|
|
|
|
|
</q-list>
|
|
|
|
|
</q-menu>
|
|
|
|
|
<q-tooltip>เพิ่ม</q-tooltip>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-12"><q-separator /></div>
|
|
|
|
|
<div class="row col-12 q-col-gutter-md q-pa-md">
|
|
|
|
|
<div class="col-12">
|
|
|
|
|
<d-table
|
|
|
|
|
for="table"
|
|
|
|
|
ref="table"
|
2024-04-03 17:51:00 +07:00
|
|
|
:columns="columnsPlannedGoals"
|
|
|
|
|
:rows="plannedGoals"
|
2024-03-25 18:01:33 +07:00
|
|
|
row-key="id"
|
|
|
|
|
flat
|
|
|
|
|
bordered
|
|
|
|
|
dense
|
|
|
|
|
class="custom-header-table"
|
|
|
|
|
hide-pagination
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:header="props">
|
|
|
|
|
<q-tr :props="props">
|
|
|
|
|
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
|
|
|
|
<span class="text-weight-medium">{{ col.label }}</span>
|
|
|
|
|
</q-th>
|
|
|
|
|
<q-th auto-width />
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:body="props">
|
|
|
|
|
<q-tr :props="props" class="cursor-pointer">
|
|
|
|
|
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
|
|
|
|
<div class="table_ellipsis">
|
|
|
|
|
{{ col.value ? col.value : "-" }}
|
|
|
|
|
</div>
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td>
|
|
|
|
|
<q-btn
|
|
|
|
|
flat
|
|
|
|
|
round
|
|
|
|
|
dense
|
|
|
|
|
icon="delete"
|
|
|
|
|
color="red"
|
2024-04-03 17:51:00 +07:00
|
|
|
@click="onclickDelete(props.rowIndex, 'plannedGoals')"
|
2024-03-25 18:01:33 +07:00
|
|
|
>
|
|
|
|
|
<q-tooltip>ลบข้อมูล</q-tooltip>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</q-td>
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
|
|
|
|
</d-table>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-12">
|
|
|
|
|
<d-table
|
|
|
|
|
for="table"
|
|
|
|
|
ref="table"
|
|
|
|
|
:columns="columnsRelated"
|
2024-04-03 17:51:00 +07:00
|
|
|
:rows="plannedPeoples"
|
2024-03-25 18:01:33 +07:00
|
|
|
row-key="id"
|
|
|
|
|
flat
|
|
|
|
|
bordered
|
|
|
|
|
dense
|
|
|
|
|
class="custom-header-table"
|
|
|
|
|
hide-pagination
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:header="props">
|
|
|
|
|
<q-tr :props="props">
|
|
|
|
|
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
|
|
|
|
<span class="text-weight-medium">{{ col.label }}</span>
|
|
|
|
|
</q-th>
|
|
|
|
|
<q-th auto-width />
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:body="props">
|
|
|
|
|
<q-tr :props="props" class="cursor-pointer">
|
|
|
|
|
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
|
|
|
|
<div class="table_ellipsis">
|
|
|
|
|
{{ col.value ? col.value : "-" }}
|
|
|
|
|
</div>
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td>
|
|
|
|
|
<q-btn
|
|
|
|
|
flat
|
|
|
|
|
round
|
|
|
|
|
dense
|
|
|
|
|
icon="delete"
|
|
|
|
|
color="red"
|
2024-04-03 17:51:00 +07:00
|
|
|
@click="onclickDelete(props.rowIndex, 'plannedPeoples')"
|
2024-03-25 18:01:33 +07:00
|
|
|
>
|
|
|
|
|
<q-tooltip>ลบข้อมูล</q-tooltip>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</q-td>
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
|
|
|
|
</d-table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</q-card>
|
|
|
|
|
|
|
|
|
|
<!--CARD เป้าหมายตามจริง -->
|
|
|
|
|
<q-card bordered style="border: 1px solid #d6dee1" class="q-mt-md">
|
|
|
|
|
<div class="text-weight-medium bg-grey-1 q-py-sm q-px-md">
|
|
|
|
|
เป้าหมายตามจริง
|
|
|
|
|
<q-btn flat round dense icon="add" color="primary">
|
|
|
|
|
<q-menu>
|
|
|
|
|
<q-list style="min-width: 100px">
|
2024-04-03 17:51:00 +07:00
|
|
|
<q-item
|
|
|
|
|
clickable
|
|
|
|
|
v-close-popup
|
|
|
|
|
@click="onClickOpenDialog('group', 'actual')"
|
|
|
|
|
>
|
2024-03-25 18:01:33 +07:00
|
|
|
<q-item-section>กลุ่มเป้าหมาย</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
<q-item
|
|
|
|
|
clickable
|
|
|
|
|
v-close-popup
|
2024-04-03 17:51:00 +07:00
|
|
|
@click="onClickOpenDialog('relate', 'actual')"
|
2024-03-25 18:01:33 +07:00
|
|
|
>
|
|
|
|
|
<q-item-section>ผู้เกี่ยวข้อง</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
<q-separator />
|
|
|
|
|
</q-list>
|
|
|
|
|
</q-menu>
|
|
|
|
|
<q-tooltip>เพิ่ม</q-tooltip>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-12"><q-separator /></div>
|
|
|
|
|
<div class="row col-12 q-col-gutter-md q-pa-md">
|
|
|
|
|
<div class="col-12">
|
|
|
|
|
<d-table
|
|
|
|
|
for="table"
|
|
|
|
|
ref="table"
|
2024-04-03 17:51:00 +07:00
|
|
|
:columns="columnsActualGoals"
|
|
|
|
|
:rows="actualGoals"
|
2024-03-25 18:01:33 +07:00
|
|
|
row-key="id"
|
|
|
|
|
flat
|
|
|
|
|
bordered
|
|
|
|
|
dense
|
|
|
|
|
class="custom-header-table"
|
|
|
|
|
hide-pagination
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:header="props">
|
|
|
|
|
<q-tr :props="props">
|
|
|
|
|
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
|
|
|
|
<span class="text-weight-medium">{{ col.label }}</span>
|
|
|
|
|
</q-th>
|
|
|
|
|
<q-th auto-width />
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:body="props">
|
|
|
|
|
<q-tr :props="props" class="cursor-pointer">
|
|
|
|
|
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
|
|
|
|
<div class="table_ellipsis">
|
|
|
|
|
{{ col.value ? col.value : "-" }}
|
|
|
|
|
</div>
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td>
|
|
|
|
|
<q-btn
|
|
|
|
|
flat
|
|
|
|
|
round
|
|
|
|
|
dense
|
|
|
|
|
icon="delete"
|
|
|
|
|
color="red"
|
2024-04-03 17:51:00 +07:00
|
|
|
@click="onclickDelete(props.rowIndex, 'actualGoals')"
|
2024-03-25 18:01:33 +07:00
|
|
|
>
|
|
|
|
|
<q-tooltip>ลบข้อมูล</q-tooltip>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</q-td>
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
|
|
|
|
</d-table>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-12">
|
|
|
|
|
<d-table
|
|
|
|
|
for="table"
|
|
|
|
|
ref="table"
|
|
|
|
|
:columns="columnsRelated"
|
2024-04-03 17:51:00 +07:00
|
|
|
:rows="actualPeoples"
|
2024-03-25 18:01:33 +07:00
|
|
|
row-key="id"
|
|
|
|
|
flat
|
|
|
|
|
bordered
|
|
|
|
|
dense
|
|
|
|
|
class="custom-header-table"
|
|
|
|
|
hide-pagination
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:header="props">
|
|
|
|
|
<q-tr :props="props">
|
|
|
|
|
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
|
|
|
|
<span class="text-weight-medium">{{ col.label }}</span>
|
|
|
|
|
</q-th>
|
|
|
|
|
<q-th auto-width />
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:body="props">
|
|
|
|
|
<q-tr :props="props" class="cursor-pointer">
|
|
|
|
|
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
|
|
|
|
<div class="table_ellipsis">
|
|
|
|
|
{{ col.value ? col.value : "-" }}
|
|
|
|
|
</div>
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td>
|
|
|
|
|
<q-btn
|
|
|
|
|
flat
|
|
|
|
|
round
|
|
|
|
|
dense
|
|
|
|
|
icon="delete"
|
|
|
|
|
color="red"
|
2024-04-03 17:51:00 +07:00
|
|
|
@click="onclickDelete(props.rowIndex, 'actualPeoples')"
|
2024-03-25 18:01:33 +07:00
|
|
|
>
|
|
|
|
|
<q-tooltip>ลบข้อมูล</q-tooltip>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</q-td>
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
|
|
|
|
</d-table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</q-card>
|
|
|
|
|
|
|
|
|
|
<q-dialog v-model="modalGroupTarget" persistent>
|
|
|
|
|
<q-card style="width: 700px">
|
|
|
|
|
<q-form greedy @submit.prevent @validation-success="onSubmitGroup">
|
|
|
|
|
<DialogHeader tittle="เพิ่มกลุ่มเป้าหมาย" :close="onClickCloseDialog" />
|
|
|
|
|
<q-separator />
|
|
|
|
|
<q-card-section class="q-p-sm">
|
|
|
|
|
<div class="row col-12 q-col-gutter-md">
|
|
|
|
|
<div class="col-xs-6 col-sm-6 col-md-6">
|
|
|
|
|
<q-select
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
v-model="formGroupTarget.groupTarget"
|
2024-04-02 16:57:48 +07:00
|
|
|
:options="groupOp"
|
2024-03-25 18:01:33 +07:00
|
|
|
label="กลุ่มเป้าหมาย"
|
|
|
|
|
hide-bottom-space
|
2024-04-02 16:57:48 +07:00
|
|
|
option-label="name"
|
|
|
|
|
option-value="id"
|
|
|
|
|
map-options
|
|
|
|
|
emit-value
|
2024-03-25 18:01:33 +07:00
|
|
|
lazy-rules
|
2024-04-03 17:51:00 +07:00
|
|
|
@update:model-value="updateGroupTarget"
|
2024-03-25 18:01:33 +07:00
|
|
|
:rules="[
|
|
|
|
|
(val:string) =>
|
|
|
|
|
!!val || `${'กรุณาเลือกกลุ่มเป้าหมาย'}`,
|
|
|
|
|
]"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2024-04-03 17:51:00 +07:00
|
|
|
<div
|
|
|
|
|
class="col-xs-6 col-sm-6 col-md-6"
|
|
|
|
|
v-if="formGroupTarget.groupTarget !== 'OUTSIDERS'"
|
|
|
|
|
>
|
2024-03-25 18:01:33 +07:00
|
|
|
<q-select
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
v-model="formGroupTarget.groupTargetSub"
|
2024-04-03 17:51:00 +07:00
|
|
|
:options="
|
|
|
|
|
formGroupTarget.groupTarget === 'OFFICER'
|
|
|
|
|
? groupSubOp.slice(0, 2)
|
|
|
|
|
: groupSubOp.slice(2, 4)
|
|
|
|
|
"
|
2024-03-25 18:01:33 +07:00
|
|
|
label="กลุ่มเป้าหมายย่อย"
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
lazy-rules
|
2024-04-02 16:57:48 +07:00
|
|
|
option-label="name"
|
|
|
|
|
option-value="id"
|
|
|
|
|
map-options
|
|
|
|
|
emit-value
|
2024-03-25 18:01:33 +07:00
|
|
|
:rules="[
|
|
|
|
|
(val:string) =>
|
|
|
|
|
!!val || `${'กรุณาเลือกกลุ่มเป้าหมายย่อย'}`,
|
|
|
|
|
]"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2024-04-03 17:51:00 +07:00
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
class="col-xs-6 col-sm-4 col-md-4"
|
|
|
|
|
v-if="formGroupTarget.groupTarget !== 'OUTSIDERS'"
|
|
|
|
|
>
|
2024-03-25 18:01:33 +07:00
|
|
|
<q-input
|
|
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
v-model="formGroupTarget.position"
|
|
|
|
|
label="ตำแหน่ง"
|
|
|
|
|
:rules="[
|
|
|
|
|
(val:string) =>
|
|
|
|
|
!!val || `${'กรุณากรอกตำแหน่ง'}`,
|
|
|
|
|
]"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2024-04-03 17:51:00 +07:00
|
|
|
<div
|
|
|
|
|
class="col-xs-6 col-sm-4 col-md-4"
|
|
|
|
|
v-if="formGroupTarget.groupTarget !== 'OUTSIDERS'"
|
|
|
|
|
>
|
2024-04-02 16:57:48 +07:00
|
|
|
<q-select
|
2024-03-25 18:01:33 +07:00
|
|
|
dense
|
2024-04-02 16:57:48 +07:00
|
|
|
outlined
|
2024-03-25 18:01:33 +07:00
|
|
|
hide-bottom-space
|
2024-04-02 16:57:48 +07:00
|
|
|
lazy-rules
|
2024-03-25 18:01:33 +07:00
|
|
|
v-model="formGroupTarget.posType"
|
2024-04-02 16:57:48 +07:00
|
|
|
:options="posTypeOp"
|
|
|
|
|
option-label="name"
|
|
|
|
|
option-value="id"
|
|
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
input-class="text-red"
|
2024-03-25 18:01:33 +07:00
|
|
|
label="ประเภทตำแหน่ง"
|
2024-04-02 16:57:48 +07:00
|
|
|
@update:model-value="updatePosTypeName"
|
2024-03-25 18:01:33 +07:00
|
|
|
:rules="[
|
2024-04-02 16:57:48 +07:00
|
|
|
(val:string) =>
|
|
|
|
|
!!val || `${'กรุณาเลือกประเภทตำแหน่ง'}`,
|
|
|
|
|
]"
|
2024-03-25 18:01:33 +07:00
|
|
|
/>
|
|
|
|
|
</div>
|
2024-04-03 17:51:00 +07:00
|
|
|
<div
|
|
|
|
|
class="col-xs-6 col-sm-4 col-md-4"
|
|
|
|
|
v-if="formGroupTarget.groupTarget !== 'OUTSIDERS'"
|
|
|
|
|
>
|
2024-04-02 16:57:48 +07:00
|
|
|
<q-select
|
2024-03-25 18:01:33 +07:00
|
|
|
dense
|
2024-04-02 16:57:48 +07:00
|
|
|
outlined
|
2024-03-25 18:01:33 +07:00
|
|
|
hide-bottom-space
|
2024-04-02 16:57:48 +07:00
|
|
|
lazy-rules
|
2024-03-25 18:01:33 +07:00
|
|
|
v-model="formGroupTarget.level"
|
2024-04-02 16:57:48 +07:00
|
|
|
:options="posLevelOp"
|
|
|
|
|
option-label="name"
|
|
|
|
|
option-value="id"
|
|
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
input-class="text-red"
|
2024-03-25 18:01:33 +07:00
|
|
|
label="ระดับ"
|
|
|
|
|
:rules="[
|
2024-04-02 16:57:48 +07:00
|
|
|
(val:string) =>
|
|
|
|
|
!!val || `${'กรุณาเลือกระดับ'}`,
|
|
|
|
|
]"
|
2024-03-25 18:01:33 +07:00
|
|
|
/>
|
|
|
|
|
</div>
|
2024-04-03 17:51:00 +07:00
|
|
|
<div
|
|
|
|
|
class="col-xs-6 col-sm-6 col-md-8"
|
|
|
|
|
v-if="formGroupTarget.groupTarget === 'OUTSIDERS'"
|
|
|
|
|
>
|
2024-03-25 18:01:33 +07:00
|
|
|
<q-input
|
|
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
v-model="formGroupTarget.type"
|
|
|
|
|
label="ประเภท(กลุ่มอาชีพ คุณสมบัติ)"
|
|
|
|
|
:rules="[
|
|
|
|
|
(val:string) =>
|
|
|
|
|
!!val || `${'กรุณากรอกประเภท(กลุ่มอาชีพ คุณสมบัติ)'}`,
|
|
|
|
|
]"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-xs-6 col-sm-6 col-md-4">
|
|
|
|
|
<q-input
|
|
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
v-model="formGroupTarget.amount"
|
|
|
|
|
label="จำนวน(คน)"
|
2024-04-02 10:23:22 +07:00
|
|
|
mask="#"
|
|
|
|
|
reverse-fill-mask
|
2024-03-25 18:01:33 +07:00
|
|
|
:rules="[
|
|
|
|
|
(val:string) =>
|
|
|
|
|
!!val || `${'กรุณากรอกจำนวน(คน)'}`,
|
|
|
|
|
]"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</q-card-section>
|
|
|
|
|
<q-separator />
|
|
|
|
|
<div class="text-right q-pa-sm">
|
|
|
|
|
<q-btn
|
|
|
|
|
dense
|
|
|
|
|
unelevated
|
|
|
|
|
label="บันทึก"
|
|
|
|
|
id="onSubmit"
|
|
|
|
|
type="submit"
|
|
|
|
|
color="public"
|
|
|
|
|
class="q-px-md"
|
|
|
|
|
>
|
|
|
|
|
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</div>
|
|
|
|
|
</q-form>
|
|
|
|
|
</q-card>
|
|
|
|
|
</q-dialog>
|
|
|
|
|
|
|
|
|
|
<q-dialog v-model="modalRelate" persistent>
|
|
|
|
|
<q-card style="width: 400px">
|
|
|
|
|
<q-form greedy @submit.prevent @validation-success="onSubmitRelate">
|
|
|
|
|
<DialogHeader tittle="เพิ่มผู้เกี่ยวข้อง" :close="onClickCloseDialog" />
|
|
|
|
|
<q-separator />
|
|
|
|
|
<q-card-section class="q-p-sm">
|
|
|
|
|
<div class="row col-12 q-col-gutter-md">
|
|
|
|
|
<div class="col-xs-6 col-sm-12 col-md-12">
|
|
|
|
|
<q-select
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
v-model="formGroupRelate.relate"
|
2024-04-03 17:51:00 +07:00
|
|
|
:options="peoplesOp"
|
2024-03-25 18:01:33 +07:00
|
|
|
label="ผู้เกี่ยวข้อง"
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
lazy-rules
|
2024-04-03 17:51:00 +07:00
|
|
|
option-label="name"
|
|
|
|
|
option-value="id"
|
|
|
|
|
map-options
|
|
|
|
|
emit-value
|
2024-03-25 18:01:33 +07:00
|
|
|
:rules="[
|
|
|
|
|
(val:string) =>
|
|
|
|
|
!!val || `${'กรุณาเลือกผู้เกี่ยวข้อง'}`,
|
|
|
|
|
]"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-xs-6 col-sm-12 col-md-12">
|
|
|
|
|
<q-input
|
|
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
v-model="formGroupRelate.amount"
|
|
|
|
|
label="จำนวน(คน)"
|
2024-04-02 10:23:22 +07:00
|
|
|
mask="#"
|
|
|
|
|
reverse-fill-mask
|
2024-03-25 18:01:33 +07:00
|
|
|
:rules="[
|
|
|
|
|
(val:string) =>
|
|
|
|
|
!!val || `${'กรุณากรอกจำนวน(คน)'}`,
|
|
|
|
|
]"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</q-card-section>
|
|
|
|
|
<q-separator />
|
|
|
|
|
<div class="text-right q-pa-sm">
|
|
|
|
|
<q-btn
|
|
|
|
|
dense
|
|
|
|
|
unelevated
|
|
|
|
|
label="บันทึก"
|
|
|
|
|
id="onSubmit"
|
|
|
|
|
type="submit"
|
|
|
|
|
color="public"
|
|
|
|
|
class="q-px-md"
|
|
|
|
|
>
|
|
|
|
|
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</div>
|
|
|
|
|
</q-form>
|
|
|
|
|
</q-card>
|
|
|
|
|
</q-dialog>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style scoped></style>
|