Merge branch 'develop'

This commit is contained in:
Warunee Tamkoo 2025-05-08 17:23:55 +07:00
commit e734bb0bf0
6 changed files with 83 additions and 107 deletions

View file

@ -170,4 +170,6 @@ export default {
workflow: `${workflow}/`,
keycloakLogSSO: `${org}/keycloak/log/sso`,
orgAssistance:(id:string)=>`${profileOrg}/assistance/${id}`
};

View file

@ -35,7 +35,7 @@ const filter = ref<string>("");
const maxPage = ref<number>(1);
const page = ref<number>(1);
const pageSize = ref<number>(10);
const total = ref<number>(0)
const total = ref<number>(0);
/** function เรียกข้อมูลการลา*/
async function fetchDataTable() {
showLoader();
@ -204,7 +204,15 @@ onMounted(async () => {
:props="props"
@click="onClickView(props.row.id, props.row.status)"
>
{{ props.row.leaveTypeName ? `${props.row.leaveTypeName} ${props.row.leaveSubTypeName ? `(${props.row.leaveSubTypeName})`:''}`: '-' }}
{{
props.row.leaveTypeName
? `${props.row.leaveTypeName} ${
props.row.leaveSubTypeName
? `(${props.row.leaveSubTypeName})`
: ""
}`
: "-"
}}
</q-td>
<q-td
key="dateLeave"
@ -260,7 +268,9 @@ onMounted(async () => {
class="q-mr-sm"
/>
<q-icon
v-if="props.row.status == 'DELETE'"
v-if="
props.row.status == 'DELETING' || props.row.status == 'DELETE'
"
size="10px"
color="grey-10"
name="mdi-circle"
@ -428,7 +438,10 @@ onMounted(async () => {
class="q-mr-sm"
/>
<q-icon
v-if="props.row.status == 'DELETE'"
v-if="
props.row.status == 'DELETING' ||
props.row.status == 'DELETE'
"
size="10px"
color="grey-10"
name="mdi-circle"

View file

@ -241,7 +241,7 @@ watch([() => currentPage.value, () => pagination.value.rowsPerPage], () => {
:virtual-scroll-sticky-size-start="48"
dense
:rows-per-page-options="[10, 25, 50, 100]"
:pagination="pagination"
v-model:pagination="pagination"
@update:pagination="updatePageSize"
:grid="$q.screen.gt.xs ? false : true"
>

View file

@ -77,8 +77,10 @@ export const useLeaveStore = defineStore("Leave", () => {
return "อนุมัติ";
case "REJECT":
return "ไม่อนุมัติ";
case "DELETING":
return "กำลังดำเนินการยกเลิก";
case "DELETE":
return "ยกเลิก";
return "ยกเลิกสำเร็จ";
}
}

View file

@ -248,7 +248,7 @@ onMounted(async () => {
class="text-indigo"
>
<span class="text-subtitle2 text-weight-bold">{{
item.value
item.remain
}}</span>
</q-knob>
</div>

View file

@ -28,101 +28,40 @@ const filterKeyword = ref<string>("");
const rows = ref<any[]>([]);
const visibleColumns = ref<string[]>([
"no",
"name",
"posMasterNoOld",
"positionOld",
"positionLevel",
"organizationPositionOld",
"organization",
"commandName",
"agency",
"dateStart",
"dateEnd",
"createdAt",
"status",
"commandNo",
"document",
"lastUpdateFullName",
"lastUpdatedAt",
]);
//
const columns = ref<QTableProps["columns"]>([
{
name: "no",
name: "commandName",
align: "left",
label: "ลำดับ",
sortable: false,
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "name",
align: "left",
label: "ชื่อ-นามสกุล",
label: "ประเภทคำสั่ง",
sortable: true,
field: "name",
field: "commandName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return `${row.prefix}${row.firstName} ${row.lastName}`;
},
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "posMasterNoOld",
name: "agency",
align: "left",
label: "เลขที่ตำแหน่ง",
label: "หน่วยงานที่ให้ช่วยราชการ/ส่งตัวกลับ",
sortable: true,
field: "posMasterNoOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return findPosMasterNoOld(row);
},
},
{
name: "positionOld",
align: "left",
label: "ตำแหน่งในสายงาน",
sortable: true,
field: "positionOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "positionLevel",
align: "left",
label: "ตำแหน่งประเภท",
sortable: true,
field: "positionLevel",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
let name = "";
if (row.posTypeNameOld && row.posLevelNameOld) {
name = `${row.posTypeNameOld} (${row.posLevelNameOld})`;
} else if (row.posTypeNameOld) {
name = `${row.posTypeNameOld}`;
} else if (row.posLevelNameOld) {
name = `(${row.posLevelNameOld})`;
} else name = "-";
return name;
},
},
{
name: "organizationPositionOld",
align: "left",
label: "สังกัด",
sortable: true,
field: "organization",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "organization",
align: "left",
label: "หน่วยงานที่ให้ช่วยราชการ",
sortable: true,
field: "organization",
field: "agency",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "dateStart",
@ -130,9 +69,11 @@ const columns = ref<QTableProps["columns"]>([
label: "วันเริ่มช่วยราชการ",
sortable: true,
field: "dateStart",
format: (v) => date2Thai(v),
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (val) => date2Thai(val),
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "dateEnd",
@ -140,29 +81,11 @@ const columns = ref<QTableProps["columns"]>([
label: "วันสิ้นสุดการช่วยราชการ",
sortable: true,
field: "dateEnd",
format: (v) => date2Thai(v),
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (val) => date2Thai(val),
},
{
name: "createdAt",
align: "left",
label: "วันที่ดำเนินการ",
sortable: true,
field: "createdAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (val) => date2Thai(val),
},
{
name: "status",
align: "left",
label: "สถานะ",
sortable: true,
field: "status",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (val) => statusText(val),
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "commandNo",
@ -172,6 +95,42 @@ const columns = ref<QTableProps["columns"]>([
field: "commandNo",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "document",
align: "left",
label: "เอกสารอ้างอิง",
sortable: true,
field: "document",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "lastUpdateFullName",
align: "left",
label: "ผู้ดำเนินการ",
sortable: true,
field: "lastUpdateFullName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "lastUpdatedAt",
align: "left",
label: "วันที่แก้ไข",
sortable: true,
field: "lastUpdatedAt",
format: (v) => date2Thai(v, false, true),
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
@ -207,7 +166,7 @@ function close() {
function getData() {
showLoader();
http
.get(config.API.placementKeycloak + `/${store.dataEvaluation.profileId}`)
.get(config.API.orgAssistance(store.dataEvaluation.profileId))
.then((res) => {
const data = res.data.result;
rows.value = data;