diff --git a/src/modules/04_registryPerson/views/edit/components/Table.vue b/src/modules/04_registryPerson/views/edit/components/Table.vue index 82578b5bd..f3f0ca56c 100644 --- a/src/modules/04_registryPerson/views/edit/components/Table.vue +++ b/src/modules/04_registryPerson/views/edit/components/Table.vue @@ -26,6 +26,7 @@ const { messageError, success, findOrgNameHtml, + dialogConfirm, } = useCounterMixin(); const empType = ref(route.params.type.toString()); @@ -43,6 +44,15 @@ const rows = ref([]); const rowsMain = ref([]); const keyword = ref(""); const baseColumns = ref([ + { + 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([ 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([ 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([ ? 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([ 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([ 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([ }, 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([ 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([ }, 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([ }, 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([ 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([ 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([ }` : "-"; }, - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "mouthSalaryAmount", @@ -229,10 +223,6 @@ const baseColumns = ref([ 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([ 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([ 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([ + "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) " > {{ @@ -505,10 +504,10 @@ onMounted(() => { : '' " > -
+
+ {{ props.rowIndex + 1 }} +
+
{{ findOrgNameHtml({ root: props.row.orgRoot, @@ -519,10 +518,8 @@ onMounted(() => { }) }}
-
+ +
{{ col.value ? col.value : "-" }}
diff --git a/src/modules/13_salary/components/04_salaryLists/TableTypeOther.vue b/src/modules/13_salary/components/04_salaryLists/TableTypeOther.vue index 5016f77df..e32f93751 100644 --- a/src/modules/13_salary/components/04_salaryLists/TableTypeOther.vue +++ b/src/modules/13_salary/components/04_salaryLists/TableTypeOther.vue @@ -59,7 +59,7 @@ const baseColumns = ref([ { name: "posNo", align: "left", - label: "ตำแหน่งเลขที่", + label: "เลขที่ตำแหน่ง", sortable: false, field: "posNo", headerStyle: "font-size: 14px", @@ -86,7 +86,7 @@ const baseColumns = ref([ { name: "posType", align: "left", - label: "ประเภทตำแหน่ง", + label: "ตำแหน่งประเภท", sortable: false, field: "posType", headerStyle: "font-size: 14px", @@ -95,7 +95,7 @@ const baseColumns = ref([ { name: "posLevel", align: "left", - label: "ระดับตำแหน่ง", + label: "ระดับ", sortable: false, field: "posLevel", headerStyle: "font-size: 14px", diff --git a/src/modules/13_salary/components/04_salaryLists/TableTypePending.vue b/src/modules/13_salary/components/04_salaryLists/TableTypePending.vue index 79e951409..8af27fda9 100644 --- a/src/modules/13_salary/components/04_salaryLists/TableTypePending.vue +++ b/src/modules/13_salary/components/04_salaryLists/TableTypePending.vue @@ -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("formFilter", { required: true }); @@ -68,7 +74,7 @@ const columns = ref([ { name: "posType", align: "left", - label: "ประเภทตำแหน่ง", + label: "ตำแหน่งประเภท", sortable: false, field: "posType", headerStyle: "font-size: 14px", @@ -95,7 +101,7 @@ const columns = ref([ { name: "posLevel", align: "left", - label: "ระดับตำแหน่ง", + label: "ระดับ", field: "posLevel", sortable: false, headerStyle: "font-size: 14px", @@ -116,7 +122,7 @@ const columns = ref([ 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" /> -
-
- - -
- {{ - `${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 : ""}` - }} +
+ {{ findOrgNameHtml(props.row) }}
{{ Number(props.row.amount).toLocaleString() }} diff --git a/src/modules/13_salary/components/05_salaryListsEmployee/TableTypePending.vue b/src/modules/13_salary/components/05_salaryListsEmployee/TableTypePending.vue index 74aa79900..9a41b1481 100644 --- a/src/modules/13_salary/components/05_salaryListsEmployee/TableTypePending.vue +++ b/src/modules/13_salary/components/05_salaryListsEmployee/TableTypePending.vue @@ -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("formFilter", { required: true }); @@ -128,7 +134,7 @@ const columns = ref([ 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" /> -
-
- - -
- {{ - `${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 : ""}` - }} +
+ {{ findOrgNameHtml(props.row) }}
diff --git a/src/modules/13_salary/components/InfoSalary.vue b/src/modules/13_salary/components/InfoSalary.vue index 0dfdc0c65..e85e71412 100644 --- a/src/modules/13_salary/components/InfoSalary.vue +++ b/src/modules/13_salary/components/InfoSalary.vue @@ -46,8 +46,7 @@ const baseColumns = ref([ { 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([ { name: "posNo", align: "left", - label: "ตำแหน่งเลขที่", + label: + employeeClass.value === "-employee" ? "ตำแหน่งเลขที่" : "เลขที่ตำแหน่ง", sortable: true, field: "posNo", headerStyle: "font-size: 14px", @@ -88,7 +88,7 @@ const baseColumns = ref([ { name: "positionType", align: "left", - label: "ประเภทตำแหน่ง", + label: employeeClass.value === "-employee" ? "กลุ่มงาน" : "ตำแหน่งประเภท", sortable: true, field: "positionType", headerStyle: "font-size: 14px", @@ -97,7 +97,7 @@ const baseColumns = ref([ { name: "positionLevel", align: "left", - label: "ระดับ", + label: employeeClass.value === "-employee" ? "ระดับชั้นงาน" : "ระดับ", sortable: true, field: "positionLevel", headerStyle: "font-size: 14px",