Merge branch 'develop' into dev

* develop:
  สรรหาแก้ไขวันที่สมัครให้แสดงเวลา
  fix
  fix(placement):filter
  fix(salary): status isPunish
  fix(probation): probationPersonalList  status
This commit is contained in:
Warunee Tamkoo 2025-11-25 17:21:20 +07:00
commit 0d78dbf425
7 changed files with 72 additions and 30 deletions

View file

@ -260,13 +260,17 @@ async function deleteData(id: string) {
* แปลงชวงวนทา2คาเปนวนเดยวกนจะโชววนเดยวแตาไมเทากนจะแสดงเปนชวง
* @param val วงวนท
*/
function dateThaiRange(val: [Date, Date]) {
function dateThaiRange(val: [Date, Date], time: boolean = false) {
if (val === null) {
return "-";
} else if (date2Thai(val[0], true) === date2Thai(val[1], true)) {
return `${date2Thai(val[0], true)}`;
return `${date2Thai(val[0], true, time)}`;
} else {
return `${date2Thai(val[0], true)} - ${date2Thai(val[1], true)}`;
return `${date2Thai(val[0], true, time)} - ${date2Thai(
val[1],
true,
time
)}`;
}
}
@ -355,11 +359,15 @@ onMounted(async () => {
{{ props.rowIndex + 1 }}
</div>
<div
v-else-if="col.name == 'dateRegister'"
class="table_ellipsis2"
>
{{ dateThaiRange(col.value, true) }}
</div>
<div
v-else-if="
col.name == 'dateRegister' ||
col.name == 'datePayment' ||
col.name == 'dateAnnouncement'
col.name == 'datePayment' || col.name == 'dateAnnouncement'
"
class="table_ellipsis2"
>

View file

@ -768,13 +768,19 @@ function clickDeletePosition(row: any) {
* แปลงชวงวนทา2คาเปนวนเดยวกนจะโชววนเดยวแตาไมเทากนจะแสดงเปนชวง
* @param val วงวนท
*/
function dateThaiRange(val: [Date, Date] | null) {
function dateThaiRange(val: [Date, Date] | null, showTime: boolean = false) {
if (val === null) {
return "";
} else if (date2Thai(val[0], true) === date2Thai(val[1], true)) {
return `${date2Thai(val[0], true)}`;
} else if (
date2Thai(val[0], true, showTime) === date2Thai(val[1], true, showTime)
) {
return `${date2Thai(val[0], true, showTime)}`;
} else {
return `${date2Thai(val[0], true)} - ${date2Thai(val[1], true)}`;
return `${date2Thai(val[0], true, showTime)} - ${date2Thai(
val[1],
true,
showTime
)}`;
}
}
@ -1145,6 +1151,11 @@ onMounted(async () => {
borderless
range
week-start="0"
:enableTimePicker="true"
:start-time="[
{ hours: 8, minutes: 0 },
{ hours: 16, minutes: 0 },
]"
>
<template #year="{ year }">
{{ year + 543 }}
@ -1158,8 +1169,9 @@ onMounted(async () => {
dense
:readonly="checkRoutePermisson"
class="full-width datepicker q-mb-md"
:model-value="dateThaiRange(dateRegister)"
:model-value="dateThaiRange(dateRegister, true)"
:label="`${'วันที่สมัคร'}`"
:rules="[(val:string) => !!val || `${'กรุณาเลือกวันที่สมัคร'}`]"
clearable
@clear="clearDateRegister"
hide-bottom-space
@ -1488,10 +1500,7 @@ onMounted(async () => {
<q-separator size="5px" color="grey-2" class="q-mt-lg" />
</div>
<div
class="col-12 q-mt-lg"
v-if="shouldShowPaymentFields"
>
<div class="col-12 q-mt-lg" v-if="shouldShowPaymentFields">
<div class="text-bold text-subtitle2 q-pb-md">
เลอกวการชำระเง
</div>

View file

@ -415,14 +415,19 @@ async function getTable() {
rowsAwait.value = rowData;
await onUpdateNewRows(typeEmployee.value, positionCandidate.value);
const filteredRows = await filterRowsMain(
typeEmployee.value,
positionCandidate.value
);
//
rowsFilter.value = await rows.value.filter(
rowsFilter.value = await filteredRows.filter(
(e: any) =>
e.draft == "รอส่งตัว" &&
e.nodeName !== null &&
e.reportingDate !== null
);
rowsFilterData.value = await rows.value.filter(
rowsFilterData.value = await filteredRows.filter(
(e: any) =>
e.draft == "รอส่งตัว" &&
e.nodeName !== null &&
@ -830,6 +835,25 @@ async function onUpdateNewRows(type: string, pos: string) {
});
}
async function filterRowsMain(type: string, pos: string) {
return rowsAwait.value.filter((item: any) => {
const isTypeMatch =
type === "OFFICER"
? item.bmaOfficerCheck === "OFFICER"
: type === "EXTERNAL"
? item.bmaOfficerCheck === null
: item.bmaOfficerCheck === "OFFICER" || item.bmaOfficerCheck === null;
const isPositionMatch = pos === "" || item.positionCandidate === pos;
const isStatusMatch = containStatus.value
? item.statusId === "DONE"
: item.statusId !== "DONE";
return isTypeMatch && isPositionMatch && isStatusMatch;
});
}
async function getWorkFlow() {
showLoader();
await http
@ -1172,7 +1196,8 @@ onMounted(async () => {
v-if="
props.row.statusId === 'UN-CONTAIN' ||
(props.row.statusId === 'PREPARE-CONTAIN' &&
checkPermission($route)?.attrIsUpdate)
checkPermission($route)?.attrIsUpdate &&
!props.row.root)
"
clickable
v-close-popup

View file

@ -96,7 +96,7 @@ const columns = ref<QTableProps["columns"]>([
name: "name",
align: "left",
label: "ชื่อ-นามสกุล",
sortable: true,
sortable: false,
field: "name",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
@ -105,7 +105,7 @@ const columns = ref<QTableProps["columns"]>([
name: "position_line",
align: "left",
label: "ตำแหน่งในสายงาน",
sortable: true,
sortable: false,
field: "position_line",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
@ -114,7 +114,7 @@ const columns = ref<QTableProps["columns"]>([
name: "position_level",
align: "left",
label: "ระดับ",
sortable: true,
sortable: false,
field: "position_level",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
@ -123,7 +123,7 @@ const columns = ref<QTableProps["columns"]>([
name: "organization",
align: "left",
label: "สังกัด",
sortable: true,
sortable: false,
field: "organization",
headerStyle: "font-size: 14px",
style: "font-size: 14px ",
@ -133,7 +133,7 @@ const columns = ref<QTableProps["columns"]>([
name: "probation_no",
align: "center",
label: "ครั้งที่ทดลองปฏิบัติหน้าที่ราชการ",
sortable: true,
sortable: false,
field: "probation_no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
@ -145,7 +145,7 @@ const columns = ref<QTableProps["columns"]>([
name: "order_number",
align: "center",
label: "เลขที่คําสั่งบรรจุแต่งตั้ง",
sortable: true,
sortable: false,
field: "order_number",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
@ -157,7 +157,7 @@ const columns = ref<QTableProps["columns"]>([
name: "probation_status",
align: "left",
label: "สถานะ",
sortable: true,
sortable: false,
field: "probation_status",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
@ -203,7 +203,7 @@ async function getList() {
.get(
config.API.probationPersonalList() +
`?status=${
commandType.value ? (commandType.value == "C-PM-11" ? 2 : 3) : ""
commandType.value ? (commandType.value == "C-PM-11" ? 3 : 2) : ""
}&page=${pagination.value.page}&pageSize=${
pagination.value.rowsPerPage
}&keyword=${filter.value.trim()}`

View file

@ -102,7 +102,7 @@ const columns = ref<QTableProps["columns"]>([
label: "สังกัด",
sortable: true,
field: "organization",
headerStyle: "font-size: 14px",
headerStyle: "font-size: 14px;min-width: 250px",
style: "font-size: 14px ",
classes: "table_ellipsis",
},

View file

@ -529,7 +529,7 @@ function onClickViewInfo(type: string, id: string) {
</div>
<div v-else-if="col.name == 'discipline'">
<q-btn
v-if="checkPermission($route)?.attrIsGet && props.row.isPunish"
v-if="checkPermission($route)?.attrIsGet && !props.row.isPunish"
flat
dense
icon="info"

View file

@ -432,7 +432,7 @@ async function updateCurrentPageAndfetchData() {
bordered
:paging="true"
dense
:rows-per-page-options="[1,10, 25, 50, 100]"
:rows-per-page-options="[1, 10, 25, 50, 100]"
:visible-columns="visibleColumns"
v-model:pagination="pagination"
@request="props.onRequest"
@ -546,7 +546,7 @@ async function updateCurrentPageAndfetchData() {
<div v-else-if="col.name == 'discipline'">
<q-btn
v-if="checkPermission($route)?.attrIsGet && props.row.isPunish"
v-if="checkPermission($route)?.attrIsGet && !props.row.isPunish"
flat
dense
icon="info"