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
IMAGE_NAME: ehr/bma-ehr-app
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:
# 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:

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, watch } from "vue";
import { ref, watch, computed } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
@ -29,7 +29,7 @@ const empType = ref<string>(
const modal = defineModel<boolean>("modal", { required: true });
const salaryId = defineModel<string>("salaryId", { required: true });
const columns = ref<QTableProps["columns"]>([
const baseColumns = ref<QTableProps["columns"]>([
{
name: "date",
align: "left",
@ -43,7 +43,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "amount",
align: "left",
label: "เงินเดือน",
label: empType.value === "-employee" ? "ค่าตอบแทนรายเดือน" : "เงินเดือน",
sortable: true,
field: "amount",
headerStyle: "font-size: 14px",
@ -218,6 +218,19 @@ const visibleColumns = ref<string[]>([
"lastUpdateFullName",
"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 pagination = ref({
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 { 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) {
if (val == undefined) val = -1;
if (val >= 0 && val <= 60) return "(ต่ำกว่าร้อยละ 60)";
if (val >= 60 && val <= 69) return "(ร้อยละ 60 69)";
if (val >= 70 && val <= 79) return "(ร้อยละ 70 79)";
if (val >= 80 && val <= 89) return "(ร้อยละ 80 89)";
if (val >= 90 && val <= 100) return "(ร้อยละ 90 - 100)";
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 "-";
}
function textPoint(val: number | undefined) {
if (val == undefined) val = -1;
if (val < 60.0) return "ต้องปรับปรุง";
if (val >= 60.0 && val <= 69.99) return "พอใช้";
if (val >= 70.0 && val <= 79.99) return "ดี";
if (val >= 80.0 && val <= 89.99) return "ดีมาก";
if (val >= 90.0) return "ดีเด่น";
else return "-";
}
return { textRangePoint, textPoint };
});
return { textRangePoint, textPoint };
}
);

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -4,14 +4,23 @@ import { QForm, useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
/** import Type*/
/**
* import Type
*/
import type { DataOption } from "@/modules/04_registry/components/profileType";
import DialogHeader from "@/components/DialogHeader.vue";
/** import Stores */
/**
* import Stores
*/
import { useCounterMixin } from "@/stores/mixin";
import { useResultDataStore } from "@/modules/07_insignia/storeResult";
/** useStore*/
/**
* use
*/
const $q = useQuasar();
const myForm = ref<QForm>();
const DataStore = useResultDataStore();
const mixin = useCounterMixin();
const {
@ -24,53 +33,9 @@ const {
notifyError,
} = mixin;
const $q = useQuasar();
const myForm = ref<QForm>();
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;
}
/**
* Props
*/
const props = defineProps({
modal: Boolean,
save: {
@ -91,11 +56,58 @@ const props = defineProps({
profileType: {
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, () => {
if (props.modal === true) {
filterinsigniaOp2.value = DataStore.insigniaOp2;
employeeClass.value = "";
cardid.value = "";
fullName.value = "";
@ -120,20 +132,23 @@ watch(props, () => {
}
} else {
status.value = "";
selectType();
}
});
/** disbleStatus */
/**
* disbleStatus
*/
const disbleStatus = computed(() => {
if (employeeClass.value !== "") {
return false;
} else return true;
});
//
/** function เลือกประเภทลูกจ้าง */
async function selectType() {
// showLoader();
/**
* function เลอกประเภทลกจาง
*/
function selectType() {
cardid.value = "";
fullName.value = "";
position.value = "";
@ -150,36 +165,13 @@ async function selectType() {
announced.value = "";
invoiceDate.value = null;
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 หนวยงาน
* @param id id หนวยงาน
*/
async function findlist(id: string = "", idCard: string) {
function findlist(id: string = "", idCard: string) {
formFilter.searchKeyword = idCard;
http
.get(
@ -207,43 +199,18 @@ async function findlist(id: string = "", idCard: string) {
.finally(() => {
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
* @param id
* @param id personId
*/
async function fectDataByid(id: string) {
function fectDataByid(id: string) {
showLoader();
if (props.profileType !== undefined) {
// employeeClass.value = props.profileType.toString();
employeeClass.value = "officer";
}
await http
http
.get(config.API.noteByid(id))
.then((res) => {
let data = res.data.result;
@ -275,7 +242,7 @@ async function fectDataByid(id: string) {
}
/** function บักทึกผล*/
async function onSubmit() {
function onSubmit() {
dialogConfirm($q, () => {
if (props.roundId !== undefined) {
showLoader();
@ -299,9 +266,9 @@ async function onSubmit() {
http
.put(config.API.noteAdd(props.roundId), body)
.then(async () => {
await props.fecthlistInsignia?.();
await props.close?.();
await success($q, "บันทึกข้อมูลสำเร็จ");
await showLoader();
})
.catch((err) => {
messageError($q, err);
@ -311,7 +278,9 @@ async function onSubmit() {
});
}
/** function หาเลขประจำตัวประชาชน*/
/**
* function หาเลขประจำตวประชาชน
*/
function searchcardid() {
if (cardid.value.length === 13) {
findlist("", cardid.value);

View file

@ -7,8 +7,14 @@ import config from "@/app.config";
/** import Type*/
import type { DataOption } from "@/modules/04_registry/components/profileType";
/**
* import Components
*/
import DialogHeader from "../DialogHeader.vue";
/** import Stores */
import { useCounterMixin } from "@/stores/mixin";
/** useStore*/
const mixin = useCounterMixin();
const {
@ -48,11 +54,6 @@ const props = defineProps({
dataModal: Object,
});
/** function reset วันที่ประกาศราชกิจจานุเบกษา*/
function clearReceiveDate() {
Datereceive.value = null;
}
/** function clearDate */
function clearReturnDate() {
Datereturn.value = null;
@ -74,7 +75,7 @@ function close() {
* @param type receive,return
* @param id personId
*/
async function onSubmit(type: string, id: string) {
function onSubmit(type: string, id: string) {
dialogConfirm($q, () => {
const formData = new FormData();
if (props.dateCheckReceive === null) {
@ -117,7 +118,7 @@ watch(
);
/** function เรียกหน่วยงาน*/
async function fetchOrgList() {
function fetchOrgList() {
showLoader();
http
.get(config.API.activeOrganization)
@ -144,30 +145,6 @@ async function fetchOrgList() {
.finally(() => {
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 มีการเปลี่ยนแปลง*/
@ -203,19 +180,8 @@ watch(props, () => {
)
"
>
<q-toolbar>
<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>
<DialogHeader :tittle="'รับ-คืนเครื่องราชฯ'" :close="close" />
<q-separator />
<q-card-section>
<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 listPerson = ref<any>([]);
const OrgList = ref<DataOption[]>([]);
const filterOrgList = ref<any>([]);
const filterOrgList = ref<DataOption[]>([]);
const insigniaNoteProfileId = ref<string>("");
const filterSelectRound = ref<any>();
const selectRound = ref<any>();
@ -124,25 +124,32 @@ async function fecthlistInsignia() {
}
/** function ดึงข้อมูลรายการหน่วยงาน */
// async function fetchOrgList() {
// showLoader();
// await http
// .get(config.API.typeOc())
// .then(async (response: any) => {
// const orgArr = response.data.result.map((e: any) => ({
// id: e.organizationId,
// name: e.organizationName,
// }));
// OrgList.value = orgArr;
// filterOrgList.value = OrgList.value;
// })
// .catch((err) => {
// messageError($q, err);
// })
// .finally(() => {
// hideLoader();
// });
// }
/** funcion เรียกข้อมูลหน่วยงานจัดสรรเครื่องราชอิสริยาภรณ์ */
async function fetchOrgList() {
http
.get(config.API.activeOrganization)
.then((res) => {
const data = res.data.result;
http
.get(config.API.orgByid(data.activeId))
.then(async (res) => {
const data = await res.data.result.map((item: any) => ({
id: item.orgTreeId,
name: item.orgName,
}));
OrgList.value = data;
filterOrgList.value = data;
})
.catch((err) => {
messageError($q, err);
});
})
.catch((err) => {
messageError($q, err);
});
}
// -
// const fetchData = async () => {
@ -172,7 +179,6 @@ async function onSubmit() {
.then(async () => {
await props.closeAndFecth();
await clearData();
// await hideLoader();
await success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((err) => {
@ -189,7 +195,6 @@ async function onSubmit() {
.then(async () => {
await props.closeAndFecth();
await clearData();
// await hideLoader();
await success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((err) => {
@ -215,7 +220,6 @@ async function searchcardid() {
?.shortName || ""
})`;
insigniaNoteProfileId.value = node.id;
insigniaNoteProfileId.value = node.id;
hideLoader();
} else {
notifyError($q, "ไม่พบข้อมูลการได้รับในรอบนี้");
@ -229,7 +233,6 @@ async function searchcardid() {
fullName.value = "";
brand.value = "";
receivedate.value = null;
// OrganazationId.value = "";
}
}
@ -281,11 +284,13 @@ onMounted(() => {
/** function callback เช็ค props ถ้าเปิด dialog ให้ดึงรายการข้อมูล */
watch(props, () => {
// type.value = props.type;
if (props.modal == true && props.roundId != "all") {
roundNo.value = props.roundId;
fecthlistInsignia();
// fetchOrgList();
if (props.action === "editData") {
// fetchOrgList();
} else {
fecthlistInsignia();
}
}
});
</script>
@ -485,26 +490,26 @@ watch(props, () => {
</div>
<!-- <div class="col-xs-12 col-sm-6">
<q-select
hide-bottom-space
:options="filterOrgList"
dense
lazy-rules
borderless
option-label="name"
option-value="id"
emit-value
map-options
outlined
use-input
v-model="OrganazationId"
:label="`เลือกหน่วยงานที่ส่งคืน`"
:rules="[(val) => !!val || 'กรุณาเลือกหน่วยงานที่คืน']"
@filter="(inputValue:any,
<q-select
hide-bottom-space
:options="filterOrgList"
dense
lazy-rules
borderless
option-label="name"
option-value="id"
emit-value
map-options
outlined
use-input
v-model="OrganazationId"
:label="`เลือกหน่วยงานที่ส่งคืน`"
:rules="[(val) => !!val || 'กรุณาเลือกหน่วยงานที่คืน']"
@filter="(inputValue:any,
doneFn:Function) => filterSelector(inputValue, doneFn,'filterOrgList'
) "
/>
</div> -->
/>
</div> -->
<div class="col-12">
<q-input

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -340,9 +340,13 @@ function onClickDownload(data: DataOption) {
const isGovernmentId =
data.id === "gov-01" ||
data.id === "gov-03" ||
data.id === "gov-04" ||
data.id === "gov-04-01" ||
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;
http
@ -620,6 +624,7 @@ const updateIsShowRetire = async () => {
v-model:formFilter="formFilter"
:fetchDataTable="fetchDataPeriodNew"
:total="total"
:type="item.type"
/>
</q-tab-panel>
</q-tab-panels>

View file

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

View file

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

View file

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

View file

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

View file

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