ปรับคอลัมน์รายชื่อผู้ถูกพักราชการ
This commit is contained in:
parent
b13f8c0697
commit
2a21ca2fd4
2 changed files with 26 additions and 22 deletions
|
|
@ -4,7 +4,7 @@ import { useQuasar } from "quasar";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useDisciplineSuspendStore } from "@/modules/11_discipline/store/SuspendStore";
|
import { useDisciplineSuspendStore } from "@/modules/11_discipline/store/SuspendStore";
|
||||||
import type { dataType } from '@/modules/11_discipline/interface/response/suspend'
|
import type { dataType } from "@/modules/11_discipline/interface/response/suspend";
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
|
|
@ -18,11 +18,7 @@ const $q = useQuasar();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
|
|
||||||
const {
|
const { messageError, showLoader, hideLoader } = mixin;
|
||||||
messageError,
|
|
||||||
showLoader,
|
|
||||||
hideLoader,
|
|
||||||
} = mixin;
|
|
||||||
|
|
||||||
const modal = ref<boolean>(false);
|
const modal = ref<boolean>(false);
|
||||||
|
|
||||||
|
|
@ -35,6 +31,7 @@ const visibleColumns = ref<string[]>([
|
||||||
"positionLevel",
|
"positionLevel",
|
||||||
"organization",
|
"organization",
|
||||||
"dateTotal",
|
"dateTotal",
|
||||||
|
"descriptionSuspend",
|
||||||
"status",
|
"status",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
@ -103,12 +100,21 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "dateTotal",
|
name: "dateTotal",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "วันที่ดำเนินการ",
|
label: "วันที่เริ่มต้น-สิ้นสุดคำสั่ง",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "dateTotal",
|
field: "dateTotal",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "descriptionSuspend",
|
||||||
|
align: "left",
|
||||||
|
label: "เหตุที่ถูกสั่งพักราชการ",
|
||||||
|
sortable: true,
|
||||||
|
field: "descriptionSuspend",
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "status",
|
name: "status",
|
||||||
align: "left",
|
align: "left",
|
||||||
|
|
@ -144,9 +150,10 @@ const pagination = ref({
|
||||||
});
|
});
|
||||||
|
|
||||||
/** เปิด popup ส่งไปออกคำสั่ง โดย PENDING*/
|
/** เปิด popup ส่งไปออกคำสั่ง โดย PENDING*/
|
||||||
function openModalOrder(){
|
function openModalOrder() {
|
||||||
openModal();
|
openModal();
|
||||||
const dataMap = dataStore.rows.filter((r: dataType) =>
|
const dataMap = dataStore.rows.filter(
|
||||||
|
(r: dataType) =>
|
||||||
r.statusEn == "PENDING" &&
|
r.statusEn == "PENDING" &&
|
||||||
r.name &&
|
r.name &&
|
||||||
r.organization &&
|
r.organization &&
|
||||||
|
|
@ -154,9 +161,9 @@ function openModalOrder(){
|
||||||
r.positionLevel &&
|
r.positionLevel &&
|
||||||
r.posNo &&
|
r.posNo &&
|
||||||
r.organization
|
r.organization
|
||||||
)
|
);
|
||||||
rows2.value = dataMap;
|
rows2.value = dataMap;
|
||||||
};
|
}
|
||||||
|
|
||||||
/** ดึงข้อมูลหน้าหลัก */
|
/** ดึงข้อมูลหน้าหลัก */
|
||||||
async function getList() {
|
async function getList() {
|
||||||
|
|
@ -186,22 +193,21 @@ async function getList() {
|
||||||
* ยืนยัน ส่งไปออกคำสั่ง
|
* ยืนยัน ส่งไปออกคำสั่ง
|
||||||
* @param data ข้อมูลรายบุคคล
|
* @param data ข้อมูลรายบุคคล
|
||||||
*/
|
*/
|
||||||
function onSubmit(data:dataType[]){
|
function onSubmit(data: dataType[]) {
|
||||||
console.log(data)
|
console.log(data);
|
||||||
const dataMapId = data.map((item: dataType) => item.id);
|
const dataMapId = data.map((item: dataType) => item.id);
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.post(config.API.suspendReport(), {
|
.post(config.API.suspendReport(), {
|
||||||
id: dataMapId,
|
id: dataMapId,
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {})
|
||||||
})
|
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
getList()
|
getList();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -228,7 +234,6 @@ onMounted(() => {
|
||||||
dataStore.columns = columns.value;
|
dataStore.columns = columns.value;
|
||||||
dataStore.visibleColumns = visibleColumns.value;
|
dataStore.visibleColumns = visibleColumns.value;
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="toptitle text-dark col-12 row items-center">
|
<div class="toptitle text-dark col-12 row items-center">
|
||||||
|
|
@ -328,10 +333,10 @@ onMounted(() => {
|
||||||
>
|
>
|
||||||
<div v-if="col.name === 'no'">
|
<div v-if="col.name === 'no'">
|
||||||
{{
|
{{
|
||||||
(currentPage - 1) * Number(pagination.rowsPerPage) +
|
(currentPage - 1) * Number(pagination.rowsPerPage) +
|
||||||
props.rowIndex +
|
props.rowIndex +
|
||||||
1
|
1
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-else-if="col.name === 'organization'"
|
v-else-if="col.name === 'organization'"
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,6 @@ export const useDisciplineSuspendStore = defineStore(
|
||||||
disciplinaryCaseFault: item.disciplinaryCaseFault,
|
disciplinaryCaseFault: item.disciplinaryCaseFault,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
console.log('dataList ===',dataList)
|
|
||||||
rows.value = dataList
|
rows.value = dataList
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue