Merge branch 'develop' of github.com:Frappet/bma-ehr-frontend into me
This commit is contained in:
commit
98bcbe1bb1
22 changed files with 1510 additions and 926 deletions
|
|
@ -383,38 +383,104 @@
|
|||
</q-dialog>
|
||||
<!-- Dialog แนบใบมรณบัตร -->
|
||||
<q-dialog v-model="dialogPassaway" persistent>
|
||||
<q-card style="width: 100vw; max-width: 60vw">
|
||||
<q-card-section class="q-py-sm row">
|
||||
<div class="text-h6">แนบใบมรณบัตร</div>
|
||||
<q-space />
|
||||
<q-btn
|
||||
icon="close"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
@click="closePassaway"
|
||||
style="color: #ff8080; background-color: #ffdede"
|
||||
>
|
||||
<q-tooltip>ปิดหน้านี้</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-file
|
||||
class="col-xs-12 col-sm-12"
|
||||
outlined
|
||||
dense
|
||||
v-model="filePassaway"
|
||||
label="แนบใบมรณบัตร"
|
||||
hide-bottom-space
|
||||
lazy-rules
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
</q-file>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
<div class="col-12">
|
||||
<q-card style="width: 100vw; max-width: 60vw">
|
||||
<q-form ref="myForm">
|
||||
<q-card-section class="q-py-sm row">
|
||||
<DialogHeader tittle="ถึงแก่กรรม" :close="closePassaway" />
|
||||
<div class="col-12 row q-pa-sm q-col-gutter-sm">
|
||||
<q-file
|
||||
class="col-12 col-sm-6 col-md-5"
|
||||
outlined
|
||||
dense
|
||||
v-model="filePassaway"
|
||||
label="แนบใบมรณบัตร"
|
||||
hide-bottom-space
|
||||
lazy-rules
|
||||
>
|
||||
<q-separator />
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
</q-file>
|
||||
<q-input
|
||||
class="col-12 col-sm-6 col-md-7"
|
||||
dense
|
||||
outlined
|
||||
v-model="deathCertificateNo"
|
||||
label="เลขที่ใบมรณบัตร"
|
||||
/>
|
||||
|
||||
<datepicker
|
||||
class="col-12 col-sm-6 col-md-5"
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateDeath"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
<template #year-overlay-value="{ value }">
|
||||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker"
|
||||
:model-value="
|
||||
dateDeath != null ? date2Thai(dateDeath) : null
|
||||
"
|
||||
:label="`${'วันที่เสียชีวิต'}`"
|
||||
:rules="[
|
||||
(val) => !!val || `${'กรุณาเลือกวันที่เสียชีวิต'}`,
|
||||
]"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
|
||||
<q-input
|
||||
class="col-12 col-sm-6 col-md-7"
|
||||
dense
|
||||
outlined
|
||||
v-model="placeDeathCertificate"
|
||||
label="สถานที่ออกใบมรณบัตร"
|
||||
/>
|
||||
<q-separator />
|
||||
<q-input
|
||||
class="col-12"
|
||||
dense
|
||||
outlined
|
||||
v-model="reasonDeath"
|
||||
label="เหตุผลการเสีบชีวิต"
|
||||
type="textarea"
|
||||
/>
|
||||
</div>
|
||||
<q-space />
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<DialogFooter
|
||||
:save="clickSave"
|
||||
:validate="validateData"
|
||||
v-model:editvisible="edit"
|
||||
v-model:modalEdit="modalEdit"
|
||||
/>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</div>
|
||||
</q-dialog>
|
||||
<!-- Dialog เลือก เกษียณ -->
|
||||
<q-dialog v-model="dialogLeave" persistent>
|
||||
|
|
@ -579,8 +645,10 @@ import { ref, onMounted } from "vue";
|
|||
import { useDataStore } from "@/stores/data";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useQuasar, QForm } from "quasar";
|
||||
import EducationVue from "@/modules/04_registry/components/Education.vue";
|
||||
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
|
||||
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
|
||||
import TrainVue from "@/modules/04_registry/components/Train.vue";
|
||||
import InsigniaVue from "@/modules/04_registry/components/Insignia.vue";
|
||||
import CoinedVue from "@/modules/04_registry/components/Coin.vue";
|
||||
|
|
@ -608,6 +676,9 @@ import config from "@/app.config";
|
|||
const $q = useQuasar();
|
||||
const store = useDataStore();
|
||||
const { changeTab, loaderPage } = store;
|
||||
const reasonDeath = ref("");
|
||||
const deathCertificateNo = ref("");
|
||||
const placeDeathCertificate = ref("");
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, dateToISO, messageError, dialogMessage, success } = mixin;
|
||||
const route = useRoute();
|
||||
|
|
@ -616,12 +687,7 @@ const imageUrl = ref<any>(null);
|
|||
const inputImage = ref<any>(null);
|
||||
const fullname = ref<string>("");
|
||||
const position = ref<string>("นักจัดการงานทั่วไป");
|
||||
const pdfSrc = ref<string>("");
|
||||
const pdfCurrentPage = ref<number>();
|
||||
const pdfTotalPage = ref<number>();
|
||||
const pdfSrcShort = ref<string>("");
|
||||
const pdfCurrentPageShort = ref<number>();
|
||||
const pdfTotalPageShort = ref<number>();
|
||||
const dateDeath = ref<Date>(new Date());
|
||||
const dialog = ref<boolean>(false);
|
||||
const dialogShort = ref<boolean>(false);
|
||||
const dialogLeave = ref<boolean>(false);
|
||||
|
|
@ -632,6 +698,11 @@ const statusEdit = ref<boolean>(false);
|
|||
const activeImage = ref<any | null>(null);
|
||||
const filePassaway = ref(null);
|
||||
const images = ref<any>([]);
|
||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||
const myForm = ref<QForm | null>(null); //form data input
|
||||
const edit = ref<boolean>(false); //เช็คการกดปุ่มแก้ไขใน dialog
|
||||
const modal = ref<boolean>(false); //modal add detail
|
||||
const modalEdit = ref<boolean>(false); //modal ที่แสดงใช้สำหรับแก้ไขหรือไม่
|
||||
const profileId = ref<string>(route.params.id.toString());
|
||||
const profileType = ref<string>("");
|
||||
const employeeClass = ref<string>("temp");
|
||||
|
|
@ -918,6 +989,99 @@ const clickKp7 = async () => {
|
|||
// });
|
||||
};
|
||||
|
||||
/**
|
||||
* กดบันทึกใน dialog
|
||||
*/
|
||||
const clickSave = async () => {
|
||||
myForm.value!.validate().then(async (result: boolean) => {
|
||||
if (result) {
|
||||
if (modalEdit.value) {
|
||||
await editData();
|
||||
} else {
|
||||
await saveData();
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* บันทึกแก้ไขข้อมูล
|
||||
*/
|
||||
const editData = async () => {
|
||||
// modal.value = false;
|
||||
// loaderPage(true);
|
||||
// await http
|
||||
// .put(config.API.getPositionMasterId(positionMasterId.value), {
|
||||
// positionMasterId: positionMasterId.value,
|
||||
// positionTypeId: positionTypeId.value,
|
||||
// positionLineId: positionLineId.value,
|
||||
// positionPathId: positionPathId.value,
|
||||
// positionPathSideId: positionPathSideId.value,
|
||||
// positionExecutiveId: positionExecutiveId.value,
|
||||
// positionExecutiveSideId: positionExecutiveSideId.value,
|
||||
// positionLevelId: positionLevelId.value,
|
||||
// isDirector: isDirector.value,
|
||||
// positionStatusId: positionStatusId.value,
|
||||
// qualification: qualification.value,
|
||||
// positionCondition: positionCondition.value,
|
||||
// positionMasterUserNote: positionMasterUserNote.value,
|
||||
// })
|
||||
// .then((res) => {
|
||||
// success($q, "บันทึกข้อมูลร่างสำเร็จ");
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// statusCode.value = e.response.data.status;
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// edit.value = false;
|
||||
// await fetchData();
|
||||
// });
|
||||
};
|
||||
|
||||
/**
|
||||
* บันทึกเพิ่มข้อมูล
|
||||
*/
|
||||
const saveData = async () => {
|
||||
// modal.value = false;
|
||||
// loaderPage(true);
|
||||
// await http
|
||||
// .post(config.API.getPositionMaster, {
|
||||
// positionTypeId: positionTypeId.value,
|
||||
// positionLineId: positionLineId.value,
|
||||
// positionPathId: positionPathId.value,
|
||||
// positionPathSideId: positionPathSideId.value,
|
||||
// positionExecutiveId: positionExecutiveId.value,
|
||||
// positionExecutiveSideId: positionExecutiveSideId.value,
|
||||
// positionLevelId: positionLevelId.value,
|
||||
// isDirector: isDirector.value,
|
||||
// positionStatusId: positionStatusId.value,
|
||||
// qualification: qualification.value,
|
||||
// positionCondition: positionCondition.value,
|
||||
// positionMasterUserNote: positionMasterUserNote.value,
|
||||
// })
|
||||
// .then((res) => {
|
||||
// success($q, "บันทึกข้อมูลร่างสำเร็จ");
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// statusCode.value = e.response.data.status;
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// modal.value = false;
|
||||
// await fetchData();
|
||||
// });
|
||||
};
|
||||
|
||||
/**
|
||||
* validate input ใน dialog
|
||||
*/
|
||||
const validateData = async () => {
|
||||
checkValidate.value = true;
|
||||
await myForm.value!.validate().then((result: boolean) => {
|
||||
if (result == false) {
|
||||
checkValidate.value = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
const downloadFilePDF = async (res: string, fileName: string) => {
|
||||
const link = document.createElement("a");
|
||||
// link.href = window.URL.createObjectURL(new Blob([res]));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue