refactor(UI work-list): display column time
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
parent
8a1fb4f9ed
commit
8d5384c1d3
4 changed files with 46 additions and 26 deletions
|
|
@ -268,7 +268,11 @@ watch(
|
|||
<div class="row">
|
||||
<div class="col text-grey-8">เวลาเข้างาน</div>
|
||||
<div class="col">
|
||||
{{ `${formData.checkInDate} ${formData.checkInTime} น.` }}
|
||||
{{
|
||||
formData.checkInDate
|
||||
? `${formData.checkInDate} ${formData.checkInTime} น.`
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
|
@ -341,14 +345,16 @@ watch(
|
|||
<div class="col text-grey-8">เวลาออกงาน</div>
|
||||
<div class="col">
|
||||
{{
|
||||
`${formData.checkOutDate} ${formData.checkOutTime} น.`
|
||||
formData.checkOutDate
|
||||
? `${formData.checkOutDate} ${formData.checkOutTime} น.`
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col text-grey-8">สถานที่ทำงาน</div>
|
||||
<div class="col" v-if="formData.isLocationCheckOut">
|
||||
ในสถานที่
|
||||
{{ formData.checkOutLat ? "ในสถานที่" : "-" }}
|
||||
</div>
|
||||
<div class="col" v-else>
|
||||
{{
|
||||
|
|
|
|||
|
|
@ -75,7 +75,10 @@ const columns = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format(val, row) {
|
||||
return `${row.checkInDate} ${val} น.`;
|
||||
if (row.checkInDate && val) {
|
||||
return `${row.checkInDate} ${val} น.`;
|
||||
}
|
||||
return "-";
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
@ -105,7 +108,10 @@ const columns = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format(val, row) {
|
||||
return `${row.checkOutDate} ${val} น.`;
|
||||
if (row.checkOutDate && val) {
|
||||
return `${row.checkOutDate} ${val} น.`;
|
||||
}
|
||||
return "-";
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
@ -166,19 +172,19 @@ async function fetchListTimeRecord() {
|
|||
id: e.id,
|
||||
fullName: e.fullName,
|
||||
profileType: e.profileType,
|
||||
checkInDate: e.checkInDate ? date2Thai(e.checkInDate) : "-",
|
||||
checkInDate: date2Thai(e.checkInDate),
|
||||
checkInTime: e.checkInTime,
|
||||
checkInLocation: e.checkInLocation,
|
||||
checkInLat: e.checkInLat ? e.checkInLat : "",
|
||||
checkInLon: e.checkInLon ? e.checkInLon : "",
|
||||
checkInLat: e.checkInLat,
|
||||
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.checkOutLat ? e.checkOutLat : "",
|
||||
checkOutLon: e.checkOutLat ? e.checkOutLon : "",
|
||||
checkOutDate: date2Thai(e.checkOutDate),
|
||||
checkOutLocation: e.checkOutLocation,
|
||||
checkOutTime: e.checkOutTime,
|
||||
checkOutLat: e.checkOutLat,
|
||||
checkOutLon: e.checkOutLon,
|
||||
checkOutStatus: e.checkOutStatus
|
||||
? workStore.convertSatatus(e.checkOutStatus)
|
||||
: "-",
|
||||
|
|
|
|||
|
|
@ -71,7 +71,10 @@ const columns = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format(val, row) {
|
||||
return `${row.checkInDate} ${val} น.`;
|
||||
if (row.checkInDate && val) {
|
||||
return `${row.checkInDate} ${val} น.`;
|
||||
}
|
||||
return "-";
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
@ -92,7 +95,10 @@ const columns = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format(val, row) {
|
||||
return `${row.checkOutDate} ${val} น.`;
|
||||
if (row.checkOutDate && val) {
|
||||
return `${row.checkOutDate} ${val} น.`;
|
||||
}
|
||||
return "-";
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
@ -139,15 +145,15 @@ async function fetchListLogRecord() {
|
|||
profileType: e.profileType,
|
||||
fullName: e.fullName,
|
||||
checkInDate: e.checkInDate && date2Thai(e.checkInDate),
|
||||
checkInTime: e.checkInTime ? e.checkInTime : "-",
|
||||
checkInLocation: e.checkInLocation ? e.checkInLocation : "-",
|
||||
checkInLat: e.checkInLat ? e.checkInLat : "",
|
||||
checkInLon: e.checkInLon ? e.checkInLon : "",
|
||||
checkInTime: e.checkInTime,
|
||||
checkInLocation: e.checkInLocation,
|
||||
checkInLat: e.checkInLat,
|
||||
checkInLon: e.checkInLon,
|
||||
checkOutDate: e.checkOutDate && date2Thai(e.checkOutDate),
|
||||
checkOutLocation: e.checkOutLocation ? e.checkOutLocation : "-",
|
||||
checkOutTime: e.checkOutTime ? e.checkOutTime : "-",
|
||||
checkOutLat: e.checkOutLat ? e.checkOutLat : "",
|
||||
checkOutLon: e.checkOutLon ? e.checkOutLon : "",
|
||||
checkOutLocation: e.checkOutLocation,
|
||||
checkOutTime: e.checkOutTime,
|
||||
checkOutLat: e.checkOutLat,
|
||||
checkOutLon: e.checkOutLon,
|
||||
}));
|
||||
} else {
|
||||
rows.value = [];
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ onMounted(() => {
|
|||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'checkInLocation'">
|
||||
<q-item style="padding: 0">
|
||||
<q-item style="padding: 0" v-if="props.row.checkInLocation">
|
||||
<q-item-section>
|
||||
<q-item-label> {{ props.row.checkInLocation }}</q-item-label>
|
||||
<q-item-label caption lines="2">{{
|
||||
|
|
@ -131,9 +131,10 @@ onMounted(() => {
|
|||
}}</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<div v-else>-</div>
|
||||
</div>
|
||||
<div v-else-if="col.name == 'checkOutLocation'">
|
||||
<q-item style="padding: 0">
|
||||
<q-item style="padding: 0" v-if="props.row.checkOutLocation">
|
||||
<q-item-section>
|
||||
<q-item-label> {{ props.row.checkOutLocation }}</q-item-label>
|
||||
<q-item-label caption lines="2">{{
|
||||
|
|
@ -141,6 +142,7 @@ onMounted(() => {
|
|||
}}</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<div v-else>-</div>
|
||||
</div>
|
||||
<div v-else-if="col.name == 'profileType'">
|
||||
{{
|
||||
|
|
@ -150,7 +152,7 @@ onMounted(() => {
|
|||
}}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue