From c9dfcc755f080ff0352dd201311c8b70b7ed223d Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Thu, 7 Mar 2024 13:31:58 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=E0=B8=A3?= =?UTF-8?q?=E0=B8=B2=E0=B8=A2=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=9C=E0=B8=B1?= =?UTF-8?q?=E0=B8=87=E0=B8=9A=E0=B8=B1=E0=B8=8D=E0=B8=8A=E0=B8=B5=E0=B9=80?= =?UTF-8?q?=E0=B8=87=E0=B8=B4=E0=B8=99=E0=B9=80=E0=B8=94=E0=B8=B7=E0=B8=AD?= =?UTF-8?q?=E0=B8=99=E0=B8=82=E0=B9=89=E0=B8=B2=E0=B8=A3=E0=B8=B2=E0=B8=8A?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/SalaryChart/DialogFormMain.vue | 31 +++----- src/modules/13_salary/interface/index/Main.ts | 4 +- src/modules/13_salary/views/salaryChart.vue | 71 ++++++++----------- 3 files changed, 43 insertions(+), 63 deletions(-) diff --git a/src/modules/13_salary/components/SalaryChart/DialogFormMain.vue b/src/modules/13_salary/components/SalaryChart/DialogFormMain.vue index e37fce74a..b6b635847 100644 --- a/src/modules/13_salary/components/SalaryChart/DialogFormMain.vue +++ b/src/modules/13_salary/components/SalaryChart/DialogFormMain.vue @@ -49,7 +49,7 @@ const props = defineProps({ const salaryId = ref(""); const formData = reactive({ - salaryType: "", //*ประเภทผัง (OFFICER->"ข้าราชการกรุงเทพมหานครสามัญ",EMPLOYEE->"ลูกจ้างประจำกรุงเทพมหานคร") + name: "", //*ชื่อผังบัญชีอัตราเงินเดือน posTypeId: "", //*ประเภทของตำแหน่ง posLevelId: "", //*ระดับของตำแหน่ง isActive: false, //*สถานะการใช้งาน @@ -61,21 +61,16 @@ const formData = reactive({ }); /** ตัวแปร ref สำหรับแสดง validate */ -const salaryTypeRef = ref(null); +const nameRef = ref(null); const posTypeRef = ref(null); const posLevelRef = ref(null); const ObjectRef: ObjectSalaryRef = { - salaryType: salaryTypeRef, + name: nameRef, posTypId: posTypeRef, posLevelId: posLevelRef, }; -const salaryTypeOption = ref([ - { id: "OFFICER", name: "ข้าราชการกรุงเทพมหานครสามัญ" }, - { id: "EMPLOYEE", name: "ลูกจ้างประจำกรุงเทพมหานคร" }, -]); - const posType = ref([]); const salaryPosTypeOption = ref([]); const salaryPosLevelOption = ref([]); @@ -130,7 +125,7 @@ async function fetchSalaryDetail(id: string) { .get(config.API.salaryChartByid(id)) .then((res) => { const data = res.data.result; - formData.salaryType = data.salaryType; + formData.name = data.name; formData.posTypeId = data.posTypeId; formData.posLevelId = data.posLevelId; formData.isActive = data.isActive; @@ -191,7 +186,7 @@ function closeDialog() { } function clearFormData() { - formData.salaryType = ""; + formData.name = ""; formData.posTypeId = ""; formData.posLevelId = ""; formData.isSpecial = false; @@ -263,21 +258,17 @@ function checkEndDate() {
- diff --git a/src/modules/13_salary/interface/index/Main.ts b/src/modules/13_salary/interface/index/Main.ts index 466885b23..6c3ae0b4d 100644 --- a/src/modules/13_salary/interface/index/Main.ts +++ b/src/modules/13_salary/interface/index/Main.ts @@ -23,7 +23,7 @@ interface ItemsMenu { type: string; } interface ObjectSalaryRef { - salaryType: object | null; + name: object | null; posTypId: object | null; posLevelId: object | null; @@ -43,7 +43,7 @@ interface ObjectSalaryRateRef { } interface FormData{ - salaryType:string + name:string posTypeId:string posLevelId:string isActive:boolean diff --git a/src/modules/13_salary/views/salaryChart.vue b/src/modules/13_salary/views/salaryChart.vue index 309aecf9c..077810d28 100644 --- a/src/modules/13_salary/views/salaryChart.vue +++ b/src/modules/13_salary/views/salaryChart.vue @@ -13,13 +13,13 @@ import type { } from "@/modules/13_salary/interface/index/Main"; import type { Salary } from "@/modules/13_salary/interface/response/Main"; import type { FormQuerySalary } from "@/modules/13_salary/interface/request/Main"; -import DialogFormUpload from '@/modules/13_salary/components/SalaryChart/DialogUpload.vue' +import DialogFormUpload from "@/modules/13_salary/components/SalaryChart/DialogUpload.vue"; import DialogFormMain from "@/modules/13_salary/components/SalaryChart/DialogFormMain.vue"; /** importStore*/ import { useCounterMixin } from "@/stores/mixin"; /** use*/ -const isActive = ref(false) +const isActive = ref(false); const $q = useQuasar(); const router = useRouter(); const { @@ -31,38 +31,29 @@ const { success, } = useCounterMixin(); -const total = ref() +const total = ref(); /** modalDialog*/ const modalDialogFormMain = ref(false); const modalUpload = ref(false); -const rowId = ref('') +const rowId = ref(""); /** Table*/ const rows = ref([]); const columns = ref([ { - name: "salaryType", + name: "name", align: "left", - label: "ประเภทผัง", + label: "ชื่อผังบัญชีอัตราเงินเดือน", sortable: true, - field: "salaryType", + field: "name", headerStyle: "font-size: 14px", style: "font-size: 14px", }, { - name: "posType", + name: "posList", align: "left", - label: "ประเภทตำแหน่ง", - sortable: true, - field: "posType", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "posLevel", - align: "left", - label: "ระดับ", - field: "posLevel", + label: "ประเภทผังบัญชีเงินเดือน", sortable: true, + field: "posList", headerStyle: "font-size: 14px", style: "font-size: 14px", }, @@ -86,9 +77,8 @@ const columns = ref([ }, ]); const visibleColumns = ref([ - "salaryType", - "posType", - "posLevel", + "name", + "posList", "startDate", "isActive", ]); @@ -102,8 +92,8 @@ const itemMenu = ref([ type: "edit", }, { - label: "อัปโหลดเอกสารอ้างอิง", - icon: "mdi-upload", + label: "เอกสารอ้างอิง", + icon: "mdi-file-document-outline", color: "teal", type: "upload", }, @@ -149,11 +139,10 @@ async function fetchListSalaly() { `?page=${page}&pageSize=${pageSize}&keyword=${keyword}` ) .then((res) => { - total.value = res.data.result.total + total.value = res.data.result.total; maxPage.value = Math.ceil(res.data.result.total / formQuery.pageSize); const data = res.data.result.data; rows.value = data; - }) .catch((err) => { messageError($q, err); @@ -168,7 +157,7 @@ const dataRow = ref(); async function onClickSalary(type: string, data: Salary | null) { modalDialogFormMain.value = !modalDialogFormMain.value; typeAction.value = type; - + if (data) { dataRow.value = data; } @@ -208,11 +197,11 @@ async function onClickDelete(id: string) { }); } -async function onClickUpload(type: string,id: string,active:boolean) { - modalUpload.value = true +async function onClickUpload(type: string, id: string, active: boolean) { + modalUpload.value = true; typeAction.value = type; - rowId.value = id - isActive.value = active + rowId.value = id; + isActive.value = active; } onMounted(async () => { @@ -305,6 +294,10 @@ async function filterFn(page: number) { size="24px" />
+
+
{{ props.row.posType }}
+
{{ props.row.isSpecial ? `${props.row.posLevel} (ฉ)` : `${props.row.posLevel}` }}
+
{{ col.value === "OFFICER" @@ -315,9 +308,6 @@ async function filterFn(page: number) {
{{ col.value ? date2Thai(col.value) : "" }}
-
- {{ props.row.isSpecial ? `${col.value} (ฉ)` : `${col.value}` }} -
{{ col.value ? col.value : "-" }}
@@ -344,7 +334,11 @@ async function filterFn(page: number) { : item.type === 'salaryRate' ? onClickSalaryRate(props.row.id) : item.type === 'upload' - ? onClickUpload('edit',props.row.id,props.row.isActive) + ? onClickUpload( + 'edit', + props.row.id, + props.row.isActive + ) : item.type === 'copy' ? onClickCoppy(props.row.id) : null @@ -369,11 +363,7 @@ async function filterFn(page: number) { >
- +
ลบ
@@ -414,7 +404,6 @@ async function filterFn(page: number) { :fetchData="fetchListSalaly" :isActive="isActive" /> -