forked from verdnatura/salix-front
WorkerTimeForm set initial data
This commit is contained in:
parent
772959ff81
commit
026588c03d
|
@ -49,7 +49,8 @@ const weekTotalHours = ref(null);
|
||||||
const workerTimeControlMails = ref([]);
|
const workerTimeControlMails = ref([]);
|
||||||
const workerTimeFormProps = reactive({
|
const workerTimeFormProps = reactive({
|
||||||
dated: null,
|
dated: null,
|
||||||
formType: null,
|
entryId: null,
|
||||||
|
entryCode: null,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Array utilizado por QCalendar para seleccionar un rango de fechas
|
// Array utilizado por QCalendar para seleccionar un rango de fechas
|
||||||
|
@ -357,7 +358,8 @@ const getMailStates = async (date) => {
|
||||||
const showWorkerTimeForm = (propValue, formType) => {
|
const showWorkerTimeForm = (propValue, formType) => {
|
||||||
const isEditForm = formType === 'edit';
|
const isEditForm = formType === 'edit';
|
||||||
|
|
||||||
workerTimeFormProps.entryId = isEditForm ? propValue : null;
|
workerTimeFormProps.entryId = isEditForm ? propValue.id : null;
|
||||||
|
workerTimeFormProps.entryCode = isEditForm ? propValue.entryCode : null;
|
||||||
workerTimeFormProps.dated = isEditForm ? null : propValue;
|
workerTimeFormProps.dated = isEditForm ? null : propValue;
|
||||||
|
|
||||||
workerTimeFormDialogRef.value.show();
|
workerTimeFormDialogRef.value.show();
|
||||||
|
@ -556,7 +558,10 @@ onMounted(async () => {
|
||||||
:id="hour.id"
|
:id="hour.id"
|
||||||
@on-hour-entry-deleted="updateData()"
|
@on-hour-entry-deleted="updateData()"
|
||||||
@show-worker-time-form="
|
@show-worker-time-form="
|
||||||
showWorkerTimeForm(hour.id, 'edit')
|
showWorkerTimeForm(
|
||||||
|
{ id: hour.id, entryCode: hour.direction },
|
||||||
|
'edit'
|
||||||
|
)
|
||||||
"
|
"
|
||||||
class="hour-chip"
|
class="hour-chip"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -12,6 +12,10 @@ const $props = defineProps({
|
||||||
type: Number,
|
type: Number,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
entryCode: {
|
||||||
|
type: String,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
dated: {
|
dated: {
|
||||||
type: Date,
|
type: Date,
|
||||||
default: true,
|
default: true,
|
||||||
|
@ -54,7 +58,7 @@ const urlCreate = computed(() =>
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
workerHourEntry = isEditMode.value
|
workerHourEntry = isEditMode.value
|
||||||
? {}
|
? { direction: $props.entryCode }
|
||||||
: {
|
: {
|
||||||
timed: new Date($props.dated),
|
timed: new Date($props.dated),
|
||||||
workerFk: route.params.id,
|
workerFk: route.params.id,
|
||||||
|
|
Loading…
Reference in New Issue