2023-08-16 18:15:26 +07:00
|
|
|
<script setup lang="ts">
|
2023-09-01 16:22:34 +07:00
|
|
|
import { onMounted, ref, computed, reactive } from "vue";
|
2023-08-16 18:15:26 +07:00
|
|
|
import { useCounterMixin } from "@/stores/mixin";
|
2023-09-22 15:14:06 +07:00
|
|
|
import { useQuasar, QForm } from "quasar";
|
2023-08-17 09:58:09 +07:00
|
|
|
import type { QTableProps } from "quasar";
|
2023-08-21 11:55:57 +07:00
|
|
|
import { useInsigniaDataStore } from "@/modules/07_insignia/store";
|
2023-09-08 13:21:07 +07:00
|
|
|
import { useroleUserDataStore } from "@/stores/roleUser";
|
2023-08-21 11:55:57 +07:00
|
|
|
import http from "@/plugins/http";
|
|
|
|
|
import config from "@/app.config";
|
2023-08-22 17:56:24 +07:00
|
|
|
import { useRouter } from "vue-router";
|
|
|
|
|
|
2023-08-25 09:56:03 +07:00
|
|
|
import DialogPopupReason from "@/components/Dialogs/PopupReason.vue";
|
2023-09-25 14:21:01 +07:00
|
|
|
import DialogInformation from "@/components/Dialogs/Information.vue";
|
2023-09-13 15:51:37 +07:00
|
|
|
import DialogHeader from "@/components/DialogHeader.vue";
|
2023-09-15 14:34:31 +07:00
|
|
|
import btnDownloadFile from "./downloadFile.vue";
|
2023-08-16 18:15:26 +07:00
|
|
|
|
2023-09-22 15:14:06 +07:00
|
|
|
const myForm = ref<QForm>();
|
2023-08-25 09:56:03 +07:00
|
|
|
const router = useRouter();
|
2023-08-16 18:15:26 +07:00
|
|
|
const mixin = useCounterMixin();
|
2023-09-01 13:54:08 +07:00
|
|
|
const {
|
|
|
|
|
dialogConfirm,
|
|
|
|
|
showLoader,
|
|
|
|
|
hideLoader,
|
|
|
|
|
messageError,
|
|
|
|
|
success,
|
|
|
|
|
dialogMessageNotify,
|
|
|
|
|
} = mixin;
|
2023-08-16 18:15:26 +07:00
|
|
|
const $q = useQuasar();
|
2023-08-21 11:55:57 +07:00
|
|
|
const DataStore = useInsigniaDataStore();
|
2023-09-08 13:21:07 +07:00
|
|
|
const roleDataStore = useroleUserDataStore();
|
2023-08-16 18:15:26 +07:00
|
|
|
|
2023-08-25 09:56:03 +07:00
|
|
|
const modelPopupReject = ref<boolean>(false);
|
|
|
|
|
const modelPopupDelete = ref<boolean>(false);
|
2023-08-21 16:31:28 +07:00
|
|
|
const modalAdd = ref<boolean>(false);
|
2023-08-21 18:07:35 +07:00
|
|
|
const modalEdit = ref<boolean>(false);
|
2023-08-25 09:56:03 +07:00
|
|
|
const rowid = ref<string>("");
|
2023-08-21 16:31:28 +07:00
|
|
|
const organization = ref<string>("");
|
2023-09-25 14:21:01 +07:00
|
|
|
// หมายเหตุ
|
|
|
|
|
const dialogNote = ref<boolean>(false);
|
|
|
|
|
const dialogTitle = ref<string>("");
|
|
|
|
|
const dialogDesc = ref<string>("");
|
2023-09-28 17:14:37 +07:00
|
|
|
const typeinsigniaOptions = ref<any>(DataStore.typeinsigniaOptions);
|
|
|
|
|
const employeeClassOps = ref<any>(DataStore.employeeClassOps);
|
2023-09-25 14:21:01 +07:00
|
|
|
// แจ้งเตือน
|
|
|
|
|
const dialogWarn = ref<boolean>(false);
|
2023-09-27 16:58:49 +07:00
|
|
|
const checkboxData = ref<any>([]);
|
2023-08-28 11:27:08 +07:00
|
|
|
|
2023-08-21 16:31:28 +07:00
|
|
|
const organizationOptions = ref<any>([{ id: "1", name: "ทั้งหมด" }]);
|
2023-09-28 17:14:37 +07:00
|
|
|
const filterOrganizationOP = ref<any>([]);
|
2023-08-16 18:15:26 +07:00
|
|
|
const visibleColumns = ref<string[]>([
|
|
|
|
|
"no",
|
|
|
|
|
"citizenId",
|
|
|
|
|
"name",
|
2023-09-01 13:54:08 +07:00
|
|
|
"employeeType",
|
2023-08-16 18:15:26 +07:00
|
|
|
"position",
|
|
|
|
|
"level",
|
|
|
|
|
"salary",
|
|
|
|
|
"insigniaType",
|
|
|
|
|
"insigniaSend",
|
|
|
|
|
"insigniaLevel",
|
|
|
|
|
"dateSend",
|
2023-09-25 14:21:01 +07:00
|
|
|
"note",
|
|
|
|
|
"warn",
|
2023-08-16 18:15:26 +07:00
|
|
|
]);
|
|
|
|
|
// หัวตาราง
|
|
|
|
|
const columns = ref<QTableProps["columns"]>([
|
|
|
|
|
{
|
|
|
|
|
name: "no",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ลำดับ",
|
2023-09-20 15:33:39 +07:00
|
|
|
sortable: false,
|
2023-08-16 18:15:26 +07:00
|
|
|
field: "no",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "citizenId",
|
|
|
|
|
align: "left",
|
2023-09-01 13:54:08 +07:00
|
|
|
label: "เลขประจำตัวประชาชน",
|
2023-08-16 18:15:26 +07:00
|
|
|
sortable: true,
|
|
|
|
|
field: "citizenId",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "name",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ชื่อ-นามสกุล",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "name",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
2023-09-01 13:54:08 +07:00
|
|
|
{
|
|
|
|
|
name: "employeeType",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "สถานภาพ",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "employeeType",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
2023-08-16 18:15:26 +07:00
|
|
|
{
|
|
|
|
|
name: "position",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ตำแหน่ง",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "position",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "level",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "อันดับ/ระดับ",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "level",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "salary",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "เงินเดือน",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "salary",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "insigniaType",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ประเภทเครื่องราชฯ ปัจจุบัน",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "insigniaType",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "insigniaSend",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ประเภทเครื่องราชฯ ที่ยื่นขอ",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "insigniaSend",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "insigniaLevel",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ชั้นเครื่องราชฯ",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "insigniaLevel",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "dateSend",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "วันที่ยื่นขอ",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "dateSend",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
2023-09-25 14:21:01 +07:00
|
|
|
{
|
|
|
|
|
name: "note",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "หมายเหตุ",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "warn",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "แจ้งเตือน",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
2023-08-16 18:15:26 +07:00
|
|
|
]);
|
|
|
|
|
|
2023-08-21 16:31:28 +07:00
|
|
|
const columns2 = ref<QTableProps["columns"]>([
|
|
|
|
|
{
|
|
|
|
|
name: "index",
|
|
|
|
|
required: true,
|
|
|
|
|
label: "ลำดับ",
|
|
|
|
|
field: "index",
|
|
|
|
|
align: "left",
|
2023-09-22 15:14:06 +07:00
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
2023-08-21 16:31:28 +07:00
|
|
|
},
|
|
|
|
|
{
|
2023-09-22 15:14:06 +07:00
|
|
|
name: "citizenId",
|
2023-08-21 16:31:28 +07:00
|
|
|
required: true,
|
2023-09-22 15:14:06 +07:00
|
|
|
label: "เลขประจำตัวประชาชน",
|
|
|
|
|
field: "citizenId",
|
2023-08-21 16:31:28 +07:00
|
|
|
align: "left",
|
2023-09-22 15:14:06 +07:00
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
2023-08-21 16:31:28 +07:00
|
|
|
},
|
|
|
|
|
{
|
2023-09-22 15:14:06 +07:00
|
|
|
name: "fullname",
|
2023-08-21 16:31:28 +07:00
|
|
|
required: true,
|
2023-09-22 15:14:06 +07:00
|
|
|
label: "ชื่อ-นามสกุล",
|
|
|
|
|
field: "fullname",
|
2023-08-21 16:31:28 +07:00
|
|
|
align: "left",
|
2023-09-22 15:14:06 +07:00
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
2023-08-21 16:31:28 +07:00
|
|
|
},
|
2023-09-22 15:14:06 +07:00
|
|
|
// {
|
|
|
|
|
// name: "position",
|
|
|
|
|
// required: true,
|
2023-09-25 14:21:01 +07:00
|
|
|
// label: "หมายเหตุ",
|
2023-09-22 15:14:06 +07:00
|
|
|
// field: "position",
|
|
|
|
|
// align: "left",
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// name: "level",
|
|
|
|
|
// required: true,
|
2023-09-25 14:21:01 +07:00
|
|
|
// label: "แจ้งเตื่อน",
|
2023-09-22 15:14:06 +07:00
|
|
|
// field: "level",
|
|
|
|
|
// align: "left",
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// name: "organizationOrganization",
|
|
|
|
|
// required: true,
|
|
|
|
|
// label: "สังกัด",
|
|
|
|
|
// field: "organizationOrganization",
|
|
|
|
|
// align: "left",
|
|
|
|
|
// },
|
2023-08-21 16:31:28 +07:00
|
|
|
]);
|
2023-08-22 15:58:34 +07:00
|
|
|
|
2023-08-21 16:31:28 +07:00
|
|
|
const rows2 = ref<any[]>([]);
|
2023-08-17 09:58:09 +07:00
|
|
|
const person = ref<any>([]);
|
2023-08-21 11:55:57 +07:00
|
|
|
const props = defineProps({
|
|
|
|
|
tab: {
|
|
|
|
|
type: String,
|
|
|
|
|
},
|
|
|
|
|
roundId: {
|
|
|
|
|
type: String,
|
|
|
|
|
},
|
2023-08-21 16:31:28 +07:00
|
|
|
fecthInsigniaAll: {
|
|
|
|
|
type: Function,
|
|
|
|
|
},
|
|
|
|
|
fecthInsigniaByOc: {
|
|
|
|
|
type: Function,
|
|
|
|
|
},
|
2023-08-28 15:51:40 +07:00
|
|
|
roundName: {
|
|
|
|
|
type: String,
|
|
|
|
|
},
|
2023-08-25 23:49:41 +07:00
|
|
|
requestStatus: {
|
|
|
|
|
type: String,
|
2023-08-28 11:27:08 +07:00
|
|
|
},
|
2023-09-18 16:08:05 +07:00
|
|
|
fecthStat: {
|
|
|
|
|
type: Function,
|
|
|
|
|
},
|
2023-08-21 11:55:57 +07:00
|
|
|
});
|
2023-08-22 15:58:34 +07:00
|
|
|
|
2023-08-21 11:55:57 +07:00
|
|
|
onMounted(async () => {
|
2023-08-25 09:56:03 +07:00
|
|
|
organization.value = await (DataStore.agency != null
|
|
|
|
|
? DataStore.agency
|
|
|
|
|
: DataStore.typeOc);
|
2023-08-23 22:23:09 +07:00
|
|
|
organizationOptions.value = await DataStore.optionsTypeOc;
|
2023-08-21 16:31:28 +07:00
|
|
|
if (organization.value !== "" || organization.value !== undefined) {
|
|
|
|
|
if (props.fecthInsigniaByOc) {
|
|
|
|
|
props.fecthInsigniaByOc(
|
|
|
|
|
props.roundId,
|
|
|
|
|
organization.value,
|
|
|
|
|
"officer",
|
|
|
|
|
props.tab
|
|
|
|
|
);
|
2023-09-07 16:05:25 +07:00
|
|
|
DataStore.mainTab = props.tab;
|
2023-08-21 16:31:28 +07:00
|
|
|
}
|
|
|
|
|
}
|
2023-09-28 17:14:37 +07:00
|
|
|
filterOrganizationOP.value = organizationOptions.value;
|
2023-08-21 11:55:57 +07:00
|
|
|
});
|
2023-09-19 14:58:16 +07:00
|
|
|
// เช็คสถานนะแสดงปุ่มเพิ่ม
|
2023-09-01 16:22:34 +07:00
|
|
|
const checkStatus = computed(() => {
|
|
|
|
|
if (
|
2023-09-08 13:21:07 +07:00
|
|
|
roleDataStore.insignia1Role &&
|
2023-09-01 16:22:34 +07:00
|
|
|
(DataStore.requestStatus == "st1" || DataStore.requestStatus == "st4")
|
|
|
|
|
) {
|
|
|
|
|
return true;
|
|
|
|
|
} else return false;
|
|
|
|
|
});
|
2023-09-21 14:21:26 +07:00
|
|
|
// เลือกหน่วยงาน
|
2023-08-21 16:31:28 +07:00
|
|
|
const changtypeOc = () => {
|
2023-09-28 17:14:37 +07:00
|
|
|
if (organization.value !== null) {
|
|
|
|
|
props.fecthInsigniaByOc?.(
|
2023-08-21 16:31:28 +07:00
|
|
|
props.roundId,
|
|
|
|
|
organization.value,
|
|
|
|
|
"officer",
|
|
|
|
|
props.tab
|
|
|
|
|
);
|
|
|
|
|
}
|
2023-08-22 16:54:15 +07:00
|
|
|
DataStore.typeOc = organization.value;
|
2023-08-21 16:31:28 +07:00
|
|
|
};
|
2023-09-19 14:58:16 +07:00
|
|
|
// เพิ่มราชชื่อ
|
2023-09-22 15:14:06 +07:00
|
|
|
const clickmodalAdd = async () => {
|
2023-09-21 12:07:12 +07:00
|
|
|
let ocId = DataStore.typeOc ? DataStore.typeOc : DataStore.agency;
|
2023-08-21 16:31:28 +07:00
|
|
|
showLoader();
|
2023-09-22 15:14:06 +07:00
|
|
|
await fecthInsignia();
|
|
|
|
|
await fecthlistperson(ocId);
|
|
|
|
|
clearForm();
|
2023-08-21 16:31:28 +07:00
|
|
|
};
|
2023-09-19 14:58:16 +07:00
|
|
|
// เรียกรายชื่อข้าราชการตามหน่วยงานที่จะเพิ่ม
|
2023-08-21 16:31:28 +07:00
|
|
|
const fecthlistperson = async (id: string) => {
|
|
|
|
|
let data = [{}];
|
|
|
|
|
data = [
|
|
|
|
|
{
|
|
|
|
|
criteriaType: "is_retire",
|
|
|
|
|
criteriaValue: "false",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
criteriaType: "is_probation",
|
|
|
|
|
criteriaValue: "false",
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
await http
|
|
|
|
|
.post(config.API.profileSearchNewOcIdType(id, "officer"), {
|
|
|
|
|
criterias: data,
|
|
|
|
|
})
|
|
|
|
|
.then((res) => {
|
2023-09-01 13:54:08 +07:00
|
|
|
let data = res.data.result.map((e: any) => ({
|
2023-08-21 16:31:28 +07:00
|
|
|
id: e.id,
|
2023-09-22 15:14:06 +07:00
|
|
|
citizenId: e.citizenId,
|
2023-08-21 16:31:28 +07:00
|
|
|
fullname: e.fullname == null ? "-" : e.fullname,
|
|
|
|
|
position: e.position == null ? "-" : e.position,
|
|
|
|
|
level: e.positionEmployeeLevel == null ? "-" : e.positionEmployeeLevel,
|
|
|
|
|
organizationOrganization: e.oc == null ? "-" : e.oc,
|
|
|
|
|
}));
|
|
|
|
|
modalAdd.value = true;
|
2023-09-19 14:58:16 +07:00
|
|
|
rows2.value = data;
|
2023-08-21 16:31:28 +07:00
|
|
|
})
|
|
|
|
|
.catch((e) => {
|
|
|
|
|
messageError($q, e);
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
hideLoader();
|
|
|
|
|
});
|
|
|
|
|
};
|
2023-09-19 14:58:16 +07:00
|
|
|
// ยืนยันการเพิ่มราชชื่อ
|
2023-09-22 15:14:06 +07:00
|
|
|
const clickAdd = async () => {
|
|
|
|
|
dataPerson.id
|
|
|
|
|
? await myForm.value!.validate().then((result: boolean) => {
|
2023-09-29 15:08:39 +07:00
|
|
|
if (result) {
|
|
|
|
|
dialogConfirm(
|
|
|
|
|
$q,
|
|
|
|
|
async () => {
|
|
|
|
|
await addlistperson(dataPerson.id);
|
|
|
|
|
},
|
|
|
|
|
"ยืนยันการเพิ่มรายชื่อคนที่ยื่นขอพระราชทานเครื่องราชฯ",
|
|
|
|
|
"ต้องการยืนยันการเพิ่มรายชื่อคนที่ยื่นขอพระราชทานเครื่องราชฯ นี้หรือไม่?"
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
})
|
2023-09-22 15:14:06 +07:00
|
|
|
: dialogMessageNotify($q, "กรุณาเลือกราชชื่อที่ต้องการเพิ่ม");
|
2023-08-21 16:31:28 +07:00
|
|
|
};
|
2023-09-19 14:58:16 +07:00
|
|
|
//เพิ่มราชชื่อข้าราชการ
|
2023-08-21 16:31:28 +07:00
|
|
|
const addlistperson = async (id: string) => {
|
|
|
|
|
showLoader();
|
|
|
|
|
let data = {
|
|
|
|
|
profileId: id,
|
2023-09-01 13:54:08 +07:00
|
|
|
insigniaId: insigniaType.value,
|
2023-08-21 16:31:28 +07:00
|
|
|
insigniaPeriodId: props.roundId,
|
2023-09-22 15:14:06 +07:00
|
|
|
reason: reason.value,
|
2023-08-21 16:31:28 +07:00
|
|
|
};
|
|
|
|
|
await http
|
|
|
|
|
.post(config.API.insigniaCreate(), data)
|
|
|
|
|
.then(() => {
|
|
|
|
|
success($q, "เพิ่มรายชื่อสำเร็จ");
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
messageError($q, err);
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
modalAdd.value = false;
|
|
|
|
|
if (props.fecthInsigniaByOc) {
|
|
|
|
|
props.fecthInsigniaByOc(
|
|
|
|
|
props.roundId,
|
|
|
|
|
organization.value,
|
|
|
|
|
"officer",
|
|
|
|
|
props.tab
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
hideLoader();
|
|
|
|
|
});
|
2023-08-21 11:55:57 +07:00
|
|
|
};
|
2023-09-19 14:58:16 +07:00
|
|
|
// เปิด POP แก้ไขเครื่องราชฯ
|
2023-08-22 15:58:34 +07:00
|
|
|
const clickmodalEdit = (props: any) => {
|
2023-08-22 16:54:15 +07:00
|
|
|
insignia.value = props.insigniaSend;
|
2023-08-22 15:58:34 +07:00
|
|
|
person.value = props;
|
2023-08-21 18:07:35 +07:00
|
|
|
modalEdit.value = true;
|
|
|
|
|
fecthInsignia();
|
|
|
|
|
};
|
2023-09-19 14:58:16 +07:00
|
|
|
// downloadfile รายชื่อข้าราชการสามัญฯ
|
2023-08-28 11:27:08 +07:00
|
|
|
const downloadFile = (response: any, filename: string) => {
|
|
|
|
|
const link = document.createElement("a");
|
|
|
|
|
var fileName = filename;
|
|
|
|
|
link.href = window.URL.createObjectURL(new Blob([response.data]));
|
|
|
|
|
link.setAttribute("download", fileName);
|
|
|
|
|
document.body.appendChild(link);
|
|
|
|
|
link.click();
|
|
|
|
|
document.body.removeChild(link);
|
|
|
|
|
};
|
2023-09-19 14:58:16 +07:00
|
|
|
// เรียก file รายชื่อข้าราชการสามัญฯ
|
2023-09-01 15:17:48 +07:00
|
|
|
const downloadFileexcel = async () => {
|
2023-09-29 09:49:43 +07:00
|
|
|
const findInsigniaId = DataStore.dataInsigniaType.find(
|
|
|
|
|
(e: any) => e.name == DataStore.typeinsignia
|
|
|
|
|
);
|
|
|
|
|
|
2023-08-28 11:27:08 +07:00
|
|
|
showLoader();
|
|
|
|
|
await http
|
2023-09-29 09:49:43 +07:00
|
|
|
.put(config.API.insigniaDowanload(DataStore.requestId), {
|
|
|
|
|
profileType:
|
|
|
|
|
DataStore.employeeClass == "all" ? null : DataStore.employeeClass,
|
|
|
|
|
InsigniaId: DataStore.typeinsignia == "all" ? null : findInsigniaId.id,
|
2023-09-29 15:08:39 +07:00
|
|
|
}, { responseType: "blob" })
|
2023-08-28 11:27:08 +07:00
|
|
|
.then(async (res) => {
|
2023-09-01 15:17:48 +07:00
|
|
|
await downloadFile(
|
2023-08-28 11:27:08 +07:00
|
|
|
res,
|
2023-09-01 15:17:48 +07:00
|
|
|
`รายชื่อข้าราชการสามัญฯ ${props.roundName}.xlsx`
|
2023-08-28 11:27:08 +07:00
|
|
|
);
|
|
|
|
|
})
|
2023-09-01 15:17:48 +07:00
|
|
|
.catch((err) => {
|
|
|
|
|
messageError($q, err);
|
2023-08-28 11:27:08 +07:00
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
hideLoader();
|
|
|
|
|
});
|
|
|
|
|
};
|
2023-09-19 14:58:16 +07:00
|
|
|
// ยืนยันการแก้ไขเครื่องราช
|
2023-08-21 18:07:35 +07:00
|
|
|
const clickSave = () => {
|
2023-08-21 16:31:28 +07:00
|
|
|
dialogConfirm(
|
|
|
|
|
$q,
|
|
|
|
|
async () => {
|
2023-08-22 15:58:34 +07:00
|
|
|
await listEdit(person.value.id);
|
2023-08-21 16:31:28 +07:00
|
|
|
},
|
|
|
|
|
"ยืนยันการแก้ไขเครื่องราชฯ ที่ยื่นขอ",
|
|
|
|
|
"ต้องการยืนยันการแก้ไขเครื่องราชฯ ที่ยื่นขอนี้หรือไม่ ?"
|
|
|
|
|
);
|
|
|
|
|
};
|
2023-09-19 14:58:16 +07:00
|
|
|
// แก้ไขเครื่องราช API
|
2023-08-22 15:58:34 +07:00
|
|
|
const listEdit = async (profileId: string) => {
|
|
|
|
|
let data: any = {
|
|
|
|
|
insigniaId: insignia.value,
|
|
|
|
|
};
|
2023-08-21 16:31:28 +07:00
|
|
|
await http
|
2023-08-22 15:58:34 +07:00
|
|
|
.put(config.API.insigniaEdit(profileId), data)
|
2023-08-21 16:31:28 +07:00
|
|
|
.then(() => {
|
|
|
|
|
success($q, "แก้ไขเครื่องราชฯ ที่ยื่นขอสำเร็จ");
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
messageError($q, err);
|
2023-08-22 15:58:34 +07:00
|
|
|
})
|
|
|
|
|
.finally(async () => {
|
|
|
|
|
modalEdit.value = false;
|
|
|
|
|
if (props.fecthInsigniaByOc) {
|
|
|
|
|
await props.fecthInsigniaByOc(
|
|
|
|
|
props.roundId,
|
|
|
|
|
organization.value,
|
|
|
|
|
"officer",
|
|
|
|
|
props.tab
|
|
|
|
|
);
|
|
|
|
|
}
|
2023-08-21 16:31:28 +07:00
|
|
|
});
|
|
|
|
|
};
|
2023-09-19 14:58:16 +07:00
|
|
|
//เปิด POPUP ไม่ยืนขอ
|
2023-08-25 09:56:03 +07:00
|
|
|
const clickReject = (id: string) => {
|
|
|
|
|
modelPopupReject.value = true;
|
|
|
|
|
rowid.value = id;
|
|
|
|
|
};
|
2023-09-19 14:58:16 +07:00
|
|
|
// ปิด POPUP ไม่ยืนขอ
|
|
|
|
|
const closemodelPopupReject = () => {
|
|
|
|
|
modelPopupReject.value = false;
|
|
|
|
|
};
|
|
|
|
|
// ยืนยัน การไม่ยืนขอ
|
2023-08-25 09:56:03 +07:00
|
|
|
const savaReasonReject = (reason: string) => {
|
2023-09-21 12:07:12 +07:00
|
|
|
dialogConfirm($q, async () => {
|
|
|
|
|
await listreject(rowid.value, reason);
|
|
|
|
|
if (props.fecthStat) {
|
|
|
|
|
await props.fecthStat(DataStore.roundId);
|
|
|
|
|
}
|
|
|
|
|
});
|
2023-08-21 16:31:28 +07:00
|
|
|
};
|
2023-09-19 14:58:16 +07:00
|
|
|
// ยืนยัน การไม่ยืนขอ API
|
2023-08-25 09:56:03 +07:00
|
|
|
const listreject = async (profileId: string, reason: string) => {
|
2023-08-21 16:31:28 +07:00
|
|
|
await http
|
2023-08-25 09:56:03 +07:00
|
|
|
.put(config.API.insigniaReject(profileId), { reason: reason })
|
2023-08-21 16:31:28 +07:00
|
|
|
.then(() => {
|
|
|
|
|
success($q, "ย้ายข้อมูลสำเร็จ");
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
messageError($q, err);
|
2023-08-22 15:58:34 +07:00
|
|
|
})
|
|
|
|
|
.finally(async () => {
|
|
|
|
|
if (props.fecthInsigniaByOc) {
|
|
|
|
|
await props.fecthInsigniaByOc(
|
|
|
|
|
props.roundId,
|
|
|
|
|
organization.value,
|
|
|
|
|
"officer",
|
|
|
|
|
props.tab
|
|
|
|
|
);
|
|
|
|
|
}
|
2023-08-25 09:56:03 +07:00
|
|
|
await closemodelPopupReject();
|
2023-08-21 16:31:28 +07:00
|
|
|
});
|
2023-08-16 18:15:26 +07:00
|
|
|
};
|
2023-09-19 14:58:16 +07:00
|
|
|
//เปิด POPUP คนที่ถูกลบ
|
2023-08-25 09:56:03 +07:00
|
|
|
const clickDelete = (id: string) => {
|
|
|
|
|
modelPopupDelete.value = true;
|
|
|
|
|
rowid.value = id;
|
|
|
|
|
};
|
2023-09-19 14:58:16 +07:00
|
|
|
// ปิด POPUP คนที่ถูกลบ
|
2023-08-25 09:56:03 +07:00
|
|
|
const closemodelPopupDelete = () => {
|
|
|
|
|
modelPopupDelete.value = false;
|
|
|
|
|
};
|
2023-09-19 14:58:16 +07:00
|
|
|
// ยืนยัน การลบคนที่ถูกลบ
|
2023-08-25 09:56:03 +07:00
|
|
|
const savaReasonDelete = (reason: string) => {
|
|
|
|
|
dialogConfirm(
|
2023-08-21 16:31:28 +07:00
|
|
|
$q,
|
|
|
|
|
async () => {
|
2023-08-25 09:56:03 +07:00
|
|
|
await listdelete(rowid.value, reason);
|
2023-09-18 16:08:05 +07:00
|
|
|
if (props.fecthStat) {
|
|
|
|
|
await props.fecthStat(DataStore.roundId);
|
|
|
|
|
}
|
2023-08-21 16:31:28 +07:00
|
|
|
},
|
|
|
|
|
"ยืนยันการลบออกข้ออมูล",
|
|
|
|
|
"ต้องการยืนยันการลบข้อมูลนี้หรือไม่ ?"
|
|
|
|
|
);
|
2023-08-16 18:15:26 +07:00
|
|
|
};
|
2023-09-19 14:58:16 +07:00
|
|
|
// ยืนยัน คนที่ถูกลบ API
|
2023-08-25 09:56:03 +07:00
|
|
|
const listdelete = async (id: string, reason: string) => {
|
2023-08-21 16:31:28 +07:00
|
|
|
await http
|
2023-08-25 09:56:03 +07:00
|
|
|
.put(config.API.insigniaDelete(id), { reason: reason })
|
2023-08-21 16:31:28 +07:00
|
|
|
.then(() => {
|
|
|
|
|
success($q, "ลบข้อมูลสำเร็จ");
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
messageError($q, err);
|
2023-08-22 15:58:34 +07:00
|
|
|
})
|
|
|
|
|
.finally(async () => {
|
|
|
|
|
if (props.fecthInsigniaByOc) {
|
|
|
|
|
await props.fecthInsigniaByOc(
|
|
|
|
|
props.roundId,
|
|
|
|
|
organization.value,
|
|
|
|
|
"officer",
|
|
|
|
|
props.tab
|
|
|
|
|
);
|
|
|
|
|
}
|
2023-08-25 09:56:03 +07:00
|
|
|
await closemodelPopupDelete();
|
2023-08-21 16:31:28 +07:00
|
|
|
});
|
2023-08-16 18:15:26 +07:00
|
|
|
};
|
2023-09-22 15:14:06 +07:00
|
|
|
const dataPerson = reactive({
|
|
|
|
|
id: "",
|
|
|
|
|
position: "",
|
|
|
|
|
organizationOrganization: "",
|
|
|
|
|
level: "",
|
|
|
|
|
});
|
|
|
|
|
const reason = ref<string>("");
|
2023-09-24 09:14:17 +07:00
|
|
|
const selectPerson = (person: any) => {
|
2023-09-22 15:14:06 +07:00
|
|
|
dataPerson.id = person.id;
|
|
|
|
|
dataPerson.position = person.position;
|
|
|
|
|
dataPerson.organizationOrganization = person.organizationOrganization;
|
|
|
|
|
dataPerson.level = person.level;
|
|
|
|
|
};
|
|
|
|
|
const clearForm = () => {
|
2023-09-22 16:10:28 +07:00
|
|
|
filterKeyword2.value = "";
|
2023-09-22 15:14:06 +07:00
|
|
|
dataPerson.id = "";
|
|
|
|
|
dataPerson.position = "";
|
|
|
|
|
dataPerson.organizationOrganization = "";
|
|
|
|
|
dataPerson.level = "";
|
|
|
|
|
reason.value = "";
|
|
|
|
|
insigniaType.value = "";
|
|
|
|
|
};
|
2023-08-24 17:37:06 +07:00
|
|
|
|
2023-08-21 18:07:35 +07:00
|
|
|
const insignia = ref<string>("");
|
|
|
|
|
const insigniaOptions = ref<any>([]);
|
|
|
|
|
const insigniaType = ref<string>("");
|
2023-09-19 14:58:16 +07:00
|
|
|
// เรียกประเภทเครื่องราชฯ
|
2023-08-21 18:07:35 +07:00
|
|
|
const fecthInsignia = async () => {
|
|
|
|
|
await http
|
|
|
|
|
.get(config.API.insignia)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
insigniaOptions.value = res.data.result;
|
|
|
|
|
})
|
2023-08-29 10:59:58 +07:00
|
|
|
.catch((e) => {
|
|
|
|
|
messageError($q, e);
|
2023-08-22 17:56:24 +07:00
|
|
|
});
|
2023-08-21 18:07:35 +07:00
|
|
|
};
|
2023-08-22 17:56:24 +07:00
|
|
|
const nextPage = (id: string) => {
|
|
|
|
|
router.push(`/registry/${id}`);
|
2023-08-21 18:07:35 +07:00
|
|
|
};
|
|
|
|
|
|
2023-08-16 18:15:26 +07:00
|
|
|
const filterKeyword = ref<string>("");
|
2023-08-21 16:31:28 +07:00
|
|
|
const filterKeyword2 = ref<string>("");
|
2023-08-16 18:15:26 +07:00
|
|
|
const filterRef = ref<any>(null);
|
|
|
|
|
const resetFilter = () => {
|
|
|
|
|
filterKeyword.value = "";
|
2023-08-21 16:31:28 +07:00
|
|
|
filterKeyword2.value = "";
|
2023-08-16 18:15:26 +07:00
|
|
|
filterRef.value.focus();
|
|
|
|
|
};
|
|
|
|
|
const pagination = ref({
|
2023-09-01 13:54:08 +07:00
|
|
|
sortBy: "name",
|
2023-08-16 18:15:26 +07:00
|
|
|
descending: false,
|
|
|
|
|
page: 1,
|
|
|
|
|
rowsPerPage: 10,
|
|
|
|
|
});
|
2023-08-21 16:31:28 +07:00
|
|
|
const pagination2 = ref({
|
2023-09-22 15:14:06 +07:00
|
|
|
sortBy: "fullname",
|
2023-08-21 16:31:28 +07:00
|
|
|
descending: false,
|
|
|
|
|
page: 1,
|
|
|
|
|
rowsPerPage: 10,
|
|
|
|
|
});
|
2023-08-16 18:15:26 +07:00
|
|
|
const paging = ref<boolean>(true);
|
2023-08-21 16:31:28 +07:00
|
|
|
const paging2 = ref<boolean>(true);
|
2023-08-24 17:37:06 +07:00
|
|
|
const paginationLabel = (start: number, end: number, total: number) => {
|
2023-08-16 18:15:26 +07:00
|
|
|
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
|
|
|
|
|
else return start + "-" + end + " ใน " + total;
|
|
|
|
|
};
|
2023-08-24 17:37:06 +07:00
|
|
|
const paginationLabel2 = (start: number, end: number, total: number) => {
|
2023-08-21 16:31:28 +07:00
|
|
|
if (paging2.value == true) return " " + start + "-" + end + " ใน " + total;
|
|
|
|
|
else return start + "-" + end + " ใน " + total;
|
|
|
|
|
};
|
2023-09-13 15:51:37 +07:00
|
|
|
const closeModalEdit = () => {
|
2023-09-15 14:34:31 +07:00
|
|
|
modalEdit.value = false;
|
|
|
|
|
};
|
2023-09-25 14:21:01 +07:00
|
|
|
// เปิด popup หมายเหตุ
|
|
|
|
|
const clickShowreson = (name: string, requestNote: string) => {
|
|
|
|
|
dialogTitle.value = "หมายเหตุ" + name;
|
|
|
|
|
dialogDesc.value = requestNote;
|
|
|
|
|
dialogNote.value = true;
|
|
|
|
|
};
|
|
|
|
|
// ปิด popup หมายเหตุ
|
|
|
|
|
const clickCloseReson = () => {
|
|
|
|
|
dialogNote.value = false;
|
|
|
|
|
};
|
2023-09-27 16:58:49 +07:00
|
|
|
const clickShowWarn = (
|
|
|
|
|
markDiscipline: boolean,
|
|
|
|
|
markLeave: boolean,
|
|
|
|
|
markRate: boolean
|
|
|
|
|
) => {
|
|
|
|
|
checkboxData.value = [
|
|
|
|
|
{ id: 1, name: "มีโทษทางวินัย", val: markDiscipline },
|
|
|
|
|
{
|
|
|
|
|
id: 2,
|
|
|
|
|
name: "ไม่ได้เลื่อนเงินเดือน/ไม่ได้เลื่อนขั้น เนื่องจากลาเกิน",
|
|
|
|
|
val: markLeave,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 3,
|
|
|
|
|
name: "ผลการประเมินการปฏิบัติราชการในรอบ 5 ปี ต่ำกว่าระดับดี (น้อยกว่าร้อยละ 70)",
|
|
|
|
|
val: markRate,
|
|
|
|
|
},
|
|
|
|
|
];
|
2023-09-25 14:21:01 +07:00
|
|
|
dialogWarn.value = true;
|
|
|
|
|
};
|
2023-09-28 17:14:37 +07:00
|
|
|
|
|
|
|
|
const filterSelector = (val: any, update: Function, name: any) => {
|
|
|
|
|
update(() => {
|
|
|
|
|
const needle = val.toLowerCase();
|
2023-09-29 09:49:43 +07:00
|
|
|
if (name === "typeinsigniaOptions") {
|
|
|
|
|
DataStore.typeinsignia = "";
|
|
|
|
|
typeinsigniaOptions.value = DataStore.typeinsigniaOptions.filter(
|
|
|
|
|
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
|
|
|
|
);
|
|
|
|
|
} else if (name === "employeeClassOps") {
|
|
|
|
|
DataStore.employeeClass = "";
|
|
|
|
|
employeeClassOps.value = DataStore.employeeClassOps.filter(
|
|
|
|
|
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
|
|
|
|
);
|
|
|
|
|
} else if (name === "filterOrganizationOP") {
|
2023-09-28 17:14:37 +07:00
|
|
|
filterOrganizationOP.value = organizationOptions.value.filter(
|
2023-09-29 09:49:43 +07:00
|
|
|
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
|
|
|
|
);
|
2023-09-28 17:14:37 +07:00
|
|
|
}
|
2023-09-29 09:49:43 +07:00
|
|
|
});
|
|
|
|
|
};
|
2023-09-28 17:14:37 +07:00
|
|
|
|
|
|
|
|
const clearInsigniaFilters = (name: string) => {
|
|
|
|
|
if (name === "typeinsigniaOptions") {
|
|
|
|
|
DataStore.typeinsignia = "all";
|
|
|
|
|
typeinsigniaOptions.value = DataStore.typeinsigniaOptions;
|
2023-09-29 09:49:43 +07:00
|
|
|
} else if (name === "employeeClassOps") {
|
2023-09-28 17:14:37 +07:00
|
|
|
DataStore.employeeClass = "all";
|
|
|
|
|
employeeClassOps.value = DataStore.employeeClassOps;
|
|
|
|
|
}
|
|
|
|
|
};
|
2023-08-16 18:15:26 +07:00
|
|
|
</script>
|
2023-08-24 17:37:06 +07:00
|
|
|
|
2023-08-16 18:15:26 +07:00
|
|
|
<template>
|
|
|
|
|
<div class="col-12 row q-pa-md">
|
|
|
|
|
<div class="row col-12">
|
|
|
|
|
<div class="row col-12 q-col-gutter-sm">
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-select class="col-4" v-if="roleDataStore.adminRole" v-model="organization" label="หน่วยงาน" dense emit-value
|
|
|
|
|
map-options :options="filterOrganizationOP" option-value="id" option-label="name" lazy-rules use-input
|
|
|
|
|
hide-bottom-space :readonly="false" :borderless="false" :outlined="true" :hide-dropdown-icon="false"
|
|
|
|
|
style="min-width: 150px" @update:model-value="changtypeOc" @filter="(inputValue: any,
|
|
|
|
|
doneFn: Function) => filterSelector(inputValue, doneFn, 'filterOrganizationOP'
|
|
|
|
|
)" />
|
|
|
|
|
<q-select class="col-1" v-model="DataStore.typeinsignia" label="ประเภทเครื่องราชฯ ที่ยืนขอ" dense emit-value
|
|
|
|
|
map-options :options="typeinsigniaOptions" option-value="id" option-label="name" lazy-rules hide-bottom-space
|
|
|
|
|
use-input :readonly="false" :borderless="false" :outlined="true" :hide-dropdown-icon="false"
|
|
|
|
|
style="min-width: 180px" @update:model-value="
|
2023-09-07 09:33:04 +07:00
|
|
|
DataStore.searchDataTable(
|
|
|
|
|
DataStore.typeinsignia,
|
|
|
|
|
DataStore.employeeClass
|
|
|
|
|
)
|
2023-09-29 15:08:39 +07:00
|
|
|
" @filter="(inputValue: any,
|
|
|
|
|
doneFn: Function) => filterSelector(inputValue, doneFn, 'typeinsigniaOptions'
|
|
|
|
|
)">
|
2023-09-28 17:14:37 +07:00
|
|
|
<template v-if="DataStore.typeinsignia !== 'all'" v-slot:append>
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-icon name="cancel" @click.stop.prevent="
|
|
|
|
|
clearInsigniaFilters('typeinsigniaOptions'),
|
|
|
|
|
DataStore.searchDataTable(
|
|
|
|
|
DataStore.typeinsignia,
|
|
|
|
|
DataStore.employeeClass
|
|
|
|
|
)
|
|
|
|
|
" class="cursor-pointer" />
|
2023-09-28 17:14:37 +07:00
|
|
|
</template>
|
2023-10-09 09:42:55 +07:00
|
|
|
<template v-slot:no-option>
|
|
|
|
|
<q-item>
|
|
|
|
|
<q-item-section class="text-grey">
|
|
|
|
|
ไม่มีข้อมูล
|
|
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</template>
|
2023-09-28 17:14:37 +07:00
|
|
|
</q-select>
|
2023-09-01 13:54:08 +07:00
|
|
|
<div>
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-select class="col-2" v-model="DataStore.employeeClass" dense outlined lazy-rules hide-bottom-space
|
|
|
|
|
:label="`${'สถานภาพ'}`" emit-value use-input map-options option-label="name" :options="employeeClassOps"
|
|
|
|
|
option-value="id" :readonly="false" :borderless="false" style="min-width: 150px" @update:model-value="
|
2023-09-07 09:33:04 +07:00
|
|
|
DataStore.searchDataTable(
|
|
|
|
|
DataStore.typeinsignia,
|
|
|
|
|
DataStore.employeeClass
|
|
|
|
|
)
|
2023-09-29 15:08:39 +07:00
|
|
|
" @filter="(inputValue: any,
|
|
|
|
|
doneFn: Function) => filterSelector(inputValue, doneFn, 'employeeClassOps'
|
|
|
|
|
)">
|
2023-09-28 17:14:37 +07:00
|
|
|
<template v-if="DataStore.employeeClass !== 'all'" v-slot:append>
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-icon name="cancel" @click.stop.prevent="
|
|
|
|
|
clearInsigniaFilters('employeeClassOps'),
|
|
|
|
|
DataStore.searchDataTable(
|
|
|
|
|
DataStore.typeinsignia,
|
|
|
|
|
DataStore.employeeClass
|
|
|
|
|
)
|
|
|
|
|
" class="cursor-pointer" />
|
2023-09-28 17:14:37 +07:00
|
|
|
</template>
|
2023-10-09 09:42:55 +07:00
|
|
|
<template v-slot:no-option>
|
|
|
|
|
<q-item>
|
|
|
|
|
<q-item-section class="text-grey">
|
|
|
|
|
ไม่มีข้อมูล
|
|
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</template>
|
2023-09-28 17:14:37 +07:00
|
|
|
</q-select>
|
2023-09-01 13:54:08 +07:00
|
|
|
</div>
|
2023-08-16 18:15:26 +07:00
|
|
|
<div>
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-btn size="md" icon="mdi-download" flat round color="primary" @click="downloadFileexcel">
|
2023-08-16 18:15:26 +07:00
|
|
|
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
|
|
|
|
</q-btn>
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-btn size="12px" flat round color="add" icon="mdi-plus" @click="clickmodalAdd" v-if="(DataStore.isLock == false &&
|
|
|
|
|
DataStore.requestStatus == 'st5' &&
|
|
|
|
|
roleDataStore.adminRole) ||
|
|
|
|
|
checkStatus == true
|
|
|
|
|
">
|
2023-08-16 18:15:26 +07:00
|
|
|
<q-tooltip>เพิ่ม</q-tooltip>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</div>
|
|
|
|
|
<q-space />
|
|
|
|
|
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-input class="col-xs-12 col-sm-3 col-md-2" standout dense v-model="filterKeyword" ref="filterRef" outlined
|
|
|
|
|
debounce="300" placeholder="ค้นหา">
|
2023-08-16 18:15:26 +07:00
|
|
|
<template v-slot:append>
|
|
|
|
|
<q-icon v-if="filterKeyword == ''" name="search" />
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-icon v-if="filterKeyword !== ''" name="clear" class="cursor-pointer" @click="resetFilter" />
|
2023-08-16 18:15:26 +07:00
|
|
|
</template>
|
|
|
|
|
</q-input>
|
|
|
|
|
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-select v-model="visibleColumns" multiple outlined dense options-dense :display-value="$q.lang.table.columns"
|
|
|
|
|
emit-value map-options :options="columns" option-value="name" options-cover style="min-width: 150px"
|
|
|
|
|
class="col-xs-12 col-sm-3 col-md-2" />
|
2023-08-16 18:15:26 +07:00
|
|
|
</div>
|
|
|
|
|
<div class="col-12 q-pt-sm">
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-table ref="table" :columns="columns" :rows="DataStore.rows" :filter="filterKeyword" row-key="name" flat
|
|
|
|
|
bordered :paging="true" dense class="custom-header-table" :visible-columns="visibleColumns"
|
|
|
|
|
:pagination-label="paginationLabel" v-model:pagination="pagination">
|
2023-08-16 18:15:26 +07:00
|
|
|
<template v-slot:header="props">
|
|
|
|
|
<q-tr :props="props">
|
|
|
|
|
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
|
|
|
|
<span class="text-weight-medium">{{ col.label }}</span>
|
|
|
|
|
</q-th>
|
2023-09-15 14:34:31 +07:00
|
|
|
<q-th></q-th>
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-th auto-width v-if="(DataStore.isLock == false &&
|
|
|
|
|
DataStore.requestStatus == 'st5') ||
|
|
|
|
|
checkStatus == true
|
|
|
|
|
" />
|
2023-09-26 13:50:09 +07:00
|
|
|
<q-th v-else></q-th>
|
2023-08-16 18:15:26 +07:00
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:body="props">
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-tr :props="props" class="cursor-pointer" @click.stop="nextPage(props.row.profileId)">
|
2023-08-16 18:15:26 +07:00
|
|
|
<q-td key="no" :props="props">
|
|
|
|
|
{{ props.rowIndex + 1 }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="citizenId" :props="props">
|
|
|
|
|
{{ props.row.citizenId }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="name" :props="props">
|
|
|
|
|
{{ props.row.name }}
|
|
|
|
|
</q-td>
|
2023-09-01 13:54:08 +07:00
|
|
|
<q-td key="employeeType" :props="props">
|
|
|
|
|
{{ props.row.employeeType }}
|
|
|
|
|
</q-td>
|
2023-08-16 18:15:26 +07:00
|
|
|
<q-td key="position" :props="props">
|
|
|
|
|
{{ props.row.position }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="level" :props="props">
|
|
|
|
|
{{ props.row.level }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="salary" :props="props">
|
2023-08-22 16:54:15 +07:00
|
|
|
{{ Number(props.row.salary).toLocaleString() }}
|
2023-08-16 18:15:26 +07:00
|
|
|
</q-td>
|
|
|
|
|
<q-td key="insigniaType" :props="props">
|
|
|
|
|
{{ props.row.insigniaType }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="insigniaSend" :props="props">
|
|
|
|
|
{{ props.row.insigniaSend }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="insigniaLevel" :props="props">
|
|
|
|
|
{{ props.row.insigniaLevel }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="dateSend" :props="props">
|
|
|
|
|
{{ props.row.dateSend }}
|
|
|
|
|
</q-td>
|
2023-09-25 14:21:01 +07:00
|
|
|
<q-td key="note" class="text-center">
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-btn v-if="props.row.reason" icon="mdi-information-outline" size="12px" color="blue" flat round dense
|
|
|
|
|
@click.stop="clickShowreson(props.row.name, props.row.reason)">
|
2023-09-25 14:21:01 +07:00
|
|
|
<q-tooltip>หมายเหตุ</q-tooltip>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</q-td>
|
2023-09-27 16:58:49 +07:00
|
|
|
<q-td key="warn" class="text-center" v-if="props.row.statusMark">
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-btn icon="mdi-information-outline" size="12px" color="red" flat round dense @click.stop="
|
|
|
|
|
clickShowWarn(
|
|
|
|
|
props.row.markDiscipline,
|
|
|
|
|
props.row.markLeave,
|
|
|
|
|
props.row.markRate
|
|
|
|
|
)
|
|
|
|
|
">
|
|
|
|
|
<q-tooltip>แจ้งเตือน</q-tooltip></q-btn>
|
2023-09-25 14:21:01 +07:00
|
|
|
</q-td>
|
2023-09-27 16:58:49 +07:00
|
|
|
<q-td v-else auto-width></q-td>
|
2023-09-19 14:58:16 +07:00
|
|
|
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-td v-close-popup auto-width v-if="(DataStore.isLock == false &&
|
|
|
|
|
DataStore.requestStatus == 'st5' &&
|
|
|
|
|
roleDataStore.adminRole) ||
|
|
|
|
|
checkStatus == true
|
|
|
|
|
">
|
|
|
|
|
<q-btn v-if="roleDataStore.adminRole ||
|
|
|
|
|
(roleDataStore.insignia1Role &&
|
|
|
|
|
(requestStatus == 'st1' || requestStatus == 'st4'))
|
|
|
|
|
" icon="mdi-dots-vertical" size="12px" color="grey-7" flat round dense @click.stop>
|
2023-08-16 18:15:26 +07:00
|
|
|
<q-menu transition-show="jump-down" transition-hide="jump-up">
|
2023-08-21 16:31:28 +07:00
|
|
|
<q-list dense style="min-width: 250px">
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-item clickable @click.stop="clickmodalEdit(props.row)" v-close-popup>
|
|
|
|
|
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
2023-08-21 16:31:28 +07:00
|
|
|
<q-tooltip>แก้ไขเครื่องราชฯ ที่ยื่นขอ</q-tooltip>
|
|
|
|
|
<q-icon color="primary" size="xs" name="mdi-pencil" />
|
|
|
|
|
</q-item-section>
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-item-section>แก้ไขเครื่องราชฯ ที่ยื่นขอ</q-item-section>
|
2023-08-21 16:31:28 +07:00
|
|
|
</q-item>
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-item clickable @click.stop="clickReject(props.row.id)" v-close-popup>
|
|
|
|
|
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
2023-08-17 09:58:09 +07:00
|
|
|
<q-tooltip>ไม่ยื่นขอ</q-tooltip>
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-icon color="blue" size="xs" name="mdi-alert-circle-outline" />
|
2023-08-16 18:15:26 +07:00
|
|
|
</q-item-section>
|
2023-08-17 09:58:09 +07:00
|
|
|
<q-item-section>ไม่ยื่นขอ</q-item-section>
|
2023-08-16 18:15:26 +07:00
|
|
|
</q-item>
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-item clickable @click.stop="clickDelete(props.row.id)" v-close-popup>
|
|
|
|
|
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
2023-08-17 09:58:09 +07:00
|
|
|
<q-tooltip>ลบออก</q-tooltip>
|
2023-08-16 18:15:26 +07:00
|
|
|
<q-icon color="red" size="xs" name="mdi-delete" />
|
|
|
|
|
</q-item-section>
|
2023-08-17 09:58:09 +07:00
|
|
|
<q-item-section>ลบออก</q-item-section>
|
2023-08-16 18:15:26 +07:00
|
|
|
</q-item>
|
|
|
|
|
</q-list>
|
|
|
|
|
</q-menu>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</q-td>
|
2023-09-21 16:22:56 +07:00
|
|
|
<q-td v-else auto-width></q-td>
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-td auto-width v-if="props.row.insigniaSend == 'เหรียญจักรพรรดิมาลา'">
|
|
|
|
|
<btnDownloadFile :profileId="props.row.profileId" :round="DataStore.roundId"
|
|
|
|
|
:optionRound="DataStore.optionRound" />
|
2023-09-19 14:58:16 +07:00
|
|
|
</q-td>
|
|
|
|
|
<q-td v-else auto-width></q-td>
|
2023-08-16 18:15:26 +07:00
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:pagination="scope">
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-pagination v-model="pagination.page" active-color="primary" color="primary" :max="scope.pagesNumber"
|
|
|
|
|
:max-pages="5" size="sm" boundary-links direction-links></q-pagination>
|
2023-08-16 18:15:26 +07:00
|
|
|
</template>
|
|
|
|
|
</q-table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2023-08-21 16:31:28 +07:00
|
|
|
<!-- add -->
|
|
|
|
|
<q-dialog v-model="modalAdd">
|
2023-09-22 15:14:06 +07:00
|
|
|
<q-card style="width: 800px; max-width: 80vw">
|
2023-08-21 16:31:28 +07:00
|
|
|
<q-toolbar class="q-py-md">
|
|
|
|
|
<q-toolbar-title class="text-h6">เพิ่มรายชื่อ </q-toolbar-title>
|
2023-09-01 13:54:08 +07:00
|
|
|
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-btn icon="close" unelevated round dense @click="modalAdd = false"
|
|
|
|
|
style="color: #ff8080; background-color: #ffdede" />
|
2023-08-21 16:31:28 +07:00
|
|
|
</q-toolbar>
|
|
|
|
|
<q-separator />
|
2023-09-22 15:14:06 +07:00
|
|
|
<q-card-section class="q-pa-sm bg-grey-1">
|
|
|
|
|
<div class="row col-12 q-col-gutter-sm">
|
|
|
|
|
<div class="col-xs-12 col-sm-7">
|
|
|
|
|
<q-card flat bordered class="fit q-pa-sm">
|
|
|
|
|
<q-toolbar style="padding: 0">
|
|
|
|
|
<q-space />
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-input borderless outlined dense debounce="300" placeholder="ค้นหา" v-model="filterKeyword2">
|
2023-09-22 15:14:06 +07:00
|
|
|
<template v-slot:append>
|
|
|
|
|
<q-icon name="search" />
|
|
|
|
|
</template>
|
|
|
|
|
</q-input>
|
|
|
|
|
</q-toolbar>
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-table flat bordered dense :rows="rows2" :columns="columns2" :filter="filterKeyword2" row-key="fullname"
|
|
|
|
|
class="custom-header-table" :pagination-label="paginationLabel2" v-model:pagination="pagination2">
|
2023-09-22 15:14:06 +07:00
|
|
|
<template v-slot:header="props">
|
|
|
|
|
<q-tr :props="props">
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
2023-09-22 15:14:06 +07:00
|
|
|
<span class="text-weight-medium">{{ col.label }}</span>
|
|
|
|
|
</q-th>
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:body="props">
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-tr :props="props" class="cursor-pointer" :class="{ 'text-primary': props.row.id === dataPerson.id }"
|
|
|
|
|
@click="selectPerson(props.row)">
|
2023-09-22 15:14:06 +07:00
|
|
|
<q-td style="width: 75px">{{ props.rowIndex + 1 }}</q-td>
|
|
|
|
|
<q-td style="width: 250px" key="citizenId" :props="props">
|
|
|
|
|
{{ props.row.citizenId }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="fullname" :props="props">
|
|
|
|
|
{{ props.row.fullname }}
|
|
|
|
|
</q-td>
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:pagination="scope">
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-pagination v-model="pagination2.page" color="primary" :max="scope.pagesNumber" :max-pages="5"
|
|
|
|
|
size="sm" boundary-links direction-links></q-pagination>
|
2023-09-22 15:14:06 +07:00
|
|
|
</template>
|
|
|
|
|
</q-table>
|
|
|
|
|
</q-card>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-xs-12 col-sm-5">
|
|
|
|
|
<q-card flat bordered class="fit q-pa-sm">
|
|
|
|
|
<q-form ref="myForm">
|
|
|
|
|
<div class="q-pa-md">
|
|
|
|
|
<div class="row q-gutter-sm">
|
|
|
|
|
<div class="col-12">
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-input borderless outlined dense label="ตำแหน่งในสายงาน" placeholder="ตำแหน่งในสายงาน"
|
|
|
|
|
v-model="dataPerson.position" readonly />
|
2023-09-22 15:14:06 +07:00
|
|
|
</div>
|
|
|
|
|
<div class="col-12">
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-input borderless outlined dense label="สังกัด" placeholder="สังกัด"
|
|
|
|
|
v-model="dataPerson.organizationOrganization" readonly />
|
2023-09-22 15:14:06 +07:00
|
|
|
</div>
|
|
|
|
|
<div class="col-12">
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-input borderless outlined dense label="ระดับ" placeholder="ระดับ " v-model="dataPerson.level"
|
|
|
|
|
readonly />
|
2023-09-22 15:14:06 +07:00
|
|
|
</div>
|
|
|
|
|
<div class="col-12">
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-select v-model="insigniaType" label="ประเภทเครื่องราชฯ" dense emit-value map-options
|
|
|
|
|
:options="insigniaOptions" option-value="id" option-label="name" lazy-rules hide-bottom-space
|
|
|
|
|
:readonly="false" :borderless="false" :outlined="true" :hide-dropdown-icon="false" :rules="[
|
2023-09-22 15:14:06 +07:00
|
|
|
(val) => !!val || `กรุณาเลือกประเภทเครื่องราช`,
|
2023-09-29 15:08:39 +07:00
|
|
|
]" />
|
2023-09-22 15:14:06 +07:00
|
|
|
</div>
|
|
|
|
|
<div class="col-12">
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-input type="textarea" class="full-width inputgreen cursor-pointer" hide-bottom-space outlined
|
|
|
|
|
dense lazy-rules :rules="[(val) => !!val || `กรุณากรอกหมายเหตุ`]" v-model="reason"
|
|
|
|
|
:label="`หมายเหตุ`" />
|
2023-09-22 15:14:06 +07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</q-form>
|
|
|
|
|
</q-card>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</q-card-section>
|
|
|
|
|
<q-separator />
|
|
|
|
|
<q-card-actions align="right">
|
|
|
|
|
<q-btn dense unelevated label="บันทึก" color="public" @click="clickAdd">
|
|
|
|
|
<q-tooltip>บันทึก</q-tooltip>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</q-card-actions>
|
2023-08-21 16:31:28 +07:00
|
|
|
</q-card>
|
|
|
|
|
</q-dialog>
|
|
|
|
|
|
2023-08-21 18:07:35 +07:00
|
|
|
<!-- Edit -->
|
|
|
|
|
<q-dialog v-model="modalEdit" persistent>
|
2023-09-13 15:51:37 +07:00
|
|
|
<q-card style="width: 450px; max-width: 80vw">
|
|
|
|
|
<q-form ref="myForm">
|
2023-09-29 15:08:39 +07:00
|
|
|
<DialogHeader tittle="แก้ไขเครื่องราชฯ ที่ยื่นขอ" :close="closeModalEdit" />
|
2023-09-13 15:51:37 +07:00
|
|
|
<q-separator />
|
|
|
|
|
<q-card-section class="q-pa-sm bg-grey-1">
|
|
|
|
|
<div class="row col-12 q-py-md">
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-select v-model="insignia" label="ชื่อเครื่องราชฯ" dense emit-value map-options :options="insigniaOptions"
|
|
|
|
|
option-value="id" option-label="name" lazy-rules hide-bottom-space :readonly="false" :borderless="false"
|
|
|
|
|
:outlined="true" :hide-dropdown-icon="false" style="width: 100%" />
|
2023-08-21 18:07:35 +07:00
|
|
|
</div>
|
2023-09-13 15:51:37 +07:00
|
|
|
</q-card-section>
|
|
|
|
|
<q-separator />
|
|
|
|
|
<q-card-actions align="right">
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-btn dense unelevated label="บันทึก" color="public" @click="clickSave" class="q-px-md">
|
2023-09-13 15:51:37 +07:00
|
|
|
<!-- icon="mdi-content-save-outline" -->
|
|
|
|
|
<q-tooltip>บันทึก</q-tooltip>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</q-card-actions>
|
|
|
|
|
</q-form>
|
2023-08-21 18:07:35 +07:00
|
|
|
</q-card>
|
|
|
|
|
</q-dialog>
|
|
|
|
|
|
2023-09-19 14:58:16 +07:00
|
|
|
<!-- popup เหตุผลไม่ยื่นขอ -->
|
2023-09-29 15:08:39 +07:00
|
|
|
<DialogPopupReason :modal="modelPopupReject" title="เหตุผลการไม่ยื่นขอ" label="หมายเหตุ"
|
|
|
|
|
:click-close="closemodelPopupReject" :savaForm="savaReasonReject" />
|
2023-09-19 14:58:16 +07:00
|
|
|
<!-- เหตุผลที่ลบออก -->
|
2023-09-29 15:08:39 +07:00
|
|
|
<DialogPopupReason :modal="modelPopupDelete" title="เหตุผลการลบออก" label="หมายเหตุ"
|
|
|
|
|
:click-close="closemodelPopupDelete" :savaForm="savaReasonDelete" />
|
2023-09-25 14:21:01 +07:00
|
|
|
<!-- หมายเหตุ -->
|
2023-09-29 15:08:39 +07:00
|
|
|
<DialogInformation :modal="dialogNote" :title="dialogTitle" :desc="dialogDesc" :click-close="clickCloseReson" />
|
2023-09-25 14:21:01 +07:00
|
|
|
<!-- แจ้งเตือน -->
|
|
|
|
|
<q-dialog v-model="dialogWarn">
|
|
|
|
|
<q-card style="width: 800px; max-width: 80vw">
|
|
|
|
|
<q-toolbar class="q-py-md">
|
|
|
|
|
<q-toolbar-title class="text-h6">แจ้งเตือน </q-toolbar-title>
|
|
|
|
|
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-btn icon="close" unelevated round dense v-close-popup style="color: #ff8080; background-color: #ffdede" />
|
2023-09-25 14:21:01 +07:00
|
|
|
</q-toolbar>
|
|
|
|
|
<q-separator />
|
|
|
|
|
<div class="q-pa-md">
|
|
|
|
|
<div class="q-gutter-sm">
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-item tag="label" v-ripple v-for="list in checkboxData" :key="list.id">
|
2023-09-25 14:21:01 +07:00
|
|
|
<q-item-section avatar>
|
2023-09-29 15:08:39 +07:00
|
|
|
<q-checkbox v-model="list.val" :val="`${list.id}`" color="teal" disable />
|
2023-09-25 14:21:01 +07:00
|
|
|
<!-- <q-radio v-model="checkboxList" :val="list.id" color="teal" /> -->
|
|
|
|
|
</q-item-section>
|
|
|
|
|
<q-item-section>
|
|
|
|
|
<q-item-label>{{ list.name }}</q-item-label>
|
|
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</q-card>
|
|
|
|
|
</q-dialog>
|
2023-08-16 18:15:26 +07:00
|
|
|
</template>
|