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