Merge branch 'develop' into devTee

This commit is contained in:
STW_TTTY\stwtt 2024-07-09 10:40:14 +07:00
commit 17b832bcfc
35 changed files with 877 additions and 621 deletions

View file

@ -9,7 +9,8 @@ env:
REGISTRY: docker.frappet.com REGISTRY: docker.frappet.com
IMAGE_NAME: ehr/bma-ehr-app IMAGE_NAME: ehr/bma-ehr-app
DEPLOY_HOST: frappet.com DEPLOY_HOST: frappet.com
COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr COMPOSE_PATH: /home/frappet/docker/bma-ehr
# COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr
jobs: jobs:
# act workflow_dispatch -W .github/workflows/release.yaml --input IMAGE_VER=latest -s DOCKER_USER=kittapath@frappet.com -s DOCKER_PASS=P@ssw0rd -s SSH_PASSWORD=FPTadmin2357 # act workflow_dispatch -W .github/workflows/release.yaml --input IMAGE_VER=latest -s DOCKER_USER=kittapath@frappet.com -s DOCKER_PASS=P@ssw0rd -s SSH_PASSWORD=FPTadmin2357
release-test: release-test:

View file

@ -7,6 +7,7 @@ interface DataOption {
id: string; id: string;
name: string; name: string;
note?: string; note?: string;
level?: number;
} }
interface GovermentOption { interface GovermentOption {

View file

@ -30,7 +30,7 @@
> >
<q-tooltip>นทกขอม</q-tooltip> <q-tooltip>นทกขอม</q-tooltip>
</q-btn> </q-btn>
<q-btn <!-- <q-btn
color="primary" color="primary"
flat flat
round round
@ -40,7 +40,7 @@
v-if="status == 'checkRegister'" v-if="status == 'checkRegister'"
> >
<q-tooltip>ตรวจสอบขอม</q-tooltip> <q-tooltip>ตรวจสอบขอม</q-tooltip>
</q-btn> </q-btn> -->
<q-btn <q-btn
color="red" color="red"
flat flat

View file

@ -1570,10 +1570,15 @@ const fetchPositionLevel = async (val: string) => {
option.push({ option.push({
id: r.id.toString(), id: r.id.toString(),
name: r.name.toString(), name: r.name.toString(),
level: r.level,
}); });
}); });
positionLevelOptions.value = option; positionLevelOptions.value = option.filter(
positionLevelFilters.value = option; (v: DataOption) => v.level === 0
);
positionLevelFilters.value = option.filter(
(v: DataOption) => v.level === 0
);
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);

View file

@ -158,7 +158,6 @@
<div <div
v-else-if="col.name == 'status'" v-else-if="col.name == 'status'"
:class=" :class="
props.row.status == 'checkRegister' ||
props.row.status == 'checkPayment' || props.row.status == 'checkPayment' ||
props.row.status == 'checkSeat' || props.row.status == 'checkSeat' ||
props.row.status == 'checkPoint' props.row.status == 'checkPoint'

View file

@ -5,23 +5,43 @@ import { useRouter } from "vue-router";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
/** importType*/ /**
import type { DataOption } from "@/modules/04_registryNew/interface/index/Main"; * importType*
*/
import type { QTableProps } from "quasar";
import type { QForm } from "quasar"; import type { QForm } from "quasar";
import type { DataOption } from "@/modules/04_registryNew/interface/index/Main";
import type {
HistoryPos,
Position,
} from "@/modules/04_registryNew/interface/response/History";
/** importStore*/ /**
* import components
*/
import DialogHeader from "@/components/DialogHeader.vue";
/**
* importStore
*/
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
/** use*/ /**
* use
*/
const myForm = ref<QForm>(); const myForm = ref<QForm>();
const router = useRouter(); const router = useRouter();
const $q = useQuasar(); const $q = useQuasar();
const { showLoader, hideLoader, messageError, date2Thai, dialogMessageNotify } = const { showLoader, hideLoader, messageError, date2Thai } = useCounterMixin();
useCounterMixin();
/**props*/ /**
* props
*/
const modal = defineModel<boolean>("modal", { required: true }); const modal = defineModel<boolean>("modal", { required: true });
/**
* วแปร
*/
const employeeClass = ref<string>(""); const employeeClass = ref<string>("");
const typeKeyword = ref<string>(""); const typeKeyword = ref<string>("");
const Keyword = ref<string>(""); const Keyword = ref<string>("");
@ -35,7 +55,12 @@ const typeKeywordOps = ref<DataOption[]>([
{ id: "position", name: "ตำแหน่ง" }, { id: "position", name: "ตำแหน่ง" },
]); ]);
const positionOps = ref<DataOption[]>([]); const positionOps = ref<DataOption[]>([]);
const columns = ref<any["columns"]>([ const options = ref<DataOption[]>([]);
/**
* Table
*/
const columns = ref<QTableProps["columns"]>([
{ {
name: "no", name: "no",
label: "ลำดับ", label: "ลำดับ",
@ -81,18 +106,26 @@ const columns = ref<any["columns"]>([
align: "left", align: "left",
label: "วันที่ถือครอง", label: "วันที่ถือครอง",
field: "date", field: "date",
format: (val, row) => `${date2Thai(val)}`,
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
]); ]);
const rows = ref<any>([]); const rows = ref<HistoryPos[]>([]);
/**
* function fetch อมลตำแหน าราชการ
*/
function fecthPositionOfficer() { function fecthPositionOfficer() {
http http
.get(config.API.listPositionPathHistory) .get(config.API.listPositionPathHistory)
.then((res) => { .then((res) => {
let data = res.data.result.items; let data = res.data.result.items;
positionOps.value = data.map((e: any) => ({ id: e.id, name: e.name }));
positionOps.value = data.map((e: Position) => ({
id: e.id,
name: e.name,
}));
options.value = positionOps.value; options.value = positionOps.value;
}) })
.catch((err) => { .catch((err) => {
@ -100,12 +133,20 @@ function fecthPositionOfficer() {
}); });
} }
/**
* function fetch อมลตำแหน กจางประจำ
*/
function fetchPositionPerm() { function fetchPositionPerm() {
http http
.get(config.API.listPositionEmployeePositionHistory) .get(config.API.listPositionEmployeePositionHistory)
.then((res) => { .then((res) => {
let data = res.data.result.items; let data = res.data.result.items;
positionOps.value = data.map((e: any) => ({ id: e.id, name: e.name })); console.log(data);
positionOps.value = data.map((e: Position) => ({
id: e.id,
name: e.name,
}));
options.value = positionOps.value; options.value = positionOps.value;
}) })
.catch((err) => { .catch((err) => {
@ -113,12 +154,20 @@ function fetchPositionPerm() {
}); });
} }
/**
* function เปลยนประเภท
*/
function changeEmployeeClass() { function changeEmployeeClass() {
typeKeyword.value = ""; typeKeyword.value = "";
Keyword.value = ""; Keyword.value = "";
positionKeyword.value = ""; positionKeyword.value = "";
rows.value = []; rows.value = [];
} }
/**
* function เลอกฟลดจะคนหา
* @param typeKeyword ประเภทฟลด
*/
function selectTypeKeyword(typeKeyword: string) { function selectTypeKeyword(typeKeyword: string) {
positionOps.value = []; positionOps.value = [];
positionKeyword.value = ""; positionKeyword.value = "";
@ -131,6 +180,10 @@ function selectTypeKeyword(typeKeyword: string) {
} }
} }
/**
* function นหาประวอครองตำแหน
* @param type ประเภทขาราชการ
*/
function clickSearch(type: string) { function clickSearch(type: string) {
myForm.value!.validate().then((result: boolean) => { myForm.value!.validate().then((result: boolean) => {
if (result) { if (result) {
@ -151,16 +204,15 @@ function clickSearch(type: string) {
.then((res) => { .then((res) => {
let data = res.data.result; let data = res.data.result;
if (data.length !== 0) { if (data.length !== 0) {
rows.value = data.map((e: any) => ({ rows.value = data.map((e: HistoryPos) => ({
id: e.id, id: e.id,
citizenId: e.citizenId, citizenId: e.citizenId,
name: e.fullName, name: e.fullName,
posNo: e.posNo, posNo: e.posNo,
position: e.position, position: e.position,
date: date2Thai(e.date), date: e.date,
})); }));
} else { } else {
dialogMessageNotify($q, "ไม่มีข้อมูลที่ต้องการค้นหา");
rows.value = []; rows.value = [];
} }
}) })
@ -174,8 +226,13 @@ function clickSearch(type: string) {
} }
}); });
} }
const options = ref<any>([]);
function filterFn(val: string, update: any) { /**
* function นหาขอม Optiion
* @param val คำคนหา
* @param update function
*/
function filterFn(val: string, update: Function) {
if (val === "") { if (val === "") {
update(() => { update(() => {
options.value = positionOps.value; options.value = positionOps.value;
@ -189,6 +246,11 @@ function filterFn(val: string, update: any) {
}); });
} }
} }
/**
* function redirect ไปทะเบยนประว
* @param id
*/
function clickRedirect(id: string) { function clickRedirect(id: string) {
const url = const url =
employeeClass.value === "officer" employeeClass.value === "officer"
@ -197,42 +259,32 @@ function clickRedirect(id: string) {
router.push(`${url}/${id}`); router.push(`${url}/${id}`);
} }
const paging = ref<boolean>(true); /**
const pagination = ref({ * function popup
sortBy: "order", */
descending: false, function closeDialog() {
page: 1, modal.value = false;
rowsPerPage: 10, employeeClass.value = "";
}); typeKeyword.value = "";
const paginationLabel = (start: number, end: number, total: number) => { Keyword.value = "";
if (paging.value == true) return " " + start + "-" + end + " ใน " + total; positionKeyword.value = "";
else return start + "-" + end + " ใน " + total; rows.value = [];
}; }
</script> </script>
<template> <template>
<q-dialog v-model="modal"> <q-dialog v-model="modal">
<q-card style="width: 850px; max-width: 80vw"> <q-card style="width: 850px; max-width: 80vw">
<q-toolbar> <DialogHeader :tittle="'ประวัติถือครองตำแหน่ง'" :close="closeDialog" />
<q-toolbar-title class="text-subtitle2 text-bold"
>ประวอครองตำแหน</q-toolbar-title
>
<q-btn
icon="close"
unelevated
round
dense
v-close-popup
style="color: #ff8080; background-color: #ffdede"
/>
</q-toolbar>
<q-separator /> <q-separator />
<div class="dialog-card-contain"> <q-card-section class="q-pa-sm">
<q-card-section class="q-pa-sm"> <q-form ref="myForm">
<q-form ref="myForm"> <div class="col-12 bg-grey-2 q-pa-sm">
<div class="col-12 bg-grey-2 q-pa-sm"> <div class="col-12 row q-pb-sm q-col-gutter-sm items-center"></div>
<div class="q-col-gutter-xs row no-wrap"> <div class="q-col-gutter-xs row no-wrap">
<div class="col-4">
<q-select <q-select
hide-bottom-space hide-bottom-space
:rules="[(val:string) => !!val || `${'กรุณาเลือก ประเภท'}`]" :rules="[(val:string) => !!val || `${'กรุณาเลือก ประเภท'}`]"
@ -250,6 +302,8 @@ const paginationLabel = (start: number, end: number, total: number) => {
input-debounce="0" input-debounce="0"
@update:model-value="changeEmployeeClass" @update:model-value="changeEmployeeClass"
/> />
</div>
<div class="col-3">
<q-select <q-select
hide-bottom-space hide-bottom-space
:rules="[(val:string) => !!val || `${'กรุณาเลือก ฟิลด์ที่จะค้น'}`]" :rules="[(val:string) => !!val || `${'กรุณาเลือก ฟิลด์ที่จะค้น'}`]"
@ -267,8 +321,10 @@ const paginationLabel = (start: number, end: number, total: number) => {
input-debounce="0" input-debounce="0"
@update:model-value="selectTypeKeyword(typeKeyword)" @update:model-value="selectTypeKeyword(typeKeyword)"
/> />
</div>
<div class="col" v-if="typeKeyword === 'no'">
<q-input <q-input
v-if="typeKeyword === 'no'"
borderless borderless
outlined outlined
dense dense
@ -278,8 +334,10 @@ const paginationLabel = (start: number, end: number, total: number) => {
:rules="[(val:string) => !!val || `${'กรุณากรอก ตำแหน่งเลขที่'}`]" :rules="[(val:string) => !!val || `${'กรุณากรอก ตำแหน่งเลขที่'}`]"
hide-bottom-space hide-bottom-space
/> />
</div>
<div class="col" v-if="typeKeyword === 'position'">
<q-select <q-select
v-if="typeKeyword === 'position'"
hide-bottom-space hide-bottom-space
:rules="[(val:string) => !!val || `${'กรุณาเลือก ตำแหน่ง'}`]" :rules="[(val:string) => !!val || `${'กรุณาเลือก ตำแหน่ง'}`]"
outlined outlined
@ -304,119 +362,78 @@ const paginationLabel = (start: number, end: number, total: number) => {
</q-item> </q-item>
</template></q-select </template></q-select
> >
<q-space />
<div class="col-2 row">
<q-btn
dense
color="primary"
icon="mdi-magnify"
label="ค้นหา"
class="col-12"
@click="clickSearch(employeeClass)"
/>
</div>
</div> </div>
<q-space />
<q-btn
color="primary"
icon="mdi-magnify"
label="ค้นหา"
@click="clickSearch(employeeClass)"
/>
</div> </div>
</q-form> </div>
</q-card-section>
</div>
<div class="col-12 q-px-sm q-pb-sm"> <div class="col-12 q-mt-sm">
<q-table <d-table
flat flat
dense dense
bordered bordered
:rows="rows" :rows="rows"
:columns="columns" :columns="columns"
row-key="order" row-key="order"
class="custom-header-table" no-data-label="ไม่มีข้อมูล"
no-data-label="ไม่มีข้อมูล" >
:pagination-label="paginationLabel" <template v-slot:header="props">
v-model:pagination="pagination" <q-tr :props="props">
> <q-th
<template v-slot:header="props"> v-for="col in props.cols"
<q-tr :props="props"> :key="col.name"
<q-th v-for="col in props.cols" :key="col.name" :props="props"> :props="props"
<div class="text-grey-7 text-weight-medium"> >
<span class="row">{{ col.label }}</span> <div class="text-grey-7 text-weight-medium">
</div> <span class="row">{{ col.label }}</span>
</q-th> </div>
</q-tr> </q-th>
</template> </q-tr>
<template v-slot:body="props"> </template>
<q-tr :props="props" class="cursor-pointer"> <template v-slot:body="props">
<q-td key="no" :props="props"> {{ props.rowIndex + 1 }}</q-td> <q-tr :props="props" class="cursor-pointer">
<q-td key="order" :props="props">{{ props.row.order }} </q-td> <q-td
<q-td v-for="col in props.cols"
key="citizenId" :key="col.name"
class="text-primary" :props="props"
@click="clickRedirect(props.row.id)" >
:props="props" <div v-if="col.name === 'no'">
>{{ props.row.citizenId }}</q-td {{ props.rowIndex + 1 }}
> </div>
<q-td <div
key="name" v-else-if="col.name === 'citizenId'"
class="text-primary" class="text-primary"
@click="clickRedirect(props.row.id)" @click="clickRedirect(props.row.id)"
:props="props" >
>{{ props.row.name }}</q-td {{ props.row.citizenId ?? "-" }}
> </div>
<div
<q-td key="posNo" :props="props">{{ props.row.posNo }}</q-td> v-else-if="col.name === 'name'"
<q-td key="position" :props="props">{{ class="text-primary"
props.row.position @click="clickRedirect(props.row.id)"
}}</q-td> >
<q-td key="date" :props="props">{{ props.row.date }}</q-td> {{ props.row.name ?? "-" }}
</q-tr> </div>
</template> <div v-else class="table_ellipsis2">
<template v-slot:pagination="scope"> {{ col.value ? col.value : "-" }}
<q-pagination </div>
v-model="pagination.page" </q-td>
color="primary" </q-tr>
:max="scope.pagesNumber" </template>
:max-pages="5" </d-table>
size="sm" </div>
boundary-links </q-form>
direction-links </q-card-section>
></q-pagination>
</template>
</q-table>
</div>
<!-- <q-card-actions align="right">
<q-btn flat label="OK" color="primary" v-close-popup />
</q-card-actions> -->
</q-card> </q-card>
</q-dialog> </q-dialog>
</template> </template>
<style scoped> <style scoped></style>
.custom-header-table {
max-height: 64vh;
.q-table tr:nth-child(odd) td {
background: white;
}
.q-table tr:nth-child(even) td {
background: #f8f8f8;
}
.q-table thead tr {
background: #ecebeb;
}
.q-table thead tr th {
position: sticky;
z-index: 1;
}
.q-table thead tr:last-child th {
top: 48px;
}
.q-table thead tr:first-child th {
top: 0;
}
}
</style>

View file

@ -661,7 +661,6 @@ onMounted(async () => {
outlined outlined
lazy-rules lazy-rules
hide-bottom-space hide-bottom-space
mask="###"
class="inputgreen" class="inputgreen"
v-model="resPerformForm.point1Total" v-model="resPerformForm.point1Total"
input-class="text-right " input-class="text-right "
@ -675,7 +674,6 @@ onMounted(async () => {
outlined outlined
lazy-rules lazy-rules
hide-bottom-space hide-bottom-space
mask="###"
class="inputgreen" class="inputgreen"
v-model="resPerformForm.point1" v-model="resPerformForm.point1"
input-class="text-right" input-class="text-right"
@ -691,7 +689,6 @@ onMounted(async () => {
outlined outlined
lazy-rules lazy-rules
hide-bottom-space hide-bottom-space
mask="###"
class="inputgreen" class="inputgreen"
v-model="resPerformForm.point2Total" v-model="resPerformForm.point2Total"
input-class="text-right" input-class="text-right"
@ -705,7 +702,6 @@ onMounted(async () => {
outlined outlined
lazy-rules lazy-rules
hide-bottom-space hide-bottom-space
mask="###"
class="inputgreen" class="inputgreen"
v-model="resPerformForm.point2" v-model="resPerformForm.point2"
input-class="text-right" input-class="text-right"
@ -721,7 +717,6 @@ onMounted(async () => {
outlined outlined
lazy-rules lazy-rules
hide-bottom-space hide-bottom-space
mask="###"
class="inputgreen" class="inputgreen"
v-model="resPerformForm.pointSumTotal" v-model="resPerformForm.pointSumTotal"
input-class="text-right" input-class="text-right"
@ -735,7 +730,6 @@ onMounted(async () => {
outlined outlined
lazy-rules lazy-rules
hide-bottom-space hide-bottom-space
mask="###"
v-model="resPerformForm.pointSum" v-model="resPerformForm.pointSum"
class="inputgreen" class="inputgreen"
input-class="text-right" input-class="text-right"

View file

@ -263,13 +263,19 @@ const visibleColumnsHistory = ref<String[]>([
async function getData() { async function getData() {
showLoader(); showLoader();
await http http
.get(config.API.registryNewByProfileId(profileId.value, empType.value)) .get(config.API.registryNewByProfileId(profileId.value, empType.value))
.then((res) => { .then(async (res) => {
informaData.value = res.data.result; informaData.value = await res.data.result;
if (informaData.value) { if (informaData.value) {
id.value = informaData.value.id; id.value = informaData.value.id;
age.value = calculateAge(informaData.value.birthDate);
if (informaData.value.birthDate) {
console.log("birthDate===>", informaData.value.birthDate);
age.value = calculateAge(informaData.value.birthDate);
console.log("age===>", age.value);
}
} }
}) })
.catch((e) => { .catch((e) => {
@ -309,6 +315,8 @@ async function editData() {
function onClickOpenDialog() { function onClickOpenDialog() {
if (!informaData.value) return; if (!informaData.value) return;
modal.value = true; modal.value = true;
console.log("onClickOpenDialog birthDate===>", informaData.value.birthDate);
id.value = informaData.value.id; id.value = informaData.value.id;
age.value = calculateAge(informaData.value.birthDate); age.value = calculateAge(informaData.value.birthDate);
formData.citizenId = informaData.value.citizenId; formData.citizenId = informaData.value.citizenId;
@ -375,6 +383,8 @@ function changeCardID(citizenId: string | number | null) {
watch( watch(
() => formData.birthDate, () => formData.birthDate,
(v) => { (v) => {
console.log("v===>", v);
if (v) { if (v) {
age.value = calculateAge(v); age.value = calculateAge(v);
} }
@ -383,21 +393,19 @@ watch(
onMounted(async () => { onMounted(async () => {
await getData(); await getData();
if (
store.Ops.prefixOps.length === 0 || if (store.Ops && store.Ops.prefixOps && store.Ops.prefixOps.length === 0) {
store.Ops.genderOps.length === 0 || fetchPerson();
store.Ops.bloodOps.length === 0 ||
store.Ops.statusOps.length === 0 ||
store.Ops.religionOps.length === 0
) {
await fetchPerson();
} }
// store.genderOp.length === 0 ? await getGender() : "";
// store.relationshipOp.length === 0 ? await getRelationship() : ""; // store.Ops.prefixOps.length === 0 ||
// store.religionOp.length === 0 ? await getReligion() : ""; // store.Ops.genderOps.length === 0 ||
// store.bloodGroupOp.length === 0 ? await getBloodGroup() : ""; // store.Ops.bloodOps.length === 0 ||
// store.Ops.statusOps.length === 0 ||
// store.Ops.religionOps.length === 0
}); });
</script> </script>
<template> <template>
<div class="row q-gutter-sm items-center"> <div class="row q-gutter-sm items-center">
<div class="toptitle col text-right q-gutter-x-sm"> <div class="toptitle col text-right q-gutter-x-sm">
@ -449,7 +457,7 @@ onMounted(async () => {
}} }}
</div> </div>
<div class="q-py-xs"> <div class="q-py-xs">
{{ date2Thai(informaData.birthDate) }} {{ informaData.birthDate ? date2Thai(informaData.birthDate) : "" }}
</div> </div>
<div class="q-py-xs"> <div class="q-py-xs">
{{ age ? age : "-" }} {{ age ? age : "-" }}
@ -621,9 +629,7 @@ onMounted(async () => {
hide-bottom-space hide-bottom-space
class="inputgreen" class="inputgreen"
:model-value=" :model-value="
formData.birthDate != null formData.birthDate ? date2Thai(formData.birthDate) : null
? date2Thai(formData.birthDate)
: null
" "
:label="dataLabel.birthDate" :label="dataLabel.birthDate"
:rules="[ :rules="[

View file

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive, onMounted } from "vue"; import { ref, reactive, onMounted, computed } from "vue";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
import http from "@/plugins/http"; import http from "@/plugins/http";
@ -37,7 +37,7 @@ const {
success, success,
} = useCounterMixin(); } = useCounterMixin();
const columns = ref<QTableProps["columns"]>([ const baseColumns = ref<QTableProps["columns"]>([
{ {
name: "date", name: "date",
align: "left", align: "left",
@ -51,7 +51,7 @@ const columns = ref<QTableProps["columns"]>([
{ {
name: "amount", name: "amount",
align: "left", align: "left",
label: "เงินเดือน", label: empType.value === "-employee" ? "ค่าตอบแทนรายเดือน" : "เงินเดือน",
sortable: true, sortable: true,
field: "amount", field: "amount",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
@ -127,6 +127,20 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px", style: "font-size: 14px",
}, },
]); ]);
const columns = computed(() => {
if (empType.value === "-employee") {
if (baseColumns.value) {
return baseColumns.value.filter(
(column) =>
column.name !== "positionSalaryAmount" &&
column.name !== "mouthSalaryAmount"
);
}
}
return baseColumns.value;
});
const visibleColumns = ref<string[]>([ const visibleColumns = ref<string[]>([
"date", "date",
"amount", "amount",

View file

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, watch } from "vue"; import { ref, watch, computed } from "vue";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
@ -29,7 +29,7 @@ const empType = ref<string>(
const modal = defineModel<boolean>("modal", { required: true }); const modal = defineModel<boolean>("modal", { required: true });
const salaryId = defineModel<string>("salaryId", { required: true }); const salaryId = defineModel<string>("salaryId", { required: true });
const columns = ref<QTableProps["columns"]>([ const baseColumns = ref<QTableProps["columns"]>([
{ {
name: "date", name: "date",
align: "left", align: "left",
@ -43,7 +43,7 @@ const columns = ref<QTableProps["columns"]>([
{ {
name: "amount", name: "amount",
align: "left", align: "left",
label: "เงินเดือน", label: empType.value === "-employee" ? "ค่าตอบแทนรายเดือน" : "เงินเดือน",
sortable: true, sortable: true,
field: "amount", field: "amount",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
@ -218,6 +218,19 @@ const visibleColumns = ref<string[]>([
"lastUpdateFullName", "lastUpdateFullName",
"lastUpdatedAt", "lastUpdatedAt",
]); ]);
const columns = computed(() => {
if (empType.value === "-employee") {
if (baseColumns.value) {
return baseColumns.value.filter(
(column) =>
column.name !== "positionSalaryAmount" &&
column.name !== "mouthSalaryAmount"
);
}
}
return baseColumns.value;
});
const rows = ref<any>([]); const rows = ref<any>([]);
const pagination = ref({ const pagination = ref({
page: 1, page: 1,

View file

@ -0,0 +1,23 @@
interface HistoryPos {
citizenId: string;
date: string | Date;
fullName: string;
id: string;
posNo: string;
position: string;
}
interface Position {
createdAt: string;
createdFullName: string;
createdUserId: string;
id: string;
isActive: boolean;
lastUpdateFullName: string;
lastUpdateUserId: "";
lastUpdatedAt: string;
name: string;
note: string;
}
export type { HistoryPos, Position };

View file

@ -1,27 +1,29 @@
import { ref } from "vue"; import { ref } from "vue";
import { defineStore } from "pinia"; import { defineStore } from "pinia";
export const useResultsPerformDataStore = defineStore("resultPerformDataStore", () => { export const useResultsPerformDataStore = defineStore(
"resultPerformDataStore",
() => {
function textRangePoint(val: number | undefined) {
if (val == undefined) val = -1;
if (val < 60.0) return "(คะแนนต่ำกว่าร้อยละ 60.00)";
if (val >= 60.0 && val <= 69.99) return "(คะแนนร้อยละ 60.00 - 69.99)";
if (val >= 70.0 && val <= 79.99) return "(คะแนนร้อยละ 70.00 - 79.99)";
if (val >= 80.0 && val <= 89.99) return " (คะแนนร้อยละ 80.00 - 89.99)";
if (val >= 90.0) return " (คะแนนร้อยละ 90.00 ขึ้นไป)";
else return "";
}
function textRangePoint(val: number | undefined) { function textPoint(val: number | undefined) {
if (val == undefined) val = -1; if (val == undefined) val = -1;
if (val >= 0 && val <= 60) return "(ต่ำกว่าร้อยละ 60)"; if (val < 60.0) return "ต้องปรับปรุง";
if (val >= 60 && val <= 69) return "(ร้อยละ 60 69)"; if (val >= 60.0 && val <= 69.99) return "พอใช้";
if (val >= 70 && val <= 79) return "(ร้อยละ 70 79)"; if (val >= 70.0 && val <= 79.99) return "ดี";
if (val >= 80 && val <= 89) return "(ร้อยละ 80 89)"; if (val >= 80.0 && val <= 89.99) return "ดีมาก";
if (val >= 90 && val <= 100) return "(ร้อยละ 90 - 100)"; if (val >= 90.0) return "ดีเด่น";
else return ""; else return "-";
} }
function textPoint(val: number | undefined) {
if (val == undefined) val = -1;
if (val >= 0 && val <= 60) return "ต้องปรับปรุง";
if (val >= 60 && val <= 69) return "พอใช้";
if (val >= 70 && val <= 79) return "ดี";
if (val >= 80 && val <= 89) return "ดีมาก";
if (val >= 90 && val <= 100) return "ดีเด่น";
else return "-";
}
return { textRangePoint, textPoint }; return { textRangePoint, textPoint };
}); }
);

View file

@ -6,7 +6,10 @@ import config from "@/app.config";
/** importType*/ /** importType*/
import type { DataOption } from "@/modules/04_registryNew/interface/index/Main"; import type { DataOption } from "@/modules/04_registryNew/interface/index/Main";
import type { DataPerson } from "@/modules/04_registryNew/interface/response/Main"; import type {
DataPerson,
DataType,
} from "@/modules/04_registryNew/interface/response/Main";
import type { FormFilter } from "@/modules/04_registryNew/interface/request/Main"; import type { FormFilter } from "@/modules/04_registryNew/interface/request/Main";
/** importComponents*/ /** importComponents*/
@ -43,10 +46,11 @@ const formFilter = reactive<FormFilter>({
posLevel: "", posLevel: "",
retireYear: "", retireYear: "",
rangeYear: { min: 0, max: 60 }, rangeYear: { min: 0, max: 60 },
isShowRetire: null, isShowRetire: false,
isProbation: null, isProbation: false,
}); });
const maxPage = ref<number>(1); const maxPage = ref<number>(1);
const total = ref<number>(0);
const dataPersonMain = ref<DataPerson[]>([]); const dataPersonMain = ref<DataPerson[]>([]);
@ -61,7 +65,9 @@ const conditionTotal = computed(() => {
return num; return num;
}); });
/** function เรียกข้อมูลตำแหน่งประเภท*/ /**
* function เรยกขอมลตำแหนงประเภท
*/
function fetchType() { function fetchType() {
http http
.get(config.API.orgPosType) .get(config.API.orgPosType)
@ -74,17 +80,20 @@ function fetchType() {
} }
/** function เรียกข้อมูลระดับ*/ /** function เรียกข้อมูลระดับ*/
function fetchLevel() { // function fetchLevel() {
http // http
.get(config.API.orgPosLevel) // .get(config.API.orgPosLevel)
.then((res) => { // .then((res) => {
store.fetchLevel(res.data.result); // store.fetchLevel(res.data.result);
}) // })
.catch((err) => { // .catch((err) => {
messageError($q, err); // messageError($q, err);
}); // });
} // }
/**
* function เรยกขอมลกลมงาน
*/
function fetchOptionGroup() { function fetchOptionGroup() {
http http
.get(config.API.orgEmployeeType) .get(config.API.orgEmployeeType)
@ -96,16 +105,16 @@ function fetchOptionGroup() {
}); });
} }
function fetchLevelGroup() { // function fetchLevelGroup() {
http // http
.get(config.API.orgEmployeelevel) // .get(config.API.orgEmployeelevel)
.then((res) => { // .then((res) => {
store.fetchLevel(res.data.result); // store.fetchLevel(res.data.result);
}) // })
.catch((err) => { // .catch((err) => {
messageError($q, err); // messageError($q, err);
}); // });
} // }
function fetchYearOption() { function fetchYearOption() {
if (store.yearOps.length === 0) { if (store.yearOps.length === 0) {
@ -121,16 +130,17 @@ function fetchYearOption() {
} }
} }
const total = ref<number>(0); /**
async function fetchDataPerson(search: boolean = false) { * function fetch รายชอขอมลทะเบยนประว
*/
function fetchDataPerson() {
showLoader(); showLoader();
let queryParams: any = { let queryParams: any = {
page: formFilter.page, page: formFilter.page,
pageSize: formFilter.pageSize, pageSize: formFilter.pageSize,
}; };
if (search) { if (formFilter.keyword) {
queryParams = Object.assign({}, queryParams, { queryParams = Object.assign({}, queryParams, {
searchField: searchType.value, searchField: searchType.value,
searchKeyword: formFilter.keyword, searchKeyword: formFilter.keyword,
@ -180,6 +190,10 @@ async function fetchDataPerson(search: boolean = false) {
}); });
} }
/**
* function fetch ปโปรไฟล
* @param items อมลคน
*/
function insertAvatar(items: DataPerson[]) { function insertAvatar(items: DataPerson[]) {
items.map((x: any, index: number) => { items.map((x: any, index: number) => {
if (x.avatarName != null) { if (x.avatarName != null) {
@ -208,29 +222,39 @@ function insertAvatar(items: DataPerson[]) {
}); });
} }
/**
* funciotn แสดงตวเลอกเพมเต
*/
function onClickShowFilter() { function onClickShowFilter() {
isShowFilter.value = !isShowFilter.value; isShowFilter.value = !isShowFilter.value;
isShowBtnFilter.value = false; isShowBtnFilter.value = false;
if (isShowFilter.value) { if (isShowFilter.value) {
fetchType(); fetchType();
fetchLevel(); // fetchLevel();
fetchYearOption(); fetchYearOption();
} }
} }
/**
* funciotn นหาขอม
*/
function onclickSearch() { function onclickSearch() {
isShowFilter.value = true; isShowFilter.value = true;
isShowBtnFilter.value = false; isShowBtnFilter.value = false;
formFilter.page = 1; formFilter.page = 1;
if (isShowFilter.value) { if (isShowFilter.value) {
fetchType(); fetchType();
fetchLevel(); // fetchLevel();
fetchYearOption(); fetchYearOption();
} }
formFilter.keyword = formFilter.keyword === null ? "" : formFilter.keyword; formFilter.keyword = formFilter.keyword === null ? "" : formFilter.keyword;
fetchDataPerson(true); fetchDataPerson();
} }
/**
* function เลอกประเภทขาราชการ
* @param item ประเภทขาราชการ
*/
function selectType(item: DataOption) { function selectType(item: DataOption) {
labelOption.type = item.name; labelOption.type = item.name;
empType.value = item.id; empType.value = item.id;
@ -242,30 +266,46 @@ function selectType(item: DataOption) {
formFilter.isShowRetire = null; formFilter.isShowRetire = null;
formFilter.isProbation = null; formFilter.isProbation = null;
fetchOptionGroup(); fetchOptionGroup();
fetchLevelGroup(); // fetchLevelGroup();
} else { } else {
fetchType(); fetchType();
fetchLevel(); // fetchLevel();
} }
fetchDataPerson(true); fetchDataPerson();
} }
/**
* function เลอกประเภทตำแหน
* @param item ประเภทตำแหน
*/
function selectPosType(item: DataOption) { function selectPosType(item: DataOption) {
const dataType = store.posTypeMain.find((e: DataType) => e.id === item.id);
store.fetchLevel(dataType?.posLevels);
labelOption.posType = item.name; labelOption.posType = item.name;
labelOption.posLevel = "ทั้งหมด";
formFilter.page = 1; formFilter.page = 1;
fetchDataPerson(); fetchDataPerson();
} }
/**
* function เลอกประเภทตำแหน
* @param item ประเภทระด
*/
function selectPosLevel(item: DataOption) { function selectPosLevel(item: DataOption) {
labelOption.posLevel = item.name; labelOption.posLevel = item.name;
formFilter.page = 1; formFilter.page = 1;
fetchDataPerson(); fetchDataPerson();
} }
/**
* function เคลวเลอก
* @param t ประเภทตวเลอก
*/
function clearSelect(t: string) { function clearSelect(t: string) {
if (t === "posType") { if (t === "posType") {
labelOption.posType = "ทั้งหมด"; labelOption.posType = "ทั้งหมด";
labelOption.posLevel = "ทั้งหมด";
} else if (t === "posLevel") { } else if (t === "posLevel") {
labelOption.posLevel = "ทั้งหมด"; labelOption.posLevel = "ทั้งหมด";
} else if (t === "retireYear") { } else if (t === "retireYear") {
@ -425,7 +465,6 @@ onMounted(async () => {
</q-btn-dropdown> </q-btn-dropdown>
<q-separator inset vertical class="lineFil" /> <q-separator inset vertical class="lineFil" />
<q-btn-dropdown <q-btn-dropdown
flat flat
dense dense
@ -433,6 +472,7 @@ onMounted(async () => {
label-color="white" label-color="white"
dropdown-icon="mdi-chevron-down" dropdown-icon="mdi-chevron-down"
class="q-px-sm" class="q-px-sm"
:disable="labelOption.posType === 'ทั้งหมด' ? true : false"
> >
<template v-slot:label> <template v-slot:label>
{{ {{

View file

@ -130,7 +130,7 @@ export default [
meta: { meta: {
Auth: true, Auth: true,
Key: [6.3], Key: [6.3],
Role: "placement", Role: "probation",
}, },
}, },
{ {
@ -140,7 +140,7 @@ export default [
meta: { meta: {
Auth: true, Auth: true,
Key: [6.3], Key: [6.3],
Role: "placement", Role: "probation",
}, },
}, },
{ {
@ -150,7 +150,7 @@ export default [
meta: { meta: {
Auth: true, Auth: true,
Key: [6.3], Key: [6.3],
Role: "placement", Role: "probation",
}, },
}, },
{ {
@ -160,7 +160,7 @@ export default [
meta: { meta: {
Auth: true, Auth: true,
Key: [6.3], Key: [6.3],
Role: "placement", Role: "probation",
}, },
}, },
{ {
@ -170,7 +170,7 @@ export default [
meta: { meta: {
Auth: true, Auth: true,
Key: [6.3], Key: [6.3],
Role: "placement", Role: "probation",
}, },
}, },
{ {
@ -180,7 +180,7 @@ export default [
meta: { meta: {
Auth: true, Auth: true,
Key: [6.3], Key: [6.3],
Role: "placement", Role: "probation",
}, },
}, },
{ {
@ -190,7 +190,7 @@ export default [
meta: { meta: {
Auth: true, Auth: true,
Key: [6.3], Key: [6.3],
Role: "placement", Role: "probation",
}, },
}, },
{ {
@ -200,7 +200,7 @@ export default [
meta: { meta: {
Auth: true, Auth: true,
Key: [6.3], Key: [6.3],
Role: "placement", Role: "probation",
}, },
}, },
{ {
@ -210,7 +210,7 @@ export default [
meta: { meta: {
Auth: true, Auth: true,
Key: [6.3], Key: [6.3],
Role: "placement", Role: "probation",
}, },
}, },
{ {
@ -220,7 +220,7 @@ export default [
meta: { meta: {
Auth: true, Auth: true,
Key: [6.3], Key: [6.3],
Role: "placement", Role: "probation",
}, },
}, },
{ {

View file

@ -107,8 +107,8 @@ const fecthlistprofile = async (id: string) => {
organization: e.root, organization: e.root,
position: e.position, position: e.position,
positionNumber: e.posNo, positionNumber: e.posNo,
positionType: e.positionType, positionType: e.posTypeName,
positionLevel: e.positionLevel, positionLevel: e.posLevelName,
// organizationAgency: e.organizationAgency, // organizationAgency: e.organizationAgency,
// organizationGovernmentAgency: e.organizationGovernmentAgency, // organizationGovernmentAgency: e.organizationGovernmentAgency,
// bureau: e.oc, // bureau: e.oc,

View file

@ -87,7 +87,7 @@ const fileDownload = async (type: string) => {
.then((res) => { .then((res) => {
downloadFile( downloadFile(
res, res,
`รายละเอียดบันทึกเวียนแจ้งการถึงแก่กรรม-${fullName}.${type}` `รายละเอียดบันทึกเวียนแจ้งการถึงแก่กรรม-${fullName.value}.${type}`
); );
}) })
.catch(async (e) => { .catch(async (e) => {

View file

@ -287,7 +287,7 @@ onMounted(async () => {
<q-th v-for="col in props.cols" :key="col.name" :props="props"> <q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span> <span class="text-weight-medium">{{ col.label }}</span>
</q-th> </q-th>
<!-- <q-th auto-width /> --> <q-th auto-width />
<q-th auto-width /> <q-th auto-width />
<q-th auto-width /> <q-th auto-width />
</q-tr> </q-tr>
@ -323,7 +323,7 @@ onMounted(async () => {
@click="clickEdit(props.row)" @click="clickEdit(props.row)"
/> />
</q-td> </q-td>
<!-- <q-td auto-width> <q-td auto-width>
<q-btn <q-btn
dense dense
size="12px" size="12px"
@ -335,7 +335,7 @@ onMounted(async () => {
> >
<q-tooltip>ไดบเครองราชฯ</q-tooltip> <q-tooltip>ไดบเครองราชฯ</q-tooltip>
</q-btn> </q-btn>
</q-td> --> </q-td>
<q-td auto-width v-if="props.row.period_doc !== null"> <q-td auto-width v-if="props.row.period_doc !== null">
<q-btn <q-btn
dense dense

View file

@ -1061,7 +1061,7 @@ onMounted(async () => {
{{ props.rowIndex + 1 }} {{ props.rowIndex + 1 }}
</q-td> </q-td>
<q-td key="citizenId" :props="props"> <q-td key="citizenId" :props="props">
{{ props.row.citizenId }} {{ props.row.citizenId ?? "-" }}
</q-td> </q-td>
<q-td key="name" :props="props"> <q-td key="name" :props="props">
{{ props.row.name }} {{ props.row.name }}

View file

@ -16,14 +16,17 @@ import DialogPopupReason from "@/components/Dialogs/PopupReason.vue"; //หม
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useInsigniaDataStore } from "@/modules/07_insignia/store"; import { useInsigniaDataStore } from "@/modules/07_insignia/store";
import { useroleUserDataStore } from "@/stores/roleUser"; import { useroleUserDataStore } from "@/stores/roleUser";
/**use sToer */
/**use */
const $q = useQuasar(); // noti quasar
const roleDataStore = useroleUserDataStore(); const roleDataStore = useroleUserDataStore();
const DataStore = useInsigniaDataStore(); const DataStore = useInsigniaDataStore();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { messageError, dialogConfirm, showLoader, hideLoader, success } = mixin; const { messageError, dialogConfirm, showLoader, hideLoader, success } = mixin;
const $q = useQuasar(); // noti quasar /**
* วแปร
*/
const loading = ref<boolean>(false); const loading = ref<boolean>(false);
const loadview = ref<boolean>(false); const loadview = ref<boolean>(false);
const hideBottom = ref<boolean>(false); const hideBottom = ref<boolean>(false);
@ -38,12 +41,19 @@ const stat = ref<any>({
orgNoSendCount: 0, orgNoSendCount: 0,
orgSendCount: 0, orgSendCount: 0,
}); });
const requestNote = ref<string>("");
const requestStatus = ref<string>("");
const requestId = ref<string>("");
const document = ref<string>("");
const fileUpload = ref<any>(null);
const modalPopupBackToEdit = ref<boolean>(false); //model const modalPopupBackToEdit = ref<boolean>(false); //model
const modalbackInsignia2Role = ref<boolean>(false);
/** function เรียกรอบการเสนอขอพระราชทานเครื่อง*/ /**
async function fecthlistRound() { * function เรยกรอบการเสนอขอพระราชทานเครอง
// showLoader(); */
await http function fecthlistRound() {
http
.get(config.API.listRoundInsignia()) .get(config.API.listRoundInsignia())
.then(async (res: any) => { .then(async (res: any) => {
optionRound.value = res.data.result.map((e: any) => ({ optionRound.value = res.data.result.map((e: any) => ({
@ -53,8 +63,6 @@ async function fecthlistRound() {
})); }));
// UI // UI
if (optionRound.value.length !== 0) { if (optionRound.value.length !== 0) {
loadview.value = true;
loading.value = true;
DataStore.optionRound = optionRound.value; DataStore.optionRound = optionRound.value;
const lastValue = optionRound.value[0]; const lastValue = optionRound.value[0];
if (DataStore.roundId) { if (DataStore.roundId) {
@ -72,13 +80,14 @@ async function fecthlistRound() {
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
hideLoader();
}); });
} }
/** function เรียกดู Stat ของรอบการเสนอขอพระราชทานเครื่อง*/ /**
const fecthStat = async (id: string) => { * function เรยกด Stat ของรอบการเสนอขอพระราชทานเครอง
await http */
function fecthStat(id: string) {
http
.get(config.API.insigniaDashboard(id)) .get(config.API.insigniaDashboard(id))
.then((res) => { .then((res) => {
stat.value = res.data.result; stat.value = res.data.result;
@ -86,24 +95,28 @@ const fecthStat = async (id: string) => {
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
}); });
}; }
/** funcion เช็คหน่วยงาน*/ /**
async function fecthAgency() { * funcion เชคหนวยงาน
await http */
function fecthAgency() {
http
.get(config.API.keycloakPosition()) .get(config.API.keycloakPosition())
.then(async (res) => { .then((res) => {
// loadview.value = true; loadview.value = true;
DataStore.agency = res.data.result.rootId; DataStore.agency = res.data.result.rootId;
DataStore.typeOc = DataStore.agency; DataStore.typeOc = DataStore.agency;
// loading.value = true; loading.value = true;
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
}) });
.finally(() => {});
} }
/**
* function fetch โครองสรางปจจ
*/
function fetchActiveId() { function fetchActiveId() {
http http
.get(config.API.activeOrganization) .get(config.API.activeOrganization)
@ -115,6 +128,11 @@ function fetchActiveId() {
messageError($q, err); messageError($q, err);
}); });
} }
/**
* function fetch อมลโครองสรางปจจ
* @param id โครงสรางปจจ
*/
function fetchListOrg(id: string) { function fetchListOrg(id: string) {
showLoader(); showLoader();
http http
@ -126,22 +144,22 @@ function fetchListOrg(id: string) {
})); }));
optiontypeOc.value = data; optiontypeOc.value = data;
DataStore.fetchOption(optiontypeOc.value); // DataStore DataStore.fetchOption(optiontypeOc.value); // DataStore
fecthAgency(); await fecthAgency();
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
})
.finally(() => {
hideLoader(); hideLoader();
}); });
} }
/**function เรียกประเภทเครื่องราช*/ /**
async function fecthInsignia() { * function เรยกประเภทเครองราช
await http */
function fecthInsignia() {
http
.get(config.API.insigniaOrg) .get(config.API.insigniaOrg)
.then((res) => { .then((res) => {
let data = res.data.result; const data = res.data.result;
DataStore.fetchInsigniaType(data); DataStore.fetchInsigniaType(data);
}) })
.catch((err) => { .catch((err) => {
@ -149,7 +167,9 @@ async function fecthInsignia() {
}); });
} }
/** function เลือกรอบการแสดง*/ /**
* function เปลยนรอบการแสดง
*/
async function changround() { async function changround() {
DataStore.roundId = round.value; DataStore.roundId = round.value;
fecthStat(round.value); // Stat fecthStat(round.value); // Stat
@ -165,10 +185,6 @@ async function changround() {
roundFilter.year + 543 roundFilter.year + 543
}`; }`;
} }
const requestNote = ref<string>("");
const requestStatus = ref<string>("");
const requestId = ref<string>("");
const document = ref<string>("");
/** /**
* function เรยกขอมลรายชอขาราชการสามญฯ ทธนขอพระราชทานเครองราชอสรยาภรณ ตามรอบการเสนอขอ * function เรยกขอมลรายชอขาราชการสามญฯ ทธนขอพระราชทานเครองราชอสรยาภรณ ตามรอบการเสนอขอ
@ -177,7 +193,7 @@ const document = ref<string>("");
* @param role ประเภท officer,employee * @param role ประเภท officer,employee
* @param status สถานะ * @param status สถานะ
*/ */
async function fecthInsigniaByOc( function fecthInsigniaByOc(
roundId: string, roundId: string,
ocId: string, ocId: string,
role: string, role: string,
@ -185,7 +201,7 @@ async function fecthInsigniaByOc(
) { ) {
if (roundId && ocId && role && status) { if (roundId && ocId && role && status) {
showLoader(); showLoader();
await http http
.get(config.API.insigniaList(roundId, ocId, role, status)) .get(config.API.insigniaList(roundId, ocId, role, status))
.then(async (res) => { .then(async (res) => {
requestNote.value = res.data.result.requestNote; requestNote.value = res.data.result.requestNote;
@ -194,7 +210,7 @@ async function fecthInsigniaByOc(
document.value = res.data.result.document; document.value = res.data.result.document;
await DataStore.fetchData(res.data.result.items); // await DataStore.fetchData(res.data.result.items); //
await DataStore.fetchDataInsignia(res.data.result); // await DataStore.fetchDataInsignia(res.data.result); //
// loading.value = true; loading.value = true;
// //
if (res.data.result.items !== null) { if (res.data.result.items !== null) {
if (res.data.result.items.length !== 0) { if (res.data.result.items.length !== 0) {
@ -203,7 +219,7 @@ async function fecthInsigniaByOc(
} }
}) })
.catch((err) => { .catch((err) => {
// messageError($q, err); messageError($q, err);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -211,11 +227,13 @@ async function fecthInsigniaByOc(
} }
} }
/**function ยืนยันการส่งรอบการเสนอขอต่อ เฉพาะ รอบที่ requestStatus st1 และ st4 */ /**
async function sendToDirector() { * function นยนการสงรอบการเสนอขอต เฉพาะ รอบท requestStatus st1 และ st4
dialogConfirm($q, async () => { */
function sendToDirector() {
dialogConfirm($q, () => {
showLoader(); showLoader();
await http http
.get(config.API.insigniaSendToDirector(round.value, DataStore.agency)) .get(config.API.insigniaSendToDirector(round.value, DataStore.agency))
.then(async () => { .then(async () => {
await fecthStat(round.value); await fecthStat(round.value);
@ -229,34 +247,35 @@ async function sendToDirector() {
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
})
.finally(() => {
hideLoader(); hideLoader();
}); });
}); });
} }
/** function open popup แก้ไข*/ /**
async function popupBackToEdit() { * function open popup แกไข*
*/
function popupBackToEdit() {
modalPopupBackToEdit.value = true; modalPopupBackToEdit.value = true;
} }
const modalbackInsignia2Role = ref<boolean>(false); /**
/**function open popup ตีกลับ admin*/ * function open popup กล admin
const popupBackToInsignia2Role = async () => { */
function popupBackToInsignia2Role() {
modalbackInsignia2Role.value = true; modalbackInsignia2Role.value = true;
}; }
/** /**
* funtion นยนการ กลบรอบการเสนอขอ เฉพาะ รอบท requestStatus st3 และ insignia2Role * funtion นยนการ กลบรอบการเสนอขอ เฉพาะ รอบท requestStatus st3 และ insignia2Role
* @param reason หมายเหตการตกล * @param reason หมายเหตการตกล
*/ */
async function backToEdit(reason: string) { function backToEdit(reason: string) {
dialogConfirm( dialogConfirm(
$q, $q,
async () => { () => {
showLoader(); showLoader();
await http http
.put( .put(
config.API.insigniaDirectorBackToEdit(round.value, DataStore.agency), config.API.insigniaDirectorBackToEdit(round.value, DataStore.agency),
{ {
@ -283,13 +302,15 @@ async function backToEdit(reason: string) {
); );
} }
/**function ยืนยันการอนุมัติรอบการเสนอขอ เฉพาะ รอบที่ requestStatus st3 และ insignia2Role */ /**
async function directorApproved() { * function นยนการอนรอบการเสนอขอ เฉพาะ รอบท requestStatus st3 และ insignia2Role
*/
function directorApproved() {
dialogConfirm( dialogConfirm(
$q, $q,
async () => { () => {
showLoader(); showLoader();
await http http
.get(config.API.insigniaDirectorApproved(round.value, DataStore.agency)) .get(config.API.insigniaDirectorApproved(round.value, DataStore.agency))
.then(async () => { .then(async () => {
await fecthInsigniaByOc( await fecthInsigniaByOc(
@ -315,9 +336,9 @@ async function directorApproved() {
* function นยนการตกลบรอบการเสนอขอ เฉพาะ รอบท requestStatus st5 และ adminRole * function นยนการตกลบรอบการเสนอขอ เฉพาะ รอบท requestStatus st5 และ adminRole
* @param reason หมายเหตการตกล * @param reason หมายเหตการตกล
*/ */
async function backToEditinsignia2Role(reason: string) { function backToEditinsignia2Role(reason: string) {
dialogConfirm($q, async () => { dialogConfirm($q, () => {
await http http
.put(config.API.rejectRequest(round.value, DataStore.typeOc), { .put(config.API.rejectRequest(round.value, DataStore.typeOc), {
reason: reason, reason: reason,
}) })
@ -337,11 +358,13 @@ async function backToEditinsignia2Role(reason: string) {
}); });
} }
/**function ยืนยันการล็อกข้อมูล*/ /**
async function requestSendNote() { * function นยนการลอกขอม
dialogConfirm($q, async () => { */
function requestSendNote() {
dialogConfirm($q, () => {
showLoader(); showLoader();
await http http
.post(config.API.insigniaRequestSendNote(round.value), { .post(config.API.insigniaRequestSendNote(round.value), {
name: roundName.value, name: roundName.value,
}) })
@ -362,7 +385,6 @@ async function requestSendNote() {
}); });
} }
const fileUpload = ref<any>(null);
/** /**
* function ปโหลดไฟลเจาหนาท * function ปโหลดไฟลเจาหนาท
* @param event file * @param event file
@ -392,12 +414,14 @@ async function uploadFile(event: any) {
}); });
} }
/** hook*/ /**
* hook
*/
onMounted(async () => { onMounted(async () => {
tab.value = DataStore.mainTab; tab.value = DataStore.mainTab;
await fecthlistRound();
await fetchActiveId();
DataStore.dataInsigniaType.length === 0 && (await fecthInsignia()); DataStore.dataInsigniaType.length === 0 && (await fecthInsignia());
fecthlistRound();
fetchActiveId();
}); });
</script> </script>

View file

@ -4,14 +4,23 @@ import { QForm, useQuasar } from "quasar";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
/** import Type*/ /**
* import Type
*/
import type { DataOption } from "@/modules/04_registry/components/profileType"; import type { DataOption } from "@/modules/04_registry/components/profileType";
import DialogHeader from "@/components/DialogHeader.vue"; import DialogHeader from "@/components/DialogHeader.vue";
/** import Stores */ /**
* import Stores
*/
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useResultDataStore } from "@/modules/07_insignia/storeResult"; import { useResultDataStore } from "@/modules/07_insignia/storeResult";
/** useStore*/
/**
* use
*/
const $q = useQuasar();
const myForm = ref<QForm>();
const DataStore = useResultDataStore(); const DataStore = useResultDataStore();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { const {
@ -24,53 +33,9 @@ const {
notifyError, notifyError,
} = mixin; } = mixin;
const $q = useQuasar(); /**
const myForm = ref<QForm>(); * Props
*/
const status = ref<string>("");
const Advertise = ref<string>("");
const issue = ref<string>("");
const brand = ref<string>("");
const cardid = ref<string>("");
const fullName = ref<string>("");
const volume = ref<string>("");
const episode = ref<string>("");
const duty = ref<string>("");
const announced = ref<string>("");
const position = ref<string>("");
const payment = ref<string>("");
const addressPayment = ref<string | null>(null);
const affiliationRequest = ref<string>("");
const affiliationReceived = ref<string>("");
const receivedate = ref<Date | null>();
const announceDate = ref<Date | null>();
const invoiceDate = ref<Date | null>(null);
const filterinsigniaOp2 = ref<any>(DataStore.insigniaOp2);
const employeeClass = ref<string>("");
const employeeClassOps = ref<DataOption[]>([
{ id: "officer", name: "ข้าราชการ กทม.สามัญ" },
{ id: "employee", name: "ลูกจ้างประจำ" },
]);
const listPerson = ref<any>([]);
const paymentOp = [
{ label: "จัดส่งทางไปรษณีย์", value: "จัดส่งทางไปรษณีย์" },
{ label: "มารับด้วยตัวเอง", value: "มารับด้วยตัวเอง" },
];
function clearAnnounceExam() {
announceDate.value = null;
}
/** function reset วันที่ได้รับพระราชทานเครื่องราชอิสริยาภรณ์*/
function clearDateReceivedate() {
receivedate.value = null;
}
/** function reset วันที่จ่ายใบกำกับ*/
function clearDateInvoiceDate() {
invoiceDate.value = null;
}
const props = defineProps({ const props = defineProps({
modal: Boolean, modal: Boolean,
save: { save: {
@ -91,11 +56,58 @@ const props = defineProps({
profileType: { profileType: {
type: String, type: String,
}, },
fecthlistInsignia: { type: Function, required: true },
}); });
/** callback function จำทำงานเมื่อ props.modal = true เปิด popup เพิ่มรายชื่อบันทึกผล*/ /**
* วแปร
*/
const status = ref<string>("");
const Advertise = ref<string>("");
const issue = ref<string>("");
const brand = ref<string>("");
const cardid = ref<string>("");
const fullName = ref<string>("");
const volume = ref<string>("");
const episode = ref<string>("");
const duty = ref<string>("");
const announced = ref<string>("");
const position = ref<string>("");
const payment = ref<string>("");
const addressPayment = ref<string | null>(null);
const affiliationRequest = ref<string>("");
const affiliationReceived = ref<string>("");
const receivedate = ref<Date | null>();
const announceDate = ref<Date | null>();
const invoiceDate = ref<Date | null>(null);
const filterinsigniaOp2 = ref<any[]>([]);
const employeeClass = ref<string>("");
const employeeClassOps = ref<DataOption[]>([
{ id: "officer", name: "ข้าราชการ กทม.สามัญ" },
{ id: "employee", name: "ลูกจ้างประจำ" },
]);
const paymentOp = [
{ label: "จัดส่งทางไปรษณีย์", value: "จัดส่งทางไปรษณีย์" },
{ label: "มารับด้วยตัวเอง", value: "มารับด้วยตัวเอง" },
];
const formFilter = reactive({
page: 1,
pageSize: 10,
searchField: "citizenId",
searchKeyword: "",
});
/** function reset วันที่จ่ายใบกำกับ*/
function clearDateInvoiceDate() {
invoiceDate.value = null;
}
/**
* callback function จำทำงานเม props.modal = true เป popup เพมรายชอบนทกผล
*/
watch(props, () => { watch(props, () => {
if (props.modal === true) { if (props.modal === true) {
filterinsigniaOp2.value = DataStore.insigniaOp2;
employeeClass.value = ""; employeeClass.value = "";
cardid.value = ""; cardid.value = "";
fullName.value = ""; fullName.value = "";
@ -120,20 +132,23 @@ watch(props, () => {
} }
} else { } else {
status.value = ""; status.value = "";
selectType();
} }
}); });
/** disbleStatus */ /**
* disbleStatus
*/
const disbleStatus = computed(() => { const disbleStatus = computed(() => {
if (employeeClass.value !== "") { if (employeeClass.value !== "") {
return false; return false;
} else return true; } else return true;
}); });
//
/** function เลือกประเภทลูกจ้าง */ /**
async function selectType() { * function เลอกประเภทลกจาง
// showLoader(); */
function selectType() {
cardid.value = ""; cardid.value = "";
fullName.value = ""; fullName.value = "";
position.value = ""; position.value = "";
@ -150,36 +165,13 @@ async function selectType() {
announced.value = ""; announced.value = "";
invoiceDate.value = null; invoiceDate.value = null;
payment.value = ""; payment.value = "";
// await fecthlistPerson();
} }
/** function เรียกหน่วยงาน*/
// async function fecthlistPerson() {
// await http
// .get(config.API.profileOrganizRoot)
// .then((res) => {
// const id = res.data.result[0].id;
// if (id !== "") {
// findlist(id); // id
// }
// })
// .catch((e) => {
// messageError($q, e);
// });
// }
const formFilter = reactive({
page: 1,
pageSize: 10,
searchField: "citizenId",
searchKeyword: "",
});
/** /**
* function เรยกรายชอลกจางตาม id หนวยงาน * function เรยกรายชอลกจางตาม id หนวยงาน
* @param id id หนวยงาน * @param id id หนวยงาน
*/ */
async function findlist(id: string = "", idCard: string) { function findlist(id: string = "", idCard: string) {
formFilter.searchKeyword = idCard; formFilter.searchKeyword = idCard;
http http
.get( .get(
@ -207,43 +199,18 @@ async function findlist(id: string = "", idCard: string) {
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
}); });
// let data = [{}];
// //
// if (employeeClass.value === "officer") {
// data = [{ criteriaType: "is_retire", criteriaValue: "false" }];
// //
// } else if (employeeClass.value === "employee") {
// data = [
// { criteriaType: "is_retire", criteriaValue: "false" },
// { criteriaType: "employee_class", criteriaValue: "perm" },
// ];
// }
// await http
// .post(config.API.profileSearchNewOcIdType(id, employeeClass.value), {
// criterias: data,
// })
// .then((res) => {
// listPerson.value = res.data.result;
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(() => {
// hideLoader();
// });
} }
/** /**
* function เรยกขอมลบนทกผลตาม id * function เรยกขอมลบนทกผลตาม id
* @param id * @param id personId
*/ */
async function fectDataByid(id: string) { function fectDataByid(id: string) {
showLoader(); showLoader();
if (props.profileType !== undefined) { if (props.profileType !== undefined) {
// employeeClass.value = props.profileType.toString();
employeeClass.value = "officer"; employeeClass.value = "officer";
} }
await http http
.get(config.API.noteByid(id)) .get(config.API.noteByid(id))
.then((res) => { .then((res) => {
let data = res.data.result; let data = res.data.result;
@ -275,7 +242,7 @@ async function fectDataByid(id: string) {
} }
/** function บักทึกผล*/ /** function บักทึกผล*/
async function onSubmit() { function onSubmit() {
dialogConfirm($q, () => { dialogConfirm($q, () => {
if (props.roundId !== undefined) { if (props.roundId !== undefined) {
showLoader(); showLoader();
@ -299,9 +266,9 @@ async function onSubmit() {
http http
.put(config.API.noteAdd(props.roundId), body) .put(config.API.noteAdd(props.roundId), body)
.then(async () => { .then(async () => {
await props.fecthlistInsignia?.();
await props.close?.(); await props.close?.();
await success($q, "บันทึกข้อมูลสำเร็จ"); await success($q, "บันทึกข้อมูลสำเร็จ");
await showLoader();
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
@ -311,7 +278,9 @@ async function onSubmit() {
}); });
} }
/** function หาเลขประจำตัวประชาชน*/ /**
* function หาเลขประจำตวประชาชน
*/
function searchcardid() { function searchcardid() {
if (cardid.value.length === 13) { if (cardid.value.length === 13) {
findlist("", cardid.value); findlist("", cardid.value);

View file

@ -7,8 +7,14 @@ import config from "@/app.config";
/** import Type*/ /** import Type*/
import type { DataOption } from "@/modules/04_registry/components/profileType"; import type { DataOption } from "@/modules/04_registry/components/profileType";
/**
* import Components
*/
import DialogHeader from "../DialogHeader.vue";
/** import Stores */ /** import Stores */
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
/** useStore*/ /** useStore*/
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { const {
@ -48,11 +54,6 @@ const props = defineProps({
dataModal: Object, dataModal: Object,
}); });
/** function reset วันที่ประกาศราชกิจจานุเบกษา*/
function clearReceiveDate() {
Datereceive.value = null;
}
/** function clearDate */ /** function clearDate */
function clearReturnDate() { function clearReturnDate() {
Datereturn.value = null; Datereturn.value = null;
@ -74,7 +75,7 @@ function close() {
* @param type receive,return * @param type receive,return
* @param id personId * @param id personId
*/ */
async function onSubmit(type: string, id: string) { function onSubmit(type: string, id: string) {
dialogConfirm($q, () => { dialogConfirm($q, () => {
const formData = new FormData(); const formData = new FormData();
if (props.dateCheckReceive === null) { if (props.dateCheckReceive === null) {
@ -117,7 +118,7 @@ watch(
); );
/** function เรียกหน่วยงาน*/ /** function เรียกหน่วยงาน*/
async function fetchOrgList() { function fetchOrgList() {
showLoader(); showLoader();
http http
.get(config.API.activeOrganization) .get(config.API.activeOrganization)
@ -144,30 +145,6 @@ async function fetchOrgList() {
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
}); });
// showLoader();
// await http
// .get(config.API.insigniaOrg)
// .then(async (response: any) => {
// const orgArr = response.data.result.map((e: any) => ({
// id: e.id,
// name: e.name + `(${e.shortName})`,
// }));
// OrgList.value = orgArr;
// OrgList2.value = orgArr;
// // [
// // {
// // id: "00000000-0000-0000-0000-000000000000",
// // name: "",
// // },
// // ...orgArr,
// // ];
// })
// .catch((err) => {
// messageError($q, err);
// })
// .finally(() => {
// hideLoader();
// });
} }
/** callback function จำทำงานเมื่อ props มีการเปลี่ยนแปลง*/ /** callback function จำทำงานเมื่อ props มีการเปลี่ยนแปลง*/
@ -203,19 +180,8 @@ watch(props, () => {
) )
" "
> >
<q-toolbar> <DialogHeader :tittle="'รับ-คืนเครื่องราชฯ'" :close="close" />
<q-toolbar-title class="text-subtitle2 text-bold"
>-นเครองราชฯ</q-toolbar-title
>
<q-btn
icon="close"
unelevated
round
dense
@click="close"
style="color: #ff8080; background-color: #ffdede"
/>
</q-toolbar>
<q-separator /> <q-separator />
<q-card-section> <q-card-section>
<div class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs"> <div class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs">

View file

@ -39,7 +39,7 @@ const returndate = ref<Date | null>();
const reason = ref<string>(""); const reason = ref<string>("");
const listPerson = ref<any>([]); const listPerson = ref<any>([]);
const OrgList = ref<DataOption[]>([]); const OrgList = ref<DataOption[]>([]);
const filterOrgList = ref<any>([]); const filterOrgList = ref<DataOption[]>([]);
const insigniaNoteProfileId = ref<string>(""); const insigniaNoteProfileId = ref<string>("");
const filterSelectRound = ref<any>(); const filterSelectRound = ref<any>();
const selectRound = ref<any>(); const selectRound = ref<any>();
@ -124,25 +124,32 @@ async function fecthlistInsignia() {
} }
/** function ดึงข้อมูลรายการหน่วยงาน */ /** function ดึงข้อมูลรายการหน่วยงาน */
// async function fetchOrgList() {
// showLoader(); /** funcion เรียกข้อมูลหน่วยงานจัดสรรเครื่องราชอิสริยาภรณ์ */
// await http async function fetchOrgList() {
// .get(config.API.typeOc()) http
// .then(async (response: any) => { .get(config.API.activeOrganization)
// const orgArr = response.data.result.map((e: any) => ({ .then((res) => {
// id: e.organizationId, const data = res.data.result;
// name: e.organizationName,
// })); http
// OrgList.value = orgArr; .get(config.API.orgByid(data.activeId))
// filterOrgList.value = OrgList.value; .then(async (res) => {
// }) const data = await res.data.result.map((item: any) => ({
// .catch((err) => { id: item.orgTreeId,
// messageError($q, err); name: item.orgName,
// }) }));
// .finally(() => { OrgList.value = data;
// hideLoader(); filterOrgList.value = data;
// }); })
// } .catch((err) => {
messageError($q, err);
});
})
.catch((err) => {
messageError($q, err);
});
}
// - // -
// const fetchData = async () => { // const fetchData = async () => {
@ -172,7 +179,6 @@ async function onSubmit() {
.then(async () => { .then(async () => {
await props.closeAndFecth(); await props.closeAndFecth();
await clearData(); await clearData();
// await hideLoader();
await success($q, "บันทึกข้อมูลสำเร็จ"); await success($q, "บันทึกข้อมูลสำเร็จ");
}) })
.catch((err) => { .catch((err) => {
@ -189,7 +195,6 @@ async function onSubmit() {
.then(async () => { .then(async () => {
await props.closeAndFecth(); await props.closeAndFecth();
await clearData(); await clearData();
// await hideLoader();
await success($q, "บันทึกข้อมูลสำเร็จ"); await success($q, "บันทึกข้อมูลสำเร็จ");
}) })
.catch((err) => { .catch((err) => {
@ -215,7 +220,6 @@ async function searchcardid() {
?.shortName || "" ?.shortName || ""
})`; })`;
insigniaNoteProfileId.value = node.id; insigniaNoteProfileId.value = node.id;
insigniaNoteProfileId.value = node.id;
hideLoader(); hideLoader();
} else { } else {
notifyError($q, "ไม่พบข้อมูลการได้รับในรอบนี้"); notifyError($q, "ไม่พบข้อมูลการได้รับในรอบนี้");
@ -229,7 +233,6 @@ async function searchcardid() {
fullName.value = ""; fullName.value = "";
brand.value = ""; brand.value = "";
receivedate.value = null; receivedate.value = null;
// OrganazationId.value = "";
} }
} }
@ -281,11 +284,13 @@ onMounted(() => {
/** function callback เช็ค props ถ้าเปิด dialog ให้ดึงรายการข้อมูล */ /** function callback เช็ค props ถ้าเปิด dialog ให้ดึงรายการข้อมูล */
watch(props, () => { watch(props, () => {
// type.value = props.type;
if (props.modal == true && props.roundId != "all") { if (props.modal == true && props.roundId != "all") {
roundNo.value = props.roundId; roundNo.value = props.roundId;
fecthlistInsignia(); if (props.action === "editData") {
// fetchOrgList(); // fetchOrgList();
} else {
fecthlistInsignia();
}
} }
}); });
</script> </script>
@ -485,26 +490,26 @@ watch(props, () => {
</div> </div>
<!-- <div class="col-xs-12 col-sm-6"> <!-- <div class="col-xs-12 col-sm-6">
<q-select <q-select
hide-bottom-space hide-bottom-space
:options="filterOrgList" :options="filterOrgList"
dense dense
lazy-rules lazy-rules
borderless borderless
option-label="name" option-label="name"
option-value="id" option-value="id"
emit-value emit-value
map-options map-options
outlined outlined
use-input use-input
v-model="OrganazationId" v-model="OrganazationId"
:label="`เลือกหน่วยงานที่ส่งคืน`" :label="`เลือกหน่วยงานที่ส่งคืน`"
:rules="[(val) => !!val || 'กรุณาเลือกหน่วยงานที่คืน']" :rules="[(val) => !!val || 'กรุณาเลือกหน่วยงานที่คืน']"
@filter="(inputValue:any, @filter="(inputValue:any,
doneFn:Function) => filterSelector(inputValue, doneFn,'filterOrgList' doneFn:Function) => filterSelector(inputValue, doneFn,'filterOrgList'
) " ) "
/> />
</div> --> </div> -->
<div class="col-12"> <div class="col-12">
<q-input <q-input

View file

@ -79,13 +79,15 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
position: e.position, position: e.position,
status: status(e.status), status: status(e.status),
dateReceive: date2Thai(e.dateReceive), dateReceive: date2Thai(e.dateReceive),
name: e.prefix + e.fullName, name: e.fullName,
type: `${e.requestInsignia} (${ type: `${e.requestInsignia} (${
type.value.find((item) => item.name === e.requestInsignia)?.shortName || type.value.find((item) => item.name === e.requestInsignia)?.shortName ||
"" ""
})`, })`,
employeeType: profileType(e.profileType), employeeType: profileType(
profileType: e.profileType, e.profileType === "" ? "officer" : e.profileType
),
profileType: e.profileType === "" ? "officer" : e.profileType,
date: date2Thai(e.date), date: date2Thai(e.date),
volumeNo: e.volumeNo, volumeNo: e.volumeNo,
section: e.section, section: e.section,

View file

@ -4,19 +4,30 @@ import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
/** import Type*/ /**
* import Typฃ
*/
import type { OptionData } from "@/modules/07_insignia/interface/index/Main"; import type { OptionData } from "@/modules/07_insignia/interface/index/Main";
import type { QTableProps, QInput } from "quasar"; import type { QTableProps, QInput } from "quasar";
/** import Components*/ /**
* import Components
*/
import DialogHeader from "@/components/DialogHeader.vue";
import Dialogbody from "@/modules/07_insignia/components/3_result/Dialogbody.vue"; import Dialogbody from "@/modules/07_insignia/components/3_result/Dialogbody.vue";
import DialogForm from "@/modules/07_insignia/components/3_result/DialogForm.vue"; import DialogForm from "@/modules/07_insignia/components/3_result/DialogForm.vue";
import fileUploadview from "../components/3_result/fileUpload.vue"; import fileUploadview from "../components/3_result/fileUpload.vue";
/** import Stores */ /**
* import Stores
*/
import { useResultDataStore } from "@/modules/07_insignia/storeResult"; import { useResultDataStore } from "@/modules/07_insignia/storeResult";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
/** useStore*/
/**
* use
*/
const $q = useQuasar();
const DataStore = useResultDataStore(); const DataStore = useResultDataStore();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { const {
@ -28,8 +39,9 @@ const {
success, success,
} = mixin; } = mixin;
const $q = useQuasar(); /**
* วแปร
*/
const tab = ref<string>(""); const tab = ref<string>("");
const selectRound = ref<string>(""); const selectRound = ref<string>("");
const selectRoundOption = ref<OptionData[]>([]); const selectRoundOption = ref<OptionData[]>([]);
@ -51,7 +63,9 @@ const dateCheckReceive = ref<any>();
const dateCheckReturn = ref<any>(); const dateCheckReturn = ref<any>();
const dataModal = ref<any>([]); const dataModal = ref<any>([]);
/** ข้อมูล Tabla*/ /**
* อม Tabla
*/
const columns = ref<QTableProps["columns"]>([ const columns = ref<QTableProps["columns"]>([
{ {
name: "no", name: "no",
@ -222,14 +236,15 @@ const visibleColumns = ref<String[]>([
"address", "address",
"action", "action",
]); ]);
const filterRef = ref<QInput>(); const filterRef = ref<QInput>();
const filter = ref<string>(""); const filter = ref<string>("");
/** function เรียกรอบการเสนอขอพระราชทานเครื่องราช*/ /**
async function fecthRound() { *function เรยกรอบการเสนอขอพระราชทานเครองราช
*/
function fecthRound() {
showLoader(); showLoader();
await http http
.get(config.API.noteround()) .get(config.API.noteround())
.then(async (res) => { .then(async (res) => {
let data = res.data.result; let data = res.data.result;
@ -252,9 +267,11 @@ async function fecthRound() {
}); });
} }
/** function เรียกประเภทเครื่องราช*/ /**
async function fecthInsignia() { * function เรยกประเภทเครองราช
await http */
function fecthInsignia() {
http
.get(config.API.insigniaOrg) .get(config.API.insigniaOrg)
.then((res) => { .then((res) => {
let data = res.data.result; let data = res.data.result;
@ -265,9 +282,11 @@ async function fecthInsignia() {
}); });
} }
/** function เรียกระดับเครื่องราช*/ /**
async function fecthInsigniaType() { * function เรยกระดบเครองราช
await http(config.API.insigniaTypeOrg) */
function fecthInsigniaType() {
http(config.API.insigniaTypeOrg)
.then((res) => { .then((res) => {
let data = res.data.result; let data = res.data.result;
DataStore.fetchDatainsigniaType(data); DataStore.fetchDatainsigniaType(data);
@ -279,7 +298,9 @@ async function fecthInsigniaType() {
}); });
} }
/** function เลือกประเภทเครื่องราช*/ /**
* function เลอกประเภทเครองราช
*/
function selectorInsignia() { function selectorInsignia() {
fecthlistInsignia(); fecthlistInsignia();
} }
@ -295,7 +316,9 @@ function selectorRound(round: string) {
fecthlistInsignia(); fecthlistInsignia();
} }
/** callback function จำทำงานเมื่อ tab มีการเปลี่ยนแปลง*/ /**
* callback function จำทำงานเม tab การเปลยนแปลง
*/
watch(tab, () => { watch(tab, () => {
if (tab.value !== "doc") { if (tab.value !== "doc") {
DataStore.insignia = ""; DataStore.insignia = "";
@ -308,22 +331,26 @@ watch(tab, () => {
} }
}); });
/** callback function จำทำงานเมื่อ modal มีการเปลี่ยนแปลง*/ /**
watch(modal, () => { * callback function จำทำงานเม modal การเปลยนแปลง
if (modal.value == false) { */
fecthlistInsignia(); // watch(modal, () => {
} // if (modal.value == false) {
}); // fecthlistInsignia();
// }
// });
/** function เรียกรายชื่อบันทึกผลการได้รับพระราชทานเครื่องราชอิสริยาภรณ์/การจ่ายใบกำกับ */ /**
async function fecthlistInsignia() { * function เรยกรายชอบนทกผลการไดบพระราชทานเครองราชอสรยาภรณ/การจายใบกำก
*/
function fecthlistInsignia() {
showLoader(); showLoader();
let data = { let data = {
insigniaTypeId: tab.value, insigniaTypeId: tab.value,
insigniaNoteId: selectRound.value, insigniaNoteId: selectRound.value,
insigniaId: DataStore.insignia, insigniaId: DataStore.insignia,
}; };
await http http
.post(config.API.noteSearch(), data) .post(config.API.noteSearch(), data)
.then((res) => { .then((res) => {
let data = res.data.result; let data = res.data.result;
@ -342,21 +369,16 @@ async function fecthlistInsignia() {
* @param event file * @param event file
* @param action typepreview * @param action typepreview
*/ */
async function uploadFile(event: any, action: string) { function uploadFile(event: any, action: string) {
if (selectRound.value !== undefined) { if (selectRound.value !== undefined) {
let id = selectRound.value; let id = selectRound.value;
dialogConfirm($q, async () => { dialogConfirm($q, () => {
showLoader();
const formdata = new FormData(); const formdata = new FormData();
formdata.append("file", event); formdata.append("file", event);
await http http
.put(config.API.uploadfileInsignia(action, id), formdata) .put(config.API.uploadfileInsignia(action, id), formdata)
.then(() => { .then(async () => {
success($q, "อัพโหลดไฟล์สำเร็จ");
})
.catch((err) => {
messageError($q, err);
})
.finally(async () => {
await fecthlistInsignia(); await fecthlistInsignia();
if (action === "receice") { if (action === "receice") {
fileResult.value = null; fileResult.value = null;
@ -364,7 +386,12 @@ async function uploadFile(event: any, action: string) {
fileinvoice.value = null; fileinvoice.value = null;
} }
modelPerview.value = false; await success($q, "อัพโหลดไฟล์สำเร็จ");
modelPerview.value = await false;
})
.catch((err) => {
messageError($q, err);
hideLoader();
}); });
}), }),
"ยืนยันการบันทึกรายการข้อมูล", "ยืนยันการบันทึกรายการข้อมูล",
@ -396,7 +423,9 @@ const save = () => {
console.log("save function"); console.log("save function");
}; };
/** ข้อมูล ไฟล์*/ /**
* อม ไฟล
*/
const modelPerview = ref<boolean>(false); const modelPerview = ref<boolean>(false);
const rowspreview = ref<any>([]); const rowspreview = ref<any>([]);
const typepreview = ref<string>(""); const typepreview = ref<string>("");
@ -407,7 +436,7 @@ const fileInsignia = ref<any>(null);
* @param event ไฟล * @param event ไฟล
* @param actionType ประเภทไฟล receice,invoice * @param actionType ประเภทไฟล receice,invoice
*/ */
async function perviewfile(event: any, actionType: string) { function perviewfile(event: any, actionType: string) {
showLoader(); showLoader();
typepreview.value = actionType; typepreview.value = actionType;
fileInsignia.value = event; fileInsignia.value = event;
@ -415,7 +444,7 @@ async function perviewfile(event: any, actionType: string) {
let id = selectRound.value.toString(); let id = selectRound.value.toString();
const formdata = new FormData(); const formdata = new FormData();
formdata.append("file", event); formdata.append("file", event);
await http http
.put(config.API.previewfileInsignia(actionType, id), formdata) .put(config.API.previewfileInsignia(actionType, id), formdata)
.then((res) => { .then((res) => {
let data = res.data.result; let data = res.data.result;
@ -448,8 +477,11 @@ async function perviewfile(event: any, actionType: string) {
} }
} }
function closeDialogPerview() {
modelPerview.value = false;
}
const resetFilter = () => { const resetFilter = () => {
// reset X
filter.value = ""; filter.value = "";
filterRef.value!.focus(); filterRef.value!.focus();
}; };
@ -465,7 +497,9 @@ const paginationLabel = (start: number, end: number, total: number) => {
else return start + "-" + end + " ใน " + total; else return start + "-" + end + " ใน " + total;
}; };
/** function openPopup */ /**
* function openPopup
*/
function OpenModal(data: any) { function OpenModal(data: any) {
dataModal.value = data; dataModal.value = data;
ModalDialog.value = true; ModalDialog.value = true;
@ -520,8 +554,8 @@ function clearInsigniaFilters(name: string) {
} }
/** hook*/ /** hook*/
onMounted(async () => { onMounted(() => {
await fecthRound(); fecthRound();
}); });
</script> </script>
@ -937,6 +971,7 @@ onMounted(async () => {
:action="action" :action="action"
:personId="personId" :personId="personId"
:profileType="profileType" :profileType="profileType"
:fecthlistInsignia="fecthlistInsignia"
/> />
</q-card> </q-card>
<q-card v-else> <q-card v-else>
@ -949,7 +984,8 @@ onMounted(async () => {
<q-dialog v-model="modelPerview"> <q-dialog v-model="modelPerview">
<q-card style="width: 850px; max-width: 80vw"> <q-card style="width: 850px; max-width: 80vw">
<q-card-section> <DialogHeader tittle="ยืนยันรายการข้อมูล" :close="closeDialogPerview" />
<!-- <q-card-section>
<q-toolbar class="q-py-md"> <q-toolbar class="q-py-md">
<q-toolbar-title class="header-text"> <q-toolbar-title class="header-text">
นยนรายการขอม นยนรายการขอม
@ -963,8 +999,7 @@ onMounted(async () => {
style="color: #ff8080; background-color: #ffdede" style="color: #ff8080; background-color: #ffdede"
/> />
</q-toolbar> </q-toolbar>
<!-- <div class="text-h6">นยนรายการขอม</div> --> </q-card-section> -->
</q-card-section>
<q-card-section class="q-pt-none"> <q-card-section class="q-pt-none">
<d-table <d-table
@ -980,7 +1015,7 @@ onMounted(async () => {
{{ props.rowIndex + 1 }} {{ props.rowIndex + 1 }}
</div> </div>
<div v-else> <div v-else>
{{ props.value }} {{ props.value ?? "-" }}
</div> </div>
</q-td> </q-td>
</template> </template>

View file

@ -10,6 +10,7 @@ import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import axios from "axios"; import axios from "axios";
import genReport from "@/plugins/genreport"; import genReport from "@/plugins/genreport";
import genReportXLSX from "@/plugins/genreportxlsx";
import { useOrderPlacementDataStore } from "@/modules/10_order/store"; import { useOrderPlacementDataStore } from "@/modules/10_order/store";
@ -127,11 +128,19 @@ const downloadCover = async (type: string) => {
// //
const downloadAttachment = async (type: string) => { const downloadAttachment = async (type: string) => {
// if (type === "xlsx") {
// genReportXLSX(
// dataAttachmentxlxs.value,
// ` ${orderName.value}`,
// type
// );
// } else {
genReport( genReport(
dataAttachment.value, dataAttachment.value,
`เอกสารแนบท้าย คำสั่ง ${orderName.value}`, `เอกสารแนบท้าย คำสั่ง ${orderName.value}`,
type type
); );
// }
}; };
const dataCover = ref<any>(); const dataCover = ref<any>();
@ -151,6 +160,7 @@ const fetchReportCover = async (type: string, orderId: string) => {
}; };
const dataAttachment = ref<any>(); const dataAttachment = ref<any>();
// const dataAttachmentxlxs = ref<any>();
// //
const fetchReportAttachment = async (type: string, orderId: string) => { const fetchReportAttachment = async (type: string, orderId: string) => {
showLoader(); showLoader();
@ -164,6 +174,17 @@ const fetchReportAttachment = async (type: string, orderId: string) => {
messageError($q, e); messageError($q, e);
hideLoader(); hideLoader();
}); });
// showLoader();
// await http
// .get(config.API.reportOrderAttachment("xlsx", orderId, code.value))
// .then(async (res) => {
// dataAttachmentxlxs.value = res.data.result;
// })
// .catch(async (e) => {
// messageError($q, e);
// hideLoader();
// });
}; };
function genPDf(data: any) { function genPDf(data: any) {
@ -531,15 +552,15 @@ const viewFileUpload = async (url: string) => {
<q-item <q-item
clickable clickable
v-close-popup v-close-popup
@click="downloadAttachment('xlsx')" @click="downloadAttachment('docx')"
> >
<!-- type="a" <!-- type="a"
:href="orderAttachmentXlsx" :href="orderAttachmentXlsx"
target="_blank" --> target="_blank" -->
<q-item-section avatar <q-item-section avatar
><q-icon color="green-7" name="mdi-file-excel" ><q-icon color="blue" name="mdi-file-word"
/></q-item-section> /></q-item-section>
<q-item-section>ไฟล .xls</q-item-section> <q-item-section>ไฟล .docx</q-item-section>
</q-item> </q-item>
</q-list> </q-list>
</q-menu> </q-menu>

View file

@ -23,12 +23,14 @@ const profileId = defineModel<string>("profileId", { required: true });
const props = defineProps({ const props = defineProps({
typeLevel: { type: String, required: true }, typeLevel: { type: String, required: true },
isReserve: { type: Boolean, required: true }, isReserve: { type: Boolean, required: true },
remark: { type: String, required: true },
fetchData: { fetchData: {
type: Function, type: Function,
}, },
}); });
const type = ref<string>(""); const type = ref<string>("");
const note = ref<string>("");
const typeRef = ref<any>(null); const typeRef = ref<any>(null);
const isReadonly = ref<boolean>(false); // const isReadonly = ref<boolean>(false); //
const isChange = ref<boolean>(false); // const isChange = ref<boolean>(false); //
@ -75,6 +77,7 @@ function onSubmit() {
profileId: profileId.value, profileId: profileId.value,
type: type.value, type: type.value,
isReserve: isReserve.value, isReserve: isReserve.value,
remark: type.value === "NONE" ? note.value : undefined,
}; };
http http
.post(config.API.salaryPeriodEmp() + `/change/type`, body) .post(config.API.salaryPeriodEmp() + `/change/type`, body)
@ -92,10 +95,15 @@ function onSubmit() {
}); });
} }
function chengType() {
note.value = props.typeLevel === "NONE" ? props.remark : "";
}
watch( watch(
() => modal.value, () => modal.value,
() => { () => {
type.value = props.typeLevel == "PENDING" ? "" : props.typeLevel; type.value = props.typeLevel == "PENDING" ? "" : props.typeLevel;
note.value = props.typeLevel === "NONE" ? props.remark : "";
isReserve.value = props.isReserve; isReserve.value = props.isReserve;
isChange.value = false; isChange.value = false;
} }
@ -132,7 +140,7 @@ function inputEdit(val: boolean) {
:rules="[(val) => !!val || `${'กรุณาเลือก ขั้น'}`]" :rules="[(val) => !!val || `${'กรุณาเลือก ขั้น'}`]"
lazy-rules lazy-rules
hide-bottom-space hide-bottom-space
@update:model-value="isChange = true" @update:model-value="(isChange = true), chengType()"
/> />
<!-- :options="typeRangeOps.filter((e) => e.id !== store.tabType)" --> <!-- :options="typeRangeOps.filter((e) => e.id !== store.tabType)" -->
@ -144,6 +152,17 @@ function inputEdit(val: boolean) {
v-model="isReserve" v-model="isReserve"
@update:model-value="isChange = true" @update:model-value="isChange = true"
/> />
<q-input
v-if="type === 'NONE'"
:class="inputEdit(isReadonly)"
outlined
dense
v-model="note"
label="หมายเหตุ"
type="textarea"
@update:model-value="isChange = true"
/>
</div> </div>
</q-card-section> </q-card-section>
<q-separator /> <q-separator />

View file

@ -541,6 +541,7 @@ const updateIsShowRetire = async () => {
v-model:formFilter="formFilter" v-model:formFilter="formFilter"
:fetchDataTable="fetchDataPeriodNew" :fetchDataTable="fetchDataPeriodNew"
:total="total" :total="total"
:type="item.type"
/> />
</q-tab-panel> </q-tab-panel>
</q-tab-panels> </q-tab-panels>

View file

@ -36,10 +36,14 @@ const props = defineProps({
total: { total: {
type: Number, type: Number,
}, },
type: {
type: String,
requird: true,
},
}); });
/** ข้อมูล Table*/ /** ข้อมูล Table*/
const columns = ref<QTableProps["columns"]>([ const baseColumns = ref<QTableProps["columns"]>([
{ {
name: "no", name: "no",
align: "left", align: "left",
@ -152,6 +156,15 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{
name: "remark",
align: "center",
label: "หมายเหตุ",
sortable: false,
field: "remark",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]); ]);
const visibleColumns = ref<string[]>([ const visibleColumns = ref<string[]>([
@ -167,8 +180,18 @@ const visibleColumns = ref<string[]>([
"amountUse", "amountUse",
"positionSalaryAmount", "positionSalaryAmount",
"isRetired", "isRetired",
"remark",
]); ]);
const columns = computed(() => {
if (props.type !== "NONE") {
if (baseColumns.value) {
return baseColumns.value.filter((column) => column.name !== "remark");
}
}
return baseColumns.value;
});
/** modalDialog*/ /** modalDialog*/
const modalDialogAddPerson = ref<boolean>(false); const modalDialogAddPerson = ref<boolean>(false);
const modalDialogForm = ref<boolean>(false); const modalDialogForm = ref<boolean>(false);
@ -207,16 +230,24 @@ function onClickMovieGroup(id: string) {
const typeLevel = ref<string>(""); const typeLevel = ref<string>("");
const isReserve = ref<boolean>(false); const isReserve = ref<boolean>(false);
const remark = ref<string>("");
/** /**
* function openPopup ายกข * function openPopup ายกข
* @param id profileId * @param id profileId
* *
*/ */
function onClickMoveLevel(id: string, typeVal: string, isReserveVal: boolean) { function onClickMoveLevel(
id: string,
typeVal: string,
isReserveVal: boolean,
remarkVal: string = ""
) {
profileId.value = id; profileId.value = id;
modalDialogMoveLeve.value = !modalDialogMoveLeve.value; modalDialogMoveLeve.value = !modalDialogMoveLeve.value;
typeLevel.value = typeVal; typeLevel.value = typeVal;
isReserve.value = isReserveVal; isReserve.value = isReserveVal;
remark.value = typeVal === "NONE" ? remarkVal : "";
} }
/** /**
@ -306,7 +337,7 @@ watch(
store.roundMainCode === 'OCT' store.roundMainCode === 'OCT'
? columns ? columns
: columns : columns
? columns.slice(0, 11) ? columns.filter((e) => e.name !== 'isRetired')
: [] : []
" "
option-value="name" option-value="name"
@ -322,7 +353,7 @@ watch(
store.roundMainCode === 'OCT' store.roundMainCode === 'OCT'
? columns ? columns
: columns : columns
? columns.slice(0, 11) ? columns.filter((e) => e.name !== 'isRetired')
: [] : []
" "
:rows="props.rows" :rows="props.rows"
@ -416,7 +447,7 @@ watch(
/> />
</div> </div>
<div v-else> <div v-else class="table_ellipsis2">
{{ col.value ? col.value : "-" }} {{ col.value ? col.value : "-" }}
</div> </div>
</q-td> </q-td>
@ -446,7 +477,8 @@ watch(
? onClickMoveLevel( ? onClickMoveLevel(
props.row.id, props.row.id,
props.row.type, props.row.type,
props.row.isReserve props.row.isReserve,
props.row.remark
) )
: item.type === 'delete' : item.type === 'delete'
? onClickDelete(props.row.id) ? onClickDelete(props.row.id)
@ -510,6 +542,7 @@ watch(
v-model:profileId="profileId" v-model:profileId="profileId"
:fetchData="props.fetchDataTable" :fetchData="props.fetchDataTable"
:type="store.tabType" :type="store.tabType"
:remark="remark"
/> />
</template> </template>

View file

@ -29,12 +29,14 @@ const profileId = defineModel<string>("profileId", { required: true });
const props = defineProps({ const props = defineProps({
typeLevel: { type: String, required: true }, typeLevel: { type: String, required: true },
isReserve: { type: Boolean, required: true }, isReserve: { type: Boolean, required: true },
remark: { type: String, required: true },
fetchData: { fetchData: {
type: Function, type: Function,
}, },
}); });
const type = ref<string>(""); const type = ref<string>("");
const note = ref<string>("");
const typeRef = ref<any>(null); const typeRef = ref<any>(null);
const isReadonly = ref<boolean>(false); // const isReadonly = ref<boolean>(false); //
const isChange = ref<boolean>(false); // const isChange = ref<boolean>(false); //
@ -81,6 +83,7 @@ function onSubmit() {
profileId: profileId.value, profileId: profileId.value,
type: type.value, type: type.value,
isReserve: isReserve.value, isReserve: isReserve.value,
remark: type.value === "NONE" ? note.value : undefined,
}; };
http http
.post(config.API.salaryPeriod() + `/change/type`, body) .post(config.API.salaryPeriod() + `/change/type`, body)
@ -98,10 +101,15 @@ function onSubmit() {
}); });
} }
function chengType() {
note.value = props.typeLevel === "NONE" ? props.remark : "";
}
watch( watch(
() => modal.value, () => modal.value,
() => { () => {
type.value = props.typeLevel == "PENDING" ? "" : props.typeLevel; type.value = props.typeLevel == "PENDING" ? "" : props.typeLevel;
note.value = props.typeLevel === "NONE" ? props.remark : "";
isReserve.value = props.isReserve; isReserve.value = props.isReserve;
isChange.value = false; isChange.value = false;
} }
@ -138,9 +146,8 @@ function inputEdit(val: boolean) {
:rules="[(val) => !!val || `${'กรุณาเลือก ขั้น'}`]" :rules="[(val) => !!val || `${'กรุณาเลือก ขั้น'}`]"
lazy-rules lazy-rules
hide-bottom-space hide-bottom-space
@update:model-value="isChange = true" @update:model-value="(isChange = true), chengType()"
/> />
<!-- :options="typeRangeOps.filter((e) => e.id !== store.tabType)" -->
<q-checkbox <q-checkbox
v-if="type === 'FULL'" v-if="type === 'FULL'"
@ -150,12 +157,22 @@ function inputEdit(val: boolean) {
v-model="isReserve" v-model="isReserve"
@update:model-value="isChange = true" @update:model-value="isChange = true"
/> />
<q-input
v-if="type === 'NONE'"
outlined
dense
v-model="note"
label="หมายเหตุ"
type="textarea"
:class="inputEdit(isReadonly)"
@update:model-value="isChange = true"
/>
</div> </div>
</q-card-section> </q-card-section>
<q-separator /> <q-separator />
<form @submit.prevent="validateForm"> <form @submit.prevent="validateForm">
<q-card-actions align="right" class="bg-white text-teal"> <q-card-actions align="right" class="bg-white text-teal">
<!-- <q-btn flat label="OK" v-close-popup /> -->
<q-btn <q-btn
:disabled="!isChange" :disabled="!isChange"
type="submit" type="submit"

View file

@ -340,9 +340,13 @@ function onClickDownload(data: DataOption) {
const isGovernmentId = const isGovernmentId =
data.id === "gov-01" || data.id === "gov-01" ||
data.id === "gov-03" ||
data.id === "gov-04" || data.id === "gov-04" ||
data.id === "gov-04-01" ||
data.id === "gov-05" || data.id === "gov-05" ||
data.id === "gov-07"; data.id === "gov-05-01" ||
data.id === "gov-07" ||
data.id === "gov-08";
const finalUrl = isGovernmentId ? `${url}/${store.tabGroup}` : url; const finalUrl = isGovernmentId ? `${url}/${store.tabGroup}` : url;
http http
@ -620,6 +624,7 @@ const updateIsShowRetire = async () => {
v-model:formFilter="formFilter" v-model:formFilter="formFilter"
:fetchDataTable="fetchDataPeriodNew" :fetchDataTable="fetchDataPeriodNew"
:total="total" :total="total"
:type="item.type"
/> />
</q-tab-panel> </q-tab-panel>
</q-tab-panels> </q-tab-panels>

View file

@ -36,10 +36,14 @@ const props = defineProps({
total: { total: {
type: Number, type: Number,
}, },
type: {
type: String,
required: true,
},
}); });
/** ข้อมูล Table*/ /** ข้อมูล Table*/
const columns = ref<QTableProps["columns"]>([ const baseColumns = ref<QTableProps["columns"]>([
{ {
name: "no", name: "no",
align: "left", align: "left",
@ -140,6 +144,15 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{
name: "remark",
align: "center",
label: "หมายเหตุ",
sortable: false,
field: "remark",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]); ]);
const visibleColumns = ref<string[]>([ const visibleColumns = ref<string[]>([
@ -154,8 +167,20 @@ const visibleColumns = ref<string[]>([
"amountUse", "amountUse",
"positionSalaryAmount", "positionSalaryAmount",
"isRetired", "isRetired",
"remark",
]); ]);
const columns = computed(() => {
if (props.type !== "NONE") {
if (baseColumns.value) {
return baseColumns.value.filter((column) => column.name !== "remark");
}
}
console.log(baseColumns.value);
return baseColumns.value;
});
/** modalDialog*/ /** modalDialog*/
const modalDialogAddPerson = ref<boolean>(false); const modalDialogAddPerson = ref<boolean>(false);
const modalDialogForm = ref<boolean>(false); const modalDialogForm = ref<boolean>(false);
@ -194,16 +219,24 @@ function onClickMovieGroup(id: string) {
const typeLevel = ref<string>(""); const typeLevel = ref<string>("");
const isReserve = ref<boolean>(false); const isReserve = ref<boolean>(false);
const remark = ref<string>("");
/** /**
* function openPopup ายกข * function openPopup ายกข
* @param id profileId * @param id profileId
* *
*/ */
function onClickMoveLevel(id: string, typeVal: string, isReserveVal: boolean) { function onClickMoveLevel(
id: string,
typeVal: string,
isReserveVal: boolean,
remarkVal: string = ""
) {
profileId.value = id; profileId.value = id;
modalDialogMoveLeve.value = !modalDialogMoveLeve.value; modalDialogMoveLeve.value = !modalDialogMoveLeve.value;
typeLevel.value = typeVal; typeLevel.value = typeVal;
isReserve.value = isReserveVal; isReserve.value = isReserveVal;
remark.value = typeVal === "NONE" ? remarkVal : "";
} }
/** /**
@ -293,7 +326,7 @@ watch(
store.roundMainCode === 'OCT' store.roundMainCode === 'OCT'
? columns ? columns
: columns : columns
? columns.slice(0, 10) ? columns.filter((e) => e.name !== 'isRetired')
: [] : []
" "
option-value="name" option-value="name"
@ -309,7 +342,7 @@ watch(
store.roundMainCode === 'OCT' store.roundMainCode === 'OCT'
? columns ? columns
: columns : columns
? columns.slice(0, 10) ? columns.filter((e) => e.name !== 'isRetired')
: [] : []
" "
:rows="props.rows" :rows="props.rows"
@ -401,7 +434,7 @@ watch(
/> />
</div> </div>
<div v-else> <div v-else class="table_ellipsis2">
{{ col.value ? col.value : "-" }} {{ col.value ? col.value : "-" }}
</div> </div>
</q-td> </q-td>
@ -431,7 +464,8 @@ watch(
? onClickMoveLevel( ? onClickMoveLevel(
props.row.id, props.row.id,
props.row.type, props.row.type,
props.row.isReserve props.row.isReserve,
props.row.remark
) )
: item.type === 'delete' : item.type === 'delete'
? onClickDelete(props.row.id) ? onClickDelete(props.row.id)
@ -495,6 +529,7 @@ watch(
v-model:profileId="profileId" v-model:profileId="profileId"
:fetchData="props.fetchDataTable" :fetchData="props.fetchDataTable"
:type="store.tabType" :type="store.tabType"
:remark="remark"
/> />
</template> </template>

View file

@ -107,15 +107,18 @@ const pagination = ref({
rowsPerPage: formFilter.pageSize, rowsPerPage: formFilter.pageSize,
}); });
const isActive = ref<boolean>(false); const isActive = ref<boolean>(false);
const groupSalary = ref<string>("");
function fetchDataDetail() { function fetchDataDetail() {
http http
.get(config.API.salaryEmployeeChartByid(salaryEmployeeId.value)) .get(config.API.salaryEmployeeChartByid(salaryEmployeeId.value))
.then((res) => { .then((res) => {
isActive.value = res.data.result.isActive; isActive.value = res.data.result.isActive;
groupSalary.value = res.data.result.group;
}) })
.catch((e) => {}) .catch((e) => {
.finally(() => {}); messageError($q, e);
});
} }
function fetchSalalyEmployeeRate() { function fetchSalalyEmployeeRate() {
@ -222,9 +225,9 @@ watch(
} }
); );
onMounted(() => { onMounted(async () => {
fetchSalalyEmployeeRate(); await fetchDataDetail();
fetchDataDetail(); await fetchSalalyEmployeeRate();
}); });
</script> </script>
<template> <template>
@ -240,7 +243,7 @@ onMounted(() => {
class="q-mr-sm" class="q-mr-sm"
@click="router.go(-1)" @click="router.go(-1)"
/> />
ตราคาจาง ตราคาจาง กลมท{{ groupSalary }}
</div> </div>
</div> </div>
<q-card flat bordered class="q-pa-md"> <q-card flat bordered class="q-pa-md">

View file

@ -276,7 +276,7 @@ async function onChangeRound() {
/** function เปลี่ยนรอบ*/ /** function เปลี่ยนรอบ*/
async function onChangeSnap() { async function onChangeSnap() {
agencyFilter.value = ""; // agencyFilter.value = "";
if (agencyFilter.value && roundFilter.value.id && snapFilter.value) { if (agencyFilter.value && roundFilter.value.id && snapFilter.value) {
await fetchSalalyPeriod( await fetchSalalyPeriod(
agencyFilter.value, agencyFilter.value,

View file

@ -379,7 +379,7 @@ onMounted(async () => {
1 1
}} }}
</div> </div>
<div v-if="col.name == 'effectiveDate'"> <div v-else-if="col.name == 'effectiveDate'">
{{ date2Thai(props.row.effectiveDate) }} {{ date2Thai(props.row.effectiveDate) }}
</div> </div>
<div v-else-if="col.name == 'year'"> <div v-else-if="col.name == 'year'">
@ -403,10 +403,10 @@ onMounted(async () => {
/> />
</div> </div>
<div v-else-if="col.name == 'isClose'"> <div v-else-if="col.name == 'isClose'">
{{ props.row.isClose == false ? "" : "ปิดรอบแล้ว" }} {{ props.row.isClose == false ? "-" : "ปิดรอบแล้ว" }}
</div> </div>
<div v-else> <div v-else>
{{ col.value }} {{ col.value ?? "-" }}
</div> </div>
</q-td> </q-td>
<q-td> <q-td>

View file

@ -171,11 +171,17 @@ function getData() {
developmentMethod.value = data.developEvaluator; developmentMethod.value = data.developEvaluator;
developmentPeriod.value = data.timeEvaluator; developmentPeriod.value = data.timeEvaluator;
evaluatorComment.value = data.reasonEvaluator; evaluatorComment.value = data.reasonEvaluator;
superiorCommentCheck.value = data.isReasonCommander.toString(); superiorCommentCheck.value =
data.isReasonCommander != null
? data.isReasonCommander.toString()
: null;
superiorComment.value = data.reasonCommander; superiorComment.value = data.reasonCommander;
additionalSuperiorCheck.value = data.isReasonCommanderHigh.toString(); additionalSuperiorCheck.value =
data.isReasonCommanderHigh != null
? data.isReasonCommanderHigh.toString()
: null;
additionalSuperiorComment.value = data.reasonCommanderHigh; additionalSuperiorComment.value = data.reasonCommanderHigh;
result1.value = data.totalPoint1; result1.value = data.totalPoint1;
result2.value = data.totalPoint2_1 + data.totalPoint2_2; result2.value = data.totalPoint2_1 + data.totalPoint2_2;