"Refactoring code module 05_placement 01_Main,02_transferMain,03_receiveMain
This commit is contained in:
parent
131f8ff499
commit
24a4dac091
21 changed files with 534 additions and 1368 deletions
|
|
@ -58,7 +58,7 @@ const visibleColumns = ref<string[]>([
|
|||
"citizenId",
|
||||
"fullname",
|
||||
"organizationName",
|
||||
"birthday",
|
||||
"dateOfBirth",
|
||||
"createdAt",
|
||||
"status",
|
||||
]);
|
||||
|
|
@ -106,11 +106,11 @@ const columns = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "birthday",
|
||||
name: "dateOfBirth",
|
||||
align: "left",
|
||||
label: "วัน/เดือน/ปี เกิด",
|
||||
sortable: true,
|
||||
field: "birthday",
|
||||
field: "dateOfBirth",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,643 +0,0 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, ref, reactive } from "vue";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { usePlacementDataStore } from "@/modules/05_placement/store";
|
||||
import type { QTableProps } from "quasar";
|
||||
import type {
|
||||
DataOption,
|
||||
DataOption1,
|
||||
} from "@/modules/05_placement/interface/index/Main";
|
||||
|
||||
import router from "@/router";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const DataStore = usePlacementDataStore();
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
|
||||
|
||||
const searchYear = ref();
|
||||
const yearOptions = reactive<DataOption[]>([{ id: 0, name: "ทั้งหมด" }]);
|
||||
const dataPlacement = ref<any>([]);
|
||||
const yearOptionsFn = ref<any>([]);
|
||||
|
||||
/**ข้อมูลตาราง (จำลอง)*/
|
||||
const rows = ref<QTableProps["rows"]>([]);
|
||||
|
||||
/** ค้นหาในตาราง */
|
||||
const filterKeyword = ref<string>("");
|
||||
const filterRef = ref<any>(null);
|
||||
const resetFilter = () => {
|
||||
filterKeyword.value = "";
|
||||
filterRef.value.focus();
|
||||
};
|
||||
|
||||
/**ครั้งที่สอบ */
|
||||
const examTime = ref<number | string>("");
|
||||
const examTimeOP = reactive<DataOption1[]>([{ id: "all", name: "ทั้งหมด" }]);
|
||||
const addedExamTimeValues: Set<number> = new Set();
|
||||
|
||||
/** ประเภทการสอบ */
|
||||
const examType = ref<string | null>("");
|
||||
const examTypeOP = ref<DataOption1[]>([{ id: "all", name: "ทั้งหมด" }]);
|
||||
const addedExamTypeValues: Set<string> = new Set();
|
||||
|
||||
/** บัญชีหมดอายุ */
|
||||
const expiredAccount = ref<boolean>(false);
|
||||
const examTimeOP2 = ref<any[]>([]);
|
||||
const examTypeOP2 = ref<any[]>([]);
|
||||
|
||||
const paging = ref<boolean>(true);
|
||||
const pagination = ref({
|
||||
sortBy: "accountStartDate",
|
||||
descending: true,
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
});
|
||||
|
||||
/** ส่วนเเสดงผล ตาราง */
|
||||
const visibleColumns = ref([
|
||||
"id",
|
||||
"examRound",
|
||||
"examOrder",
|
||||
"examOrder",
|
||||
"fiscalYear",
|
||||
"numberOfCandidates",
|
||||
"examTypeName",
|
||||
"accountStartDate",
|
||||
"accountExpirationDate",
|
||||
]);
|
||||
|
||||
/**หัวตาราง */
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "id",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: false,
|
||||
field: "id",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "examRound",
|
||||
align: "left",
|
||||
label: "รอบการสอบ",
|
||||
sortable: true,
|
||||
field: "examRound",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "examOrder",
|
||||
align: "left",
|
||||
label: "ครั้งที่",
|
||||
sortable: true,
|
||||
field: "examOrder",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "fiscalYear",
|
||||
align: "left",
|
||||
label: "ปีงบประมาณ",
|
||||
sortable: true,
|
||||
field: "fiscalYear",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "numberOfCandidates",
|
||||
align: "left",
|
||||
label: "จำนวนผู้สอบได้",
|
||||
sortable: true,
|
||||
field: "numberOfCandidates",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "examTypeName",
|
||||
align: "left",
|
||||
label: "ประเภทการสอบ",
|
||||
sortable: true,
|
||||
field: "examTypeName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "accountStartDate",
|
||||
align: "left",
|
||||
label: "วันที่บัญชีใช้ได้ตั้งแต่",
|
||||
sortable: true,
|
||||
field: "accountStartDate",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "accountExpirationDate",
|
||||
align: "left",
|
||||
label: "วันที่บัญชีใช้ได้ถึง",
|
||||
sortable: true,
|
||||
field: "accountExpirationDate",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
|
||||
/**
|
||||
* ฟังชั่น get ข้อมูลตามปี
|
||||
* @param val ปี ค.ส. โดยที่ทั้งหมดเป็น เลข 0
|
||||
*/
|
||||
async function fetchPlacementData(val: number) {
|
||||
showLoader();
|
||||
rows.value = [];
|
||||
await http
|
||||
.get(config.API.MainDetail(val))
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
dataPlacement.value = data.data;
|
||||
DataStore.DataMainOrig = dataPlacement.value;
|
||||
rows.value = DataStore.DataMainOrig.map((e: any) => ({
|
||||
id: e.id,
|
||||
examRound: e.examRound,
|
||||
examOrder: e.examOrder,
|
||||
examTypeName: e.examTypeName,
|
||||
examTypeValue: e.examTypeValue,
|
||||
accountEndDate: date2Thai(e.accountEndDate),
|
||||
accountExpirationDate: date2Thai(e.accountExpirationDate),
|
||||
accountStartDate: date2Thai(e.accountStartDate),
|
||||
fiscalYear: e.fiscalYear,
|
||||
numberOfCandidates: e.numberOfCandidates,
|
||||
}));
|
||||
|
||||
await Promise.all([
|
||||
examTypeFilter(),
|
||||
examTimeFilter(),
|
||||
expiredAccountFilter(),
|
||||
]);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
filterKeyword.value = "";
|
||||
examTime.value = "ทั้งหมด";
|
||||
examType.value = "ทั้งหมด";
|
||||
expiredAccount.value = false;
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/** ฟังชั่น get ปี ค.ส. */
|
||||
async function fetchYearOptions() {
|
||||
await http
|
||||
.get(config.API.yearOptions())
|
||||
.then((res) => {
|
||||
const response = res.data.result;
|
||||
yearOptions.push(...response);
|
||||
const maxNumber = yearOptions.reduce((max: any, e: any) => {
|
||||
return e.id > max ? e.id : max;
|
||||
}, "");
|
||||
searchYear.value = maxNumber;
|
||||
DataStore.DataMainYearSet(searchYear.value);
|
||||
yearOptionsFn.value = yearOptions;
|
||||
searchYear.value && fetchPlacementData(searchYear.value);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
});
|
||||
}
|
||||
|
||||
/** ฟังชั่นเช็ค ค่า Null
|
||||
* เมื่อ != null เอาค่าส่งไปฟังชั่น get data
|
||||
*/
|
||||
function filterYear() {
|
||||
if (searchYear.value !== null) {
|
||||
fetchPlacementData(searchYear.value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ดูรายการสอบแข่งขัน หน้าต่อไป
|
||||
* @param examId id ระบุ รอบการสอบ
|
||||
*/
|
||||
function redirectToPage(examId?: number) {
|
||||
router.push(`/placement/personal-list/${examId}`);
|
||||
}
|
||||
|
||||
/** ฟิลเตอร์หาครั้งที่สอบ ตาม ปี */
|
||||
async function examTimeFilter() {
|
||||
for (const data of dataPlacement.value) {
|
||||
const examOrder = data.examOrder;
|
||||
if (examOrder !== null && !addedExamTimeValues.has(examOrder)) {
|
||||
examTimeOP.push({ id: examOrder.toString(), name: examOrder.toString() });
|
||||
addedExamTimeValues.add(examOrder);
|
||||
}
|
||||
}
|
||||
examTimeOP.sort((a, b) => {
|
||||
if (a.id === "all") return -1; // ให้ตัวเลือก "ทั้งหมด" อยู่ด้านหน้า
|
||||
if (b.id === "all") return 1;
|
||||
return Number(a.id) - Number(b.id);
|
||||
}); // เรียงลำดับตาม id ที่แปลงเป็นตัวเลข
|
||||
}
|
||||
|
||||
function examTypeFilter() {
|
||||
dataPlacement.value.forEach((item: any) => {
|
||||
const examTypeName = item.examTypeName;
|
||||
const examTypeValue = item.examTypeValue;
|
||||
if (examTypeName && !addedExamTypeValues.has(examTypeName)) {
|
||||
examTypeOP.value.push({
|
||||
id: examTypeValue,
|
||||
name: examTypeName,
|
||||
});
|
||||
addedExamTypeValues.add(examTypeName);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** ฟิลเตอร์ */
|
||||
async function searchFilterTable() {
|
||||
rows.value = [];
|
||||
if (examType.value !== undefined && examType.value !== null) {
|
||||
await DataStore.DataUpdateMain(
|
||||
examTime.value == "ทั้งหมด" ? "all" : examTime.value,
|
||||
examType.value == "ทั้งหมด" ? "all" : examType.value,
|
||||
expiredAccount.value
|
||||
);
|
||||
const dataArr: any = [];
|
||||
await DataStore.DataMainUpdate.map((e: any) => {
|
||||
dataArr.push({
|
||||
id: e.id,
|
||||
examRound: e.examRound,
|
||||
examOrder: e.examOrder,
|
||||
examTypeName: e.examTypeName,
|
||||
examTypeValue: e.examTypeValue,
|
||||
accountEndDate: date2Thai(e.accountEndDate),
|
||||
accountExpirationDate: date2Thai(e.accountExpirationDate),
|
||||
accountStartDate: date2Thai(e.accountStartDate),
|
||||
fiscalYear: e.fiscalYear,
|
||||
numberOfCandidates: e.numberOfCandidates,
|
||||
});
|
||||
});
|
||||
rows.value = dataArr;
|
||||
}
|
||||
}
|
||||
|
||||
/** บัญชีหมดอายุ */
|
||||
async function expiredAccountFilter() {
|
||||
const updatedRows = dataPlacement.value.map((data: any) => {
|
||||
let isExpired = data.isExpired == expiredAccount;
|
||||
return { ...data, isExpired };
|
||||
});
|
||||
await DataStore.DataMain(updatedRows);
|
||||
}
|
||||
|
||||
function paginationLabel(start: number, end: number, total: number) {
|
||||
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
|
||||
else return start + "-" + end + " ใน " + total;
|
||||
}
|
||||
|
||||
/** filter ใน dropdown ครั้งที่ */
|
||||
|
||||
/**
|
||||
* ฟังชั่น กรอกข้อมูลเพื่อ ค้นหา
|
||||
* @param val ค่าที่กรอก
|
||||
* @param update afterFn ของ quasar
|
||||
*/
|
||||
function filterFnexamTime(val: string, update: any) {
|
||||
if (val === "") {
|
||||
update(() => {
|
||||
examTimeOP2.value = examTimeOP;
|
||||
});
|
||||
} else {
|
||||
update(() => {
|
||||
examTimeOP2.value = examTimeOP.filter(
|
||||
(e: any) => e.name.search(val) !== -1
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังชั่น กรอกข้อมูลเพื่อ ค้นหา
|
||||
* @param val ค่าที่กรอก
|
||||
* @param update afterFn ของ quasar
|
||||
*/
|
||||
function filterFnExamtype(val: string, update: any) {
|
||||
if (val === "") {
|
||||
update(() => {
|
||||
examTypeOP2.value = examTypeOP.value;
|
||||
});
|
||||
} else {
|
||||
update(() => {
|
||||
examTypeOP2.value = examTypeOP.value.filter(
|
||||
(e: any) => e.name.search(val) !== -1
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังชั่น กรอกข้อมูลเพื่อ ค้นหา
|
||||
* @param val ค่าที่กรอก
|
||||
* @param update afterFn ของ quasar
|
||||
*/
|
||||
function filterFnYear(val: string, update: any) {
|
||||
if (val === "") {
|
||||
update(() => {
|
||||
yearOptionsFn.value = yearOptions;
|
||||
});
|
||||
} else {
|
||||
update(() => {
|
||||
yearOptionsFn.value = yearOptions.filter(
|
||||
(e: any) => e.name.toString().search(val) !== -1
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/** เรียกใช้ฟังชั่น เมื่อเริ่มหน้านี้ */
|
||||
onMounted(async () => {
|
||||
await fetchYearOptions();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
รายการสอบแข่งขัน / คัดเลือก
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm q-pa-md">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
<q-select
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
v-model="searchYear"
|
||||
label="ปีงบประมาณ"
|
||||
dense
|
||||
emit-value
|
||||
map-options
|
||||
:options="yearOptionsFn"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
:readonly="false"
|
||||
:borderless="false"
|
||||
:outlined="true"
|
||||
:hide-dropdown-icon="false"
|
||||
@update:model-value="filterYear"
|
||||
use-input
|
||||
@filter="filterFnYear"
|
||||
><template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey"> ไม่มีข้อมูล </q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
|
||||
<q-space />
|
||||
|
||||
<q-input
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
standout
|
||||
dense
|
||||
v-model="filterKeyword"
|
||||
ref="filterRef"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filterKeyword == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="filterKeyword !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
|
||||
<q-select
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
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
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<q-card bordered class="col-12 filter-card q-pa-sm">
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
<q-select
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
v-model="examTime"
|
||||
label="ครั้งที่"
|
||||
dense
|
||||
emit-value
|
||||
map-options
|
||||
:options="examTimeOP2"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
:readonly="false"
|
||||
:borderless="false"
|
||||
:outlined="true"
|
||||
:hide-dropdown-icon="false"
|
||||
@update:model-value="searchFilterTable"
|
||||
@filter="filterFnexamTime"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
><template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
|
||||
<q-select
|
||||
class="col-xs-12 col-sm-3 col-md-3"
|
||||
v-model="examType"
|
||||
label="ประเภทการสอบ"
|
||||
dense
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="examTypeOP2"
|
||||
option-value="id"
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
:readonly="false"
|
||||
:borderless="false"
|
||||
:outlined="true"
|
||||
:hide-dropdown-icon="false"
|
||||
@update:model-value="searchFilterTable"
|
||||
@filter="filterFnExamtype"
|
||||
use-input
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
|
||||
<q-toggle
|
||||
class="col-xs-12 col-sm-5 col-md-5 toggle-expired-account"
|
||||
v-model="expiredAccount"
|
||||
color="blue"
|
||||
label="แสดงบัญชีหมดอายุ"
|
||||
@update:model-value="searchFilterTable"
|
||||
/>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-table
|
||||
ref="table"
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
:filter="filterKeyword"
|
||||
row-key="id"
|
||||
flat
|
||||
bordered
|
||||
dense
|
||||
class="custom-header-table"
|
||||
:visible-columns="visibleColumns"
|
||||
:pagination-label="paginationLabel"
|
||||
v-model:pagination="pagination"
|
||||
>
|
||||
<template v-slot:pagination="scope">
|
||||
<q-pagination
|
||||
v-model="pagination.page"
|
||||
active-color="primary"
|
||||
color="dark"
|
||||
:max="scope.pagesNumber"
|
||||
:max-pages="5"
|
||||
size="sm"
|
||||
boundary-links
|
||||
direction-links
|
||||
></q-pagination>
|
||||
</template>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width />
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
{{ col.label }}
|
||||
</q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props">
|
||||
<q-td auto-width>
|
||||
<q-icon
|
||||
v-if="checkPermission($route)?.attrIsList"
|
||||
name="mdi-eye"
|
||||
size="sm"
|
||||
color="info"
|
||||
class="cursor-pointer"
|
||||
@click="() => redirectToPage(props.row.id)"
|
||||
>
|
||||
<q-tooltip>รายละเอียด</q-tooltip>
|
||||
</q-icon>
|
||||
</q-td>
|
||||
<q-td key="id" :props="props">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<q-td key="examRound" :props="props">
|
||||
{{ props.row.examRound }}
|
||||
</q-td>
|
||||
<q-td key="examOrder" :props="props">
|
||||
{{ props.row.examOrder }}
|
||||
</q-td>
|
||||
<q-td key="fiscalYear" :props="props">
|
||||
{{ props.row.fiscalYear }}
|
||||
</q-td>
|
||||
<q-td key="numberOfCandidates" :props="props">
|
||||
{{ props.row.numberOfCandidates }}
|
||||
</q-td>
|
||||
<q-td key="examTypeName" :props="props">
|
||||
{{ props.row.examTypeName }}
|
||||
</q-td>
|
||||
<q-td key="accountStartDate" :props="props">
|
||||
{{ props.row.accountStartDate }}
|
||||
</q-td>
|
||||
<q-td key="accountExpirationDate" :props="props">
|
||||
{{ props.row.accountExpirationDate }}
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</q-table>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scope>
|
||||
.filter-card {
|
||||
background-color: #f1f1f1b0;
|
||||
}
|
||||
|
||||
.toggle-expired-account {
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
font-size: 15px;
|
||||
line-height: 150%;
|
||||
color: #35373c;
|
||||
}
|
||||
|
||||
.icon-color {
|
||||
color: #4154b3;
|
||||
}
|
||||
|
||||
.custom-header-table {
|
||||
max-height: 64vh;
|
||||
|
||||
.q-table tr:nth-child(odd) td {
|
||||
background: white;
|
||||
}
|
||||
|
||||
.q-table tr:nth-child(even) td {
|
||||
background: #f8f8f8;
|
||||
}
|
||||
|
||||
.q-table thead tr {
|
||||
background: #ecebeb;
|
||||
}
|
||||
|
||||
.q-table thead tr th {
|
||||
position: sticky;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* this will be the loading indicator */
|
||||
.q-table thead tr:last-child th {
|
||||
/* height of all previous header rows */
|
||||
top: 48px;
|
||||
}
|
||||
|
||||
.q-table thead tr:first-child th {
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
<script setup lang="ts">
|
||||
/** รับค่ามาจากหน้าหลัก */
|
||||
const props = defineProps({
|
||||
title: String,
|
||||
close: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
});
|
||||
|
||||
/** ปิด dialog*/
|
||||
const close = async () => {
|
||||
props.close();
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
<q-toolbar class="q-py-md">
|
||||
<q-toolbar-title class="header-text">{{ title }}</q-toolbar-title>
|
||||
<q-btn
|
||||
icon="close"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
@click="close"
|
||||
style="color: #ff8080; background-color: #ffdede"
|
||||
/>
|
||||
</q-toolbar>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.header-text {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
line-height: 26px;
|
||||
color: #35373c;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,756 +0,0 @@
|
|||
<script setup lang="ts">
|
||||
import { useQuasar, QForm } from "quasar";
|
||||
import { onMounted, reactive, ref, watch } from "vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogFooter.vue";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const {
|
||||
date2Thai,
|
||||
hideLoader,
|
||||
messageError,
|
||||
showLoader,
|
||||
success,
|
||||
dialogConfirm,
|
||||
} = mixin; //ฟังก์ชันกลางที่เรียกใช้
|
||||
|
||||
const notFound = ref<string>("ไม่พบข้อมูลที่ค้นหา");
|
||||
const noData = ref<string>("ไม่พบข้อมูลผังโครงสร้าง");
|
||||
|
||||
const checkValidate = ref<boolean>(false);
|
||||
const myFormPosition = ref<any>();
|
||||
const selected = ref<string>("");
|
||||
const selectedFile = ref<string>("");
|
||||
const dataRespone = ref<any>();
|
||||
const search = ref<string>("");
|
||||
const filterRef = ref<any>(null);
|
||||
const personal = ref<any>();
|
||||
const expanded = ref<string[]>([]);
|
||||
const editDataStatus = ref<boolean>(false);
|
||||
const placementPosition = ref<any>([]);
|
||||
const treeData = ref<Array<any>>([]);
|
||||
|
||||
// ตำแหน่งเลขที่
|
||||
const posNoOptions = ref<Object[]>([{ label: "", value: "" }]);
|
||||
// ตำแหน่ง
|
||||
const positionOptions = ref<Object[]>([{ label: "", value: "" }]);
|
||||
// ด้าน/สาขา
|
||||
const positionPathSideOptions = ref<Object[]>([{ label: "", value: "" }]);
|
||||
// ประเภทตำแหน่ง
|
||||
const positionTypeOptions = ref<Object[]>([{ label: "", value: "" }]);
|
||||
// สายงาน
|
||||
const positionLineOptions = ref<Object[]>([{ label: "", value: "" }]);
|
||||
// ระดับ
|
||||
const positionLevelOptions = ref<Object[]>([{ label: "", value: "" }]);
|
||||
|
||||
/** กำหนดตัวแปร เเบบ ออปเจ็ค */
|
||||
let dataForm = reactive({
|
||||
personalId: "",
|
||||
containDate: new Date(),
|
||||
posNoId: "",
|
||||
positionId: "",
|
||||
positionLevelId: "",
|
||||
positionLineId: "",
|
||||
positionPathSideId: "",
|
||||
positionTypeId: "",
|
||||
});
|
||||
|
||||
/** ฟังชั่น get file*/
|
||||
// async function fetchPublishFile() {
|
||||
// await http
|
||||
// .get(config.API.getPublishFileHistory)
|
||||
// .then((res) => {
|
||||
// let data = res.data.result;
|
||||
// selectedFile.value = data[0].fileName;
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// hideLoader();
|
||||
// });
|
||||
// }
|
||||
|
||||
/** โหลดข้อมูลโครงสร้างจาก json */
|
||||
// const loadTreeData = async () => {
|
||||
// expanded.value = [];
|
||||
// await http
|
||||
// .get(`${config.s3ClusterUrl}${selectedFile.value}`)
|
||||
// .then((res: any) => {
|
||||
// treeData.value = res.data;
|
||||
// dataRespone.value = res.data;
|
||||
|
||||
// // Filter objects with "name" null
|
||||
// const filteredData = res.data.filter(filterByPersonIdNull);
|
||||
// treeData.value = filteredData;
|
||||
// })
|
||||
// .catch((e: any) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// });
|
||||
// };
|
||||
|
||||
/**
|
||||
* ฟังก์ชันกรองข้อมูลที่ personId เป็น null
|
||||
* @param obj ข้อมูลที่จะถูกกรอง
|
||||
* @returns {boolean} ผลลัพธ์ของการกรองข้อมูล
|
||||
*/
|
||||
function filterByPersonIdNull(obj: any) {
|
||||
if (obj.name === null && obj.isCondition != true) {
|
||||
return true;
|
||||
}
|
||||
if (obj.children && obj.children.length > 0) {
|
||||
obj.children = obj.children.filter(filterByPersonIdNull);
|
||||
return obj.children.length > 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**get data ตำแหน่งงาน */
|
||||
// async function fetchplacementPosition() {
|
||||
// await http
|
||||
// .get(config.API.placementPosition())
|
||||
// .then((res: any) => {
|
||||
// placementPosition.value = res.data.result;
|
||||
// })
|
||||
// .catch((e: any) => {
|
||||
// messageError($q, e);
|
||||
// });
|
||||
// }
|
||||
|
||||
/** รับค่ามาจาก หน้าหลัก*/
|
||||
const props = defineProps({
|
||||
personalId: String,
|
||||
modal: Boolean,
|
||||
close: {
|
||||
type: Function,
|
||||
default: () => console.log("close modal"),
|
||||
},
|
||||
personal: Object,
|
||||
});
|
||||
|
||||
/**
|
||||
* ฟังก์ชันกรองข้อมูลหน่วยงาน
|
||||
* @param node ข้อมูลที่จะถูกกรอง
|
||||
* @param filter ข้อความที่ใช้ในการกรองข้อมูล
|
||||
* @returns {boolean} ผลลัพธ์ของการกรองข้อมูล
|
||||
*/
|
||||
function myFilterMethod(node: any, filter: string) {
|
||||
const filt = filter;
|
||||
return (
|
||||
// ((node.name && node.name == null) || !node.name) &&
|
||||
(node.name && node.name.indexOf(filt) > -1) ||
|
||||
(node.organizationName && node.organizationName.indexOf(filt) > -1) ||
|
||||
(node.positionNum && node.positionNum.indexOf(filt) > -1) ||
|
||||
(node.positionName && node.positionName.indexOf(filt) > -1) ||
|
||||
(node.governmentCode &&
|
||||
node.governmentCode.toString().indexOf(filt) > -1) ||
|
||||
(node.agency && node.agency.indexOf(filt) > -1) ||
|
||||
(node.government && node.government.indexOf(filt) > -1) ||
|
||||
(node.department && node.department.indexOf(filt) > -1) ||
|
||||
(node.pile && node.pile.indexOf(filt) > -1) ||
|
||||
(node.organizationShortName &&
|
||||
node.organizationShortName.indexOf(filt) > -1) ||
|
||||
(node.positionSideName && node.positionSideName.indexOf(filt) > -1) ||
|
||||
(node.executivePosition && node.executivePosition.indexOf(filt) > -1) ||
|
||||
(node.executivePositionSide &&
|
||||
node.executivePositionSide.indexOf(filt) > -1) ||
|
||||
(node.positionLevel && node.positionLevel.indexOf(filt) > -1)
|
||||
);
|
||||
}
|
||||
|
||||
/** validate */
|
||||
async function validateData() {
|
||||
checkValidate.value = true;
|
||||
await myFormPosition.value.validate().then((result: boolean) => {
|
||||
if (result == false) {
|
||||
checkValidate.value = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** ยืนยันการเลือกหน่วยงาน */
|
||||
async function saveAppoint() {
|
||||
myFormPosition.value.validate().then(async (result: boolean) => {
|
||||
if (result) {
|
||||
const dataAppoint = await {
|
||||
personalId: props.personalId,
|
||||
containDate: dataForm.containDate,
|
||||
posNoId: dataForm.posNoId,
|
||||
positionId: dataForm.positionId,
|
||||
positionLevelId: dataForm.positionLevelId,
|
||||
positionLineId: dataForm.positionLineId,
|
||||
positionPathSideId: dataForm.positionPathSideId,
|
||||
positionTypeId: dataForm.positionTypeId,
|
||||
};
|
||||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.placementPass(), dataAppoint)
|
||||
.then(() => {
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await closeAndClear();
|
||||
// await fetchPublishFile();
|
||||
// await loadTreeData();
|
||||
// await fetchplacementPosition();
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** ปิด dialog */
|
||||
function closeModal() {
|
||||
if (editDataStatus.value == true) {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
() => closeAndClear(),
|
||||
"ข้อมูลมีการแก้ไข",
|
||||
"ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่"
|
||||
);
|
||||
} else {
|
||||
closeAndClear();
|
||||
}
|
||||
}
|
||||
/** clean ข้อมูล */
|
||||
async function closeAndClear() {
|
||||
await props.close();
|
||||
editDataStatus.value = false;
|
||||
selected.value = "";
|
||||
dataForm.personalId = "";
|
||||
dataForm.containDate = new Date();
|
||||
dataForm.posNoId = "";
|
||||
dataForm.positionId = "";
|
||||
dataForm.positionLevelId = "";
|
||||
dataForm.positionLineId = "";
|
||||
dataForm.positionPathSideId = "";
|
||||
dataForm.positionTypeId = "";
|
||||
}
|
||||
|
||||
/**
|
||||
* เลือกหน่วยงาน
|
||||
* @param data ข้อมูลตำเเหน่งงาน
|
||||
*/
|
||||
async function selectedPosition(data: any) {
|
||||
if (data.name == null && selected.value != data.keyId) {
|
||||
editDataStatus.value = true;
|
||||
selected.value = data.keyId;
|
||||
|
||||
// posNo Options
|
||||
posNoOptions.value = [
|
||||
{
|
||||
label: data.positionNum,
|
||||
value: data.positionNumId,
|
||||
},
|
||||
];
|
||||
dataForm.posNoId = data.positionNumId;
|
||||
|
||||
// position Options
|
||||
positionOptions.value = [
|
||||
{
|
||||
label: data.positionName,
|
||||
value: data.positionNameId,
|
||||
},
|
||||
];
|
||||
dataForm.positionId = data.positionNameId;
|
||||
|
||||
// positionPathSide Options
|
||||
let positionPathSideArr: any = [];
|
||||
if (data.positionSideNameObj && data.positionSideNameObj != null) {
|
||||
data.positionSideNameObj.map((x: any) => {
|
||||
positionPathSideArr.push({
|
||||
label: x.Name,
|
||||
value: x.Id,
|
||||
});
|
||||
});
|
||||
positionPathSideOptions.value = positionPathSideArr;
|
||||
dataForm.positionPathSideId =
|
||||
positionPathSideArr.length > 1 || positionPathSideArr.length == 0
|
||||
? ""
|
||||
: positionPathSideArr[0].value;
|
||||
}
|
||||
|
||||
// positionType Options
|
||||
positionTypeOptions.value = [
|
||||
{
|
||||
label: data.positionType,
|
||||
value: data.positionTypeId,
|
||||
},
|
||||
];
|
||||
dataForm.positionTypeId = data.positionTypeId;
|
||||
|
||||
// positionLine Options
|
||||
positionLineOptions.value = [
|
||||
{
|
||||
label: data.positionLine,
|
||||
value: data.positionLineId,
|
||||
},
|
||||
];
|
||||
dataForm.positionLineId = data.positionLineId;
|
||||
|
||||
// positionLevel Options
|
||||
let positionLevelsArr: any = [];
|
||||
if (data.positionLevelObj != null) {
|
||||
data.positionLevelObj.map((x: any) => {
|
||||
positionLevelsArr.push({
|
||||
label: x.Name,
|
||||
value: x.Id,
|
||||
});
|
||||
});
|
||||
positionLevelOptions.value = positionLevelsArr;
|
||||
dataForm.positionLevelId =
|
||||
positionLevelsArr.length > 1 || positionLevelsArr.length == 0
|
||||
? ""
|
||||
: positionLevelsArr[0].value;
|
||||
dataForm.positionLevelId = data.positionLevelObj[0].Id;
|
||||
}
|
||||
} else if (selected.value == data.keyId) {
|
||||
selected.value = "";
|
||||
dataForm.posNoId = "";
|
||||
dataForm.positionId = "";
|
||||
dataForm.positionLevelId = "";
|
||||
dataForm.positionLineId = "";
|
||||
dataForm.positionPathSideId = "";
|
||||
dataForm.positionTypeId = "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* เช็คตำแหน่ง งาน
|
||||
* @param val id ตำแหน่ง
|
||||
*/
|
||||
function checkPosition(val: string) {
|
||||
const num = placementPosition.value.findIndex((e: string) => e === val);
|
||||
return num;
|
||||
}
|
||||
|
||||
/**
|
||||
* หาหน่วยงานที่เลือก
|
||||
* @param element
|
||||
*/
|
||||
function findByPerson(element: any): any {
|
||||
if (
|
||||
element.positionNumId &&
|
||||
element.positionLineId === personal.value.positionLineId &&
|
||||
element.positionTypeId === personal.value.positionTypeId &&
|
||||
element.positionNumId === personal.value.posNoId &&
|
||||
(element.positionLevelObj === null ||
|
||||
element.positionLevelObj[0].Id === personal.value.positionLevelId)
|
||||
) {
|
||||
return element;
|
||||
} else if (element.children) {
|
||||
var i;
|
||||
var result = null;
|
||||
for (i = 0; result == null && i < element.children.length; i++) {
|
||||
result = findByPerson(element.children[i]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/** ยืนยันการคืนตำแหน่ง */
|
||||
function clearPosition() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => postClearPosition(),
|
||||
"ยืนยันการคืนตำแหน่ง",
|
||||
"ต้องการยืนยันการคืนตำแหน่งนี้ใช่หรือไม่ ?"
|
||||
);
|
||||
}
|
||||
|
||||
/** คืนตำแหน่ง */
|
||||
async function postClearPosition() {
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.clearPosition(personal.value.personalId), {})
|
||||
.then(() => {
|
||||
success($q, "คืนตำแหน่งสำเร็จ");
|
||||
})
|
||||
.catch((e: Object) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
await closeAndClear();
|
||||
});
|
||||
}
|
||||
|
||||
/** เมื่อ props เปลี่ยนแปลงจะโหลดหน่วยงาน */
|
||||
watch(props, () => {
|
||||
expanded.value = [];
|
||||
const dataPersonal = props.personal;
|
||||
// fetchplacementPosition();
|
||||
if (dataPersonal) {
|
||||
dataPersonal.map((data: any) => {
|
||||
personal.value = data;
|
||||
});
|
||||
}
|
||||
if (
|
||||
personal.value &&
|
||||
personal.value.draft === false &&
|
||||
personal.value.positionNumber !== null
|
||||
) {
|
||||
let findData: any = null;
|
||||
dataRespone.value.map((x: any) => {
|
||||
findData = findByPerson(x);
|
||||
// ถ้ามีตำแต่งจะทำการ expandedTree
|
||||
if (findData != null) {
|
||||
selectedPosition(findData);
|
||||
for (let i = 3; i <= findData.keyId.length; i += 2) {
|
||||
expanded.value.push(findData.keyId.slice(0, i));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
// await fetchPublishFile();
|
||||
// await loadTreeData();
|
||||
// await fetchplacementPosition();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<q-dialog v-model="props.modal" persistent>
|
||||
<q-card style="width: 900px; max-width: 80vw">
|
||||
<q-form ref="myFormPosition">
|
||||
<DialogHeader tittle="เลือกหน่วยงานที่รับบรรจุ" :close="closeModal" />
|
||||
<q-separator />
|
||||
<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 row">
|
||||
<q-card flat bordered class="fit q-pa-sm">
|
||||
<q-scroll-area visible style="height: 70vh">
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
ref="filterRef"
|
||||
v-model="search"
|
||||
placeholder="ค้นหา"
|
||||
class="q-mb-sm"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="mdi-magnify" />
|
||||
</template>
|
||||
</q-input>
|
||||
<div class="q-pa-sm q-gutter-sm">
|
||||
<q-tree
|
||||
no-transition
|
||||
dense
|
||||
:nodes="treeData"
|
||||
node-key="keyId"
|
||||
:filter="search"
|
||||
:no-results-label="notFound"
|
||||
:no-nodes-label="noData"
|
||||
:filter-method="myFilterMethod"
|
||||
v-model:expanded="expanded"
|
||||
>
|
||||
<template v-slot:header-organization="prop">
|
||||
<div class="col">
|
||||
<div
|
||||
class="row items-center q-px-xs q-pt-xs q-gutter-sm"
|
||||
>
|
||||
<!--แสดงชื่อแผนก พิมพ์ตัวหนา คลิกแล้วกาง/หุบ Tree-->
|
||||
<div class="text-weight-medium">
|
||||
{{ prop.node.organizationName }}
|
||||
</div>
|
||||
|
||||
<!--แสดง Total Count PositionNum-->
|
||||
<q-badge
|
||||
v-if="prop.node.totalPositionVacant > 0"
|
||||
rounded
|
||||
color="red"
|
||||
outline
|
||||
:label="prop.node.totalPositionVacant"
|
||||
/>
|
||||
|
||||
<q-space />
|
||||
</div>
|
||||
<div class="col items-center q-px-xs q-pt-xs">
|
||||
<div class="text-weight-medium text-grey-7">
|
||||
{{ prop.node.governmentCode }}
|
||||
{{ prop.node.organizationShortName }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template v-slot:header-person="prop">
|
||||
<q-item
|
||||
clickable
|
||||
:active="selected == prop.node.keyId"
|
||||
@click="selectedPosition(prop.node)"
|
||||
:disable="
|
||||
prop.node.name != null ||
|
||||
checkPosition(prop.node.positionNumId) != -1
|
||||
"
|
||||
active-class="my-list-link text-primary text-weight-medium"
|
||||
class="row items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
|
||||
>
|
||||
<img
|
||||
v-if="
|
||||
prop.node.avatar == '' ||
|
||||
prop.node.avatar ==
|
||||
'https://cdn.quasar.dev/img/boy-avatar.png'
|
||||
"
|
||||
src="@/assets/avatar_user.jpg"
|
||||
class="col-xs-1 col-sm-2"
|
||||
style="
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: 50%;
|
||||
"
|
||||
/>
|
||||
<img
|
||||
v-else
|
||||
:src="prop.node.avatar"
|
||||
class="col-xs-1 col-sm-2"
|
||||
style="
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: 50%;
|
||||
"
|
||||
/>
|
||||
<!--=====ตำแหน่งว่าง สีแดง=====-->
|
||||
<div
|
||||
v-if="prop.node.name == null"
|
||||
class="q-px-sm text-weight-medium text-red"
|
||||
>
|
||||
ว่าง
|
||||
</div>
|
||||
<!--=====หัวหน้า สีเขียว=====-->
|
||||
<div v-else-if="prop.node.positionLeaderFlag">
|
||||
<div
|
||||
class="q-px-sm text-weight-medium text-primary"
|
||||
>
|
||||
{{ prop.node.name }}
|
||||
</div>
|
||||
</div>
|
||||
<!--=====ลูกน้อง สีปกติ=====-->
|
||||
<div v-else>
|
||||
<div class="q-px-sm text-weight-medium">
|
||||
{{ prop.node.name }}
|
||||
</div>
|
||||
</div>
|
||||
<!--ต่อท้ายชื่อคน แสดงสีปกติ-->
|
||||
<div class="q-pr-sm">
|
||||
{{ prop.node.positionName }}
|
||||
</div>
|
||||
<div class="q-pr-sm">
|
||||
{{ prop.node.positionNum }}
|
||||
</div>
|
||||
<div class="q-pr-sm">
|
||||
{{ prop.node.positionLevel }}
|
||||
</div>
|
||||
<q-icon
|
||||
v-if="prop.node.positionLeaderFlag"
|
||||
class="q-mr-sm"
|
||||
size="15px"
|
||||
color="primary"
|
||||
name="mdi-bookmark"
|
||||
></q-icon>
|
||||
|
||||
<q-space />
|
||||
</q-item>
|
||||
</template>
|
||||
</q-tree>
|
||||
</div>
|
||||
</q-scroll-area>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-5">
|
||||
<q-card flat bordered class="fit q-pa-sm">
|
||||
<q-scroll-area visible style="height: 70vh">
|
||||
<div class="row col-12 q-col-gutter-xs">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12"></div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dataForm.containDate"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
class="full-width inputgreen cursor-pointer"
|
||||
outlined
|
||||
dense
|
||||
:model-value="
|
||||
date2Thai(new Date(dataForm.containDate))
|
||||
"
|
||||
:rules="[ (val: string) =>!!val ||`${'วันที่รายงานตัว'}`,
|
||||
]"
|
||||
:label="`${'วันที่รายงานตัว'}`"
|
||||
hide-bottom-space
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<q-space />
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<q-select
|
||||
class="full-width inputgreen cursor-pointer custom-input"
|
||||
outlined
|
||||
standout
|
||||
dense
|
||||
hide-bottom-space
|
||||
lazy-rules
|
||||
:options="posNoOptions"
|
||||
v-model="dataForm.posNoId"
|
||||
:label="`${'ตำแหน่งเลขที่'}`"
|
||||
map-options
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<q-select
|
||||
outlined
|
||||
class="full-width inputgreen cursor-pointer custom-input"
|
||||
standout
|
||||
dense
|
||||
hide-bottom-space
|
||||
lazy-rules
|
||||
:options="positionOptions"
|
||||
v-model="dataForm.positionId"
|
||||
:label="`${'ตำแหน่ง'}`"
|
||||
map-options
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<q-select
|
||||
outlined
|
||||
class="full-width inputgreen cursor-pointer custom-input"
|
||||
standout
|
||||
dense
|
||||
hide-bottom-space
|
||||
lazy-rules
|
||||
:options="positionPathSideOptions"
|
||||
v-model="dataForm.positionPathSideId"
|
||||
:label="`${'ด้าน/สาขา'}`"
|
||||
map-options
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<q-select
|
||||
outlined
|
||||
class="full-width inputgreen cursor-pointer custom-input"
|
||||
standout
|
||||
dense
|
||||
hide-bottom-space
|
||||
lazy-rules
|
||||
:options="positionTypeOptions"
|
||||
v-model="dataForm.positionTypeId"
|
||||
:label="`${'ประเภทตำแหน่ง'}`"
|
||||
map-options
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<q-select
|
||||
outlined
|
||||
class="full-width inputgreen cursor-pointer custom-input"
|
||||
standout
|
||||
dense
|
||||
hide-bottom-space
|
||||
lazy-rules
|
||||
:options="positionLineOptions"
|
||||
v-model="dataForm.positionLineId"
|
||||
:label="`${'สายงาน'}`"
|
||||
map-options
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<q-select
|
||||
outlined
|
||||
class="full-width inputgreen cursor-pointer custom-input"
|
||||
standout
|
||||
dense
|
||||
lazy-rules
|
||||
:options="positionLevelOptions"
|
||||
v-model="dataForm.positionLevelId"
|
||||
:label="`${'ระดับ'}`"
|
||||
hide-bottom-space
|
||||
:rules="[(val: string) => !!val || `${'กรุณาเลือกระดับ'}`]"
|
||||
emit-value
|
||||
map-options
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="col-xs-12 col-sm-12 col-md-12 q-pa-lg"
|
||||
v-if="personal.positionNumber"
|
||||
>
|
||||
<div class="row">
|
||||
<div class="col-md-4 offset-md-4">
|
||||
<q-btn
|
||||
color="grey"
|
||||
label="คืนตำแหน่ง"
|
||||
@click="clearPosition"
|
||||
></q-btn>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-scroll-area>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
|
||||
<q-separator />
|
||||
<DialogFooter
|
||||
:editvisible="true"
|
||||
:validate="validateData"
|
||||
:save="saveAppoint"
|
||||
v-model:modalEdit="editDataStatus"
|
||||
/>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.q-tree__node-header {
|
||||
padding: 0px;
|
||||
margin-top: 0px;
|
||||
border-radius: 4px;
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
.my-list-link {
|
||||
color: rgb(118, 168, 222);
|
||||
border-radius: 5px;
|
||||
background: #a3d3fb48 !important;
|
||||
font-weight: 600;
|
||||
border: 1px solid rgba(175, 185, 196, 0.217);
|
||||
/* box-shadow: 1px 1px 7px 1px rgba(41, 95, 255, 0.15) !important; */
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,8 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
import { defineAsyncComponent } from "@vue/runtime-core";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import cardTop from "@/modules/05_placement/components/PersonalList/StatCard.vue";
|
||||
import { tokenParsed } from "@/plugins/auth";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
|
|
@ -12,6 +10,9 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
import { useQuasar } from "quasar";
|
||||
import { usePlacementDataStore } from "@/modules/05_placement/store";
|
||||
|
||||
import CardTop from "@/modules/05_placement/components/PersonalList/StatCard.vue";
|
||||
import AddTablePosition from "@/modules/05_placement/components/PersonalList/Table.vue";
|
||||
|
||||
const DataStore = usePlacementDataStore();
|
||||
|
||||
let roleAdmin = ref<boolean>(false);
|
||||
|
|
@ -25,9 +26,7 @@ const year = ref<string>("");
|
|||
const round = ref<string>("");
|
||||
const title = ref<string>("");
|
||||
const examData = ref<any>();
|
||||
const AddTablePosition = defineAsyncComponent(
|
||||
() => import("@/modules/05_placement/components/PersonalList/Table.vue")
|
||||
);
|
||||
|
||||
const stat = ref<any>({
|
||||
total: 0,
|
||||
unContain: 0,
|
||||
|
|
@ -116,28 +115,28 @@ onMounted(async () => {
|
|||
<div class="col-12 row bg-white">
|
||||
<div class="fit q-px-md q-py-sm">
|
||||
<div class="row col-12 q-col-gutter-md fit">
|
||||
<cardTop
|
||||
<CardTop
|
||||
:amount="stat.total"
|
||||
label="จำนวนทั้งหมด"
|
||||
color="#016987"
|
||||
/>
|
||||
<cardTop
|
||||
<CardTop
|
||||
v-if="roleAdmin"
|
||||
:amount="stat.unContain"
|
||||
label="จำนวนที่ยังไม่บรรจุ"
|
||||
color="#02A998"
|
||||
/>
|
||||
<cardTop
|
||||
<CardTop
|
||||
:amount="stat.prepareContain"
|
||||
label="จำนวนที่เตรียมบรรจุ"
|
||||
color="#2EA0FF"
|
||||
/>
|
||||
<cardTop
|
||||
<CardTop
|
||||
:amount="stat.contain"
|
||||
label="จำนวนที่บรรจุแล้ว"
|
||||
color="#4154B3"
|
||||
/>
|
||||
<cardTop
|
||||
<CardTop
|
||||
:amount="stat.disclaim"
|
||||
label="จำนวนที่สละสิทธิ์"
|
||||
color="#FF5C5F"
|
||||
|
|
@ -1,26 +1,26 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, watch, reactive, computed } from "vue";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useQuasar, QForm } from "quasar";
|
||||
import type { QTableProps } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
import { useRoute } from "vue-router";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { tokenParsed } from "@/plugins/auth";
|
||||
import router from "@/router";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import avatar from "@/assets/avatar_user.jpg";
|
||||
|
||||
import type { PartialTableName } from "@/modules/05_placement/interface/request/placement";
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { DataList } from "@/modules/05_placement/interface/response/SelectOrg";
|
||||
|
||||
import DialogSelectOrg from "@/modules/05_placement/components/PersonalList/DialogSelectOrg.vue";
|
||||
|
||||
import Table from "@/modules/05_placement/components/PersonalList/TableView.vue";
|
||||
import DialogCard from "@/modules/05_placement/components/PersonalList/TableDetail.vue";
|
||||
import DialogCard from "@/modules/05_placement/components/PersonalList/DialogDetail.vue";
|
||||
import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogFooter.vue";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import type { PartialTableName } from "@/modules/05_placement/interface/request/placement";
|
||||
import DialogOrgTree from "@/modules/05_placement/components/PersonalList/OrgTree.vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import router from "@/router";
|
||||
import avatar from "@/assets/avatar_user.jpg";
|
||||
import { tokenParsed } from "@/plugins/auth";
|
||||
|
||||
let roleAdmin = ref<boolean>(false);
|
||||
|
||||
|
|
@ -1169,7 +1169,6 @@ onMounted(async () => {
|
|||
</Table>
|
||||
</q-form>
|
||||
|
||||
<!-- เลือกหน่วยงานที่บรรจุ -->
|
||||
<DialogOrgTree
|
||||
v-model:modal="appointModal"
|
||||
:personalId="personalId"
|
||||
|
|
@ -1511,6 +1510,7 @@ onMounted(async () => {
|
|||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<!-- เลือกหน่วยงานที่บรรจุ -->
|
||||
<DialogSelectOrg
|
||||
v-model:modal="modalDialogSelectOrg"
|
||||
:dataRow="dataRow"
|
||||
|
|
|
|||
|
|
@ -1,611 +0,0 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||
import Dialogbody from "@/modules/05_placement/components/Receive/Dialogbody.vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
import DialogHeader from "@/modules/05_placement/components/Receive/DialogHeader.vue";
|
||||
|
||||
import type { QTableProps } from "quasar";
|
||||
import type {
|
||||
ResponseData,
|
||||
ResponseRow,
|
||||
} from "@/modules/05_placement/interface/response/Receive";
|
||||
|
||||
import DialogOrgSelect from "@/components/Dialogs/DialogOrgSelect.vue";
|
||||
|
||||
const dataRows = ref<any[]>([]);
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const rows2 = ref<ResponseRow[]>([]);
|
||||
const modal = ref<boolean>(false);
|
||||
const modalupload = ref<boolean>(false);
|
||||
const modalTree = ref<boolean>(false);
|
||||
const myForm = ref<any>();
|
||||
const personal = ref<ResponseData[]>([]);
|
||||
const personalId = ref<string>("");
|
||||
const filterKeyword = ref<string>("");
|
||||
const filterKeyword2 = ref<string>("");
|
||||
const filterRef = ref<any>(null);
|
||||
const files = ref<any>();
|
||||
const listRecevice = ref<ResponseData[]>([]);
|
||||
const filters = ref<ResponseRow[]>([]);
|
||||
const rows = ref<ResponseRow[]>([]);
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const transferStore = useTransferDataStore();
|
||||
const posType = ref<string>("");
|
||||
const posLevel = ref<string>("");
|
||||
const position = ref<string>("");
|
||||
const type = ref<string | null>(null);
|
||||
|
||||
const { statusText } = transferStore;
|
||||
const {
|
||||
showLoader,
|
||||
hideLoader,
|
||||
success,
|
||||
messageError,
|
||||
date2Thai,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
|
||||
const popup = () => {
|
||||
const row = filters.value.filter(
|
||||
(r: any) =>
|
||||
(r.status == "WAITTING" ||
|
||||
r.status == "PENDING" ||
|
||||
r.status == "APPROVE") &&
|
||||
r.posMasterNo != null &&
|
||||
r.educationOld &&
|
||||
r.organizationPositionOld &&
|
||||
r.positionTypeOld &&
|
||||
r.positionLevelOld &&
|
||||
r.positionNumberOld &&
|
||||
r.amountOld !== null
|
||||
);
|
||||
|
||||
rows2.value = row;
|
||||
modal.value = true;
|
||||
};
|
||||
//คอลัม
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"citizenId",
|
||||
"fullname",
|
||||
"organizationName",
|
||||
"dateOfBirth",
|
||||
"createdAt",
|
||||
"status",
|
||||
]);
|
||||
// หัวตาราง
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: false,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "citizenId",
|
||||
align: "left",
|
||||
label: "เลขประจำตัวประชาชน",
|
||||
sortable: true,
|
||||
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",
|
||||
align: "left",
|
||||
label: "ชื่อ-นามสกุล",
|
||||
sortable: true,
|
||||
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",
|
||||
align: "left",
|
||||
label: "หน่วยงานที่รับโอน",
|
||||
sortable: true,
|
||||
field: "organizationName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "dateOfBirth",
|
||||
align: "left",
|
||||
label: "วัน/เดือน/ปี เกิด",
|
||||
sortable: true,
|
||||
field: "dateOfBirth",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
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: "status",
|
||||
align: "left",
|
||||
label: "สถานะ",
|
||||
sortable: true,
|
||||
field: "status",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
|
||||
//save file
|
||||
const SaveData = async () => {
|
||||
myForm.value.validate().then((result: boolean) => {
|
||||
if (result) {
|
||||
const formData = new FormData();
|
||||
formData.append("File", files.value);
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.receiveFile(personalId.value), formData)
|
||||
.then(async () => {
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
await clickCloseUpload();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const fecthlistRecevice = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.receiveData() + `?keyword=`)
|
||||
.then((res: any) => {
|
||||
const response = res.data.result;
|
||||
|
||||
listRecevice.value = response;
|
||||
rows.value = response;
|
||||
filters.value = response;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
// รีเซ็ตค่าในฟิลเตอร์
|
||||
const resetFilter = () => {
|
||||
filterKeyword.value = "";
|
||||
filterKeyword2.value = "";
|
||||
filterRef.value.focus();
|
||||
};
|
||||
// ไปหน้าเพิ่มข้อมูล
|
||||
const add = () => {
|
||||
router.push(`/placement/receive/add`);
|
||||
};
|
||||
// ปิดโมเดล
|
||||
const clickClose = () => {
|
||||
modal.value = false;
|
||||
filterKeyword2.value = "";
|
||||
};
|
||||
// ปิดโมเดลอัปเดตไฟล์
|
||||
const clickCloseUpload = () => {
|
||||
modalupload.value = false;
|
||||
files.value = null;
|
||||
};
|
||||
// ปิดโมเดลโครงสร้าง
|
||||
const openModalTree = (id: string, data: any) => {
|
||||
personalId.value = id;
|
||||
personal.value = listRecevice.value.filter((e: ResponseData) => e.id === id);
|
||||
dataRows.value = data;
|
||||
|
||||
modalTree.value = true;
|
||||
type.value = null;
|
||||
dataRows.value = data;
|
||||
// console.log("data===>", data);
|
||||
|
||||
posType.value = data.posTypeOldId;
|
||||
posLevel.value = data.posLevelOldId;
|
||||
position.value = data.positionOld;
|
||||
};
|
||||
// เปิดโมเดลไฟล์
|
||||
const openUpload = (id: string) => {
|
||||
personalId.value = id;
|
||||
modalupload.value = true;
|
||||
};
|
||||
// ยินยันลบข้อมูล
|
||||
const openDelete = (id: string) => {
|
||||
dialogRemove($q, async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.delete(config.API.receiveDataId(id))
|
||||
.then(async () => {
|
||||
await fecthlistRecevice();
|
||||
await success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// ไปหน้ารายละเอียด
|
||||
const nextPage = (id: string) => {
|
||||
router.push({
|
||||
path: `/placement/receive/${id}`,
|
||||
});
|
||||
};
|
||||
|
||||
function onSave(data: any) {
|
||||
console.log("not save", data);
|
||||
const dataAppoint = {
|
||||
node: data.node,
|
||||
nodeId: data.nodeId,
|
||||
orgRevisionId: data.orgRevisionId,
|
||||
positionId: data.positionId,
|
||||
posMasterNo: data.posMasterNo,
|
||||
positionName: data.positionName,
|
||||
posTypeId: data.posTypeId,
|
||||
posTypeName: data.posTypeName,
|
||||
posLevelId: data.posLevelId,
|
||||
posLevelName: data.posLevelName,
|
||||
reportingDate: data.reportingDate,
|
||||
posmasterId: data.posmasterId,
|
||||
typeCommand: data.typeCommand,
|
||||
};
|
||||
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.receivePosition(personalId.value), dataAppoint)
|
||||
.then(async () => {
|
||||
await fecthlistRecevice();
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modalTree.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fecthlistRecevice();
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">รายการรับโอน</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm">
|
||||
<q-separator />
|
||||
<div class="row q-pa-md">
|
||||
<div class="col-12">
|
||||
<div class="row col-12">
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsCreate"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
@click="add"
|
||||
icon="mdi-plus"
|
||||
>
|
||||
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
size="14px"
|
||||
flat
|
||||
round
|
||||
color="add"
|
||||
icon="mdi-account-arrow-right"
|
||||
@click="popup()"
|
||||
>
|
||||
<q-tooltip>ส่งไปออกคำสั่งรับโอน</q-tooltip>
|
||||
</q-btn>
|
||||
<q-space />
|
||||
<q-input
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
standout
|
||||
dense
|
||||
v-model="filterKeyword"
|
||||
ref="filterRef"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filterKeyword == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="filterKeyword !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<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 q-ml-sm"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 q-pt-sm">
|
||||
<d-table
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
:filter="filterKeyword"
|
||||
row-key="id"
|
||||
:visible-columns="visibleColumns"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width />
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props">
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
icon="mdi-dots-horizontal-circle-outline"
|
||||
color="secondary"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
v-if="
|
||||
(props.row.status !== 'REPORT' &&
|
||||
props.row.status !== 'DONE' &&
|
||||
checkPermission($route)?.attrIsGet) ||
|
||||
(checkPermission($route)?.attrIsDelete &&
|
||||
props.row.status !== 'REPORT' &&
|
||||
props.row.status !== 'DONE') ||
|
||||
(checkPermission($route)?.attrIsGet &&
|
||||
checkPermission($route)?.attrIsDelete) ||
|
||||
checkPermission($route)?.attrIsGet
|
||||
"
|
||||
>
|
||||
<q-menu
|
||||
transition-show="jump-down"
|
||||
transition-hide="jump-up"
|
||||
>
|
||||
<q-list dense style="min-width: 100px">
|
||||
<q-item
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
checkPermission($route)?.attrIsGet &&
|
||||
props.row.status !== 'REPORT' &&
|
||||
props.row.status !== 'DONE'
|
||||
"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="openModalTree(props.row.id, props.row)"
|
||||
>
|
||||
<q-item-section style="min-width: 0px" avatar>
|
||||
<q-icon
|
||||
color="primary"
|
||||
size="xs"
|
||||
name="mdi-bookmark-outline"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section
|
||||
>เลือกหน่วยงานที่รับโอน
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<q-item
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
checkPermission($route)?.attrIsGet &&
|
||||
props.row.status !== 'REPORT' &&
|
||||
props.row.status !== 'DONE'
|
||||
"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="openUpload(props.row.id)"
|
||||
>
|
||||
<q-item-section style="min-width: 0px" avatar>
|
||||
<q-icon size="xs" name="attach_file" color="blue" />
|
||||
</q-item-section>
|
||||
<q-item-section>อัปโหลดเอกสาร</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<q-item
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="nextPage(props.row.id)"
|
||||
>
|
||||
<q-item-section style="min-width: 0px" avatar>
|
||||
<q-tooltip>รายละเอียด</q-tooltip>
|
||||
<q-icon color="info" size="xs" name="mdi-eye" />
|
||||
</q-item-section>
|
||||
<q-item-section>รายละเอียด</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<q-item
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsDelete &&
|
||||
props.row.status !== 'REPORT' &&
|
||||
props.row.status !== 'DONE'
|
||||
"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="openDelete(props.row.id)"
|
||||
>
|
||||
<q-item-section style="min-width: 0px" avatar>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
<q-icon color="red" size="xs" name="mdi-delete" />
|
||||
</q-item-section>
|
||||
<q-item-section>ลบ</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'fullname'">
|
||||
{{
|
||||
props.row.firstName
|
||||
? `${props.row.prefix ?? ""}${
|
||||
props.row.firstName ?? ""
|
||||
} ${props.row.lastName ?? ""}`
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'dateOfBirth'">
|
||||
{{
|
||||
props.row.dateOfBirth
|
||||
? date2Thai(props.row.dateOfBirth)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'createdAt'">
|
||||
{{
|
||||
props.row.createdAt ? date2Thai(props.row.createdAt) : "-"
|
||||
}}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'organizationName'">
|
||||
<div class="col-4">
|
||||
<div class="text-weight-medium">
|
||||
{{ props.row.root !== null ? props.row.root : "-" }}
|
||||
{{
|
||||
props.row.rootShortName !== null
|
||||
? `(${props.row.rootShortName})`
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
<div class="text-weight-light">
|
||||
{{
|
||||
props.row.nodeName !== null ? props.row.nodeName : ""
|
||||
}}
|
||||
{{
|
||||
props.row.nodeShortName !== null
|
||||
? `(${props.row.nodeShortName}${props.row.posMasterNo})`
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.name == 'status'">
|
||||
{{ props.row.status ? statusText(props.row.status) : "-" }}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<!-- ออกคำสั่ง -->
|
||||
<Dialogbody
|
||||
v-model:Modal="modal"
|
||||
:clickClose="clickClose"
|
||||
:rows2="rows2"
|
||||
v-model:filterKeyword2="filterKeyword2"
|
||||
:fecthlistRecevice="fecthlistRecevice"
|
||||
:nextPage="nextPage"
|
||||
/>
|
||||
|
||||
<!-- อัปโหลดเอกสาร -->
|
||||
<q-dialog v-model="modalupload">
|
||||
<q-card style="width: 600px">
|
||||
<DialogHeader title="อัปโหลดเอกสาร" :close="clickCloseUpload" />
|
||||
<q-separator />
|
||||
<q-card-section class="q-py-sm">
|
||||
<div class="col-12 row items-center q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-file
|
||||
ref="myForm"
|
||||
outlined
|
||||
dense
|
||||
v-model="files"
|
||||
label="อัปโหลดเอกสาร"
|
||||
lazy-rules
|
||||
:rules="[
|
||||
(val) => val || 'กรุณาเลือกไฟล์หนังสือถึงหน่วยงานที่รับโอน',
|
||||
]"
|
||||
hide-bottom-space
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
</q-file>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<div class="row q-pa-sm">
|
||||
<q-space />
|
||||
<q-btn label="บันทึก" color="secondary" @click="SaveData()">
|
||||
<q-tooltip>บันทึก</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<!-- เลือกหน่วยงานที่รับโอน -->
|
||||
<DialogOrgSelect
|
||||
:title="`เลือกหน่วยงานที่รับโอน`"
|
||||
v-model:modal="modalTree"
|
||||
v-model:type="type"
|
||||
:posType="posType"
|
||||
:posLevel="posLevel"
|
||||
:position="position"
|
||||
:dataRows="dataRows"
|
||||
:onSubmit="onSave"
|
||||
/>
|
||||
</template>
|
||||
<style scoped lang="scss"></style>
|
||||
|
|
@ -1,7 +1,8 @@
|
|||
<script setup lang="ts">
|
||||
import { useQuasar, QForm } from "quasar";
|
||||
import { onMounted, reactive, ref, watch } from "vue";
|
||||
import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogHeader.vue";
|
||||
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogFooter.vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http";
|
||||
|
|
@ -426,7 +427,7 @@ function findByPerson(element: any): any {
|
|||
<q-dialog v-model="props.modal" persistent>
|
||||
<q-card style="width: 900px; max-width: 80vw">
|
||||
<q-form ref="myFormPosition">
|
||||
<DialogHeader title="เลือกหน่วยงานที่รับย้าย" :close="closeModal" />
|
||||
<DialogHeader tittle="เลือกหน่วยงานที่รับย้าย" :close="closeModal" />
|
||||
<q-separator />
|
||||
<q-card-section class="q-pa-sm bg-grey-1">
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
|
|
|
|||
|
|
@ -1,21 +1,20 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, computed, watchEffect } from "vue";
|
||||
import { ref, watch } 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 type { QTableProps } from "quasar";
|
||||
import type { ResponseData } from "@/modules/05_placement/interface/response/Transfer";
|
||||
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const transferStore = useTransferDataStore();
|
||||
const { statusText } = transferStore;
|
||||
|
||||
const $q = useQuasar();
|
||||
const selected = ref<ResponseData[]>([]);
|
||||
const mixin = useCounterMixin();
|
||||
const { statusText } = useTransferDataStore();
|
||||
const {
|
||||
showLoader,
|
||||
success,
|
||||
|
|
@ -25,7 +24,19 @@ const {
|
|||
date2Thai,
|
||||
} = mixin;
|
||||
|
||||
//ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
/**
|
||||
* props
|
||||
*/
|
||||
const props = defineProps({
|
||||
modal: Boolean,
|
||||
closeModal: Function,
|
||||
fetchData: Function,
|
||||
rows: Array,
|
||||
});
|
||||
|
||||
//Table
|
||||
const selected = ref<ResponseData[]>([]); //รายชื่อที่เลือก
|
||||
const filter = ref<string>(""); //คำค้นหา
|
||||
const visibleColumns2 = ref<string[]>([
|
||||
"no",
|
||||
"fullname",
|
||||
|
|
@ -53,8 +64,6 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
field: "fullname",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
format(val, row) {
|
||||
return `${row.prefix}${row.firstName} ${row.lastName}`;
|
||||
},
|
||||
|
|
@ -79,8 +88,6 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
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",
|
||||
|
|
@ -90,8 +97,6 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
field: "organization",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "createdAt",
|
||||
|
|
@ -101,8 +106,6 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
field: "createdAt",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
format(val) {
|
||||
return date2Thai(val);
|
||||
},
|
||||
|
|
@ -119,68 +122,53 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
},
|
||||
]);
|
||||
|
||||
const props = defineProps({
|
||||
Modal: Boolean,
|
||||
closeModal: Function,
|
||||
getData: Function,
|
||||
rows2: Array,
|
||||
filterKeyword2: String,
|
||||
});
|
||||
|
||||
const checkSelected = computed(() => {
|
||||
if (selected.value.length === 0) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
//popup ยืนยันส่งัว
|
||||
const saveOrder = () => {
|
||||
/**
|
||||
* ฟังก์ชันยืนยันการออกคำสั่ง
|
||||
*/
|
||||
function saveOrder() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
() => Ordersave(),
|
||||
async () => {
|
||||
const id = selected.value.map((r) => r.id);
|
||||
const body = {
|
||||
id,
|
||||
};
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.transferReport, body)
|
||||
.then(async () => {
|
||||
await props.fetchData?.();
|
||||
await success($q, "ส่งไปออกคำสั่งสำเร็จ");
|
||||
props.closeModal?.();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
},
|
||||
"ยืนยันส่งไปออกคำสั่ง",
|
||||
"ต้องการยืนยันส่งไปออกคำสั่งใช่หรือไม่?"
|
||||
);
|
||||
};
|
||||
//ส่งไปออกคำสั่ง
|
||||
const Ordersave = async () => {
|
||||
const id = selected.value.map((r) => r.id);
|
||||
const body = {
|
||||
id,
|
||||
};
|
||||
}
|
||||
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.transferReport, body)
|
||||
.then(async () => {
|
||||
await props.getData?.();
|
||||
await success($q, "ส่งไปออกคำสั่งสำเร็จ");
|
||||
props.closeModal?.();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
const emit = defineEmits(["update:filterKeyword2", "update:selected"]);
|
||||
const updateInput = (value: any) => {
|
||||
emit("update:filterKeyword2", value);
|
||||
};
|
||||
//รีเซ็ตค่าในช่องค้นหา
|
||||
const Reset = () => {
|
||||
emit("update:filterKeyword2", "");
|
||||
};
|
||||
watchEffect(() => {
|
||||
if (props.Modal === true) {
|
||||
selected.value = [];
|
||||
/**
|
||||
* เมื่อ props.modal เป็น true
|
||||
*
|
||||
* กำหนดให้ selected เป็นค่าว่าง
|
||||
*/
|
||||
watch(
|
||||
() => props.modal,
|
||||
() => {
|
||||
if (props.modal === true) {
|
||||
selected.value = [];
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
</script>
|
||||
<template>
|
||||
<q-dialog v-model="props.Modal">
|
||||
<q-dialog v-model="props.modal">
|
||||
<q-card style="width: 1200px; max-width: 80vw">
|
||||
<DialogHeader :tittle="'ส่งไปออกคำสั่ง'" :close="closeModal" />
|
||||
<q-separator />
|
||||
|
|
@ -193,18 +181,17 @@ watchEffect(() => {
|
|||
outlined
|
||||
dense
|
||||
debounce="300"
|
||||
:model-value="filterKeyword2"
|
||||
@update:model-value="updateInput"
|
||||
v-model="filter"
|
||||
placeholder="ค้นหา"
|
||||
style="width: 850px; max-width: auto"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filterKeyword2 == ''" name="search" />
|
||||
<q-icon v-if="filter == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="filterKeyword2 !== ''"
|
||||
v-if="filter !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="Reset"
|
||||
@click="filter = ''"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
|
|
@ -229,8 +216,8 @@ watchEffect(() => {
|
|||
|
||||
<d-table
|
||||
:columns="columns2"
|
||||
:rows="rows2"
|
||||
:filter="filterKeyword2"
|
||||
:rows="rows"
|
||||
:filter="filter"
|
||||
row-key="id"
|
||||
:visible-columns="visibleColumns2"
|
||||
selection="multiple"
|
||||
|
|
@ -281,7 +268,7 @@ watchEffect(() => {
|
|||
<q-btn
|
||||
label="ส่งไปออกคำสั่ง"
|
||||
@click="saveOrder"
|
||||
:disable="checkSelected"
|
||||
:disable="selected.length === 0"
|
||||
color="public"
|
||||
><q-tooltip>ส่งไปออกคำสั่ง</q-tooltip></q-btn
|
||||
>
|
||||
|
|
@ -1,11 +1,10 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
|
||||
// import CurrencyInput from "@/components/CurruncyInput.vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import genReport from "@/plugins/genreport";
|
||||
|
|
@ -18,32 +17,13 @@ import type {
|
|||
rowFile,
|
||||
} from "@/modules/05_placement/interface/response/Transfer";
|
||||
|
||||
import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
|
||||
import CardProfile from "@/components/CardProfile.vue";
|
||||
import { tokenParsed } from "@/plugins/auth";
|
||||
|
||||
const modalPersonal = ref<boolean>(false);
|
||||
const personId = ref<string>("");
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
const id = ref<string>("");
|
||||
const dataId = route.params.id as string;
|
||||
const myForm = ref<QForm | null>(null);
|
||||
const roleAdmin = ref<boolean>(false);
|
||||
const edit = ref<boolean>(false);
|
||||
const dataProfile = ref<DataProfile>();
|
||||
|
||||
const organizationPositionOld = ref<string>("");
|
||||
const positionTypeOld = ref<string>("");
|
||||
const positionLevelOld = ref<string>("");
|
||||
const posNo = ref<string>("");
|
||||
const salary = ref<number>(0);
|
||||
const organization = ref<string>("");
|
||||
const date = ref<Date | null>(null);
|
||||
const reason = ref<string>("");
|
||||
const rows = ref<TypeFile[]>([]);
|
||||
const {
|
||||
date2Thai,
|
||||
messageError,
|
||||
|
|
@ -53,6 +33,21 @@ const {
|
|||
dialogConfirm,
|
||||
} = mixin;
|
||||
|
||||
const transferId = ref<string>(route.params.id as string); //Id รายการขอโอน
|
||||
const roleAdmin = ref<boolean>(false); //admin
|
||||
const edit = ref<boolean>(false); //การแก่ไข
|
||||
const dataProfile = ref<DataProfile>(); //ข้อมูลส่วนตัว
|
||||
|
||||
const organizationPositionOld = ref<string>("");
|
||||
const positionTypeOld = ref<string>("");
|
||||
const positionLevelOld = ref<string>("");
|
||||
const posNo = ref<string>("");
|
||||
const salary = ref<number>(0);
|
||||
const organization = ref<string>("");
|
||||
const date = ref<Date | null>(null);
|
||||
const reason = ref<string>("");
|
||||
const rows = ref<TypeFile[]>([]); //รายการเอกสารเพิ่มเติม
|
||||
//ข้อมูลการขอโอน
|
||||
const responseData = ref<ResponseDataDetail>({
|
||||
profileId: "",
|
||||
avataPath: "",
|
||||
|
|
@ -70,22 +65,6 @@ const responseData = ref<ResponseDataDetail>({
|
|||
fullname: "",
|
||||
});
|
||||
|
||||
async function fileDownload(no: number, type: string, fileName: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.reportTransferFile(no, type, id.value))
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
await genReport(data, fileName, type);
|
||||
hideLoader();
|
||||
})
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
hideLoader();
|
||||
})
|
||||
.finally(() => {});
|
||||
}
|
||||
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
|
|
@ -115,7 +94,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
|
||||
//รายากรเอกสารดาวน์โหลด
|
||||
const rowsFileDownload = ref<rowFile[]>([
|
||||
{
|
||||
no: 21,
|
||||
|
|
@ -155,14 +134,17 @@ const rowsFileDownload = ref<rowFile[]>([
|
|||
},
|
||||
]);
|
||||
|
||||
const getData = async () => {
|
||||
/**
|
||||
* ฟังก์ชันดึงข้อมูลรายละเอียดการขอโอนตาม ID ของรายการโอน(transferId)
|
||||
*
|
||||
*/
|
||||
async function getData() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.transferId(dataId.toString()))
|
||||
.then((res: any) => {
|
||||
const data = res.data.result;
|
||||
.get(config.API.transferId(transferId.value))
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
dataProfile.value = res.data.result as unknown as DataProfile;
|
||||
id.value = data.id;
|
||||
let list: TypeFile[] = [];
|
||||
if (data.docs.length > 0) {
|
||||
data.docs.map((doc: TypeFile) => {
|
||||
|
|
@ -207,95 +189,118 @@ const getData = async () => {
|
|||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
const confirmMessage = async () => {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => await sendConfirm(),
|
||||
"ต้องการยืนยันส่งคำร้องไปยัง สกจ หรือไม่?",
|
||||
"ข้อมูลจะถูกนำส่งคำร้องไปยัง สกจ ทันที"
|
||||
);
|
||||
};
|
||||
|
||||
const sendConfirm = async () => {
|
||||
/**
|
||||
* ฟังก์ชันดาวน์โหลดเอกสาร
|
||||
* @param no ลำดับรายการ
|
||||
* @param type นามสกุลไฟล์ที่ต้องการโหลด
|
||||
* @param fileName ชื่อไฟล์ที่ต้องการโหลด
|
||||
*/
|
||||
async function fileDownload(no: number, type: string, fileName: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.transferConfirmId(dataId.toString()))
|
||||
.then((res: any) => {
|
||||
success($q, "ส่งคำร้องข้อมูลสำเร็จ");
|
||||
.get(config.API.reportTransferFile(no, type, transferId.value))
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
await genReport(data, fileName, type);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await getData();
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
const conditionSave = async () => {
|
||||
if (myForm.value !== null) {
|
||||
myForm.value.validate().then((success) => {
|
||||
if (success) {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => await saveData(),
|
||||
"ต้องการแก้ไขข้อมูลหรือไม่?",
|
||||
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย"
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const saveData = async () => {
|
||||
showLoader();
|
||||
const body = {
|
||||
organization: organization.value,
|
||||
reason: reason.value,
|
||||
organizationPositionOld: organizationPositionOld.value,
|
||||
date: date.value,
|
||||
positionTypeOld: positionTypeOld.value,
|
||||
positionLevelOld: positionLevelOld.value,
|
||||
positionNumberOld: posNo.value,
|
||||
amountOld: salary.value,
|
||||
};
|
||||
await http
|
||||
.put(config.API.transferId(dataId.toString()), body)
|
||||
.then(async () => {
|
||||
await getData();
|
||||
await success($q, "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้ายสำเร็จ");
|
||||
edit.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
const cancel = () => {
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันยืนยันการส่งคำร้องไปยัง สกจ.
|
||||
*/
|
||||
function confirmMessage() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.transferConfirmId(transferId.value))
|
||||
.then(async () => {
|
||||
await getData();
|
||||
success($q, "ส่งคำร้องข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
});
|
||||
},
|
||||
"ต้องการยืนยันส่งคำร้องไปยัง สกจ หรือไม่?",
|
||||
"ข้อมูลจะถูกนำส่งคำร้องไปยัง สกจ ทันที"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันยืนยันการบันทึกการแก้ไขข้อมูล
|
||||
*/
|
||||
function onSubmit() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
showLoader();
|
||||
const body = {
|
||||
organization: organization.value,
|
||||
reason: reason.value,
|
||||
organizationPositionOld: organizationPositionOld.value,
|
||||
date: date.value,
|
||||
positionTypeOld: positionTypeOld.value,
|
||||
positionLevelOld: positionLevelOld.value,
|
||||
positionNumberOld: posNo.value,
|
||||
amountOld: salary.value,
|
||||
};
|
||||
await http
|
||||
.put(config.API.transferId(transferId.value), body)
|
||||
.then(async () => {
|
||||
await getData();
|
||||
await success($q, "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้ายสำเร็จ");
|
||||
edit.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
},
|
||||
"ต้องการแก้ไขข้อมูลหรือไม่?",
|
||||
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันปิดการแก้ไขข้อมูล
|
||||
*/
|
||||
async function cancel() {
|
||||
await getData();
|
||||
edit.value = false;
|
||||
getData();
|
||||
myForm.value?.resetValidation();
|
||||
};
|
||||
const getClass = (val: boolean) => {
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชัน
|
||||
* @param val ค่าการแก้ไข
|
||||
*/
|
||||
function getClass(val: boolean) {
|
||||
return {
|
||||
"full-width inputgreen cursor-pointer": val,
|
||||
"full-width cursor-pointer": !val,
|
||||
};
|
||||
};
|
||||
|
||||
function onclickViewinfo(id: string) {
|
||||
modalPersonal.value = true;
|
||||
personId.value = id;
|
||||
}
|
||||
|
||||
function updatemodalPersonal(modal: boolean) {
|
||||
modalPersonal.value = modal;
|
||||
}
|
||||
|
||||
/**
|
||||
* เมื่อ Componets ถูกเรียกใช้งาน
|
||||
*
|
||||
* เช็ต role ผู้ใช่งาน
|
||||
* เรียก getData ดึงข้อมูลรายละเอียดการขอโอน
|
||||
*/
|
||||
onMounted(async () => {
|
||||
const user = await tokenParsed();
|
||||
if (user) {
|
||||
|
|
@ -321,60 +326,6 @@ onMounted(async () => {
|
|||
|
||||
<CardProfile :data="dataProfile as DataProfile" />
|
||||
|
||||
<!-- <q-card bordered class="row col-12 text-dark">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
<div class="q-pl-sm text-weight-bold text-subtitle2">
|
||||
{{ responseData.fullname }}
|
||||
</div>
|
||||
<q-space />
|
||||
<q-btn
|
||||
outline
|
||||
color="blue"
|
||||
dense
|
||||
icon-right="mdi-open-in-new"
|
||||
class="q-px-sm"
|
||||
label="ดูข้อมูลทะเบียนประวัติ"
|
||||
@click="onclickViewinfo(responseData.profileId)"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="row col-12 q-pa-md">
|
||||
<div class="col-12 row bg-white q-col-gutter-md">
|
||||
<div class="col-xs-3 col-sm-2 col-md-1 row">
|
||||
<q-img
|
||||
:src="responseData.avataPath"
|
||||
v-if="responseData.avataPath !== ''"
|
||||
/>
|
||||
<q-img src="@/assets/avatar_user.jpg" v-else />
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<div class="col-12 q-pl-md">
|
||||
<div class="col-12 text-top">ตำแหน่งในสายงาน</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{ responseData.positionTypeOld }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<div class="col-12">
|
||||
<div class="col-12 text-top">ระดับตำแหน่ง</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{ responseData.positionLevelOld }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<div class="col-12">
|
||||
<div class="col-12 text-top">สังกัด</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{ responseData.organizationPositionOld }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card> -->
|
||||
|
||||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
<div class="q-pl-sm text-weight-bold text-dark">ข้อมูลการขอโอน</div>
|
||||
|
|
@ -504,51 +455,56 @@ onMounted(async () => {
|
|||
</q-card>
|
||||
|
||||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
<div class="q-pl-sm text-weight-bold text-dark">
|
||||
แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย
|
||||
<q-form
|
||||
class="col-12"
|
||||
greedy
|
||||
@submit.prevent
|
||||
@validation-success="onSubmit"
|
||||
>
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
<div class="q-pl-sm text-weight-bold text-dark">
|
||||
แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย
|
||||
</div>
|
||||
<q-space />
|
||||
<div class="q-gutter-sm" v-if="!edit">
|
||||
<q-btn
|
||||
outline
|
||||
color="primary"
|
||||
dense
|
||||
icon-right="mdi-file-edit-outline"
|
||||
class="q-px-sm"
|
||||
label="แก้ไข"
|
||||
style="width: 80px"
|
||||
@click="edit = !edit"
|
||||
v-if="
|
||||
!(
|
||||
responseData.status == 'REPORT' || responseData.status == 'DONE'
|
||||
) && checkPermission($route)?.attrIsUpdate
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
<div class="q-gutter-sm" v-else>
|
||||
<q-btn
|
||||
outline
|
||||
color="public"
|
||||
dense
|
||||
class="q-px-sm"
|
||||
label="บันทึก"
|
||||
style="width: 80px"
|
||||
type="submit"
|
||||
/>
|
||||
<q-btn
|
||||
outline
|
||||
color="red"
|
||||
dense
|
||||
class="q-px-sm"
|
||||
label="ยกเลิก"
|
||||
style="width: 80px"
|
||||
@click="cancel()"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<q-space />
|
||||
<div class="q-gutter-sm" v-if="!edit">
|
||||
<q-btn
|
||||
outline
|
||||
color="primary"
|
||||
dense
|
||||
icon-right="mdi-file-edit-outline"
|
||||
class="q-px-sm"
|
||||
label="แก้ไข"
|
||||
style="width: 80px"
|
||||
@click="edit = !edit"
|
||||
v-if="
|
||||
!(
|
||||
responseData.status == 'REPORT' || responseData.status == 'DONE'
|
||||
) && checkPermission($route)?.attrIsUpdate
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
<div class="q-gutter-sm" v-else>
|
||||
<q-btn
|
||||
outline
|
||||
color="public"
|
||||
dense
|
||||
class="q-px-sm"
|
||||
label="บันทึก"
|
||||
style="width: 80px"
|
||||
@click="conditionSave"
|
||||
/>
|
||||
<q-btn
|
||||
outline
|
||||
color="red"
|
||||
dense
|
||||
class="q-px-sm"
|
||||
label="ยกเลิก"
|
||||
style="width: 80px"
|
||||
@click="cancel()"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<q-form ref="myForm">
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="row q-pa-md">
|
||||
<div class="col-12">
|
||||
<div class="row bg-white q-col-gutter-y-md">
|
||||
|
|
@ -618,8 +574,9 @@ onMounted(async () => {
|
|||
</div>
|
||||
<div class="col-xs-6 col-sm-3">
|
||||
<q-input
|
||||
v-model="salary"
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
v-model="salary"
|
||||
dense
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
|
|
@ -627,7 +584,6 @@ onMounted(async () => {
|
|||
:label="`${'เงินเดือน'}`"
|
||||
:rules="[(val:number) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
|
||||
lazy-rules
|
||||
class="inputgreen"
|
||||
mask="###,###,###,###"
|
||||
reverse-fill-mask
|
||||
/>
|
||||
|
|
@ -717,12 +673,6 @@ onMounted(async () => {
|
|||
</div>
|
||||
</q-form>
|
||||
</q-card>
|
||||
|
||||
<PopupPersonal
|
||||
:modal="modalPersonal"
|
||||
:id="personId"
|
||||
@update:modal="updatemodalPersonal"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scope>
|
||||
|
|
@ -1,298 +0,0 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import type { QTableProps } from "quasar";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||
import Dialogbody from "@/modules/05_placement/components/Transfer/Dialogbody.vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import type { ResponseData } from "@/modules/05_placement/interface/response/Transfer";
|
||||
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
const transferStore = useTransferDataStore();
|
||||
|
||||
const { statusText } = transferStore;
|
||||
|
||||
const { date2Thai, messageError, showLoader, hideLoader } = mixin;
|
||||
|
||||
const modal = ref<boolean>(false);
|
||||
const filterKeyword = ref<string>("");
|
||||
const filterKeyword2 = ref<string>("");
|
||||
const filterRef = ref<any>(null);
|
||||
const rows = ref<ResponseData[]>([]);
|
||||
const rows2 = ref<ResponseData[]>([]);
|
||||
const filters = ref<ResponseData[]>([]);
|
||||
|
||||
//ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"fullname",
|
||||
"posType",
|
||||
"organizationPositionOld",
|
||||
"organization",
|
||||
"status",
|
||||
"createdAt",
|
||||
]);
|
||||
|
||||
const resetFilter = () => {
|
||||
filterKeyword.value = "";
|
||||
filterKeyword2.value = "";
|
||||
filterRef.value.focus();
|
||||
};
|
||||
|
||||
// หัวตาราง
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
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",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
format(val, row) {
|
||||
return `${row.prefix ?? ""}${row.firstName ?? ""} ${row.lastName ?? ""}`;
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "posType",
|
||||
align: "left",
|
||||
label: "ประเภทตำแหน่ง",
|
||||
sortable: true,
|
||||
field: "posType",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format(val, row) {
|
||||
return row.positionTypeOld
|
||||
? `${row.positionTypeOld}${
|
||||
row.positionLevelOld ? `(${row.positionLevelOld})` : ""
|
||||
}`
|
||||
: "";
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "organizationPositionOld",
|
||||
align: "left",
|
||||
label: "ตำแหน่ง/สังกัดเดิม",
|
||||
sortable: true,
|
||||
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",
|
||||
align: "left",
|
||||
label: "หน่วยงานที่ขอโอนไป",
|
||||
sortable: true,
|
||||
field: "organization",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
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" }),
|
||||
format(val) {
|
||||
return date2Thai(val);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "status",
|
||||
align: "left",
|
||||
label: "สถานะ",
|
||||
sortable: true,
|
||||
field: "status",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format: (val) => statusText(val),
|
||||
},
|
||||
]);
|
||||
|
||||
const openModal = () => (modal.value = true);
|
||||
const closeModal = () => {
|
||||
modal.value = false;
|
||||
filterKeyword2.value = "";
|
||||
};
|
||||
|
||||
// เปิดโมเดล
|
||||
const openModalOrder = () => {
|
||||
openModal();
|
||||
const row = filters.value.filter(
|
||||
(r: ResponseData) =>
|
||||
r.status == "APPROVE" &&
|
||||
r.organizationPositionOld &&
|
||||
r.positionTypeOld &&
|
||||
r.positionLevelOld &&
|
||||
r.positionNumberOld &&
|
||||
r.salary !== null &&
|
||||
r.organization &&
|
||||
r.date
|
||||
);
|
||||
rows2.value = row;
|
||||
};
|
||||
// เรียกข้อมูล api
|
||||
const getData = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.transfer)
|
||||
.then((res: any) => {
|
||||
rows.value = res.data.result;
|
||||
filters.value = rows.value;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
await getData();
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">รายการขอโอน</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm">
|
||||
<q-separator />
|
||||
<div class="row q-pa-md">
|
||||
<div class="col-12">
|
||||
<div class="row col-12">
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
@click="openModalOrder"
|
||||
flat
|
||||
round
|
||||
color="add"
|
||||
icon="mdi-account-arrow-right"
|
||||
>
|
||||
<q-tooltip>ส่งไปออกคำสั่ง</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-space />
|
||||
<q-input
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
standout
|
||||
dense
|
||||
v-model="filterKeyword"
|
||||
ref="filterRef"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filterKeyword == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="filterKeyword !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
|
||||
<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 q-ml-sm"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 q-pt-sm">
|
||||
<d-table
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
:filter="filterKeyword"
|
||||
row-key="id"
|
||||
:visible-columns="visibleColumns"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width />
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props">
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="info"
|
||||
icon="mdi-eye"
|
||||
@click.stop.prevent="
|
||||
router.push(`/placement/transfer/${props.row.id}`)
|
||||
"
|
||||
>
|
||||
<q-tooltip>รายละเอียด</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td v-for="col in props.cols" :key="col.id">
|
||||
<div v-if="col.name === 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
|
||||
<div v-else>
|
||||
{{}}
|
||||
{{
|
||||
col.value == null ? "" : col.value == "" ? "-" : col.value
|
||||
}}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<Dialogbody
|
||||
v-model:Modal="modal"
|
||||
:closeModal="closeModal"
|
||||
:rows2="rows2"
|
||||
v-model:filterKeyword2="filterKeyword2"
|
||||
:getData="getData"
|
||||
/>
|
||||
</template>
|
||||
<style scoped lang="scss"></style>
|
||||
Loading…
Add table
Add a link
Reference in a new issue