fix bug
This commit is contained in:
parent
a34a6f96c2
commit
8cfda78cb0
3 changed files with 32 additions and 15 deletions
|
|
@ -145,16 +145,16 @@ async function fetchListTimeRecord() {
|
|||
checkInDate: e.checkInDate ? date2Thai(e.checkInDate) : "-",
|
||||
checkInTime: e.checkInTime,
|
||||
checkInLocation: e.checkInLocation,
|
||||
checkInLat: e.checkInLat,
|
||||
checkInLon: e.checkInLon,
|
||||
checkInLat: e.checkInLat ? e.checkInLat : "",
|
||||
checkInLon: e.checkInLon ? e.checkInLon : "",
|
||||
checkInStatus: e.checkInStatus
|
||||
? workStore.convertSatatus(e.checkInStatus)
|
||||
: "-",
|
||||
checkOutDate: e.checkOutDate ? date2Thai(e.checkOutDate) : "-",
|
||||
checkOutLocation: e.checkOutLocation ? e.checkOutLocation : "-",
|
||||
checkOutTime: e.checkOutTime ? e.checkOutTime : "-",
|
||||
checkOutLat: e.checkOutLocation ? e.checkOutLat : "",
|
||||
checkOutLon: e.checkOutLocation ? e.checkOutLon : "",
|
||||
checkOutLat: e.checkOutLat ? e.checkOutLat : "",
|
||||
checkOutLon: e.checkOutLat ? e.checkOutLon : "",
|
||||
checkOutStatus: e.checkOutStatus
|
||||
? workStore.convertSatatus(e.checkOutStatus)
|
||||
: "-",
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ const formData = reactive<dataRowRound>({
|
|||
checkIn: "",
|
||||
checkOut: "",
|
||||
note: "",
|
||||
checkInStatus: "",
|
||||
checkOutStatus: "",
|
||||
checkInStatus: "NORMAL",
|
||||
checkOutStatus: "NORMAL",
|
||||
checkInEdit: false,
|
||||
checkOutEdit: false,
|
||||
});
|
||||
|
|
@ -95,8 +95,8 @@ async function approveData() {
|
|||
const body = {
|
||||
checkInTime: formData.checkIn,
|
||||
checkOutTime: formData.checkOut,
|
||||
checkInStatus: SpecialTimeStore.checkInStatus,
|
||||
checkOutStatus: SpecialTimeStore.checkOutStatus,
|
||||
checkInStatus: formData.checkInStatus,
|
||||
checkOutStatus: formData.checkOutStatus,
|
||||
reason: formData.note,
|
||||
};
|
||||
await http
|
||||
|
|
@ -123,14 +123,29 @@ function close() {
|
|||
watch(
|
||||
() => props.modal,
|
||||
() => {
|
||||
console.log("props===>", props);
|
||||
if (props.editCheck === "APPROVE") {
|
||||
formData.checkIn = "";
|
||||
formData.checkOut = "";
|
||||
formData.note = "";
|
||||
} else if (props.editCheck === "PENDING") {
|
||||
if (props.detailData) {
|
||||
formData.checkIn = props.detailData.checkIn;
|
||||
formData.checkOut = props.detailData.checkOut;
|
||||
if (props.detailData.checkInEdit) {
|
||||
formData.checkIn = props.detailData.startTimeMorning;
|
||||
formData.checkOut = props.detailData.endTimeAfternoon;
|
||||
} else if (
|
||||
props.detailData.checkInEdit &&
|
||||
!props.detailData.checkOutEdit
|
||||
) {
|
||||
formData.checkIn = props.detailData.startTimeMorning;
|
||||
formData.checkOut = props.detailData.endTimeMorning;
|
||||
} else if (
|
||||
!props.detailData.checkInEdit &&
|
||||
props.detailData.checkOutEdit
|
||||
) {
|
||||
formData.checkIn = props.detailData.startAfternoon;
|
||||
formData.checkOut = props.detailData.endTimeAfternoon;
|
||||
}
|
||||
formData.note = props.detailData.note;
|
||||
formData.checkInEdit = props.detailData.checkInEdit;
|
||||
formData.checkOutEdit = props.detailData.checkOutEdit;
|
||||
|
|
@ -142,7 +157,7 @@ watch(
|
|||
|
||||
<template>
|
||||
<q-dialog v-model="props.modal" persistent>
|
||||
<q-card style="min-width: 350px" class="bg-grey-11">
|
||||
<q-card style="width: 350px" class="bg-grey-11">
|
||||
<form @submit.prevent="validateForm">
|
||||
<DialogHeader
|
||||
:tittle="
|
||||
|
|
@ -216,7 +231,7 @@ watch(
|
|||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-if="formData.checkInEdit"
|
||||
v-if="formData.checkInEdit"
|
||||
class="col q-ma-md q-pa-sm bg-white border-custom text-weight-medium"
|
||||
>
|
||||
<p style="color: #06884d; font-size: 16px">สถานะช่วงเช้า</p>
|
||||
|
|
@ -231,7 +246,7 @@ watch(
|
|||
outlined
|
||||
full-width
|
||||
dense
|
||||
v-model="SpecialTimeStore.checkInStatus"
|
||||
v-model="formData.checkInStatus"
|
||||
:options="SpecialTimeStore.optionStatus"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
|
|
@ -243,7 +258,7 @@ watch(
|
|||
</div>
|
||||
|
||||
<div
|
||||
v-if="formData.checkOutEdit"
|
||||
v-if="formData.checkOutEdit"
|
||||
class="col q-ma-md q-pa-sm bg-white border-custom text-weight-medium"
|
||||
>
|
||||
<p style="color: #06884d; font-size: 16px">สถานะช่วงบ่าย</p>
|
||||
|
|
@ -261,7 +276,7 @@ watch(
|
|||
:rules="[(val) => !!val || 'กรุณาเลือกสถานะช่วงบ่าย']"
|
||||
hide-bottom-space
|
||||
full-width
|
||||
v-model="SpecialTimeStore.checkOutStatus"
|
||||
v-model="formData.checkOutStatus"
|
||||
:options="SpecialTimeStore.optionStatus"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue