Merge branch 'develop' into devTee

This commit is contained in:
setthawutttty 2025-03-26 10:48:12 +07:00
commit 4d47694ea5
5 changed files with 106 additions and 131 deletions

View file

@ -26,6 +26,7 @@ const {
messageError,
success,
findOrgNameHtml,
dialogConfirm,
} = useCounterMixin();
const empType = ref<string>(route.params.type.toString());
@ -43,6 +44,15 @@ const rows = ref<DataPosition[]>([]);
const rowsMain = ref<DataPosition[]>([]);
const keyword = ref<string>("");
const baseColumns = ref<QTableColumn[]>([
{
name: "no",
align: "left",
label: "ลำดับ",
sortable: false,
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "commandDateAffect",
align: "left",
@ -52,10 +62,6 @@ const baseColumns = ref<QTableColumn[]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => date2Thai(v),
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "commandDateSign",
@ -66,10 +72,24 @@ const baseColumns = ref<QTableColumn[]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => date2Thai(v),
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "posNumCodeSit",
align: "left",
label: "หน่วยงานที่ออกคำสั่ง",
sortable: false,
field: "posNumCodeSit",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "posNumCodeSitAbb",
align: "left",
label: "ตัวย่อหน่วยงานที่ออกคำสั่ง",
sortable: false,
field: "posNumCodeSitAbb",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "posNo",
@ -86,10 +106,6 @@ const baseColumns = ref<QTableColumn[]>([
? row.posNo
: "-";
},
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionName",
@ -99,10 +115,6 @@ const baseColumns = ref<QTableColumn[]>([
field: "positionName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionType",
@ -112,10 +124,6 @@ const baseColumns = ref<QTableColumn[]>([
field: "positionType",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionLevel",
@ -134,8 +142,6 @@ const baseColumns = ref<QTableColumn[]>([
},
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionExecutive",
@ -145,8 +151,6 @@ const baseColumns = ref<QTableColumn[]>([
field: "positionExecutive",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "commandNo",
@ -161,8 +165,6 @@ const baseColumns = ref<QTableColumn[]>([
},
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "commandCode",
@ -175,8 +177,6 @@ const baseColumns = ref<QTableColumn[]>([
},
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "organization",
@ -184,7 +184,7 @@ const baseColumns = ref<QTableColumn[]>([
label: "สังกัด",
sortable: false,
field: "organization",
headerStyle: "font-size: 14px",
headerStyle: "font-size: 14px;min-width: 280px",
style: "font-size: 14px",
format(val, row) {
return findOrgName({
@ -195,8 +195,6 @@ const baseColumns = ref<QTableColumn[]>([
child4: row.orgChild4,
});
},
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "amount",
@ -215,10 +213,6 @@ const baseColumns = ref<QTableColumn[]>([
}`
: "-";
},
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "mouthSalaryAmount",
@ -229,10 +223,6 @@ const baseColumns = ref<QTableColumn[]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => Number(v).toLocaleString(),
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionSalaryAmount",
@ -243,10 +233,6 @@ const baseColumns = ref<QTableColumn[]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => Number(v).toLocaleString(),
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
@ -257,14 +243,13 @@ const baseColumns = ref<QTableColumn[]>([
field: "remark",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
const visibleColumns = ref<string[]>([
"no",
"commandDateAffect",
"posNumCodeSit",
"posNumCodeSitAbb",
"posNo",
"positionName",
"positionType",
@ -309,6 +294,7 @@ async function fetchData() {
const data = res.data.result;
rowsMain.value = data;
rows.value = data;
serchDataTable();
})
.catch((err) => {
messageError($q, err);
@ -351,26 +337,39 @@ async function onSwapData(action: string, id: string) {
});
}
function onDeleteData(id: string, isDelete: boolean) {
dialogRemove($q, async () => {
showLoader();
const path = isDelete ? "/delete-renew" : "/delete";
await http
.post(config.API.salaryTemp + `${path}`, {
type: empType.value,
salaryId: id,
})
.then(async () => {
await fetchData();
success($q, "ลบข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
function onConfirmDeleteData(id: string, isDelete: boolean) {
isDelete
? dialogConfirm(
$q,
() => {
onDeleteData(id, isDelete);
},
"ยืนยันการย้อนกลับข้อมูล",
"ต้องการยืนยันการย้อนกลับข้อมูลนี้ใช่หรือไม่?"
)
: dialogRemove($q, () => {
onDeleteData(id, isDelete);
});
});
}
async function onDeleteData(id: string, isDelete: boolean) {
showLoader();
const path = isDelete ? "/delete-renew" : "/delete";
await http
.post(config.API.salaryTemp + `${path}`, {
type: empType.value,
salaryId: id,
})
.then(async () => {
await fetchData();
success($q, isDelete ? "ย้อนกลับข้อมูลสำเร็จ" : "ลบข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
function classColorRow(isDelete: boolean, isEdit: boolean, isEntry: boolean) {
@ -484,7 +483,7 @@ onMounted(() => {
:icon="props.row.isDelete ? 'mdi-refresh-circle' : 'delete'"
:color="props.row.isDelete ? 'orange' : 'red'"
@click.stop.pervent="
onDeleteData(props.row.id, props.row.isDelete)
onConfirmDeleteData(props.row.id, props.row.isDelete)
"
>
<q-tooltip>{{
@ -505,10 +504,10 @@ onMounted(() => {
: ''
"
>
<div
v-if="col.name === 'organization'"
class="text-html table_ellipsis"
>
<div v-if="col.name === 'no'">
{{ props.rowIndex + 1 }}
</div>
<div v-else-if="col.name === 'organization'" class="text-html">
{{
findOrgNameHtml({
root: props.row.orgRoot,
@ -519,10 +518,8 @@ onMounted(() => {
})
}}
</div>
<div
v-else-if="col.name === 'commandCode'"
class="table_ellipsis"
>
<div v-else-if="col.name === 'commandCode'">
{{ col.value ? col.value : "-" }}
</div>
<div v-else>

View file

@ -59,7 +59,7 @@ const baseColumns = ref<QTableProps["columns"]>([
{
name: "posNo",
align: "left",
label: "ตำแหน่งเลขที่",
label: "เลขที่ตำแหน่ง",
sortable: false,
field: "posNo",
headerStyle: "font-size: 14px",
@ -86,7 +86,7 @@ const baseColumns = ref<QTableProps["columns"]>([
{
name: "posType",
align: "left",
label: "ประเภทตำแหน่ง",
label: "ตำแหน่งประเภท",
sortable: false,
field: "posType",
headerStyle: "font-size: 14px",
@ -95,7 +95,7 @@ const baseColumns = ref<QTableProps["columns"]>([
{
name: "posLevel",
align: "left",
label: "ระดับตำแหน่ง",
label: "ระดับ",
sortable: false,
field: "posLevel",
headerStyle: "font-size: 14px",

View file

@ -25,8 +25,14 @@ import config from "@/app.config";
/** use*/
const $q = useQuasar();
const store = useSalaryListSDataStore();
const { dialogRemove, messageError, showLoader, hideLoader, success } =
useCounterMixin();
const {
dialogRemove,
messageError,
showLoader,
hideLoader,
success,
findOrgNameHtml,
} = useCounterMixin();
/** Props*/
const formFilter = defineModel<DataFilter>("formFilter", { required: true });
@ -68,7 +74,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "posType",
align: "left",
label: "ประเภทตำแหน่ง",
label: "ตำแหน่งประเภท",
sortable: false,
field: "posType",
headerStyle: "font-size: 14px",
@ -95,7 +101,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "posLevel",
align: "left",
label: "ระดับตำแหน่ง",
label: "ระดับ",
field: "posLevel",
sortable: false,
headerStyle: "font-size: 14px",
@ -116,7 +122,7 @@ const columns = ref<QTableProps["columns"]>([
label: "สังกัด",
sortable: false,
field: "organization",
headerStyle: "font-size: 14px",
headerStyle: "font-size: 14px;min-width:280px",
style: "font-size: 14px",
},
{
@ -361,7 +367,7 @@ function onClickViewInfo(type: string, id: string) {
:options="!checkPermission($route)?.attrIsGet ? columns?.filter((col:any) => col.name !== 'posSalary' && col.name !== 'discipline' && col.name !== 'leave' ) : columns"
option-value="name"
style="min-width: 140px"
class="col-xs-12 col-sm-3 col-md-2 q-ml-sm"
class="q-ml-sm"
/>
</q-toolbar>
<d-table
@ -457,25 +463,8 @@ function onClickViewInfo(type: string, id: string) {
`${props.row.prefix}${props.row.firstName} ${props.row.lastName}`
}}
</div>
<div v-else-if="col.name == 'organization'" class="table_ellipsis">
<div
v-if="
props.row.child4 === null &&
props.row.child3 === null &&
props.row.child2 === null &&
props.row.child1 === null &&
props.row.root === null
"
>
-
</div>
{{
`${props.row.child4 ? props.row.child4 + " " : ""}${
props.row.child3 ? props.row.child3 + " " : ""
}${props.row.child2 ? props.row.child2 + " " : ""}${
props.row.child1 ? props.row.child1 + " " : ""
}${props.row.root ? props.row.root : ""}`
}}
<div v-else-if="col.name == 'organization'" class="text-html">
{{ findOrgNameHtml(props.row) }}
</div>
<div v-else-if="col.name == 'amount'">
{{ Number(props.row.amount).toLocaleString() }}

View file

@ -24,8 +24,14 @@ import DialogInfo from "@/modules/13_salary/components/DialogInfoMain.vue";
/** use*/
const $q = useQuasar();
const store = useSalaryEmployeeListSDataStore();
const { dialogRemove, messageError, showLoader, hideLoader, success } =
useCounterMixin();
const {
dialogRemove,
messageError,
showLoader,
hideLoader,
success,
findOrgNameHtml,
} = useCounterMixin();
/** Props*/
const formFilter = defineModel<DataFilter>("formFilter", { required: true });
@ -128,7 +134,7 @@ const columns = ref<QTableProps["columns"]>([
label: "สังกัด",
sortable: false,
field: "organization",
headerStyle: "font-size: 14px",
headerStyle: "font-size: 14px;min-width:280px",
style: "font-size: 14px",
},
{
@ -378,7 +384,7 @@ watch(
: columns"
option-value="name"
style="min-width: 140px"
class="col-xs-12 col-sm-3 col-md-2 q-ml-sm"
class=" q-ml-sm"
/>
</q-toolbar>
<d-table
@ -475,25 +481,8 @@ watch(
`${props.row.prefix}${props.row.firstName} ${props.row.lastName}`
}}
</div>
<div v-else-if="col.name == 'organization'" class="table_ellipsis">
<div
v-if="
props.row.child4 === null &&
props.row.child3 === null &&
props.row.child2 === null &&
props.row.child1 === null &&
props.row.root === null
"
>
-
</div>
{{
`${props.row.child4 ? props.row.child4 + " " : ""}${
props.row.child3 ? props.row.child3 + " " : ""
}${props.row.child2 ? props.row.child2 + " " : ""}${
props.row.child1 ? props.row.child1 + " " : ""
}${props.row.root ? props.row.root : ""}`
}}
<div v-else-if="col.name == 'organization'" class="text-html">
{{ findOrgNameHtml(props.row) }}
</div>
<div v-else-if="col.name == 'isSuspension'">

View file

@ -46,8 +46,7 @@ const baseColumns = ref<QTableProps["columns"]>([
{
name: "amount",
align: "left",
label:
employeeClass.value === "-employee" ? "ค่าตอบแทนรายเดือน" : "เงินเดือน",
label: employeeClass.value === "-employee" ? "ค่าจ้าง" : "เงินเดือน",
sortable: true,
field: "amount",
headerStyle: "font-size: 14px",
@ -78,7 +77,8 @@ const baseColumns = ref<QTableProps["columns"]>([
{
name: "posNo",
align: "left",
label: "ตำแหน่งเลขที่",
label:
employeeClass.value === "-employee" ? "ตำแหน่งเลขที่" : "เลขที่ตำแหน่ง",
sortable: true,
field: "posNo",
headerStyle: "font-size: 14px",
@ -88,7 +88,7 @@ const baseColumns = ref<QTableProps["columns"]>([
{
name: "positionType",
align: "left",
label: "ประเภทตำแหน่ง",
label: employeeClass.value === "-employee" ? "กลุ่มงาน" : "ตำแหน่งประเภท",
sortable: true,
field: "positionType",
headerStyle: "font-size: 14px",
@ -97,7 +97,7 @@ const baseColumns = ref<QTableProps["columns"]>([
{
name: "positionLevel",
align: "left",
label: "ระดับ",
label: employeeClass.value === "-employee" ? "ระดับชั้นงาน" : "ระดับ",
sortable: true,
field: "positionLevel",
headerStyle: "font-size: 14px",