ปรับ รายการลงเวลาปฏิบัติงาน
This commit is contained in:
parent
8587a85133
commit
0a65822324
5 changed files with 68 additions and 32 deletions
|
|
@ -2,15 +2,21 @@
|
||||||
import { ref, reactive, watch } from "vue";
|
import { ref, reactive, watch } from "vue";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
import type { FormDetail } from "@/modules/09_leave/interface/response/work";
|
import type { FormDetail } from "@/modules/09_leave/interface/response/work";
|
||||||
|
|
||||||
/** importStores */
|
/** importStores */
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
import { useWorklistDataStore } from "@/modules/09_leave/stores/WorkStore";
|
||||||
|
|
||||||
/** useStore */
|
/** useStore */
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { date2Thai, showLoader, hideLoader } = mixin;
|
const stores = useWorklistDataStore();
|
||||||
|
const { date2Thai, showLoader, hideLoader, messageError } = mixin;
|
||||||
|
const { convertSatatus } = stores;
|
||||||
|
|
||||||
|
const $q = useQuasar(); //ใช้ noti quasar
|
||||||
|
|
||||||
/** props จาก TableList */
|
/** props จาก TableList */
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|
@ -22,7 +28,7 @@ const props = defineProps({
|
||||||
type: Object,
|
type: Object,
|
||||||
require: true,
|
require: true,
|
||||||
},
|
},
|
||||||
colse: {
|
close: {
|
||||||
type: Function,
|
type: Function,
|
||||||
require: true,
|
require: true,
|
||||||
},
|
},
|
||||||
|
|
@ -63,9 +69,7 @@ async function fetchDetailByid(id: string) {
|
||||||
formData.checkInImg = data.checkInImg;
|
formData.checkInImg = data.checkInImg;
|
||||||
formData.checkInLat = data.checkInLat ? data.checkInLat : "";
|
formData.checkInLat = data.checkInLat ? data.checkInLat : "";
|
||||||
formData.checkInLon = data.checkInLon ? data.checkInLon : "";
|
formData.checkInLon = data.checkInLon ? data.checkInLon : "";
|
||||||
formData.checkInLocation = data.checkInLocation
|
formData.checkInLocation = data.checkInPOI ? data.checkInPOI : "-";
|
||||||
? data.checkInLocation
|
|
||||||
: "-";
|
|
||||||
formData.checkInTime = data.checkInTime ? data.checkInTime : "-";
|
formData.checkInTime = data.checkInTime ? data.checkInTime : "-";
|
||||||
formData.checkOutDate = data.checkOutDate && date2Thai(data.checkOutDate);
|
formData.checkOutDate = data.checkOutDate && date2Thai(data.checkOutDate);
|
||||||
formData.checkOutImg = data.checkOutImg;
|
formData.checkOutImg = data.checkOutImg;
|
||||||
|
|
@ -76,27 +80,32 @@ async function fetchDetailByid(id: string) {
|
||||||
: "-";
|
: "-";
|
||||||
formData.checkOutTime = data.checkOutTime ? data.checkOutTime : "-";
|
formData.checkOutTime = data.checkOutTime ? data.checkOutTime : "-";
|
||||||
formData.fullName = data.fullName;
|
formData.fullName = data.fullName;
|
||||||
formData.checkOutLocation = data.checkOutLocation
|
formData.checkOutLocation = data.checkOutPOI ? data.checkOutPOI : "-";
|
||||||
? data.checkOutLocation
|
|
||||||
: "-";
|
|
||||||
formData.checkInDescription = data.checkInDescription
|
formData.checkInDescription = data.checkInDescription
|
||||||
? data.checkInDescription
|
? data.checkInDescription
|
||||||
: "-";
|
: "-";
|
||||||
formData.checkOutDescription = data.checkOutDescription
|
formData.checkOutDescription = data.checkOutDescription
|
||||||
? data.checkOutDescription
|
? data.checkOutDescription
|
||||||
: "-";
|
: "-";
|
||||||
formData.checkInStatus = data.checkInStatus;
|
formData.checkInStatus = data.checkInStatus
|
||||||
formData.checkOutStatus = data.checkOutStatus;
|
? convertSatatus(data.checkInStatus)
|
||||||
|
: "-";
|
||||||
|
formData.checkOutStatus = data.checkOutStatus
|
||||||
|
? convertSatatus(data.checkOutStatus)
|
||||||
|
: "-";
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
closePopup();
|
||||||
})
|
})
|
||||||
.catch((err) => {})
|
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Function ปิด popup */
|
/** Function ปิด popup */
|
||||||
function colsePopup() {
|
function closePopup() {
|
||||||
props.colse ? props.colse() : false;
|
props.close ? props.close() : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
|
|
@ -122,7 +131,7 @@ watch(
|
||||||
round
|
round
|
||||||
dense
|
dense
|
||||||
style="color: #eb0505; background-color: #ffdede"
|
style="color: #eb0505; background-color: #ffdede"
|
||||||
@click="colsePopup"
|
@click="closePopup"
|
||||||
/>
|
/>
|
||||||
</q-toolbar>
|
</q-toolbar>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
|
|
@ -152,14 +161,26 @@ watch(
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-2">
|
||||||
<q-item>
|
<q-item>
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<q-item-label class="text-grey-8">สถานะ</q-item-label>
|
<q-item-label class="text-grey-8"
|
||||||
|
>สถานะเวลาเข้างาน
|
||||||
|
</q-item-label>
|
||||||
<q-item-label>{{ formData.checkInStatus }}</q-item-label>
|
<q-item-label>{{ formData.checkInStatus }}</q-item-label>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-2">
|
||||||
|
<q-item>
|
||||||
|
<q-item-section>
|
||||||
|
<q-item-label class="text-grey-8"
|
||||||
|
>สถานะเวลาออก</q-item-label
|
||||||
|
>
|
||||||
|
<q-item-label>{{ formData.checkOutStatus }}</q-item-label>
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-card>
|
</q-card>
|
||||||
<div class="row q-gutter-md q-pt-md">
|
<div class="row q-gutter-md q-pt-md">
|
||||||
|
|
|
||||||
|
|
@ -143,20 +143,22 @@ async function fetchListTimeRecord() {
|
||||||
(e: DataResTime) => ({
|
(e: DataResTime) => ({
|
||||||
id: e.id,
|
id: e.id,
|
||||||
fullName: e.fullName,
|
fullName: e.fullName,
|
||||||
checkInDate: e.checkInDate && date2Thai(e.checkInDate),
|
checkInDate: e.checkInDate ? date2Thai(e.checkInDate) : "-",
|
||||||
checkInTime: e.checkInTime,
|
checkInTime: e.checkInTime,
|
||||||
checkInLocation: e.checkInLocation,
|
checkInLocation: e.checkInLocation,
|
||||||
checkInLat: e.checkInLat,
|
checkInLat: e.checkInLat,
|
||||||
checkInLon: e.checkInLon,
|
checkInLon: e.checkInLon,
|
||||||
checkInStatus:
|
checkInStatus: e.checkInStatus
|
||||||
e.checkInStatus && workStore.convertSatatus(e.checkInStatus),
|
? workStore.convertSatatus(e.checkInStatus)
|
||||||
checkOutDate: e.checkOutDate && date2Thai(e.checkOutDate),
|
: "-",
|
||||||
checkOutLocation: e.checkOutLocation,
|
checkOutDate: e.checkOutDate ? date2Thai(e.checkOutDate) : "-",
|
||||||
checkOutTime: e.checkOutTime,
|
checkOutLocation: e.checkOutLocation ? e.checkOutLocation : "-",
|
||||||
checkOutLat: e.checkOutLat,
|
checkOutTime: e.checkOutTime ? e.checkOutTime : "-",
|
||||||
checkOutLon: e.checkOutLon,
|
checkOutLat: e.checkOutLocation ? e.checkOutLat : "",
|
||||||
checkOutStatus:
|
checkOutLon: e.checkOutLocation ? e.checkOutLon : "",
|
||||||
e.checkOutStatus && workStore.convertSatatus(e.checkOutStatus),
|
checkOutStatus: e.checkOutStatus
|
||||||
|
? workStore.convertSatatus(e.checkOutStatus)
|
||||||
|
: "-",
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
rows.value = datalist;
|
rows.value = datalist;
|
||||||
|
|
@ -204,6 +206,7 @@ onMounted(async () => {
|
||||||
:rowsPerPage="rowsPerPage"
|
:rowsPerPage="rowsPerPage"
|
||||||
:maxPage="maxPage"
|
:maxPage="maxPage"
|
||||||
@update:pagination="updatePaging"
|
@update:pagination="updatePaging"
|
||||||
|
:tab="'1'"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
|
import { useQuasar } from "quasar";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
||||||
|
|
@ -20,7 +21,9 @@ import { useWorklistDataStore } from "@/modules/09_leave/stores/WorkStore";
|
||||||
/** useStore */
|
/** useStore */
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const workStore = useWorklistDataStore();
|
const workStore = useWorklistDataStore();
|
||||||
const { date2Thai, dateToISO, showLoader, hideLoader } = mixin;
|
const { date2Thai, dateToISO, showLoader, hideLoader, messageError } = mixin;
|
||||||
|
|
||||||
|
const $q = useQuasar(); //ใช้ noti quasar
|
||||||
|
|
||||||
/** ข้อมูลตาราง*/
|
/** ข้อมูลตาราง*/
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
|
|
@ -125,7 +128,7 @@ async function fetchListLogRecord() {
|
||||||
rows.value = datalist;
|
rows.value = datalist;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err);
|
messageError($q, err);
|
||||||
rows.value = [];
|
rows.value = [];
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|
@ -162,6 +165,7 @@ onMounted(async () => {
|
||||||
:rowsPerPage="rowsPerPage"
|
:rowsPerPage="rowsPerPage"
|
||||||
:maxPage="maxPage"
|
:maxPage="maxPage"
|
||||||
@update:pagination="updatePagingProp"
|
@update:pagination="updatePagingProp"
|
||||||
|
:tab="'2'"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,10 @@ const props = defineProps({
|
||||||
type: Number,
|
type: Number,
|
||||||
require: true,
|
require: true,
|
||||||
},
|
},
|
||||||
|
tab: {
|
||||||
|
type: String,
|
||||||
|
require: true,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(["update:pagination"]);
|
const emit = defineEmits(["update:pagination"]);
|
||||||
|
|
@ -65,12 +69,14 @@ function updateProp(newPagination: any, page: number) {
|
||||||
* @param data ข้อมูลรายละเอียด
|
* @param data ข้อมูลรายละเอียด
|
||||||
*/
|
*/
|
||||||
function clickDetail(data: any) {
|
function clickDetail(data: any) {
|
||||||
modal.value = true;
|
if (props.tab === "1") {
|
||||||
dataDetail.value = data;
|
modal.value = true;
|
||||||
|
dataDetail.value = data;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Function ปิด popup */
|
/** Function ปิด popup */
|
||||||
function colseDeyail() {
|
function closeDetail() {
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -150,7 +156,7 @@ watch([() => currentPage.value, () => pagination.value.rowsPerPage], () => {
|
||||||
</template>
|
</template>
|
||||||
</d-table>
|
</d-table>
|
||||||
|
|
||||||
<DialogDetail :modal="modal" :detail="dataDetail" :colse="colseDeyail" />
|
<DialogDetail :modal="modal" :detail="dataDetail" :close="closeDetail" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,8 @@ export const useWorklistDataStore = defineStore("work", () => {
|
||||||
return "สาย";
|
return "สาย";
|
||||||
case "ABSENT":
|
case "ABSENT":
|
||||||
return "ขาดราชการ";
|
return "ขาดราชการ";
|
||||||
|
default:
|
||||||
|
return "-";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue