From 80a69afd86ec1935680ab05fdf645f8bf237a03b Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 8 Jul 2024 11:04:00 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=A5=E0=B8=B7=E0=B9=88=E0=B8=AD?= =?UTF-8?q?=E0=B8=99=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B8=99=E0=B9=80=E0=B8=94?= =?UTF-8?q?=E0=B8=B7=E0=B8=AD=E0=B8=99=20=3D>=20=E0=B9=80=E0=B8=9E?= =?UTF-8?q?=E0=B8=B4=E0=B9=88=E0=B8=A1=20remark?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SalaryEmployeeLists/DialogMoveLevel.vue | 21 ++++++++- .../SalaryEmployeeLists/TabMain.vue | 1 + .../SalaryEmployeeLists/TableTypeOther.vue | 45 +++++++++++++++--- .../SalaryLists/DialogMoveLevel.vue | 23 +++++++-- .../components/SalaryLists/TabMain.vue | 1 + .../components/SalaryLists/TableTypeOther.vue | 47 ++++++++++++++++--- src/modules/13_salary/views/salaryRound.vue | 6 +-- 7 files changed, 125 insertions(+), 19 deletions(-) diff --git a/src/modules/13_salary/components/SalaryEmployeeLists/DialogMoveLevel.vue b/src/modules/13_salary/components/SalaryEmployeeLists/DialogMoveLevel.vue index e170ba5c3..00d8267c0 100644 --- a/src/modules/13_salary/components/SalaryEmployeeLists/DialogMoveLevel.vue +++ b/src/modules/13_salary/components/SalaryEmployeeLists/DialogMoveLevel.vue @@ -23,12 +23,14 @@ const profileId = defineModel("profileId", { required: true }); const props = defineProps({ typeLevel: { type: String, required: true }, isReserve: { type: Boolean, required: true }, + remark: { type: String, required: true }, fetchData: { type: Function, }, }); const type = ref(""); +const note = ref(""); const typeRef = ref(null); const isReadonly = ref(false); // อ่านได้อย่างเดียว const isChange = ref(false); // มีการแก้ไขข้อมูลหรือไม่ @@ -75,6 +77,7 @@ function onSubmit() { profileId: profileId.value, type: type.value, isReserve: isReserve.value, + remark: type.value === "NONE" ? note.value : undefined, }; http .post(config.API.salaryPeriodEmp() + `/change/type`, body) @@ -92,10 +95,15 @@ function onSubmit() { }); } +function chengType() { + note.value = props.typeLevel === "NONE" ? props.remark : ""; +} + watch( () => modal.value, () => { type.value = props.typeLevel == "PENDING" ? "" : props.typeLevel; + note.value = props.typeLevel === "NONE" ? props.remark : ""; isReserve.value = props.isReserve; isChange.value = false; } @@ -132,7 +140,7 @@ function inputEdit(val: boolean) { :rules="[(val) => !!val || `${'กรุณาเลือก ขั้น'}`]" lazy-rules hide-bottom-space - @update:model-value="isChange = true" + @update:model-value="(isChange = true), chengType()" /> @@ -144,6 +152,17 @@ function inputEdit(val: boolean) { v-model="isReserve" @update:model-value="isChange = true" /> + + diff --git a/src/modules/13_salary/components/SalaryEmployeeLists/TabMain.vue b/src/modules/13_salary/components/SalaryEmployeeLists/TabMain.vue index f7a4daa02..ecdb2df61 100644 --- a/src/modules/13_salary/components/SalaryEmployeeLists/TabMain.vue +++ b/src/modules/13_salary/components/SalaryEmployeeLists/TabMain.vue @@ -541,6 +541,7 @@ const updateIsShowRetire = async () => { v-model:formFilter="formFilter" :fetchDataTable="fetchDataPeriodNew" :total="total" + :type="item.type" /> diff --git a/src/modules/13_salary/components/SalaryEmployeeLists/TableTypeOther.vue b/src/modules/13_salary/components/SalaryEmployeeLists/TableTypeOther.vue index 202945bb8..be839176d 100644 --- a/src/modules/13_salary/components/SalaryEmployeeLists/TableTypeOther.vue +++ b/src/modules/13_salary/components/SalaryEmployeeLists/TableTypeOther.vue @@ -36,10 +36,14 @@ const props = defineProps({ total: { type: Number, }, + type: { + type: String, + requird: true, + }, }); /** ข้อมูล Table*/ -const columns = ref([ +const baseColumns = ref([ { name: "no", align: "left", @@ -152,6 +156,15 @@ const columns = ref([ headerStyle: "font-size: 14px", style: "font-size: 14px", }, + { + name: "remark", + align: "center", + label: "หมายเหตุ", + sortable: false, + field: "remark", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, ]); const visibleColumns = ref([ @@ -167,8 +180,18 @@ const visibleColumns = ref([ "amountUse", "positionSalaryAmount", "isRetired", + "remark", ]); +const columns = computed(() => { + if (props.type !== "NONE") { + if (baseColumns.value) { + return baseColumns.value.filter((column) => column.name !== "remark"); + } + } + return baseColumns.value; +}); + /** modalDialog*/ const modalDialogAddPerson = ref(false); const modalDialogForm = ref(false); @@ -207,16 +230,24 @@ function onClickMovieGroup(id: string) { const typeLevel = ref(""); const isReserve = ref(false); +const remark = ref(""); + /** * function openPopup ย้ายกขั้น * @param id profileId * */ -function onClickMoveLevel(id: string, typeVal: string, isReserveVal: boolean) { +function onClickMoveLevel( + id: string, + typeVal: string, + isReserveVal: boolean, + remarkVal: string = "" +) { profileId.value = id; modalDialogMoveLeve.value = !modalDialogMoveLeve.value; typeLevel.value = typeVal; isReserve.value = isReserveVal; + remark.value = typeVal === "NONE" ? remarkVal : ""; } /** @@ -306,7 +337,7 @@ watch( store.roundMainCode === 'OCT' ? columns : columns - ? columns.slice(0, 11) + ? columns.filter((e) => e.name !== 'isRetired') : [] " option-value="name" @@ -322,7 +353,7 @@ watch( store.roundMainCode === 'OCT' ? columns : columns - ? columns.slice(0, 11) + ? columns.filter((e) => e.name !== 'isRetired') : [] " :rows="props.rows" @@ -416,7 +447,7 @@ watch( /> -
+
{{ col.value ? col.value : "-" }}
@@ -446,7 +477,8 @@ watch( ? onClickMoveLevel( props.row.id, props.row.type, - props.row.isReserve + props.row.isReserve, + props.row.remark ) : item.type === 'delete' ? onClickDelete(props.row.id) @@ -510,6 +542,7 @@ watch( v-model:profileId="profileId" :fetchData="props.fetchDataTable" :type="store.tabType" + :remark="remark" /> diff --git a/src/modules/13_salary/components/SalaryLists/DialogMoveLevel.vue b/src/modules/13_salary/components/SalaryLists/DialogMoveLevel.vue index f3af5e0c5..acfc11957 100644 --- a/src/modules/13_salary/components/SalaryLists/DialogMoveLevel.vue +++ b/src/modules/13_salary/components/SalaryLists/DialogMoveLevel.vue @@ -29,12 +29,14 @@ const profileId = defineModel("profileId", { required: true }); const props = defineProps({ typeLevel: { type: String, required: true }, isReserve: { type: Boolean, required: true }, + remark: { type: String, required: true }, fetchData: { type: Function, }, }); const type = ref(""); +const note = ref(""); const typeRef = ref(null); const isReadonly = ref(false); // อ่านได้อย่างเดียว const isChange = ref(false); // มีการแก้ไขข้อมูลหรือไม่ @@ -81,6 +83,7 @@ function onSubmit() { profileId: profileId.value, type: type.value, isReserve: isReserve.value, + remark: type.value === "NONE" ? note.value : undefined, }; http .post(config.API.salaryPeriod() + `/change/type`, body) @@ -98,10 +101,15 @@ function onSubmit() { }); } +function chengType() { + note.value = props.typeLevel === "NONE" ? props.remark : ""; +} + watch( () => modal.value, () => { type.value = props.typeLevel == "PENDING" ? "" : props.typeLevel; + note.value = props.typeLevel === "NONE" ? props.remark : ""; isReserve.value = props.isReserve; isChange.value = false; } @@ -138,9 +146,8 @@ function inputEdit(val: boolean) { :rules="[(val) => !!val || `${'กรุณาเลือก ขั้น'}`]" lazy-rules hide-bottom-space - @update:model-value="isChange = true" + @update:model-value="(isChange = true), chengType()" /> - + +
- { v-model:formFilter="formFilter" :fetchDataTable="fetchDataPeriodNew" :total="total" + :type="item.type" /> diff --git a/src/modules/13_salary/components/SalaryLists/TableTypeOther.vue b/src/modules/13_salary/components/SalaryLists/TableTypeOther.vue index d67208118..3479c4bbc 100644 --- a/src/modules/13_salary/components/SalaryLists/TableTypeOther.vue +++ b/src/modules/13_salary/components/SalaryLists/TableTypeOther.vue @@ -36,10 +36,14 @@ const props = defineProps({ total: { type: Number, }, + type: { + type: String, + required: true, + }, }); /** ข้อมูล Table*/ -const columns = ref([ +const baseColumns = ref([ { name: "no", align: "left", @@ -140,6 +144,15 @@ const columns = ref([ headerStyle: "font-size: 14px", style: "font-size: 14px", }, + { + name: "remark", + align: "center", + label: "หมายเหตุ", + sortable: false, + field: "remark", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, ]); const visibleColumns = ref([ @@ -154,8 +167,20 @@ const visibleColumns = ref([ "amountUse", "positionSalaryAmount", "isRetired", + "remark", ]); +const columns = computed(() => { + if (props.type !== "NONE") { + if (baseColumns.value) { + return baseColumns.value.filter((column) => column.name !== "remark"); + } + } + console.log(baseColumns.value); + + return baseColumns.value; +}); + /** modalDialog*/ const modalDialogAddPerson = ref(false); const modalDialogForm = ref(false); @@ -194,16 +219,24 @@ function onClickMovieGroup(id: string) { const typeLevel = ref(""); const isReserve = ref(false); +const remark = ref(""); + /** * function openPopup ย้ายกขั้น * @param id profileId * */ -function onClickMoveLevel(id: string, typeVal: string, isReserveVal: boolean) { +function onClickMoveLevel( + id: string, + typeVal: string, + isReserveVal: boolean, + remarkVal: string = "" +) { profileId.value = id; modalDialogMoveLeve.value = !modalDialogMoveLeve.value; typeLevel.value = typeVal; isReserve.value = isReserveVal; + remark.value = typeVal === "NONE" ? remarkVal : ""; } /** @@ -293,7 +326,7 @@ watch( store.roundMainCode === 'OCT' ? columns : columns - ? columns.slice(0, 10) + ? columns.filter((e) => e.name !== 'isRetired') : [] " option-value="name" @@ -309,7 +342,7 @@ watch( store.roundMainCode === 'OCT' ? columns : columns - ? columns.slice(0, 10) + ? columns.filter((e) => e.name !== 'isRetired') : [] " :rows="props.rows" @@ -401,7 +434,7 @@ watch( /> -
+
{{ col.value ? col.value : "-" }}
@@ -431,7 +464,8 @@ watch( ? onClickMoveLevel( props.row.id, props.row.type, - props.row.isReserve + props.row.isReserve, + props.row.remark ) : item.type === 'delete' ? onClickDelete(props.row.id) @@ -495,6 +529,7 @@ watch( v-model:profileId="profileId" :fetchData="props.fetchDataTable" :type="store.tabType" + :remark="remark" /> diff --git a/src/modules/13_salary/views/salaryRound.vue b/src/modules/13_salary/views/salaryRound.vue index 5c55a8377..d0994beff 100644 --- a/src/modules/13_salary/views/salaryRound.vue +++ b/src/modules/13_salary/views/salaryRound.vue @@ -379,7 +379,7 @@ onMounted(async () => { 1 }}
-
+
{{ date2Thai(props.row.effectiveDate) }}
@@ -403,10 +403,10 @@ onMounted(async () => { />
- {{ props.row.isClose == false ? "" : "ปิดรอบแล้ว" }} + {{ props.row.isClose == false ? "-" : "ปิดรอบแล้ว" }}
- {{ col.value }} + {{ col.value ?? "-" }}