ผูก API เปลี่ยนแปลงรอบการปฏิบัติงานของผู้ใช้งาน

This commit is contained in:
AnandaTon 2023-11-24 17:28:37 +07:00
parent 3482ec0ae4
commit 1c74095abe
5 changed files with 342 additions and 236 deletions

View file

@ -37,7 +37,12 @@ const formData = reactive<dataPost>({
function Openmodal(check: string, detail: any) {
DataRow.value = detail;
modal.value = true;
console.log(DataRow.value.profileId);
dataStore.setProfileId(DataRow.value.profileId);
console.log(DataRow.value.profileId);
editCheck.value = check;
dataStore.fetchDatainHistory();
console.log(detail);
}
/** Function closePopup */
@ -47,29 +52,8 @@ function closeDialog() {
/** Function ค้นหาข้อมูล */
function searchData() {
const data = [
{
cardId: "3514210651232",
prefix: "นางสาว",
firstName: "กัณฐิมา",
lastName: "กาฬสินธุ์",
roundStart: "07:00",
roundEnd: "11:00",
effectiveDate: new Date("2023-11-01T03:08:43.217"),
},
{
cardId: "1231231231234",
prefix: "นายสาว",
firstName: "test",
lastName: "test",
roundStart: "07:00",
roundEnd: "16:00",
effectiveDate: new Date("2023-11-01T03:08:43.217"),
},
];
if (formData.cardId || formData.firstName || formData.lastName) {
dataStore.fetchDataForCardId(formData, data);
dataStore.fetchDataForCardId(formData);
} else {
dialogMessageNotify($q, "กรุณากรอกข้อมูลอย่างน้อย 1 ช่อง");
}
@ -77,22 +61,7 @@ function searchData() {
/** Hook */
onMounted(() => {
dataStore.fetchDatainHistory([
{
id: "xxx1",
roundStart: "08:30",
roundEnd: "16:00",
effectiveDate: new Date("2023-11-01T03:08:43.217"),
reson: null,
},
{
id: "xxx2",
roundStart: "08:00",
roundEnd: "16:30",
effectiveDate: new Date("2023-11-01T03:08:43.217"),
reson: null,
},
]);
// dataStore.fetchDatainHistory();
});
</script>
<template>
@ -160,11 +129,11 @@ onMounted(() => {
row-key="interrogated"
flat
bordered
:paging="true"
dense
class="custom-header-table"
:visible-columns="dataStore.visibleColumns"
>
<!-- :paging="true" -->
<template v-slot:header="props">
<q-tr :props="props">
<q-th
@ -231,6 +200,7 @@ onMounted(() => {
:closeDialog="closeDialog"
:editCheck="editCheck"
:DataRow="DataRow"
:personId="DataRow == null ? '' : DataRow.profileId"
/>
</template>
<style scoped lang="scss">