diff --git a/src/modules/05_placement/components/Main.vue b/src/modules/05_placement/components/Main.vue
index af79afc85..9ba46025c 100644
--- a/src/modules/05_placement/components/Main.vue
+++ b/src/modules/05_placement/components/Main.vue
@@ -425,7 +425,7 @@ function filterFnYear(val: string, update: any) {
-import { ref, computed,watchEffect } from "vue";
+import { ref, computed, watchEffect } from "vue";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import type { QTableProps } from "quasar";
@@ -25,8 +25,8 @@ const props = defineProps({
fecthlistOthet: Function,
optionsType: Array,
rows2: Array,
- filterKeyword2:String,
- type:String,
+ filterKeyword2: String,
+ type: String,
});
const visibleColumns2 = ref([
"no",
@@ -96,7 +96,6 @@ const emit = defineEmits([
"update:filterKeyword2",
"update:type",
"update:selected",
-
]);
const updateInput = (value: any) => {
emit("update:filterKeyword2", value);
@@ -107,7 +106,7 @@ const updateInputType = (value: any) => {
};
//รีเซ็ตค่าในช่องค้นหา
const Reset = () => {
- emit("update:filterKeyword2", "");
+ emit("update:filterKeyword2", "");
};
//เปิด modal ยืนยัน
const clickAddlist = () => {
@@ -117,7 +116,7 @@ const clickAddlist = () => {
//อัพเดต ส่งไปออกคำสั่ง
const addOther = async () => {
let pId: string[] = [];
- let Type = props.type as string
+ let Type = props.type as string;
selected.value.forEach((e: any) => {
pId.push(e.personalId);
});
@@ -136,7 +135,7 @@ const addOther = async () => {
.finally(() => {
props.fecthlistOthet?.();
selected.value = [];
- props.clickClose?.()
+ props.clickClose?.();
});
};
watchEffect(() => {
@@ -144,6 +143,23 @@ watchEffect(() => {
selected.value = [];
}
});
+// filter OptionsType
+const OptionsTypeFn = ref([]);
+function filterFnOptionsType(val: string, update: any) {
+ if (val == "") {
+ update(() => {
+ OptionsTypeFn.value = props.optionsType;
+ });
+ } else {
+ update(() => {
+ if (props.optionsType) {
+ OptionsTypeFn.value = props.optionsType.filter(
+ (e: any) => e.name.search(val) !== -1
+ );
+ }
+ });
+ }
+}
@@ -160,14 +176,23 @@ watchEffect(() => {
dense
:model-value="type"
@update:model-value="updateInputType"
- :options="optionsType"
+ :options="OptionsTypeFn"
label="ประเภทคำสั่ง"
style="width: 400px; max-width: auto"
emit-value
map-options
option-label="name"
option-value="id"
- />
+ use-input
+ @filter="filterFnOptionsType"
+ >
+
+
+ ไม่มีข้อมูล
+
+
+
+
@@ -232,7 +257,6 @@ watchEffect(() => {
-
-import { ref, watch } from 'vue';
-import type { FormRegistryEmployee } from '../interface/request/Main';
-import { useQuasar, type QTableProps, QInput } from 'quasar';
-import { useCounterMixin } from '@/stores/mixin';
-import http from '@/plugins/http';
+import { ref, watch } from "vue";
+import type { FormRegistryEmployee } from "../interface/request/Main";
+import { useQuasar, type QTableProps, QInput } from "quasar";
+import { useCounterMixin } from "@/stores/mixin";
+import http from "@/plugins/http";
import config from "@/app.config";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
const {
- success,
- messageError,
- showLoader,
- hideLoader,
- dialogConfirm,
- dialogMessageNotify,
+ success,
+ messageError,
+ showLoader,
+ hideLoader,
+ dialogConfirm,
+ dialogMessageNotify,
} = mixin; //ฟังก์ชันกลางที่ใช้ในหน้านี้
const $q = useQuasar();
const props = defineProps({
- modal: {
- type: Boolean,
- default: false,
+ modal: {
+ type: Boolean,
+ default: false,
+ },
+ rows: {
+ type: Object,
+ default: [],
+ },
+ fetchNewList: {
+ type: Function,
+ default: () => {
+ /* ฟังก์ชั่น get รายการข้อมูลในหน้าหลักใหม่ */
},
- rows: {
- type: Object,
- default: []
- },
- fetchNewList: {
- type: Function,
- default: () => { /* ฟังก์ชั่น get รายการข้อมูลในหน้าหลักใหม่ */ }
- },
- closeDialog: {
- type: Function,
- default: () => { /* ฟังก์ชั่นปิด dialog ส่งไปออกคำสั่ง */ }
+ },
+ closeDialog: {
+ type: Function,
+ default: () => {
+ /* ฟังก์ชั่นปิด dialog ส่งไปออกคำสั่ง */
},
+ },
});
const filter = ref("");
const filterRef = ref();
// visible columns ตารางใน dialog ส่งไปออกคำสั่ง
const visibleColumnsOrder = ref([
- "no",
- "fullname",
- "fullnameOld",
- "oc",
- "positionEmployeePosition",
- "positionEmployeePositionSide",
- "positionLine",
- "govAge",
- "positionEmployeeGroup",
- "dateAppoint",
- "refSalary",
- "dateStart",
- "createdAt",
- "salaryDate",
- "age",
- "amount",
- "statustext",
- "leaveDateOrder",
- "newAgency",
- "currentAgency",
+ "no",
+ "fullname",
+ "fullnameOld",
+ "oc",
+ "positionEmployeePosition",
+ "positionEmployeePositionSide",
+ "positionLine",
+ "govAge",
+ "positionEmployeeGroup",
+ "dateAppoint",
+ "refSalary",
+ "dateStart",
+ "createdAt",
+ "salaryDate",
+ "age",
+ "amount",
+ "statustext",
+ "leaveDateOrder",
+ "newAgency",
+ "currentAgency",
]);
// คอลัมน์ในตาราง
const columnsOrder = ref([
- {
- name: "no",
- align: "left",
- label: "ลำดับ",
- sortable: false,
- field: "no",
- headerStyle: "font-size: 14px",
- style: "font-size: 14px",
- },
- {
- name: "fullname",
- align: "left",
- label: "ชื่อ-สกุล",
- sortable: true,
- field: "fullname",
- headerStyle: "font-size: 14px; min-width: 200px",
- style: "font-size: 14px; ",
- },
- {
- name: "newAgency",
- align: "left",
- label: "หน่วยงานที่รับการบรรจุ",
- sortable: true,
- field: "newAgency",
- headerStyle: "font-size: 14px",
- style: "font-size: 14px",
- sort: (a: string, b: string) =>
- a.localeCompare(b, undefined, {
- numeric: true,
- sensitivity: "base",
- }),
- },
- {
- name: "currentAgency",
- align: "left",
- label: "หน่วยงานปัจจุบัน",
- sortable: true,
- field: "currentAgency",
- headerStyle: "font-size: 14px",
- style: "font-size: 14px",
- sort: (a: string, b: string) =>
- a.localeCompare(b, undefined, {
- numeric: true,
- sensitivity: "base",
- }),
- },
- {
- name: "amount",
- align: "left",
- label: "ค่าจ้าง",
- sortable: true,
- field: "amount",
- headerStyle: "font-size: 14px",
- style: "font-size: 14px",
- sort: (a: string, b: string) =>
- a.localeCompare(b, undefined, {
- numeric: true,
- sensitivity: "base",
- }),
- },
- {
- name: "govAge",
- align: "left",
- label: "อายุราชการ(ปี)",
- sortable: true,
- field: "govAge",
- headerStyle: "font-size: 14px",
- style: "font-size: 14px",
- sort: (a: string, b: string) =>
- a.localeCompare(b, undefined, {
- numeric: true,
- sensitivity: "base",
- }),
- },
- {
- name: "dateAppoint",
- align: "left",
- label: "วันที่จ้าง",
- sortable: true,
- field: "dateAppoint",
- headerStyle: "font-size: 14px",
- style: "font-size: 14px",
- },
- {
- name: "dateStart",
- align: "left",
- label: "วันที่เริ่มปฎิบัติราชการ",
- sortable: true,
- field: "dateStart",
- headerStyle: "font-size: 14px",
- style: "font-size: 14px",
- },
- {
- name: "salaryDate",
- align: "left",
- label: "วันที่แต่งตั้ง",
- sortable: true,
- field: "salaryDate",
- headerStyle: "font-size: 14px",
- style: "font-size: 14px",
- },
- {
- name: "refSalary",
- align: "left",
- label: "เอกสารอ้างอิง",
- sortable: true,
- field: "refSalary",
- headerStyle: "font-size: 14px; min-width: 200px",
- style: "font-size: 14px; ",
- },
- {
- name: "age",
- align: "left",
- label: "อายุ",
- sortable: true,
- field: "age",
- headerStyle: "font-size: 14px",
- style: "font-size: 14px",
- sort: (a: string, b: string) =>
- a.localeCompare(b, undefined, {
- numeric: true,
- sensitivity: "base",
- }),
- },
- {
- name: "fullnameOld",
- align: "left",
- label: "ชื่อ-สกุล(เดิม)",
- sortable: true,
- field: "fullnameOld",
- headerStyle: "font-size: 14px; min-width: 200px",
- style: "font-size: 14px; ",
- },
- {
- name: "createdAt",
- align: "left",
- label: "วันที่สร้าง",
- sortable: true,
- field: "createdAt",
- headerStyle: "font-size: 14px",
- style: "font-size: 14px",
- },
- {
- name: "leaveDateOrder",
- align: "left",
- label: "วันที่พ้นราชการ",
- sortable: true,
- field: "leaveDateOrder",
- headerStyle: "font-size: 14px",
- style: "font-size: 14px",
- },
- {
- name: "statustext",
- align: "left",
- label: "สถานะ",
- sortable: true,
- field: "statustext",
- headerStyle: "font-size: 14px",
- style: "font-size: 14px",
- sort: (a: string, b: string) =>
- a.localeCompare(b, undefined, {
- numeric: true,
- sensitivity: "base",
- }),
- },
+ {
+ name: "no",
+ align: "left",
+ label: "ลำดับ",
+ sortable: false,
+ field: "no",
+ headerStyle: "font-size: 14px",
+ style: "font-size: 14px",
+ },
+ {
+ name: "fullname",
+ align: "left",
+ label: "ชื่อ-นามสกุล",
+ sortable: true,
+ field: "fullname",
+ headerStyle: "font-size: 14px; min-width: 200px",
+ style: "font-size: 14px; ",
+ },
+ {
+ name: "newAgency",
+ align: "left",
+ label: "หน่วยงานที่รับการบรรจุ",
+ sortable: true,
+ field: "newAgency",
+ headerStyle: "font-size: 14px",
+ style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, {
+ numeric: true,
+ sensitivity: "base",
+ }),
+ },
+ {
+ name: "currentAgency",
+ align: "left",
+ label: "หน่วยงานปัจจุบัน",
+ sortable: true,
+ field: "currentAgency",
+ headerStyle: "font-size: 14px",
+ style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, {
+ numeric: true,
+ sensitivity: "base",
+ }),
+ },
+ {
+ name: "amount",
+ align: "left",
+ label: "ค่าจ้าง",
+ sortable: true,
+ field: "amount",
+ headerStyle: "font-size: 14px",
+ style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, {
+ numeric: true,
+ sensitivity: "base",
+ }),
+ },
+ {
+ name: "govAge",
+ align: "left",
+ label: "อายุราชการ(ปี)",
+ sortable: true,
+ field: "govAge",
+ headerStyle: "font-size: 14px",
+ style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, {
+ numeric: true,
+ sensitivity: "base",
+ }),
+ },
+ {
+ name: "dateAppoint",
+ align: "left",
+ label: "วันที่จ้าง",
+ sortable: true,
+ field: "dateAppoint",
+ headerStyle: "font-size: 14px",
+ style: "font-size: 14px",
+ },
+ {
+ name: "dateStart",
+ align: "left",
+ label: "วันที่เริ่มปฎิบัติราชการ",
+ sortable: true,
+ field: "dateStart",
+ headerStyle: "font-size: 14px",
+ style: "font-size: 14px",
+ },
+ {
+ name: "salaryDate",
+ align: "left",
+ label: "วันที่แต่งตั้ง",
+ sortable: true,
+ field: "salaryDate",
+ headerStyle: "font-size: 14px",
+ style: "font-size: 14px",
+ },
+ {
+ name: "refSalary",
+ align: "left",
+ label: "เอกสารอ้างอิง",
+ sortable: true,
+ field: "refSalary",
+ headerStyle: "font-size: 14px; min-width: 200px",
+ style: "font-size: 14px; ",
+ },
+ {
+ name: "age",
+ align: "left",
+ label: "อายุ",
+ sortable: true,
+ field: "age",
+ headerStyle: "font-size: 14px",
+ style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, {
+ numeric: true,
+ sensitivity: "base",
+ }),
+ },
+ {
+ name: "fullnameOld",
+ align: "left",
+ label: "ชื่อ-สกุล(เดิม)",
+ sortable: true,
+ field: "fullnameOld",
+ headerStyle: "font-size: 14px; min-width: 200px",
+ style: "font-size: 14px; ",
+ },
+ {
+ name: "createdAt",
+ align: "left",
+ label: "วันที่สร้าง",
+ sortable: true,
+ field: "createdAt",
+ headerStyle: "font-size: 14px",
+ style: "font-size: 14px",
+ },
+ {
+ name: "leaveDateOrder",
+ align: "left",
+ label: "วันที่พ้นราชการ",
+ sortable: true,
+ field: "leaveDateOrder",
+ headerStyle: "font-size: 14px",
+ style: "font-size: 14px",
+ },
+ {
+ name: "statustext",
+ align: "left",
+ label: "สถานะ",
+ sortable: true,
+ field: "statustext",
+ headerStyle: "font-size: 14px",
+ style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, {
+ numeric: true,
+ sensitivity: "base",
+ }),
+ },
]);
// checkbox เลือกคนไปออกคำสั่ง
const selected = ref([]);
const save = () => {
- if (selected.value.length == 0) {
- dialogMessageNotify($q, "กรุณาเลือกคนออกคำสั่ง");
- } else dialogConfirm($q, () => sendToCommand());
+ if (selected.value.length == 0) {
+ dialogMessageNotify($q, "กรุณาเลือกคนออกคำสั่ง");
+ } else dialogConfirm($q, () => sendToCommand());
};
// post ส่งไปออกคำสั่ง
const sendToCommand = async () => {
- let pId: string[] = [];
- selected.value.forEach((e: any) => {
- pId.push(e.id);
+ let pId: string[] = [];
+ selected.value.forEach((e: any) => {
+ pId.push(e.id);
+ });
+ let data = {
+ id: pId,
+ };
+ showLoader();
+ await http
+ .post(config.API.organizationEmployeeSendOrder, data)
+ .then((res: any) => {
+ success($q, "บันทึกสำเร็จ");
+ })
+ .catch((e: any) => {
+ messageError($q, e);
+ })
+ .finally(async () => {
+ props.fetchNewList();
+ props.closeDialog();
+ selected.value = [];
+ hideLoader();
});
- let data = {
- id: pId,
- };
- showLoader();
- await http
- .post(config.API.organizationEmployeeSendOrder, data)
- .then((res: any) => {
- success($q, "บันทึกสำเร็จ");
- })
- .catch((e: any) => {
- messageError($q, e);
- })
- .finally(async () => {
- props.fetchNewList()
- props.closeDialog()
- selected.value = [];
- hideLoader();
- });
};
// เลือกรายการเฉพาะคนที่มีสถานะ PENDING (เลือกตำแหน่งแล้ว)
const rowsOrder = ref([]);
const filterRowData = () => {
- rowsOrder.value = props.rows.filter(
- (r: FormRegistryEmployee) => r.status == "PENDING"
- );
-}
+ rowsOrder.value = props.rows.filter(
+ (r: FormRegistryEmployee) => r.status == "PENDING"
+ );
+};
// เช็ค props modal ทำการ filter เมื่อคลิก icon ส่งไปออกคำสั่ง
watch(props, () => {
- if (props.modal === true && props.rows) {
- filterRowData()
- }
+ if (props.modal === true && props.rows) {
+ filterRowData();
+ visibleColumnsOrder.value = [
+ "no",
+ "fullname",
+ "fullnameOld",
+ "oc",
+ "positionEmployeePosition",
+ "positionEmployeePositionSide",
+ "positionLine",
+ "govAge",
+ "positionEmployeeGroup",
+ "dateAppoint",
+ "refSalary",
+ "dateStart",
+ "createdAt",
+ "salaryDate",
+ "age",
+ "amount",
+ "statustext",
+ "leaveDateOrder",
+ "newAgency",
+ "currentAgency",
+ ];
+ }
});
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ props.rowIndex + 1 }}
+
+
+ {{ props.row.fullname }}
+
+
+
+
+
+ {{ props.row.draftOrganizationOrganization ?? "-" }}
+
+
+ {{ props.row.draftPositionEmployee ?? "-" }}
+
+
+
+
+
+
+
+ {{ props.row.oc ?? "-" }}
+
+
+ {{ props.row.position ?? "-" }}
+
+
+
-
-
-
-
-
-
-
-
-
+
+ {{ props.row.amount }}
+
+
+ {{ props.row.govAge }}
+
+
+ {{ props.row.dateAppoint }}
+
+
+ {{ props.row.dateStart }}
+
+
+ {{ props.row.salaryDate }}
+
+
+ {{ props.row.refSalary }}
+
+
+ {{ props.row.age }}
+
+
+ {{ props.row.fullnameOld }}
+
+
+ {{ props.row.createdAt }}
+
+
+ {{ props.row.isLeave }}
+
-
- {{ props.rowIndex + 1 }}
-
-
- {{ props.row.fullname }}
-
-
-
-
-
- {{ props.row.draftOrganizationOrganization ?? "-" }}
-
-
- {{ props.row.draftPositionEmployee ?? "-" }}
-
-
-
-
-
-
-
- {{ props.row.oc ?? "-" }}
-
-
- {{ props.row.position ?? "-" }}
-
-
-
+
+ {{ props.row.leaveDateOrder }}
+
+
+ {{ props.row.statustext }}
+
+
+
+
+
-
- {{ props.row.amount }}
-
-
- {{ props.row.govAge }}
-
-
- {{ props.row.dateAppoint }}
-
-
- {{ props.row.dateStart }}
-
-
- {{ props.row.salaryDate }}
-
-
- {{ props.row.refSalary }}
-
-
- {{ props.row.age }}
-
-
- {{ props.row.fullnameOld }}
-
-
- {{ props.row.createdAt }}
-
-
- {{ props.row.isLeave }}
-
-
-
- {{ props.row.leaveDateOrder }}
-
-
- {{ props.row.statustext }}
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
+
+
+
+
+