fix === > แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย ทุกระบบ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-11-29 14:28:21 +07:00
parent bcd5d1d56c
commit d9bb320b16
17 changed files with 514 additions and 348 deletions

View file

@ -10,6 +10,7 @@ import http from "@/plugins/http";
import config from "@/app.config";
import genReport from "@/plugins/genreport";
import type { QForm } from "quasar";
import type { QTableProps } from "quasar";
import type { DataProfile } from "@/modules/05_placement/interface/index/Main";
import type {
@ -34,6 +35,7 @@ const {
dialogConfirm,
} = mixin;
const myForm = ref<QForm | null>(null);
const transferId = ref<string>(route.params.id as string); //Id
const roleAdmin = ref<boolean>(false); //admin
const edit = ref<boolean>(false); //
@ -169,8 +171,7 @@ async function getData() {
rows.value = list;
responseData.value.profileId = data.profileId;
responseData.value.createdAt = data.createdAt;
responseData.value.date =
data.date !== null ? new Date(data.date) : new Date();
responseData.value.date = data.date !== null ? new Date(data.date) : null;
responseData.value.id = data.id ?? "";
responseData.value.organization = data.organization ?? "";
responseData.value.organizationPositionOld =
@ -182,7 +183,7 @@ async function getData() {
responseData.value.salary = data.salary !== null ? data.salary : 0;
responseData.value.status = data.status ?? "";
responseData.value.avataPath = data.avataPath ?? "";
responseData.value.fullname = `${data.firstName ?? "-"} ${
responseData.value.fullname = `${data.prefix}${data.firstName ?? "-"} ${
data.lastName ?? "-"
}`;
@ -227,15 +228,11 @@ async function fileDownload(no: number, type: string, fileName: string) {
/** ฟังก์ชันยืนยันการส่งคำร้องไปยัง สกจ.*/
async function onUpdateStatus() {
// dialogConfirm(
// $q,
// async () => {
showLoader();
await http
.get(config.API.transferConfirmId(transferId.value))
.then(async () => {
await getData();
// success($q, "");
})
.catch((e) => {
messageError($q, e);
@ -243,10 +240,6 @@ async function onUpdateStatus() {
.finally(async () => {
hideLoader();
});
// },
// " ?",
// " "
// );
}
/** ฟังก์ชันยืนยันการบันทึกการแก้ไขข้อมูล*/
@ -286,8 +279,19 @@ function onSubmit() {
/** ฟังก์ชันปิดการแก้ไขข้อมูล*/
async function cancel() {
await getData();
edit.value = false;
const data = responseData.value;
if (data) {
organizationPositionOld.value = data.organizationPositionOld ?? "";
positionTypeOld.value = data.positionTypeOld ?? "";
positionLevelOld.value = data.positionLevelOld ?? "";
posNo.value = data.positionNumberOld ?? "";
salary.value = data.salary ?? 0;
organization.value = data.organization ?? "";
date.value = data.date !== null ? new Date(data.date) : null;
reason.value = data.reason ?? "";
}
myForm.value?.resetValidation();
}
/**
@ -328,7 +332,7 @@ onMounted(async () => {
class="q-mr-sm"
@click="router.push(`/placement/transfer`)"
/>
รายละเอยดการขอโอนของ{{ responseData.fullname }}
รายละเอยดการขอโอน {{ responseData.fullname }}
</div>
<!-- รายละเอยดการ -->
@ -470,6 +474,7 @@ onMounted(async () => {
<!-- แกไขขอมลเพอลงบญชแนบทาย -->
<q-card bordered class="row col-12">
<q-form
ref="myForm"
class="col-12"
greedy
@submit.prevent
@ -537,7 +542,7 @@ onMounted(async () => {
:readonly="!edit"
:borderless="!edit"
v-model="organizationPositionOld"
:rules="[(val:string) => !!val || `${'กรุณากรอกตำแหน่ง/สังกัด'}`]"
:rules="edit ? [(val:string) => !!val || `${'กรุณากรอกตำแหน่ง/สังกัด'}`]:[]"
hide-bottom-space
:label="`${'ตำแหน่ง/สังกัด'}`"
type="textarea"
@ -555,7 +560,7 @@ onMounted(async () => {
:readonly="!edit"
:borderless="!edit"
v-model="positionTypeOld"
:rules="[(val:string) => !!val || `${'กรุณากรอกประเภทตำแหน่ง'}`]"
:rules="edit ? [(val:string) => !!val || `${'กรุณากรอกประเภทตำแหน่ง'}`]:[]"
hide-bottom-space
:label="`${'ประเภทตำแหน่ง'}`"
/>
@ -569,7 +574,7 @@ onMounted(async () => {
:readonly="!edit"
:borderless="!edit"
v-model="positionLevelOld"
:rules="[(val:string) => !!val || `${'กรุณากรอกระดับตำแหน่ง'}`]"
:rules="edit ? [(val:string) => !!val || `${'กรุณากรอกระดับตำแหน่ง'}`]:[]"
hide-bottom-space
:label="`${'ระดับตำแหน่ง'}`"
/>
@ -583,27 +588,11 @@ onMounted(async () => {
:readonly="!edit"
:borderless="!edit"
v-model="posNo"
:rules="[(val:string) => !!val || `${'กรุณากรอกเลขที่'}`]"
:rules="edit? [(val:string) => !!val || `${'กรุณากรอกเลขที่'}`]:[]"
hide-bottom-space
:label="`${'เลขที่'}`"
/>
</div>
<!-- <div class="col-xs-6 col-sm-3">
<q-input
:class="getClass(edit)"
:outlined="edit"
v-model="salary"
dense
:readonly="!edit"
:borderless="!edit"
hide-bottom-space
:label="`${'เงินเดือน'}`"
:rules="[(val:number) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
lazy-rules
mask="###,###,###,###"
reverse-fill-mask
/>
</div> -->
</div>
</div>
@ -620,7 +609,7 @@ onMounted(async () => {
:readonly="!edit"
:borderless="!edit"
v-model="organization"
:rules="[(val:string) => !!val || `${'กรุณากรอกโอนไปสังกัด'}`]"
:rules="edit ? [(val:string) => !!val || `${'กรุณากรอกโอนไปสังกัด'}`]:[]"
hide-bottom-space
:label="`${'โอนไปสังกัด'}`"
/>
@ -647,7 +636,7 @@ onMounted(async () => {
:borderless="!edit"
:readonly="!edit"
:model-value="date !== null ? date2Thai(date) : null"
:rules="[(val:string) => !!val || `${'กรุณาเลือกตั้งแต่วัน'}`]"
:rules="edit ?[(val:string) => !!val || `${'กรุณาเลือกตั้งแต่วัน'}`]:[]"
hide-bottom-space
:label="`${'ตั้งแต่วัน'}`"
>