fix(03): employee drawer info checkup
This commit is contained in:
parent
de83675db4
commit
c39b6a69a3
4 changed files with 44 additions and 22 deletions
|
|
@ -10,10 +10,13 @@ import { EmployeeCheckupCreate } from 'src/stores/employee/types';
|
|||
import { useI18n } from 'vue-i18n';
|
||||
import { checkTabBeforeAdd, selectFilterOptionRefMod } from 'src/stores/utils';
|
||||
import { QSelect } from 'quasar';
|
||||
|
||||
import SaveButton from 'src/components/button/SaveButton.vue';
|
||||
import EditButton from 'src/components/button/EditButton.vue';
|
||||
import DeleteButton from 'src/components/button/DeleteButton.vue';
|
||||
import {
|
||||
AddButton,
|
||||
EditButton,
|
||||
DeleteButton,
|
||||
SaveButton,
|
||||
UndoButton,
|
||||
} from 'src/components/button';
|
||||
|
||||
const { locale } = useI18n();
|
||||
const adrressStore = useAddressStore();
|
||||
|
|
@ -63,6 +66,7 @@ defineEmits<{
|
|||
(e: 'save', index: number): void;
|
||||
(e: 'edit', index: number): void;
|
||||
(e: 'delete', index: number): void;
|
||||
(e: 'undo'): void;
|
||||
}>();
|
||||
|
||||
async function fetchProvince() {
|
||||
|
|
@ -143,25 +147,22 @@ const insuranceCompanyFilter = selectFilterOptionRefMod(
|
|||
|
||||
<template>
|
||||
<div class="row col-12">
|
||||
<div class="col-12 q-pb-sm text-weight-bold text-body1">
|
||||
<div class="col-12 q-pb-sm text-weight-bold text-body1 row items-center">
|
||||
<q-icon
|
||||
flat
|
||||
size="xs"
|
||||
class="q-pa-sm rounded q-mr-xs"
|
||||
class="q-pa-sm rounded q-mr-sm"
|
||||
color="info"
|
||||
name="mdi-hospital-box"
|
||||
style="background-color: var(--surface-3)"
|
||||
/>
|
||||
{{ $t(`formDialogTitleHealthCheck`) }}
|
||||
<q-btn
|
||||
rounded
|
||||
color="primary"
|
||||
class="q-ml-md"
|
||||
icon="mdi-plus"
|
||||
flat
|
||||
dense
|
||||
@click="addCheckup"
|
||||
<AddButton
|
||||
v-if="!readonly"
|
||||
id="btn-add-bank"
|
||||
icon-only
|
||||
class="q-ml-sm"
|
||||
@click="addCheckup"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
@ -180,19 +181,30 @@ const insuranceCompanyFilter = selectFilterOptionRefMod(
|
|||
<span class="col-12 flex justify-between items-center">
|
||||
{{ `ครั้งที่ ${index + 1}` }}
|
||||
<div class="row items-center">
|
||||
<UndoButton
|
||||
v-if="!readonly"
|
||||
id="btn-info-health-undo"
|
||||
icon-only
|
||||
@click="$emit('undo')"
|
||||
type="button"
|
||||
/>
|
||||
<SaveButton
|
||||
icon-only
|
||||
id="btn-info-health-save"
|
||||
v-if="!readonly && !checkup.statusSave"
|
||||
@click="$emit('save', index)"
|
||||
/>
|
||||
|
||||
<EditButton
|
||||
v-if="!readonly && checkup.statusSave"
|
||||
icon-only
|
||||
id="btn-info-health-edit"
|
||||
v-if="readonly"
|
||||
@click="$emit('edit', index)"
|
||||
type="button"
|
||||
/>
|
||||
|
||||
<DeleteButton
|
||||
v-if="!readonly && checkup.statusSave"
|
||||
icon-only
|
||||
id="btn-info-health-delete"
|
||||
v-if="readonly"
|
||||
@click="$emit('delete', index)"
|
||||
type="button"
|
||||
/>
|
||||
|
|
@ -220,7 +232,7 @@ const insuranceCompanyFilter = selectFilterOptionRefMod(
|
|||
class="col-5"
|
||||
:label="$t('formDialogInputCheckupRes')"
|
||||
v-model="checkup.checkupResult"
|
||||
:rules="[(val) => !!val || $t('formDialogInputCheckupResRequired')]"
|
||||
:rules="[(val) => !!val || $t('formDialogInputCheckupResValidate')]"
|
||||
/>
|
||||
<q-select
|
||||
outlined
|
||||
|
|
|
|||
|
|
@ -144,6 +144,8 @@ export default {
|
|||
workHistory: 'Work History',
|
||||
other: 'Other',
|
||||
|
||||
formDialogInputCheckupResValidate: 'Please Enter Health Checkup Results',
|
||||
|
||||
formDialogInputOwnerName: 'Employer Name',
|
||||
formDialogInputJobPosition: 'Job Position',
|
||||
formDialogInputJobType: 'Job Type',
|
||||
|
|
|
|||
|
|
@ -144,6 +144,8 @@ export default {
|
|||
workHistory: 'ประวัติการทำงาน',
|
||||
other: 'อื่นๆ',
|
||||
|
||||
formDialogInputCheckupResValidate: 'กรุณากรอกผลการตรวจสุขภาพ',
|
||||
|
||||
formDialogInputOwnerName: 'ชื่อนายจ้าง',
|
||||
formDialogInputJobPosition: 'ตำแหน่งงาน',
|
||||
formDialogInputJobType: 'ลักษณะงาน',
|
||||
|
|
|
|||
|
|
@ -460,9 +460,17 @@ export const useEmployeeForm = defineStore('form-employee', () => {
|
|||
].statusSave = true;
|
||||
}
|
||||
} else {
|
||||
const data =
|
||||
currentFromDataEmployee.value.employeeCheckup[state.value.currentIndex];
|
||||
delete data['createdAt'];
|
||||
delete data['createdByUserId'];
|
||||
delete data['employeeId'];
|
||||
delete data['updatedAt'];
|
||||
delete data['updatedByUserId'];
|
||||
|
||||
const res = await employeeStore.editByIdEmployeeCheckup(
|
||||
state.value.currentEmployee?.id || '',
|
||||
currentFromDataEmployee.value.employeeCheckup[state.value.currentIndex],
|
||||
data,
|
||||
);
|
||||
|
||||
if (res) {
|
||||
|
|
@ -577,8 +585,6 @@ export const useEmployeeForm = defineStore('form-employee', () => {
|
|||
? (state.value.profileSubmit = true)
|
||||
: (state.value.profileSubmit = false);
|
||||
|
||||
state.value.isEmployeeEdit = true;
|
||||
|
||||
state.value.formDataEmployeeOwner = { ...foundBranch };
|
||||
|
||||
if (foundBranch.address === playlond.address) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue