แก้ UI-แก้ไขรอบการปฎิบัติงานผู้ใช้งาน

This commit is contained in:
setthawutttty 2023-11-03 17:54:28 +07:00
parent f62b48e27c
commit bf1b13522f
5 changed files with 155 additions and 75 deletions

View file

@ -1,6 +1,7 @@
import { defineStore } from "pinia";
import { ref, reactive } from "vue";
import type { changeShow, dataRowChangeRound, dataRowChangeRoundHistory, historyShow } from "@/modules/09_leave/interface/response/changeRound";
import type { dataPost } from "@/modules/09_leave/interface/request/changeRound";
import type { QTableProps } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
@ -112,15 +113,6 @@ export const useChangeRoundDataStore = defineStore(
roundEnd: "11:00",
effectiveDate: new Date("2023-11-01T03:08:43.217"),
},
{
cardId: '3514210651232',
prefix: "นางสาว",
firstName: "กัณฐิมา",
lastName: "กาฬสินธุ์",
roundStart: "13:00",
roundEnd: "16:00",
effectiveDate: new Date("2023-11-01T03:08:43.217"),
},
{
cardId: '1231231231234',
prefix: "นายสาว",
@ -148,27 +140,35 @@ export const useChangeRoundDataStore = defineStore(
rowsHistory.value = datalistHistory;
}
function fetchDataForCardId(cardId: string, check: string) {
if (cardId.length === 13) {
const data = dataList.filter((e) => e.cardId === cardId);
rows.value = data.map((e) => ({
cardId: e.cardId,
prefix: e.prefix,
firstName: e.firstName,
lastName: e.lastName,
fullName: `${e.prefix}${e.firstName} ${e.lastName}`,
roundStart: e.roundStart,
roundEnd: e.roundEnd,
currentRound: `${e.roundStart}-${e.roundEnd}`,
effectiveDate: date2Thai(e.effectiveDate),
function fetchDataForCardId(dataDetail: any, check: string) {
if (dataDetail) {
const filteredData = dataList.filter((e) => {
return (!dataDetail.cardId || e.cardId === dataDetail.cardId) &&
(!dataDetail.firstName || e.firstName === dataDetail.firstName) &&
(!dataDetail.lastName || e.lastName === dataDetail.lastName);
});
if (filteredData.length > 0) {
checkCilck.value = false;
rows.value = filteredData.map((e) => ({
cardId: e.cardId,
prefix: e.prefix,
firstName: e.firstName,
lastName: e.lastName,
fullName: `${e.prefix}${e.firstName} ${e.lastName}`,
roundStart: e.roundStart,
roundEnd: e.roundEnd,
currentRound: `${e.roundStart}-${e.roundEnd}`,
effectiveDate: date2Thai(e.effectiveDate),
}));
} else if (cardId === 'null') {
rows.value = []
checkCilck.value = false
} else if (check === 'click') {
checkCilck.value = true
} else {
rows.value = [];
console.log(3);
checkCilck.value = true;
}
}
}
}
return {