Merge branch 'develop' into devTee
This commit is contained in:
commit
23695d3f9f
11 changed files with 519 additions and 319 deletions
|
|
@ -6,6 +6,8 @@ const profileOrg = `${env.API_URI}/org/profile`;
|
|||
const report = `${env.API_URI}/org`;
|
||||
const workflow = `${env.API_URI}/org/workflow`;
|
||||
export default {
|
||||
orgCommandCode: `${metadata}commandCode`,
|
||||
|
||||
profilePosition: () => `${org}/profile/keycloak/position`,
|
||||
|
||||
searchCommander: `${org}/profile/search/commander`,
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ const visibleColumns = ref<string[]>([
|
|||
"other",
|
||||
"fundName",
|
||||
"isEducation",
|
||||
"isHigh",
|
||||
"endDate",
|
||||
"startDate",
|
||||
"finishDate",
|
||||
|
|
@ -120,6 +121,20 @@ const columns = ref<QTableProps["columns"]>([
|
|||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "isHigh",
|
||||
align: "left",
|
||||
label: "วุฒิการศึกษาสูงสุด",
|
||||
sortable: true,
|
||||
field: "isHigh",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format: (v) => (v === true ? "ใช่" : v === false ? "ไม่ใช่" : "-"),
|
||||
sort: (a: string, b: string) =>
|
||||
a
|
||||
.toString()
|
||||
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "degree",
|
||||
align: "left",
|
||||
|
|
@ -320,6 +335,20 @@ const columnsHistory = ref<QTableProps["columns"]>([
|
|||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "isHigh",
|
||||
align: "left",
|
||||
label: "วุฒิการศึกษาสูงสุด",
|
||||
sortable: true,
|
||||
field: "isHigh",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format: (v) => (v === true ? "ใช่" : v === false ? "ไม่ใช่" : "-"),
|
||||
sort: (a: string, b: string) =>
|
||||
a
|
||||
.toString()
|
||||
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "degree",
|
||||
align: "left",
|
||||
|
|
@ -455,6 +484,7 @@ const visibleColumnsHistory = ref<string[]>([
|
|||
"other",
|
||||
"fundName",
|
||||
"isEducation",
|
||||
"isHigh",
|
||||
"endDate",
|
||||
"startDate",
|
||||
"finishDate",
|
||||
|
|
|
|||
|
|
@ -238,6 +238,34 @@ function onSearch() {
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันโหลไฟลเอกสารหลักฐาน
|
||||
* @param id รายการที่ต้องการโหลด
|
||||
*/
|
||||
async function onDownloadFile(id: string, profileId: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(
|
||||
config.API.subFileByFileName(
|
||||
"ทะเบียนประวัติ",
|
||||
"ประกาศเกียรติคุณ",
|
||||
profileId,
|
||||
id,
|
||||
"เอกสารหลักฐาน"
|
||||
)
|
||||
)
|
||||
.then(async (res) => {
|
||||
const data = res.data;
|
||||
window.open(data.downloadUrl, "_blank");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
link.value = await dataStore.getProFileType();
|
||||
await getData();
|
||||
|
|
@ -316,7 +344,19 @@ onMounted(async () => {
|
|||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
v-if="props.row.isUpload == true"
|
||||
color="green"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="mdi-file-document-outline"
|
||||
@click="onDownloadFile(props.row.id, props.row.profileId)"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
color="info"
|
||||
flat
|
||||
|
|
@ -336,18 +376,31 @@ onMounted(async () => {
|
|||
<div class="q-mb-xs col-xs-12 col-sm-6 col-md-4 col-lg-3">
|
||||
<q-card bordered flat>
|
||||
<q-list dense class="q-mt-lg relative-position">
|
||||
<q-btn
|
||||
icon="mdi-history"
|
||||
color="info"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
size="14px"
|
||||
class="absolute_button"
|
||||
@click="onHistory(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ประวัติแก้ไขความสามารถพิเศษ</q-tooltip>
|
||||
</q-btn>
|
||||
<div class="row absolute_button">
|
||||
<q-btn
|
||||
v-if="props.row.isUpload == true"
|
||||
color="green"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
size="14px"
|
||||
icon="mdi-file-document-outline"
|
||||
@click="onDownloadFile(props.row.id, props.row.profileId)"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
icon="mdi-history"
|
||||
color="info"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
size="14px"
|
||||
@click="onHistory(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ประวัติแก้ไขความสามารถพิเศษ</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<q-item v-for="col in props.cols" :key="col.name">
|
||||
<q-item-section class="fix_top">
|
||||
<q-item-label class="text-grey-6 text-weight-medium">{{
|
||||
|
|
@ -385,5 +438,6 @@ onMounted(async () => {
|
|||
|
||||
.fix_top {
|
||||
justify-content: start !important;
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -220,6 +220,34 @@ function getHistory() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันโหลไฟลเอกสารหลักฐาน
|
||||
* @param id รายการที่ต้องการโหลด
|
||||
*/
|
||||
async function onDownloadFile(id: string, profileId: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(
|
||||
config.API.subFileByFileName(
|
||||
"ทะเบียนประวัติ",
|
||||
"ช่วยราชการ",
|
||||
profileId,
|
||||
id,
|
||||
"เอกสารหลักฐาน"
|
||||
)
|
||||
)
|
||||
.then(async (res) => {
|
||||
const data = res.data;
|
||||
window.open(data.downloadUrl, "_blank");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
function onSearch() {
|
||||
rows.value = onSearchDataTable(
|
||||
filter.value,
|
||||
|
|
@ -302,6 +330,18 @@ onMounted(async () => {
|
|||
</div>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="green"
|
||||
size="14px"
|
||||
icon="mdi-file-document-outline"
|
||||
v-if="props.row.isUpload"
|
||||
@click="onDownloadFile(props.row.id, props.row.profileId)"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
color="info"
|
||||
flat
|
||||
|
|
@ -320,18 +360,31 @@ onMounted(async () => {
|
|||
<div class="q-mb-xs col-xs-12 col-sm-6 col-md-4 col-lg-3">
|
||||
<q-card bordered flat>
|
||||
<q-list dense class="q-mt-lg relative-position">
|
||||
<q-btn
|
||||
icon="mdi-history"
|
||||
color="info"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
size="14px"
|
||||
class="absolute_button"
|
||||
@click="onHistory(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ประวัติแก้ไขรายการช่วยราชการ</q-tooltip>
|
||||
</q-btn>
|
||||
<div class="row absolute_button">
|
||||
<q-btn
|
||||
flat
|
||||
dense
|
||||
round
|
||||
size="14px"
|
||||
color="green"
|
||||
icon="mdi-file-document-outline"
|
||||
v-if="props.row.isUpload"
|
||||
@click="onDownloadFile(props.row.id, props.row.profileId)"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
icon="mdi-history"
|
||||
color="info"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
size="14px"
|
||||
@click="onHistory(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ประวัติแก้ไขรายการช่วยราชการ</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<q-item v-for="col in props.cols" :key="col.name">
|
||||
<q-item-section class="fix_top">
|
||||
<q-item-label class="text-grey-6 text-weight-medium">{{
|
||||
|
|
@ -369,5 +422,6 @@ onMounted(async () => {
|
|||
|
||||
.fix_top {
|
||||
justify-content: start !important;
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -1,16 +1,18 @@
|
|||
<script setup lang="ts">
|
||||
import { useQuasar, type QTableProps } from "quasar";
|
||||
import { useQuasar, type QTableColumn } from "quasar";
|
||||
import { ref, onMounted, computed } from "vue";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import { useGovernmentPosDataStore } from "@/modules/10_registry/store/Position";
|
||||
|
||||
import type {
|
||||
SalaryFormType,
|
||||
CardDataPos,
|
||||
} from "@/modules/10_registry/interface/index/Main";
|
||||
import type { DataCommandCode } from "@/modules/10_registry/interface/response/Main";
|
||||
|
||||
//history dialog
|
||||
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
|
||||
|
|
@ -18,6 +20,7 @@ import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
|
|||
const link = ref<string>("");
|
||||
const $q = useQuasar();
|
||||
const dataPerson = useDataStore();
|
||||
const store = useGovernmentPosDataStore();
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
showLoader,
|
||||
|
|
@ -26,6 +29,7 @@ const {
|
|||
date2Thai,
|
||||
onSearchDataTable,
|
||||
formatDatePosition,
|
||||
findOrgName,
|
||||
} = mixin;
|
||||
|
||||
const idByRow = ref<string>("");
|
||||
|
|
@ -54,75 +58,20 @@ const cardData = ref<CardDataPos[]>([
|
|||
},
|
||||
]);
|
||||
|
||||
const visibleColumns = ref<string[]>([
|
||||
"commandDateAffect",
|
||||
"amount",
|
||||
"positionSalaryAmount",
|
||||
"mouthSalaryAmount",
|
||||
"posNo",
|
||||
"positionName",
|
||||
"positionType",
|
||||
"positionLevel",
|
||||
"commandName",
|
||||
"refCommandNo",
|
||||
"remark",
|
||||
"lastUpdateFullName",
|
||||
"lastUpdatedAt",
|
||||
]);
|
||||
|
||||
const columns = computed(() => {
|
||||
if (checkType.value == false) {
|
||||
if (baseColumns.value) {
|
||||
return baseColumns.value.filter(
|
||||
(column) =>
|
||||
column.name !== "positionSalaryAmount" &&
|
||||
column.name !== "mouthSalaryAmount"
|
||||
);
|
||||
}
|
||||
}
|
||||
return baseColumns.value;
|
||||
});
|
||||
|
||||
const baseColumns = ref<QTableProps["columns"]>([
|
||||
const baseColumns = ref<QTableColumn[]>([
|
||||
{
|
||||
name: "commandDateAffect",
|
||||
align: "left",
|
||||
label: "วัน เดือน ปี",
|
||||
label: "วันที่คำสั่งมีผล",
|
||||
sortable: true,
|
||||
field: "commandDateAffect",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format: (v) => date2Thai(v),
|
||||
},
|
||||
{
|
||||
name: "amount",
|
||||
align: "left",
|
||||
label: checkType.value ? "เงินเดือน" : "ค่าตอบแทนรายเดือน",
|
||||
sortable: true,
|
||||
field: "amount",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format: (v) => Number(v).toLocaleString(),
|
||||
},
|
||||
{
|
||||
name: "positionSalaryAmount",
|
||||
align: "left",
|
||||
label: "เงินประจำตำแหน่ง",
|
||||
sortable: true,
|
||||
field: "positionSalaryAmount",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format: (v) => Number(v).toLocaleString(),
|
||||
},
|
||||
{
|
||||
name: "mouthSalaryAmount",
|
||||
align: "left",
|
||||
label: "เงินค่าตอบแทนรายเดือน",
|
||||
sortable: true,
|
||||
field: "mouthSalaryAmount",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format: (v) => Number(v).toLocaleString(),
|
||||
sort: (a: string, b: string) =>
|
||||
a
|
||||
.toString()
|
||||
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "posNo",
|
||||
|
|
@ -139,33 +88,43 @@ const baseColumns = ref<QTableProps["columns"]>([
|
|||
? row.posNo
|
||||
: "-";
|
||||
},
|
||||
sort: (a: string, b: string) =>
|
||||
a
|
||||
.toString()
|
||||
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "positionName",
|
||||
align: "left",
|
||||
label: "ตำแหน่ง",
|
||||
label: link.value === "-employee" ? "ตำแหน่ง" : "ตำแหน่งในสายงาน",
|
||||
sortable: true,
|
||||
field: "positionName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a
|
||||
.toString()
|
||||
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "positionType",
|
||||
align: "left",
|
||||
label: "ประเภทตำแหน่ง",
|
||||
label: link.value === "-employee" ? "กลุ่มงาน" : "ประเภทตำแหน่ง",
|
||||
sortable: true,
|
||||
field: "positionType",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a
|
||||
.toString()
|
||||
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "positionLevel",
|
||||
align: "left",
|
||||
label: "ระดับ",
|
||||
label: link.value === "-employee" ? "ระดับชั้นงาน" : "ระดับ",
|
||||
sortable: true,
|
||||
field: "positionLevel",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format(val, row) {
|
||||
return `${
|
||||
row.positionLevel
|
||||
|
|
@ -175,207 +134,10 @@ const baseColumns = ref<QTableProps["columns"]>([
|
|||
: "-"
|
||||
}`;
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: "commandName",
|
||||
align: "left",
|
||||
label: "เอกสารอ้างอิง",
|
||||
sortable: true,
|
||||
field: "commandName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "refCommandNo",
|
||||
align: "left",
|
||||
label: "เลขที่คำสั่ง",
|
||||
sortable: true,
|
||||
field: "refCommandNo",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format(val, row) {
|
||||
return row.commandNo && row.commandYear
|
||||
? `${row.commandNo}/${row.commandYear}`
|
||||
: "";
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "remark",
|
||||
align: "left",
|
||||
label: "หมายเหตุ",
|
||||
sortable: true,
|
||||
field: "remark",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "lastUpdateFullName",
|
||||
align: "left",
|
||||
label: "ผู้ดำเนินการ",
|
||||
sortable: true,
|
||||
field: "lastUpdateFullName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "lastUpdatedAt",
|
||||
align: "left",
|
||||
label: "วันที่แก้ไข",
|
||||
sortable: true,
|
||||
field: "lastUpdatedAt",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format: (v) => date2Thai(v, false, true),
|
||||
},
|
||||
]);
|
||||
|
||||
const visibleColumnsHistory = ref<string[]>([
|
||||
"commandDateAffect",
|
||||
"amount",
|
||||
"positionSalaryAmount",
|
||||
"mouthSalaryAmount",
|
||||
"oc",
|
||||
"positionName",
|
||||
"posNo",
|
||||
"positionLine",
|
||||
"positionPathSide",
|
||||
"positionType",
|
||||
"positionLevel",
|
||||
"positionExecutive",
|
||||
"positionExecutiveSide",
|
||||
"salaryClass",
|
||||
"commandName",
|
||||
"refCommandNo",
|
||||
"remark",
|
||||
"lastUpdateFullName",
|
||||
"lastUpdatedAt",
|
||||
]);
|
||||
|
||||
const columnsHistory = computed(() => {
|
||||
if (checkType.value == false) {
|
||||
if (baseColumnsHistory.value) {
|
||||
return baseColumnsHistory.value.filter(
|
||||
(column) =>
|
||||
column.name !== "positionSalaryAmount" &&
|
||||
column.name !== "mouthSalaryAmount"
|
||||
);
|
||||
}
|
||||
}
|
||||
return baseColumns.value;
|
||||
});
|
||||
|
||||
const baseColumnsHistory = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "commandDateAffect",
|
||||
align: "left",
|
||||
label: "วัน เดือน ปี",
|
||||
sortable: true,
|
||||
field: "commandDateAffect",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format: (v) => date2Thai(v),
|
||||
},
|
||||
{
|
||||
name: "amount",
|
||||
align: "left",
|
||||
label: checkType.value ? "เงินเดือน" : "ค่าตอบแทนรายเดือน",
|
||||
sortable: true,
|
||||
field: "amount",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format: (v) => Number(v).toLocaleString(),
|
||||
},
|
||||
{
|
||||
name: "positionSalaryAmount",
|
||||
align: "left",
|
||||
label: "เงินประจำตำแหน่ง",
|
||||
sortable: true,
|
||||
field: "positionSalaryAmount",
|
||||
headerStyle: "font-size: 14px",
|
||||
format: (v) => Number(v).toLocaleString(),
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "mouthSalaryAmount",
|
||||
align: "left",
|
||||
label: "เงินค่าตอบแทนรายเดือน",
|
||||
sortable: true,
|
||||
field: "mouthSalaryAmount",
|
||||
headerStyle: "font-size: 14px",
|
||||
format: (v) => Number(v).toLocaleString(),
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "oc",
|
||||
align: "left",
|
||||
label: "สังกัด",
|
||||
sortable: true,
|
||||
field: "oc",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
||||
{
|
||||
name: "posNo",
|
||||
align: "left",
|
||||
label: "ตำแหน่งเลขที่",
|
||||
sortable: true,
|
||||
field: "posNo",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format(val, row) {
|
||||
return row.posNoAbb && row.posNo
|
||||
? `${row.posNoAbb}${row.posNo}`
|
||||
: row.posNo
|
||||
? row.posNo
|
||||
: "-";
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "positionName",
|
||||
align: "left",
|
||||
label: "ตำแหน่ง",
|
||||
sortable: true,
|
||||
field: "positionName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "positionLine",
|
||||
align: "left",
|
||||
label: "สายงาน",
|
||||
sortable: true,
|
||||
field: "positionLine",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "positionPathSide",
|
||||
align: "left",
|
||||
label: "ด้าน/สาขา",
|
||||
sortable: true,
|
||||
field: "positionPathSide",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "positionType",
|
||||
align: "left",
|
||||
label: "ตำแหน่งประเภท",
|
||||
sortable: true,
|
||||
field: "positionType",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "positionLevel",
|
||||
align: "left",
|
||||
label: "ระดับ",
|
||||
sortable: true,
|
||||
field: "positionLevel",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "positionExecutive",
|
||||
|
|
@ -385,47 +147,94 @@ const baseColumnsHistory = ref<QTableProps["columns"]>([
|
|||
field: "positionExecutive",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "positionExecutiveSide",
|
||||
name: "amount",
|
||||
align: "left",
|
||||
label: "ด้านทางการบริหาร",
|
||||
label: link.value === "-employee" ? "ค่าตอบแทนรายเดือน" : "เงินเดือน",
|
||||
sortable: true,
|
||||
field: "positionExecutiveSide",
|
||||
field: "amount",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format(v, row) {
|
||||
return row.amount
|
||||
? `${row.amount.toLocaleString()}${
|
||||
row.amountSpecial !== 0 && row.amountSpecial
|
||||
? ` (${row.amountSpecial.toLocaleString()})`
|
||||
: ""
|
||||
}`
|
||||
: "-";
|
||||
},
|
||||
sort: (a: string, b: string) =>
|
||||
a
|
||||
.toString()
|
||||
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "salaryClass",
|
||||
align: "left",
|
||||
label: "ตำแหน่ง (รายละเอียด)",
|
||||
sortable: true,
|
||||
field: "salaryClass",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "commandName",
|
||||
align: "left",
|
||||
label: "เอกสารอ้างอิง",
|
||||
sortable: true,
|
||||
field: "commandName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "refCommandNo",
|
||||
name: "commandNo",
|
||||
align: "left",
|
||||
label: "เลขที่คำสั่ง",
|
||||
sortable: true,
|
||||
field: "refCommandNo",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
field: "commandNo",
|
||||
format(val, row) {
|
||||
return row.commandNo && row.commandYear
|
||||
? `${row.commandNo}/${row.commandYear}`
|
||||
: "";
|
||||
},
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "commandCode",
|
||||
align: "left",
|
||||
label: "ประเภทคำสั่ง",
|
||||
sortable: true,
|
||||
field: "commandCode",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format(val, row) {
|
||||
return store.convertCommandCodeName(val);
|
||||
},
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "commandDateSign",
|
||||
align: "left",
|
||||
label: "วันที่ลงนาม",
|
||||
sortable: true,
|
||||
field: "commandDateSign",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format: (v) => date2Thai(v),
|
||||
sort: (a: string, b: string) =>
|
||||
a
|
||||
.toString()
|
||||
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "organization",
|
||||
align: "left",
|
||||
label: "สังกัด",
|
||||
sortable: true,
|
||||
field: "organization",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format(val, row) {
|
||||
return findOrgName({
|
||||
root: row.orgRoot,
|
||||
child1: row.orgChild1,
|
||||
child2: row.orgChild2,
|
||||
child3: row.orgChild3,
|
||||
child4: row.orgChild4,
|
||||
});
|
||||
},
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "remark",
|
||||
|
|
@ -435,6 +244,8 @@ const baseColumnsHistory = ref<QTableProps["columns"]>([
|
|||
field: "remark",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "lastUpdateFullName",
|
||||
|
|
@ -444,6 +255,10 @@ const baseColumnsHistory = ref<QTableProps["columns"]>([
|
|||
field: "lastUpdateFullName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a
|
||||
.toString()
|
||||
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "lastUpdatedAt",
|
||||
|
|
@ -454,8 +269,42 @@ const baseColumnsHistory = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format: (v) => date2Thai(v, false, true),
|
||||
sort: (a: string, b: string) =>
|
||||
a
|
||||
.toString()
|
||||
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
const baseVisibleColumns = ref<string[]>([
|
||||
"commandDateAffect",
|
||||
"posNo",
|
||||
"positionName",
|
||||
"positionType",
|
||||
"positionLevel",
|
||||
"positionExecutive",
|
||||
"amount",
|
||||
"commandNo",
|
||||
"commandCode",
|
||||
"commandDateSign",
|
||||
"organization",
|
||||
"remark",
|
||||
"lastUpdateFullName",
|
||||
"lastUpdatedAt",
|
||||
]);
|
||||
|
||||
const columns = ref<QTableColumn[]>(
|
||||
baseColumns.value.filter(
|
||||
(e: QTableColumn) =>
|
||||
e.name !== "lastUpdateFullName" && e.name !== "lastUpdatedAt"
|
||||
)
|
||||
);
|
||||
const visibleColumns = ref<String[]>(
|
||||
baseVisibleColumns.value.filter(
|
||||
(e: string) => e !== "lastUpdateFullName" && e !== "lastUpdatedAt"
|
||||
)
|
||||
);
|
||||
const columnsHistory = ref<QTableColumn[]>(baseColumns.value);
|
||||
const visibleColumnsHistory = ref<string[]>(baseVisibleColumns.value);
|
||||
|
||||
/** เปิด dialog ประวัติ*/
|
||||
function onHistory(id: string) {
|
||||
|
|
@ -551,6 +400,29 @@ async function fetchDataTenure() {
|
|||
});
|
||||
}
|
||||
|
||||
/** function fetch ข้อมูลประเภทคำสั่ง*/
|
||||
async function fetchDataCommandCode() {
|
||||
if (store.commandCodeData.length > 0) return false;
|
||||
await http
|
||||
.get(config.API.orgCommandCode)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
const DataCommandCode = data.filter((e: DataCommandCode) =>
|
||||
store.positionCode.includes(e.code)
|
||||
);
|
||||
|
||||
const options = DataCommandCode.map((e: DataCommandCode) => ({
|
||||
id: e.code.toString(),
|
||||
name: e.name,
|
||||
}));
|
||||
|
||||
store.commandCodeData = options;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
link.value = await dataPerson.getProFileType();
|
||||
if (link.value === "-employee") {
|
||||
|
|
@ -558,6 +430,7 @@ onMounted(async () => {
|
|||
}
|
||||
getData();
|
||||
fetchDataTenure();
|
||||
fetchDataCommandCode();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
138
src/modules/10_registry/05_Other/03_FileOther.vue
Normal file
138
src/modules/10_registry/05_Other/03_FileOther.vue
Normal file
|
|
@ -0,0 +1,138 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useRegistryInFormationStore } from "@/modules/10_registry/store/registry";
|
||||
|
||||
import type { FileFormType } from "@/modules/10_registry/interface/index/Main";
|
||||
|
||||
const fileList = ref<FileFormType[]>([]);
|
||||
const store = useRegistryInFormationStore();
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
|
||||
|
||||
const modalHistory = ref<boolean>(false);
|
||||
/** ตัวแปรข้อมูล */
|
||||
|
||||
function onHistory() {
|
||||
modalHistory.value = true;
|
||||
}
|
||||
|
||||
/** get data */
|
||||
function getData() {
|
||||
showLoader();
|
||||
http
|
||||
.get(
|
||||
config.API.fileByFileUser(
|
||||
"ระบบทะเบียนประวัติ",
|
||||
"เอกสารหลักฐานเพิ่มเติม",
|
||||
store.citizenId
|
||||
)
|
||||
)
|
||||
.then((res) => {
|
||||
const data = res.data;
|
||||
fileList.value = data;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
setTimeout(() => {
|
||||
hideLoader();
|
||||
}, 1500);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ดาวน์โหลดลิงค์ไฟล์
|
||||
* @param fileName file name
|
||||
*/
|
||||
function downloadFile(fileName: string) {
|
||||
showLoader();
|
||||
http
|
||||
.get(
|
||||
config.API.fileByFile(
|
||||
"ระบบทะเบียนประวัติ",
|
||||
"เอกสารหลักฐานเพิ่มเติม",
|
||||
store.citizenId,
|
||||
fileName
|
||||
)
|
||||
)
|
||||
.then((res) => {
|
||||
const data = res.data.downloadUrl;
|
||||
window.open(data, "_blank");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getData();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="col-12">
|
||||
<q-toolbar class="q-px-none q-mt-md">
|
||||
<span class="text-blue-6 text-weight-bold text-body1">เอกสาร ก.พ.7 </span>
|
||||
</q-toolbar>
|
||||
<q-card bordered class="row col-12" style="border: 1px solid #d6dee1">
|
||||
<div class="col-12 text-weight-medium bg-grey-1 q-py-sm q-px-md">
|
||||
ไฟล์เอกสาร ก.พ.7
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="row col-12 q-col-gutter-y-sm q-pa-sm">
|
||||
<div v-if="fileList.length > 0" class="col-xs-12 row">
|
||||
<q-list class="full-width rounded-borders" bordered separator>
|
||||
<q-item
|
||||
clickable
|
||||
v-ripple
|
||||
v-for="data in fileList"
|
||||
:key="data.id"
|
||||
class="items-center"
|
||||
>
|
||||
<q-item-section>{{ data.fileName }}</q-item-section>
|
||||
<q-space />
|
||||
<div>
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
color="blue"
|
||||
icon="mdi-download"
|
||||
@click="downloadFile(data.fileName)"
|
||||
><q-tooltip>ดาวน์โหลดไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</div>
|
||||
|
||||
<div class="col-12" v-else>
|
||||
<q-card class="q-pa-md" bordered> ไม่มีรายการเอกสาร </q-card>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.absolute_button {
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
top: -20px;
|
||||
}
|
||||
|
||||
.fix_top {
|
||||
justify-content: start !important;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -11,4 +11,14 @@ interface DataRequest {
|
|||
topic: string;
|
||||
}
|
||||
|
||||
export type { DataRequest };
|
||||
interface DataCommandCode {
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
lastUpdatedAt: Date;
|
||||
createdFullName: string;
|
||||
lastUpdateFullName: string;
|
||||
name: string;
|
||||
code: number;
|
||||
}
|
||||
|
||||
export type { DataRequest, DataCommandCode };
|
||||
|
|
|
|||
35
src/modules/10_registry/store/Position.ts
Normal file
35
src/modules/10_registry/store/Position.ts
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
import { ref } from "vue";
|
||||
import { defineStore } from "pinia";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
import type { DataOption } from "@/modules/10_registry/interface/index/Main";
|
||||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const {} = mixin;
|
||||
|
||||
export const useGovernmentPosDataStore = defineStore("GovernmentPos", () => {
|
||||
// commandCode ขอตำแหน่ง
|
||||
const positionCode = ref<number[]>([
|
||||
0, 1, 2, 3, 4, 8, 9, 10, 11, 12, 13, 14, 15, 16,
|
||||
]);
|
||||
|
||||
const commandCodeData = ref<DataOption[]>([]);
|
||||
|
||||
function convertCommandCodeName(val: string) {
|
||||
return (
|
||||
commandCodeData.value.find((e: DataOption) => e.id === val)?.name ?? "-"
|
||||
);
|
||||
}
|
||||
|
||||
return {
|
||||
// Data
|
||||
commandCodeData,
|
||||
positionCode,
|
||||
|
||||
// Function
|
||||
convertCommandCodeName,
|
||||
};
|
||||
});
|
||||
|
|
@ -10,6 +10,7 @@ export const useRegistryInFormationStore = defineStore(
|
|||
() => {
|
||||
const typeProfile = ref<string>("OFFICER");
|
||||
const profileId = ref<string>("");
|
||||
const citizenId = ref<string>("");
|
||||
|
||||
function typeChangeName(val: string) {
|
||||
switch (val) {
|
||||
|
|
@ -29,6 +30,6 @@ export const useRegistryInFormationStore = defineStore(
|
|||
return "-";
|
||||
}
|
||||
}
|
||||
return { typeChangeName, typeProfile, profileId };
|
||||
return { typeChangeName, typeProfile, profileId, citizenId };
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { useRouter } from "vue-router";
|
|||
/** component */
|
||||
import Other from "@/modules/10_registry/05_Other/01_Other.vue";
|
||||
import File from "@/modules/10_registry/05_Other/02_File.vue";
|
||||
import FileOther from "@/modules/10_registry/05_Other/03_FileOther.vue";
|
||||
|
||||
const router = useRouter();
|
||||
</script>
|
||||
|
|
@ -27,6 +28,7 @@ const router = useRouter();
|
|||
<div :class="`row q-my-sm ${$q.screen.gt.xs ? '' : 'mobileClass'}`">
|
||||
<Other />
|
||||
<File />
|
||||
<FileOther />
|
||||
</div>
|
||||
</template>
|
||||
<style scoped>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import { useCounterMixin } from "./mixin";
|
|||
import type { ProfileData } from "@/interface/Main";
|
||||
|
||||
export const useDataStore = defineStore("dataMain", () => {
|
||||
const dataProfile = ref<any>()
|
||||
const dataProfile = ref<any>();
|
||||
const storeRegistry = useRegistryInFormationStore();
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
|
|
@ -112,6 +112,7 @@ export const useDataStore = defineStore("dataMain", () => {
|
|||
formData.posLevelName = data.posLevelName;
|
||||
formData.posNo = findPosMasterNo(data);
|
||||
storeRegistry.profileId = data.profileId;
|
||||
storeRegistry.citizenId = data.citizenId;
|
||||
}
|
||||
|
||||
async function getProFileType() {
|
||||
|
|
@ -151,7 +152,7 @@ export const useDataStore = defineStore("dataMain", () => {
|
|||
formData,
|
||||
officerLink,
|
||||
getProFileType,
|
||||
dataProfile
|
||||
dataProfile,
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue