diff --git a/package-lock.json b/package-lock.json
index e0da68418..7c4200ef5 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -7709,7 +7709,7 @@
},
"node_modules/vue": {
"version": "3.2.47",
- "resolved": "https://npm.joolsoft.com/vue/-/vue-3.2.47.tgz",
+ // "resolved": "https://npm.joolsoft.com/vue/-/vue-3.2.47.tgz",
"integrity": "sha512-60188y/9Dc9WVrAZeUVSDxRQOZ+z+y5nO2ts9jWXSTkMvayiWxCWOWtBQoYjLeccfXkiiPZWAHcV+WTPhkqJHQ==",
"dependencies": {
"@vue/compiler-dom": "3.2.47",
@@ -13775,7 +13775,7 @@
},
"vue": {
"version": "3.2.47",
- "resolved": "https://npm.joolsoft.com/vue/-/vue-3.2.47.tgz",
+ // "resolved": "https://npm.joolsoft.com/vue/-/vue-3.2.47.tgz",
"integrity": "sha512-60188y/9Dc9WVrAZeUVSDxRQOZ+z+y5nO2ts9jWXSTkMvayiWxCWOWtBQoYjLeccfXkiiPZWAHcV+WTPhkqJHQ==",
"requires": {
"@vue/compiler-dom": "3.2.47",
diff --git a/src/api/07_insignia/api.insignia.ts b/src/api/07_insignia/api.insignia.ts
index db50f6aac..fd15b5c1b 100644
--- a/src/api/07_insignia/api.insignia.ts
+++ b/src/api/07_insignia/api.insignia.ts
@@ -6,7 +6,7 @@ const insignia = `${env.API_URI}/insignia`;
const Organization = `${env.API_URI}/Organization`
export default {
getRoundInsignia: (id: string) => `${insignia}/period/${id}`,
- listRoundInsignia: (type: string) => `${insignia}/period/${type}`,
+ listRoundInsignia: () => `${insignia}/period/`,
editRoundInsignia: (id: string) => `${insignia}/period/${id}`,
RoundInsignia: (id: string) => `${insignia}/period/${id}`,
requestInsignia: (insigniaPeriodId: string) => `${insignia}/request/${insigniaPeriodId}`,
@@ -18,8 +18,8 @@ export default {
insigniaManage: (type: string) => `${insignia}/manage/${type}`,
insigniaCreate: () => `${insignia}/request`,
insigniaList: (insigniaPeriodId: any, ocId: string, role: string, status: any) => `${insignia}/request/${insigniaPeriodId}/${ocId}/${role}/${status}`,
- insigniaReject: (profileId: string) => `${insignia}/status/reject/${profileId}`,
- insigniaDelete: (profileId: string) => `${insignia}/status/delete/${profileId}`,
+ insigniaReject: (profileId: string) => `${insignia}/request/status/reject/${profileId}`,
+ insigniaDelete: (profileId: string) => `${insignia}/request/status/delete/${profileId}`,
insigniaEdit: (profileId: string) => `${insignia}/request/${profileId}`,
insigniaAgency: () => `${insignia}/request/agency`,
insigniaDashboard: (insigniaPeriodId: string) => `${insignia}/request/dashboard/${insigniaPeriodId}`,
diff --git a/src/modules/05_placement/components/Receive/receiveDetail2.vue b/src/modules/05_placement/components/Receive/receiveDetail2.vue
index 8f3b77a44..392b20507 100644
--- a/src/modules/05_placement/components/Receive/receiveDetail2.vue
+++ b/src/modules/05_placement/components/Receive/receiveDetail2.vue
@@ -82,6 +82,7 @@
label="แก้ไข"
style="width: 80px"
@click="edit = !edit"
+ v-if="!(status == 'REPORT' || status == 'DONE')"
/>
@@ -616,7 +617,7 @@ const title = ref({
positionTypeOld: "",
});
-const value = ref(123554);
+const status = ref("");
const myForm = ref(null);
const edit = ref(false);
@@ -790,6 +791,7 @@ const getData = async () => {
posNo.value = data.positionNumberOld ?? "";
salary.value = data.amountOld ?? 0;
reason.value = data.reason ?? "";
+ status.value = data.status ?? "";
await calRetire(new Date(dateToISO(new Date(data.dateOfBirth))));
dateBefore.value = new Date(data.dateOfBirth);
diff --git a/src/modules/05_placement/components/Receive/receiveMain.vue b/src/modules/05_placement/components/Receive/receiveMain.vue
index 02c54f598..56d03433d 100644
--- a/src/modules/05_placement/components/Receive/receiveMain.vue
+++ b/src/modules/05_placement/components/Receive/receiveMain.vue
@@ -2,12 +2,13 @@
import { ref, computed, onMounted } from "vue";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
+import { useTransferDataStore } from "@/modules/05_placement/store";
import http from "@/plugins/http";
import config from "@/app.config";
import { useRouter } from "vue-router";
-import DialogFooter from "@/modules/05_placement/components/Receive/DialogFooter.vue";
+
import DialogHeader from "@/modules/05_placement/components/Receive/DialogHeader.vue";
import DialogOrgTree from "@/modules/05_placement/components/Receive/receiveModal.vue";
@@ -20,6 +21,8 @@ import type {
const $q = useQuasar();
const router = useRouter();
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
+const transferStore = useTransferDataStore();
+const { statusText } = transferStore;
const {
showLoader,
hideLoader,
@@ -34,6 +37,11 @@ const selected = ref([]);
const modal = ref(false);
const popup = () => {
+ const row = filters.value.filter(
+ (r: ResponseRow) =>
+ r.status == "WAITTING" || r.status == "PENDING" || r.status == "APPROVE"
+ );
+ rows2.value = row;
modal.value = true;
};
@@ -46,6 +54,8 @@ const visibleColumns = ref([
"fullname",
"organizationName",
"birthday",
+ "dateText",
+ "statusText",
]);
const visibleColumns2 = ref([
@@ -54,6 +64,8 @@ const visibleColumns2 = ref([
"fullname",
"organizationName",
"birthday",
+ "dateText",
+ "statusText",
]); //ค้นหา คอลัมน์ คอลัมน์ที่แสดง
const filterKeyword = ref("");
const filterKeyword2 = ref("");
@@ -96,6 +108,8 @@ const columns = ref([
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "citizenId",
@@ -105,6 +119,8 @@ const columns = ref([
field: "fullname",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "fullname",
@@ -114,6 +130,8 @@ const columns = ref([
field: "fullname",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "organizationName",
@@ -134,6 +152,31 @@ const columns = ref([
field: "birthday",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
+ },
+ {
+ name: "dateText",
+ align: "left",
+ label: "วันที่ดำเนินการ",
+ sortable: true,
+ field: "dateText",
+ headerStyle: "font-size: 14px",
+ style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
+ sortOrder: "da",
+ },
+ {
+ 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" }),
},
]);
const columns2 = ref([
@@ -145,6 +188,8 @@ const columns2 = ref([
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "citizenId",
@@ -154,6 +199,8 @@ const columns2 = ref([
field: "citizenId",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "fullname",
@@ -163,6 +210,8 @@ const columns2 = ref([
field: "fullname",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "organizationName",
@@ -183,6 +232,31 @@ const columns2 = ref([
field: "birthday",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
+ },
+ {
+ name: "dateText",
+ align: "left",
+ label: "วันที่ดำเนินการ",
+ sortable: true,
+ field: "dateText",
+ headerStyle: "font-size: 14px",
+ style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
+ sortOrder: "da",
+ },
+ {
+ 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" }),
},
]);
@@ -218,8 +292,12 @@ const fecthlistRecevice = async () => {
positionPath: e.positionPath,
birthday: e.dateOfBirth == null ? "-" : date2Thai(e.dateOfBirth),
status: e.status,
+ statusText: statusText(e.status ?? ""),
+ createdAt: e.createdAt !== null ? new Date(e.createdAt) : null,
+ dateText: e.createdAt !== null ? date2Thai(e.createdAt) : "-",
});
});
+ // console.log(list);
rows.value = list;
filters.value = list;
})
@@ -243,12 +321,6 @@ const checkSelected = computed(() => {
}
});
-const row = filters.value.filter(
- (r: ResponseRow) =>
- r.status == "WAITTING" || r.status == "PENDING" || r.status == "APPROVE"
-);
-rows2.value = row;
-
const add = () => {
router.push(`/receive/add`);
};
@@ -465,6 +537,20 @@ const saveOrder = async () => {
>
{{ props.row.birthday }}
+
+ {{ props.row.dateText }}
+
+
+ {{ props.row.statusText }}
+
{
clickable
v-close-popup
@click="openModalTree(props.row.personalId)"
+ :disable="
+ props.row.status == 'REPORT' ||
+ props.row.status == 'DONE'
+ "
>
{
class="q-py-sm"
>
@@ -503,6 +598,10 @@ const saveOrder = async () => {
clickable
v-close-popup
@click="openDelete(props.row.personalId)"
+ :disable="
+ props.row.status == 'REPORT' ||
+ props.row.status == 'DONE'
+ "
>
{
class="q-py-sm"
>
ลบข้อมูล
-
+
ลบ
@@ -660,6 +768,16 @@ const saveOrder = async () => {
{{ props.row.birthday }}
+
+ {{ props.row.dateText }}
+
+
+ {{ props.row.statusText }}
+
diff --git a/src/modules/05_placement/components/Repatriate/RepatriateMain.vue b/src/modules/05_placement/components/Repatriate/RepatriateMain.vue
index aecc10e5b..1d8a711b1 100644
--- a/src/modules/05_placement/components/Repatriate/RepatriateMain.vue
+++ b/src/modules/05_placement/components/Repatriate/RepatriateMain.vue
@@ -39,20 +39,24 @@ const modal = ref(false);
const visibleColumns = ref([
"no",
"fullname",
+ "posNo",
"position",
"positionLevel",
"organizationPositionOld",
// "organization",
+ "createdAt",
"statusText",
"btn",
]);
const visibleColumns2 = ref([
"no",
"fullname",
+ "posNo",
"position",
"positionLevel",
"organizationPositionOld",
// "organization",
+ "createdAt",
"statusText",
]); //ค้นหา คอลัมน์ คอลัมน์ที่แสดง
const filterKeyword = ref("");
@@ -134,6 +138,15 @@ const columns = ref([
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",
+ },
{
name: "position",
align: "left",
@@ -170,6 +183,18 @@ const columns = ref([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
+ {
+ name: "createdAt",
+ align: "left",
+ label: "วันที่ดำเนินการ",
+ sortable: true,
+ field: "createdAt",
+ headerStyle: "font-size: 14px",
+ style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
+ sortOrder: "da",
+ },
{
name: "statusText",
align: "left",
@@ -208,6 +233,15 @@ const columns2 = ref([
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",
+ },
{
name: "position",
align: "left",
@@ -244,6 +278,18 @@ const columns2 = ref([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
+ {
+ name: "createdAt",
+ align: "left",
+ label: "วันที่ดำเนินการ",
+ sortable: true,
+ field: "createdAt",
+ headerStyle: "font-size: 14px",
+ style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
+ sortOrder: "da",
+ },
{
name: "statusText",
align: "left",
@@ -436,6 +482,13 @@ onMounted(async () => {
>
{{ props.row.fullname }}
+
+ {{ props.row.posNo }}
+
{
{{ props.row.organization }}
+
+ {{ props.row.createdAt }}
+
{
ลบข้อมูล
@@ -584,6 +651,9 @@ onMounted(async () => {
{{ props.row.fullname }}
+
+ {{ props.row.posNo }}
+
{{ props.row.position }}
@@ -600,6 +670,9 @@ onMounted(async () => {
{{ props.row.organization }}
+
+ {{ props.row.createdAt }}
+
{{ props.row.statusText }}
diff --git a/src/modules/05_placement/components/Repatriate/RepatriatebyId.vue b/src/modules/05_placement/components/Repatriate/RepatriatebyId.vue
index 83df19af8..2dc9ecf59 100644
--- a/src/modules/05_placement/components/Repatriate/RepatriatebyId.vue
+++ b/src/modules/05_placement/components/Repatriate/RepatriatebyId.vue
@@ -1,14 +1,30 @@
-
+
รายละเอียดการส่งตัวกลับ {{ fullname }}
@@ -60,11 +76,28 @@
label="แก้ไข"
style="width: 80px"
@click="edit = !edit"
+ v-if="!(status == 'REPORT' || status == 'DONE')"
/> -->
-
-
+
+
@@ -78,64 +111,140 @@
-
+
-
+
{{ year + 543 }}
{{
parseInt(value + 543)
}}
-
+ :rules="[(val) => !!val || `${'กรุณาเลือกตั้งแต่วัน'}`]"
+ hide-bottom-space
+ :label="`${'ตั้งแต่วัน'}`"
+ >
-
+
@@ -144,9 +253,19 @@
-
+
diff --git a/src/modules/05_placement/components/Transfer/transferMain.vue b/src/modules/05_placement/components/Transfer/transferMain.vue
index 34b667e00..fbc901b77 100644
--- a/src/modules/05_placement/components/Transfer/transferMain.vue
+++ b/src/modules/05_placement/components/Transfer/transferMain.vue
@@ -38,6 +38,7 @@ const visibleColumns = ref([
"organizationPositionOld",
"organization",
"statustext",
+ "dateText",
]);
const visibleColumns2 = ref([
"no",
@@ -47,6 +48,7 @@ const visibleColumns2 = ref([
"organizationPositionOld",
"organization",
"statustext",
+ "dateText",
]); //ค้นหา คอลัมน์ คอลัมน์ที่แสดง
const filterKeyword = ref("");
const filterKeyword2 = ref("");
@@ -72,6 +74,8 @@ const columns = ref([
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "fullname",
@@ -81,6 +85,8 @@ const columns = ref([
field: "fullname",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "position",
@@ -90,6 +96,8 @@ const columns = ref([
field: "position",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionLevel",
@@ -99,6 +107,8 @@ const columns = ref([
field: "positionLevel",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "organizationPositionOld",
@@ -108,6 +118,8 @@ const columns = ref([
field: "organizationPositionOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "organization",
@@ -117,6 +129,20 @@ const columns = ref([
field: "organization",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
+ },
+ {
+ name: "dateText",
+ align: "left",
+ label: "วันที่ดำเนินการ",
+ sortable: true,
+ field: "dateText",
+ headerStyle: "font-size: 14px",
+ style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
+ sortOrder: "da",
},
{
name: "statustext",
@@ -126,6 +152,8 @@ const columns = ref([
field: "statustext",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
const columns2 = ref([
@@ -137,6 +165,8 @@ const columns2 = ref([
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "fullname",
@@ -146,6 +176,8 @@ const columns2 = ref([
field: "fullname",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "position",
@@ -155,6 +187,8 @@ const columns2 = ref([
field: "position",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionLevel",
@@ -164,6 +198,8 @@ const columns2 = ref([
field: "positionLevel",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "organizationPositionOld",
@@ -173,6 +209,8 @@ const columns2 = ref([
field: "organizationPositionOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "organization",
@@ -182,6 +220,20 @@ const columns2 = ref([
field: "organization",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
+ },
+ {
+ name: "dateText",
+ align: "left",
+ label: "วันที่ดำเนินการ",
+ sortable: true,
+ field: "dateText",
+ headerStyle: "font-size: 14px",
+ style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
+ sortOrder: "da",
},
{
name: "statustext",
@@ -191,6 +243,8 @@ const columns2 = ref([
field: "statustext",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
@@ -219,7 +273,9 @@ const getData = async () => {
let list: ResponseData[] = [];
data.map((r: ResponseData) => {
list.push({
- createdAt: new Date(),
+ dateText:
+ r.createdAt !== null ? date2Thai(new Date(r.createdAt)) : "-",
+ createdAt: r.createdAt !== null ? new Date(r.createdAt) : null,
date: new Date(),
firstName: r.firstName ?? "",
id: r.id ?? "",
@@ -384,6 +440,9 @@ const saveOrder = async () => {
-->
+
+ {{ props.row.dateText }}
+
{{ props.row.statustext }}
@@ -491,6 +550,9 @@ const saveOrder = async () => {
{{ props.row.organization }}
+
+ {{ props.row.dateText }}
+
{{ props.row.statustext }}
diff --git a/src/modules/05_placement/components/Transfer/transferRegistry.vue b/src/modules/05_placement/components/Transfer/transferRegistry.vue
index b58a81fd6..6020c7e3d 100644
--- a/src/modules/05_placement/components/Transfer/transferRegistry.vue
+++ b/src/modules/05_placement/components/Transfer/transferRegistry.vue
@@ -164,6 +164,9 @@
label="แก้ไข"
style="width: 80px"
@click="edit = !edit"
+ v-if="
+ !(responseData.status == 'REPORT' || responseData.status == 'DONE')
+ "
/>
diff --git a/src/modules/05_placement/components/helpgovernment/governmentDetail.vue b/src/modules/05_placement/components/helpgovernment/governmentDetail.vue
index cbf1bab25..fdd705a18 100644
--- a/src/modules/05_placement/components/helpgovernment/governmentDetail.vue
+++ b/src/modules/05_placement/components/helpgovernment/governmentDetail.vue
@@ -1,14 +1,30 @@
-
+
รายละเอียดการช่วยราชการ {{ fullname }}
@@ -51,12 +67,37 @@
-
+
-
-
+
+
@@ -70,9 +111,19 @@
-
+
{
@update:model-value="changtypeOc"
/>
{
:outlined="true"
:hide-dropdown-icon="false"
style="min-width: 150px"
- @update:model-value="searchFilterTable"
+ @update:model-value="DataStore.searchFilterTable"
/>
@@ -632,7 +578,7 @@ const paginationLabel2 = (start: string, end: string, total: string) => {
{
{{ props.row.salary }}
-
- {{ props.row.organization }}
-
+
{{ props.row.insigniaType }}
@@ -718,7 +662,7 @@ const paginationLabel2 = (start: string, end: string, total: string) => {
{
{
/>
-
-
-
-
{
:outlined="true"
:hide-dropdown-icon="false"
style="min-width: 150px"
- @update:model-value="changtypeOc"
+ />
+
+
+
diff --git a/src/modules/07_insignia/components/2_Manage/Tab2.vue b/src/modules/07_insignia/components/2_Manage/Tab2.vue
index 9bec42a41..f3a5127e8 100644
--- a/src/modules/07_insignia/components/2_Manage/Tab2.vue
+++ b/src/modules/07_insignia/components/2_Manage/Tab2.vue
@@ -31,7 +31,7 @@ const visibleColumns = ref
([
"position",
"level",
"salary",
- "organization",
+
"insigniaType",
"insigniaSend",
"insigniaLevel",
@@ -92,15 +92,6 @@ const columns = ref([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
- {
- name: "organization",
- align: "left",
- label: "หน่วยงาน",
- sortable: true,
- field: "organization",
- headerStyle: "font-size: 14px",
- style: "font-size: 14px",
- },
{
name: "insigniaType",
align: "left",
@@ -139,63 +130,11 @@ const columns = ref([
},
]);
// ข้อมูลตาราง (จำลอง)
-const rows = ref([
- {
- no: "1",
- citizenId: "1xxxxxxxxxx",
- name: "นายใจดี ยอดใจ ",
- position: "นักวิชาการพัสดุ",
- level: "1",
- salary: "15000",
- organization: "บริหาร",
- insigniaType: "ทวีติยาภรณ์ช้างเผือก",
- insigniaSend: "ตริตาภรณ์ช้างเผือก",
- insigniaLevel: "ต่ำกว่าสายสะพาย",
- dateSend: "31 ม.ค. 2566",
- },
- {
- no: "2",
- citizenId: "1xxxxxxxxxx",
- name: "นายจักกริน บัณฑิต",
- position: "นักวิชาการพัสดุ",
- level: "ปฏิบัติการ",
- salary: "15000",
- organization: "บริหาร",
- insigniaType: "ทวีติยาภรณ์ช้างเผือก",
- insigniaSend: "ตริตาภรณ์ช้างเผือก",
- insigniaLevel: "ต่ำกว่าสายสะพาย",
- dateSend: "31 ม.ค. 2566",
- },
- {
- no: "3",
- citizenId: "1xxxxxxxxxx",
- name: "นางสาวกัณฐิมา กาฬสินธุ์",
- position: "นักจัดการงานทั่วไป",
- level: "ปฏิบัติการ",
- salary: "15000",
- organization: "บริหาร",
- insigniaType: "ทวีติยาภรณ์ช้างเผือก",
- insigniaSend: "ตริตาภรณ์ช้างเผือก",
- insigniaLevel: "ต่ำกว่าสายสะพาย",
- dateSend: "31 ม.ค. 2566",
- },
- {
- no: "4",
- citizenId: "1xxxxxxxxxx",
- name: "นางสาวเมขลา กระจ่างมนตรี",
- position: "นักจัดการงานทั่วไป",
- level: "ปฏิบัติการ",
- salary: "15000",
- organization: "บริหาร",
- insigniaType: "ทวีติยาภรณ์ช้างเผือก",
- insigniaSend: "ตริตาภรณ์ช้างเผือก",
- insigniaLevel: "ต่ำกว่าสายสะพาย",
- dateSend: "31 ม.ค. 2566",
- },
-]);
+
onMounted(async () => {
organizationOptions.value = DataStore.optionsTypeOc;
organization.value = organizationOptions.value[0].id;
+ DataStore.typeOc = organization.value;
// if (props.fecthInsigniaAll) {
// await props.fecthInsigniaAll(props.roundId, props.tab);
// }
@@ -207,7 +146,6 @@ onMounted(async () => {
"officer",
props.tab
);
- filtertypeInsignia();
}
}
});
@@ -222,35 +160,6 @@ const changtypeOc = () => {
}
};
-const typeinsignia = ref("all");
-const typeinsigniaOptions = reactive([{ id: "all", name: "ทั้งหมด" }]);
-const typeinsigniaValues: Set = new Set();
-const listinsignia = ref([]);
-const filtertypeInsignia = async () => {
- listinsignia.value = rows.value;
- for (const data of listinsignia.value) {
- const Type = data.insigniaType;
- if (Type !== null && !typeinsigniaValues.has(Type)) {
- typeinsigniaOptions.push({
- id: Type.toString(),
- name: Type.toString(),
- });
- typeinsigniaValues.add(Type);
- }
- }
-};
-const searchFilterTable = async () => {
- if (typeinsignia.value !== undefined && typeinsignia.value !== null) {
- if (typeinsignia.value === "all") {
- rows.value = listinsignia.value;
- } else {
- rows.value = listinsignia.value.filter(
- (e) => e.insigniaType === typeinsignia.value
- );
- }
- }
-};
-
const filterKeyword = ref("");
const filterRef = ref(null);
const resetFilter = () => {
@@ -272,6 +181,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
+
{
@update:model-value="changtypeOc"
/>
{
:outlined="true"
:hide-dropdown-icon="false"
style="min-width: 150px"
- @update:model-value="searchFilterTable"
+ @update:model-value="DataStore.searchFilterTable"
/>
@@ -352,7 +262,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
{
{{ props.row.salary }}
-
- {{ props.row.organization }}
-
+
{{ props.row.insigniaType }}
diff --git a/src/modules/07_insignia/components/2_Manage/Tab3.vue b/src/modules/07_insignia/components/2_Manage/Tab3.vue
index a1656c1e8..86e56a117 100644
--- a/src/modules/07_insignia/components/2_Manage/Tab3.vue
+++ b/src/modules/07_insignia/components/2_Manage/Tab3.vue
@@ -30,7 +30,6 @@ const visibleColumns = ref([
"position",
"level",
"salary",
- "organization",
"insigniaType",
"insigniaSend",
"insigniaLevel",
@@ -91,15 +90,6 @@ const columns = ref([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
- {
- name: "organization",
- align: "left",
- label: "หน่วยงาน",
- sortable: true,
- field: "organization",
- headerStyle: "font-size: 14px",
- style: "font-size: 14px",
- },
{
name: "insigniaType",
align: "left",
@@ -137,64 +127,10 @@ const columns = ref([
style: "font-size: 14px",
},
]);
-// ข้อมูลตาราง (จำลอง)
-const rows = ref([
- {
- no: "1",
- citizenId: "1xxxxxxxxxx",
- name: "นายใจดี ยอดใจ ",
- position: "นักวิชาการพัสดุ",
- level: "1",
- salary: "15000",
- organization: "บริหาร",
- insigniaType: "ทวีติยาภรณ์ช้างเผือก",
- insigniaSend: "ตริตาภรณ์ช้างเผือก",
- insigniaLevel: "ต่ำกว่าสายสะพาย",
- dateSend: "31 ม.ค. 2566",
- },
- {
- no: "2",
- citizenId: "1xxxxxxxxxx",
- name: "นายจักกริน บัณฑิต",
- position: "นักวิชาการพัสดุ",
- level: "ปฏิบัติการ",
- salary: "15000",
- organization: "บริหาร",
- insigniaType: "ทวีติยาภรณ์ช้างเผือก",
- insigniaSend: "ตริตาภรณ์ช้างเผือก",
- insigniaLevel: "ต่ำกว่าสายสะพาย",
- dateSend: "31 ม.ค. 2566",
- },
- {
- no: "3",
- citizenId: "1xxxxxxxxxx",
- name: "นางสาวกัณฐิมา กาฬสินธุ์",
- position: "นักจัดการงานทั่วไป",
- level: "ปฏิบัติการ",
- salary: "15000",
- organization: "บริหาร",
- insigniaType: "ทวีติยาภรณ์ช้างเผือก",
- insigniaSend: "ตริตาภรณ์ช้างเผือก",
- insigniaLevel: "ต่ำกว่าสายสะพาย",
- dateSend: "31 ม.ค. 2566",
- },
- {
- no: "4",
- citizenId: "1xxxxxxxxxx",
- name: "นางสาวเมขลา กระจ่างมนตรี",
- position: "นักจัดการงานทั่วไป",
- level: "ปฏิบัติการ",
- salary: "15000",
- organization: "บริหาร",
- insigniaType: "ทวีติยาภรณ์ช้างเผือก",
- insigniaSend: "ตริตาภรณ์ช้างเผือก",
- insigniaLevel: "ต่ำกว่าสายสะพาย",
- dateSend: "31 ม.ค. 2566",
- },
-]);
onMounted(async () => {
organizationOptions.value = DataStore.optionsTypeOc;
organization.value = organizationOptions.value[0].id;
+ DataStore.typeOc = organization.value;
// if (props.fecthInsigniaAll) {
// await props.fecthInsigniaAll(props.roundId, props.tab);
// }
@@ -206,7 +142,6 @@ onMounted(async () => {
"officer",
props.tab
);
- filtertypeInsignia();
}
}
});
@@ -221,35 +156,6 @@ const changtypeOc = () => {
}
};
-const typeinsignia = ref("all");
-const typeinsigniaOptions = reactive([{ id: "all", name: "ทั้งหมด" }]);
-const typeinsigniaValues: Set = new Set();
-const listinsignia = ref([]);
-const filtertypeInsignia = async () => {
- listinsignia.value = rows.value;
- for (const data of listinsignia.value) {
- const Type = data.insigniaType;
- if (Type !== null && !typeinsigniaValues.has(Type)) {
- typeinsigniaOptions.push({
- id: Type.toString(),
- name: Type.toString(),
- });
- typeinsigniaValues.add(Type);
- }
- }
-};
-const searchFilterTable = async () => {
- if (typeinsignia.value !== undefined && typeinsignia.value !== null) {
- if (typeinsignia.value === "all") {
- rows.value = listinsignia.value;
- } else {
- rows.value = listinsignia.value.filter(
- (e) => e.insigniaType === typeinsignia.value
- );
- }
- }
-};
-
const filterKeyword = ref("");
const filterRef = ref(null);
const resetFilter = () => {
@@ -291,12 +197,12 @@ const paginationLabel = (start: string, end: string, total: string) => {
@update:model-value="changtypeOc"
/>
{
:outlined="true"
:hide-dropdown-icon="false"
style="min-width: 150px"
- @update:model-value="searchFilterTable"
+ @update:model-value="DataStore.searchFilterTable"
/>
@@ -351,7 +257,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
{
{{ props.row.salary }}
-
- {{ props.row.organization }}
-
+
{{ props.row.insigniaType }}
diff --git a/src/modules/07_insignia/components/2_Manage/listManage.vue b/src/modules/07_insignia/components/2_Manage/listManage.vue
index 5af40dfc5..aae193506 100644
--- a/src/modules/07_insignia/components/2_Manage/listManage.vue
+++ b/src/modules/07_insignia/components/2_Manage/listManage.vue
@@ -36,13 +36,12 @@ const stat = ref({
disclaim: 0,
});
onMounted(async () => {
- console.log(DataStore.optionsTypeOc);
await fecthlistRound();
await fecthType();
});
const fecthlistRound = async () => {
await http
- .get(config.API.listRoundInsignia("insignia"))
+ .get(config.API.listRoundInsignia())
.then((res: any) => {
optionRound.value = res.data.result.map((e: any) => ({
id: e.period_id,
@@ -84,8 +83,6 @@ const fecthStat = async (id: string) => {
.get(config.API.insigniaDashboard(id))
.then((res) => {
stat.value = res.data.result;
- // console.log(res);
- console.log(stat.value);
})
.catch((err) => {
messageError($q, err);
@@ -96,6 +93,7 @@ const fecthStat = async (id: string) => {
};
const changround = () => {
fecthStat(round.value);
+ fecthInsigniaByOc(round.value, DataStore.typeOc, "officer", tab.value);
};
const fecthInsigniaAll = async (periodId: string, tab: string) => {
// let data: any = [];
@@ -118,14 +116,20 @@ const fecthInsigniaByOc = async (
role: string,
status: string
) => {
- console.log(status);
+ showLoader();
await http
.get(config.API.insigniaList(roundId, ocId, role, status))
- .then((res) => {
+ .then(async (res) => {
console.log(res);
+
+ await DataStore.fetchData(res.data.result.items);
})
.catch((err) => {
console.log(err);
+ // messageError($q);
+ })
+ .finally(() => {
+ hideLoader();
});
};
@@ -143,6 +147,7 @@ const fecthInsigniaByOc = async (
v-model="round"
:options="optionRound"
map-options
+ emit-value
option-value="id"
option-label="name"
@update:model-value="changround"
diff --git a/src/modules/07_insignia/store.ts b/src/modules/07_insignia/store.ts
index 5f7bbf6ec..fbed84c4d 100644
--- a/src/modules/07_insignia/store.ts
+++ b/src/modules/07_insignia/store.ts
@@ -1,9 +1,73 @@
import { defineStore } from "pinia";
import { ref, } from "vue";
+import { useCounterMixin } from "@/stores/mixin";
+const mixin = useCounterMixin();
+const {
+ date2Thai
+} = mixin;
+
export const useInsigniaDataStore = defineStore("insignia", () => {
let optionsTypeOc = ref([]);
+ let typeOc = ref("")
+ let rows = ref([])
+ const listinsignia = ref([])
+ const typeinsigniaValues: Set = new Set();
+ const typeinsignia = ref("all");
+ let typeinsigniaOptions = ref([{ id: "all", name: "ทั้งหมด" }]);
+
+
+ const fetchData = async (data: any) => {
+ if (data !== null) {
+ rows.value = await data.map((e: any) =>
+ ({
+ id: e.id,
+ profileId: e.profileId,
+ name: e.fullName,
+ position: e.position,
+ level: e.rank,
+ salary2: e.salary,
+ salary: Number(e.salary).toLocaleString(),
+ insigniaType: e.lastInsignia,
+ insigniaSend: e.requestInsignia,
+ insigniaLevel: e.level,
+ dateSend: date2Thai(e.requestDate),
+ }))
+ listinsignia.value = await rows.value
+ filtertypeInsignia()
+ } else rows.value = []
+
+
+ }
+ const filtertypeInsignia = async () => {
+ typeinsignia.value = "all"
+ for (const data of listinsignia.value) {
+ const Type = data.insigniaType;
+ if (Type !== null && !typeinsigniaValues.has(Type)) {
+ typeinsigniaOptions.value.push({ id: Type, name: Type })
+ typeinsigniaValues.add(Type);
+ }
+ }
+ };
+ const searchFilterTable = async () => {
+ if (typeinsignia.value !== undefined && typeinsignia.value !== null) {
+ if (typeinsignia.value === "all") {
+ rows.value = listinsignia.value;
+ } else {
+ rows.value = listinsignia.value.filter(
+ (e: any) => e.insigniaType === typeinsignia.value
+ );
+ }
+ }
+ };
return {
- optionsTypeOc
+ optionsTypeOc,
+ typeOc,
+ rows,
+ typeinsigniaOptions,
+ typeinsignia,
+ fetchData,
+ searchFilterTable,
+
};
});