diff --git a/src/api/06_retirement/api.retirement.ts b/src/api/06_retirement/api.retirement.ts index 6646d70a7..7f849e1b0 100644 --- a/src/api/06_retirement/api.retirement.ts +++ b/src/api/06_retirement/api.retirement.ts @@ -32,7 +32,7 @@ export default { listExitInterview: () => `${retirement}/resign/questionnaire`, ExitInterviewByid: (id: string) => `${retirement}/resign/questionnaire/${id}`, ExitInterviewReport: `${retirement}/resign/questionnaire/report`, - AppointInterview:(id: string) =>`${retirement}/resign/questionnaire/appoint/${id}`, + AppointInterview: (id: string) => `${retirement}/resign/questionnaire/appoint/${id}`, // ปลดออก retirementDischarge, listDischarge: () => `${retirement}/discharge`, @@ -52,5 +52,9 @@ export default { outReport: `${retirement}/out/report`, fileRetirement: (id: string) => `${retirement}/upload/${id}`, - checkfileupload: (id: string) => `${retirement}/upload/check/${id}` + checkfileupload: (id: string) => `${retirement}/upload/check/${id}`, + + editDetail: (retireId: string) => `${retirement}/detail/${retireId}` + + }; diff --git a/src/components/CurruncyInput.vue b/src/components/CurruncyInput.vue index 8d535b1ce..89d371935 100644 --- a/src/components/CurruncyInput.vue +++ b/src/components/CurruncyInput.vue @@ -13,8 +13,8 @@ :borderless="!edit" hide-bottom-space > - @@ -37,9 +37,9 @@ const props = defineProps({ }); const { inputRef, formattedValue, setValue } = useCurrencyInput({ - locale: "en-US", - currency: "EUR", - // currencyDisplay: "hidden", + locale: "th-TH", + currency: "THB", + currencyDisplay: "hidden" as any, hideCurrencySymbolOnFocus: true, hideGroupingSeparatorOnFocus: true, hideNegligibleDecimalDigitsOnFocus: true, @@ -50,7 +50,7 @@ const { inputRef, formattedValue, setValue } = useCurrencyInput({ watch( () => props.modelValue, - (value) => { + (value: any) => { setValue(value); } ); diff --git a/src/components/Dialogs/PopupReason.vue b/src/components/Dialogs/PopupReason.vue index 2b97f8e21..9440ee1ea 100644 --- a/src/components/Dialogs/PopupReason.vue +++ b/src/components/Dialogs/PopupReason.vue @@ -2,7 +2,7 @@ import { ref, watch } from "vue"; import DialogHeader from "@/components/DialogHeader.vue"; -const reason = ref(""); +const reason = ref(""); const props = defineProps({ modal: { type: Boolean, @@ -18,16 +18,21 @@ const props = defineProps({ }, clickClose: { type: Function, - default: () => { }, + default: () => {}, }, savaForm: { type: Function, - default: () => { }, + default: () => {}, + }, + textReport: { + type: String, }, }); watch(props, () => { - if (props.modal === true) { + if (props.modal === true && props.textReport == "") { reason.value = ""; + } else { + reason.value = props.textReport; } }); @@ -51,18 +56,31 @@ const submit = () => {
- - - - +
- + บันทึก diff --git a/src/modules/04_registry/components/Salary.vue b/src/modules/04_registry/components/Salary.vue index 0bd1a120c..43970819c 100644 --- a/src/modules/04_registry/components/Salary.vue +++ b/src/modules/04_registry/components/Salary.vue @@ -643,10 +643,10 @@ const { const route = useRoute(); const id = ref(""); const date = ref(new Date()); -const amount = ref(0); +const amount = ref(0); // const salary = ref(null); -const positionSalaryAmount = ref(0); -const mouthSalaryAmount = ref(0); +const positionSalaryAmount = ref(0); +const mouthSalaryAmount = ref(0); const ocId = ref(); const positionId = ref(); const positionLineId = ref(); @@ -1816,13 +1816,13 @@ const templateDetail = async () => { * กดบันทึกใน dialog */ const clickSave = async () => { - if (amount.value == 0) { - amount.value = null; - } else if (positionSalaryAmount.value == 0) { - positionSalaryAmount.value = null; - } else if (mouthSalaryAmount.value == 0) { - mouthSalaryAmount.value = null; - } + // if (amount.value == 0) { + // amount.value = null; + // } else if (positionSalaryAmount.value == 0) { + // positionSalaryAmount.value = null; + // } else if (mouthSalaryAmount.value == 0) { + // mouthSalaryAmount.value = null; + // } myForm.value.validate().then(async (result: boolean) => { if (result) { @@ -2018,9 +2018,9 @@ const addData = () => { edit.value = true; date.value = new Date(); date.value = new Date(); - amount.value = 0; - positionSalaryAmount.value = 0; - mouthSalaryAmount.value = 0; + amount.value = undefined; + positionSalaryAmount.value = undefined; + mouthSalaryAmount.value = undefined; ocId.value = ""; positionId.value = ""; posNoId.value = ""; diff --git a/src/modules/04_registry/components/SalaryEmployee.vue b/src/modules/04_registry/components/SalaryEmployee.vue index 398692a01..e59799e4d 100644 --- a/src/modules/04_registry/components/SalaryEmployee.vue +++ b/src/modules/04_registry/components/SalaryEmployee.vue @@ -617,9 +617,9 @@ const { const route = useRoute(); const id = ref(""); const date = ref(new Date()); -const amount = ref(null); -const positionSalaryAmount = ref(null); -const mouthSalaryAmount = ref(null); +const amount = ref(0); +const positionSalaryAmount = ref(0); +const mouthSalaryAmount = ref(0); const search = ref(""); const refCommandNo = ref(); const expanded = ref([]); @@ -1717,9 +1717,9 @@ const templateDetail = async () => { * กดบันทึกใน dialog */ const clickSave = async () => { - if (amount.value === 0) { - amount.value = null; - } + // if (amount.value === 0) { + // amount.value = null; + // } myForm.value.validate().then(async (result: boolean) => { if (result) { if (modalEdit.value) { @@ -1919,9 +1919,9 @@ const addData = () => { modal.value = true; edit.value = true; date.value = new Date(); - amount.value = 0; - positionSalaryAmount.value = null; - mouthSalaryAmount.value = null; + amount.value = undefined; + positionSalaryAmount.value = undefined; + mouthSalaryAmount.value = undefined; posNoId.value = ""; posNoEmployee.value = ""; diff --git a/src/modules/04_registry/components/SalaryEmployeeTemp.vue b/src/modules/04_registry/components/SalaryEmployeeTemp.vue index ab24a1127..5f0597691 100644 --- a/src/modules/04_registry/components/SalaryEmployeeTemp.vue +++ b/src/modules/04_registry/components/SalaryEmployeeTemp.vue @@ -592,9 +592,9 @@ const { const route = useRoute(); const id = ref(""); const date = ref(new Date()); -const amount = ref(null); -const positionSalaryAmount = ref(null); -const mouthSalaryAmount = ref(null); +const amount = ref(0); +const positionSalaryAmount = ref(0); +const mouthSalaryAmount = ref(0); const search = ref(""); const expanded = ref([]); const selected = ref(""); @@ -1746,9 +1746,9 @@ const templateDetail = async () => { * กดบันทึกใน dialog */ const clickSave = async () => { - if (amount.value == 0) { - amount.value = null; - } + // if (amount.value == 0) { + // amount.value = null; + // } myForm.value.validate().then(async (result: boolean) => { if (result) { if (modalEdit.value) { @@ -1948,9 +1948,9 @@ const addData = () => { modal.value = true; edit.value = true; date.value = new Date(); - amount.value = 0; - positionSalaryAmount.value = null; - mouthSalaryAmount.value = null; + amount.value = undefined; + positionSalaryAmount.value = undefined; + mouthSalaryAmount.value = undefined; posNoId.value = ""; posNoEmployee.value = ""; diff --git a/src/modules/06_retirement/components/ListRetirement/TableList.vue b/src/modules/06_retirement/components/ListRetirement/TableList.vue index 7ecc3666f..7e65d5197 100644 --- a/src/modules/06_retirement/components/ListRetirement/TableList.vue +++ b/src/modules/06_retirement/components/ListRetirement/TableList.vue @@ -8,12 +8,13 @@ import { useRouter } from "vue-router"; import http from "@/plugins/http"; import config from "@/app.config"; import DialogHeader from "@/components/DialogHeader.vue"; +import DialogPopupReason from "@/components/Dialogs/PopupReason.vue"; const route = useRoute(); const router = useRouter(); const $q = useQuasar(); const mixin = useCounterMixin(); -const { showLoader, hideLoader, messageError, success } = mixin; +const { showLoader, hideLoader, messageError, success, dialogConfirm } = mixin; // const type_params = route.params.type; // const year_params = route.params.year; const retireld_params = route.params.retirementId; @@ -26,6 +27,8 @@ const retireld = ref(retireld_params.toString()); const profileId = ref(""); const filter = ref(""); const statusUpload = ref(); +const modalEdit = ref(false); +const textReport = ref(""); const columns = ref([ { @@ -177,6 +180,7 @@ const fecthlistprofile = async (id: string) => { round.value = res.data.result.round; statusReport.value = res.data.result.json; typeReport.value = res.data.result.typeReport; + textReport.value = res.data.result.detail; rows.value = res.data.result.profile.map((e: any) => ({ id: e.id, profileId: e.profileId, @@ -312,6 +316,7 @@ const uploadFile = async (event: any) => { console.log(selectedFile); const formdata = new FormData(); formdata.append("file", selectedFile); + await http .put(config.API.fileRetirement(retireld.value.toString()), formdata) .then((res) => { @@ -381,6 +386,36 @@ const downloadFile = (response: any, filename: string) => { // return "color: #26a69a;"; // } else return ""; // }; +const saveEdiitReport = (reason: string) => { + const formdata = new FormData(); + formdata.append("Detail", reason); + dialogConfirm( + $q, + async () => { + await http + .put(config.API.editDetail(retireld.value), formdata) + .then(() => { + success($q, "แก้ไขข้อความสำเร็จ"); + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + fecthlistprofile(retireld.value); + closemodalEditReport(); + }); + }, + "ยืนยันการแก้ไขข้อมูล", + "ต้องการยืนยันการแก้ไขข้อมูลนี้หรือไม่ ?" + ); +}; +const openmodalEditReport = () => { + modalEdit.value = true; +}; +const closemodalEditReport = () => { + modalEdit.value = false; +}; + const paging = ref(true); const pagination = ref({ sortBy: "order", @@ -427,9 +462,22 @@ const paginationLabel = (start: number, end: number, total: number) => { - + + + + แก้ไข มติ อ.ก.ก. + + { + +