fix(03): employee drawer info work history
This commit is contained in:
parent
c39b6a69a3
commit
b9dd21d7bd
1 changed files with 26 additions and 17 deletions
|
|
@ -4,11 +4,13 @@ import { dateFormat, parseAndFormatDate } from 'src/utils/datetime';
|
|||
import { EmployeeWorkCreate } from 'src/stores/employee/types';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { checkTabBeforeAdd, selectFilterOptionRefMod } from 'src/stores/utils';
|
||||
|
||||
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 employeeWork = defineModel<EmployeeWorkCreate[]>('employeeWork');
|
||||
|
|
@ -39,6 +41,7 @@ defineEmits<{
|
|||
(e: 'save', index: number): void;
|
||||
(e: 'edit', index: number): void;
|
||||
(e: 'delete', index: number): void;
|
||||
(e: 'undo'): void;
|
||||
}>();
|
||||
|
||||
function addData() {
|
||||
|
|
@ -99,7 +102,7 @@ const workplaceFilter = 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"
|
||||
|
|
@ -109,15 +112,12 @@ const workplaceFilter = selectFilterOptionRefMod(
|
|||
style="background-color: var(--surface-3)"
|
||||
/>
|
||||
{{ $t(`workHistory`) }}
|
||||
<q-btn
|
||||
rounded
|
||||
color="primary"
|
||||
class="q-ml-md"
|
||||
icon="mdi-plus"
|
||||
flat
|
||||
dense
|
||||
@click="addData"
|
||||
<AddButton
|
||||
v-if="!readonly"
|
||||
id="btn-add-bank"
|
||||
icon-only
|
||||
class="q-ml-sm"
|
||||
@click="addData"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
@ -136,19 +136,28 @@ const workplaceFilter = 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
|
||||
v-if="!readonly && !work.statusSave"
|
||||
@click="$emit('save', index)"
|
||||
/>
|
||||
|
||||
<EditButton
|
||||
v-if="!readonly && work.statusSave"
|
||||
icon-only
|
||||
v-if="readonly"
|
||||
@click="$emit('edit', index)"
|
||||
type="button"
|
||||
/>
|
||||
|
||||
<DeleteButton
|
||||
v-if="!readonly && work.statusSave"
|
||||
icon-only
|
||||
v-if="readonly"
|
||||
@click="$emit('delete', index)"
|
||||
type="button"
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue