fix === > แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย ทุกระบบ
This commit is contained in:
parent
bcd5d1d56c
commit
d9bb320b16
17 changed files with 514 additions and 348 deletions
|
|
@ -34,6 +34,7 @@ const {
|
|||
const myForm = ref<QForm | null>(null);
|
||||
const dataProfile = ref<DataProfile>();
|
||||
const fullname = ref<string>("");
|
||||
const mainData = ref<any>();
|
||||
|
||||
/** form แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย*/
|
||||
const organizationPositionOld = ref<string>("");
|
||||
|
|
@ -47,15 +48,14 @@ const dateRepatriation = ref<Date | null>(null);
|
|||
const reason = ref<string>("");
|
||||
const status = ref<string>("");
|
||||
|
||||
/**
|
||||
* fetch ข้อมูลรายละเอียด*
|
||||
*/
|
||||
function getData() {
|
||||
/** fetch ข้อมูลรายละเอียด*/
|
||||
async function getData() {
|
||||
showLoader();
|
||||
http
|
||||
await http
|
||||
.get(config.API.repatriationDetail(dataId))
|
||||
.then((res: ResponseData) => {
|
||||
const data = res.data.result;
|
||||
mainData.value = res.data.result;
|
||||
dataProfile.value = res.data.result as unknown as DataProfile;
|
||||
fullname.value = `${data.prefix}${data.firstName} ${data.lastName}`;
|
||||
|
||||
|
|
@ -86,7 +86,7 @@ function getData() {
|
|||
function onSubmit() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
() => {
|
||||
async () => {
|
||||
const body = {
|
||||
organizationPositionOld: organizationPositionOld.value,
|
||||
positionTypeOld: positionTypeOld.value,
|
||||
|
|
@ -99,7 +99,7 @@ function onSubmit() {
|
|||
reason: reason.value,
|
||||
};
|
||||
showLoader();
|
||||
http
|
||||
await http
|
||||
.put(config.API.repatriationMainEdit(dataId), body)
|
||||
.then(async () => {
|
||||
await getData();
|
||||
|
|
@ -123,8 +123,23 @@ function onSubmit() {
|
|||
*/
|
||||
function cancelBtn() {
|
||||
edit.value = !edit;
|
||||
const data = mainData.value;
|
||||
if (data) {
|
||||
organizationPositionOld.value = data.organizationPositionOld
|
||||
? data.organizationPositionOld
|
||||
: findOrgName(data);
|
||||
positionTypeOld.value = data.positionTypeOld;
|
||||
positionLevelOld.value = data.positionLevelOld;
|
||||
positionNumberOld.value = data.positionNumberOld;
|
||||
salary.value = data.salary;
|
||||
organization.value = data.organization;
|
||||
reason.value = data.reason;
|
||||
date.value = data.date;
|
||||
dateRepatriation.value = data.dateRepatriation;
|
||||
status.value = data.status;
|
||||
}
|
||||
myForm.value?.resetValidation();
|
||||
getData();
|
||||
// getData();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -155,7 +170,7 @@ onMounted(() => {
|
|||
class="q-mr-sm"
|
||||
@click="router.push(`/placement/repatriate`)"
|
||||
/>
|
||||
รายละเอียดการส่งตัวกลับ{{ fullname }}
|
||||
รายละเอียดการส่งตัวกลับ {{ fullname }}
|
||||
</div>
|
||||
|
||||
<CardProfile :data="dataProfile as DataProfile" />
|
||||
|
|
@ -282,24 +297,7 @@ onMounted(() => {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="col-xs-6 col-sm-3 row">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
v-model="salary"
|
||||
:outlined="edit"
|
||||
dense
|
||||
:readonly="!edit"
|
||||
hide-bottom-space
|
||||
:borderless="!edit"
|
||||
:label="`${'เงินเดือน'}`"
|
||||
:class="getClass(edit)"
|
||||
:rules="[(val:number) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
|
||||
lazy-rules
|
||||
mask="###,###,###,###"
|
||||
reverse-fill-mask
|
||||
/>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="col-xs-6 col-sm-4 row">
|
||||
<div class="col-12">
|
||||
|
|
@ -342,7 +340,7 @@ onMounted(() => {
|
|||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
:model-value="date !== null ? date2Thai(date) : null"
|
||||
:rules="[(val:string) => !!val || `${'กรุณาเลือกตั้งแต่วัน'}`]"
|
||||
:rules="edit ? [(val:string) => !!val || `${'กรุณาเลือกตั้งแต่วัน'}`]:[]"
|
||||
hide-bottom-space
|
||||
:label="`${'ตั้งแต่วัน'}`"
|
||||
>
|
||||
|
|
@ -390,9 +388,9 @@ onMounted(() => {
|
|||
? date2Thai(dateRepatriation)
|
||||
: null
|
||||
"
|
||||
:rules="[
|
||||
:rules="edit ? [
|
||||
(val:string) => !!val || `${'กรุณาเลือกวันที่ส่งตัวกลับ'}`,
|
||||
]"
|
||||
] : []"
|
||||
hide-bottom-space
|
||||
:label="`${'วันที่ส่งตัวกลับ'}`"
|
||||
>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue