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

View file

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

View file

@ -415,14 +415,19 @@ async function getTable() {
rowsAwait.value = rowData; rowsAwait.value = rowData;
await onUpdateNewRows(typeEmployee.value, positionCandidate.value); 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: any) =>
e.draft == "รอส่งตัว" && e.draft == "รอส่งตัว" &&
e.nodeName !== null && e.nodeName !== null &&
e.reportingDate !== null e.reportingDate !== null
); );
rowsFilterData.value = await rows.value.filter( rowsFilterData.value = await filteredRows.filter(
(e: any) => (e: any) =>
e.draft == "รอส่งตัว" && e.draft == "รอส่งตัว" &&
e.nodeName !== null && 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() { async function getWorkFlow() {
showLoader(); showLoader();
await http await http
@ -1172,7 +1196,8 @@ onMounted(async () => {
v-if=" v-if="
props.row.statusId === 'UN-CONTAIN' || props.row.statusId === 'UN-CONTAIN' ||
(props.row.statusId === 'PREPARE-CONTAIN' && (props.row.statusId === 'PREPARE-CONTAIN' &&
checkPermission($route)?.attrIsUpdate) checkPermission($route)?.attrIsUpdate &&
!props.row.root)
" "
clickable clickable
v-close-popup v-close-popup

View file

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

View file

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

View file

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

View file

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