คอมเม้น Code ระบบ ลงเวลา
This commit is contained in:
parent
b311f1482b
commit
b202f2ed9d
11 changed files with 80 additions and 63 deletions
|
|
@ -1,18 +1,24 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, watch } from "vue";
|
||||
|
||||
/** props จาก TableList */
|
||||
const props = defineProps({
|
||||
modal: {
|
||||
type: Boolean,
|
||||
require: true,
|
||||
},
|
||||
detail: {
|
||||
type: Object,
|
||||
require: true,
|
||||
},
|
||||
colse: {
|
||||
type: Function,
|
||||
require: true,
|
||||
},
|
||||
});
|
||||
const statusEdit = ref<boolean>(false);
|
||||
// รายละเอียดข้อมูล
|
||||
|
||||
/** รายละเอียดข้อมูล */
|
||||
const titlename = ref<string>("");
|
||||
const timeIn = ref<string>("");
|
||||
const timeOut = ref<string>("");
|
||||
|
|
@ -33,7 +39,8 @@ watch(props, () => {
|
|||
}
|
||||
}
|
||||
});
|
||||
// ปิด popup
|
||||
|
||||
/** Function ปิด popup */
|
||||
function colsePopup() {
|
||||
props.colse ? props.colse() : false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,20 +1,23 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
|
||||
/** importType*/
|
||||
import type { QTableProps } from "quasar";
|
||||
//import Stores
|
||||
|
||||
/** importComponents */
|
||||
import DialogDetail from "@/modules/09_leave/components/1_Work/DialogDetail.vue";
|
||||
|
||||
/** importStores */
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useWorklistDataStore } from "@/modules/09_leave/stores/WorkStore";
|
||||
|
||||
//importComponents
|
||||
import DialogDetail from "@/modules/09_leave/components/1_Work/DialogDetail.vue";
|
||||
|
||||
/** useStore */
|
||||
const mixin = useCounterMixin();
|
||||
const workStore = useWorklistDataStore();
|
||||
|
||||
const { date2Thai } = mixin;
|
||||
const { searchDataFn, filterFn } = workStore;
|
||||
|
||||
//ข้อมูล Table
|
||||
/** ข้อมูลหัวตาราง*/
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
|
|
@ -80,24 +83,29 @@ const visibleColumns = ref<string[]>([
|
|||
"coordinatesOut",
|
||||
]);
|
||||
|
||||
/** Hook */
|
||||
onMounted(() => {
|
||||
workStore.columns = columns.value;
|
||||
workStore.visibleColumns = visibleColumns.value;
|
||||
});
|
||||
|
||||
//DialogDetail
|
||||
/** ข้อมูล popup */
|
||||
const modal = ref<boolean>(false);
|
||||
const dataDetail = ref<any>([]);
|
||||
// เปิด popup ลายละเอียด
|
||||
/**
|
||||
* Function openPopup และแสดงรายละเอียด
|
||||
* @param data ข้อมูลรายละเอียด
|
||||
*/
|
||||
function clickDetail(data: any) {
|
||||
modal.value = true;
|
||||
dataDetail.value = data;
|
||||
} //ปิด popup ลายละเอียด
|
||||
}
|
||||
/** Function ปิด popup */
|
||||
function colseDeyail() {
|
||||
modal.value = false;
|
||||
}
|
||||
|
||||
//pagination
|
||||
/** pagination */
|
||||
const pagination = ref({
|
||||
descending: true,
|
||||
page: 1,
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
<script setup lang="ts">
|
||||
//import Stores
|
||||
/** importStores */
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useWorklistDataStore } from "@/modules/09_leave/stores/WorkStore";
|
||||
|
||||
/** useStore */
|
||||
const workStore = useWorklistDataStore();
|
||||
const mixin = useCounterMixin();
|
||||
|
||||
const { date2Thai } = mixin;
|
||||
const { filterFn, searchDataFn } = workStore;
|
||||
|
||||
/** Functicon หาค่ามากสุดและปิดวันที่ไม่ให้เลือกวันล่วงหน้า*/
|
||||
function calculateMaxDate() {
|
||||
const today = new Date();
|
||||
today.setDate(today.getDate());
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
<script setup lang="ts">
|
||||
//import Stores
|
||||
/** importStores */
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useWorklistDataStore } from "@/modules/09_leave/stores/WorkStore";
|
||||
|
||||
/** useStore */
|
||||
const workStore = useWorklistDataStore();
|
||||
const mixin = useCounterMixin();
|
||||
|
||||
const { date2Thai } = mixin;
|
||||
const { filterFn, searchDataFn } = workStore;
|
||||
const { searchDataFn } = workStore;
|
||||
|
||||
/** Functicon หาค่ามากสุดและปิดวันที่ไม่ให้เลือกวันล่วงหน้า*/
|
||||
function calculateMaxDate() {
|
||||
const today = new Date();
|
||||
today.setDate(today.getDate());
|
||||
|
|
|
|||
|
|
@ -2,17 +2,17 @@
|
|||
import { ref, reactive, onMounted } from "vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
//importStore
|
||||
/** importStore */
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useLeavelistDataStore } from "@/modules/09_leave/stores/LeaveStore";
|
||||
import { useLeavelistDataStoreTest } from "@/modules/09_leave/stores/ListLeave";
|
||||
|
||||
const APIDATA = useLeavelistDataStoreTest();
|
||||
|
||||
//importType
|
||||
/** importType */
|
||||
import type { FremData } from "@/modules/09_leave/interface/request/leave";
|
||||
|
||||
// importForm
|
||||
/** importForm*/
|
||||
import FormMain from "@/modules/09_leave/components/2_Leave/formDetail/formMain.vue"; // from ซ้าย
|
||||
import FormLeave from "@/modules/09_leave/components/2_Leave/formDetail/formLeave.vue"; // ลาป่วย ลาคลอดบุตร และลากิจส่วนตัว
|
||||
import FormChildbirth from "@/modules/09_leave/components/2_Leave/formDetail/formChildbirth.vue"; // ลาไปช่วยเหลือภริยาที่คลอดบุตร
|
||||
|
|
@ -25,6 +25,8 @@ import FormLeaveToTraining from "@/modules/09_leave/components/2_Leave/formDetai
|
|||
import FormLeaveToWorkInternational from "@/modules/09_leave/components/2_Leave/formDetail/formLeaveToWorkInternational.vue"; // ลาไปปฏิบัติงานในองค์การระหว่างประเทศ
|
||||
import FormSpouse from "@/modules/09_leave/components/2_Leave/formDetail/formSpouse.vue"; // ลาติดตามคู่สมรส
|
||||
import FormVocationalRehabilitation from "@/modules/09_leave/components/2_Leave/formDetail/formVocationalRehabilitation.vue"; //ลาไปฟื้นฟูสมรรถภาพด้านอาชีพ
|
||||
|
||||
/** use */
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogConfirm, showLoader, hideLoader, date2Thai } = mixin;
|
||||
|
|
@ -170,17 +172,15 @@ function fetchDetailLeave(paramsId: string) {
|
|||
formData.historyFollow = e.historyFollow;
|
||||
});
|
||||
|
||||
// setTimeout(() => {
|
||||
|
||||
/** ส่งประเภทของการลาไป Function เช็คประเภทการลา*/
|
||||
checkLeaveType(formData.leaveType ? formData.leaveType : "");
|
||||
hideLoader();
|
||||
// }, 1000);
|
||||
}
|
||||
/**Status Form การลา*/
|
||||
const checkForm = ref<string>("");
|
||||
/**
|
||||
* Function เช็คประเภทการลา
|
||||
* @param type รับค่าประเภทของการลา
|
||||
* @param type รับค่า
|
||||
*/
|
||||
function checkLeaveType(type: string) {
|
||||
if (type === "leave1" || type === "leave2" || type === "leave3") {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@ q
|
|||
import { ref, onMounted } from "vue";
|
||||
import type { QTableProps } from "quasar";
|
||||
import { useRouter } from "vue-router";
|
||||
//import Stores
|
||||
|
||||
/** importStores*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useLeavelistDataStore } from "@/modules/09_leave/stores/LeaveStore";
|
||||
const mixin = useCounterMixin();
|
||||
|
|
@ -11,10 +12,17 @@ const leaveStore = useLeavelistDataStore();
|
|||
|
||||
const router = useRouter();
|
||||
|
||||
const { date2Thai } = mixin;
|
||||
const { optionYear, searchDataFn, filterOption } = leaveStore; // เรียน funtion จาก stores
|
||||
/** Hook*/
|
||||
onMounted(() => {
|
||||
leaveStore.columns = columns.value;
|
||||
leaveStore.visibleColumns = visibleColumns.value;
|
||||
});
|
||||
|
||||
// ข้อมูล TABLE
|
||||
/** เรียน funtion จาก stores*/
|
||||
// const { date2Thai } = mixin;
|
||||
// const { optionYear, searchDataFn, filterOption } = leaveStore;
|
||||
|
||||
/** ข้อมูลหัวตาราง */
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
|
|
@ -70,22 +78,11 @@ const visibleColumns = ref<string[]>([
|
|||
"status",
|
||||
]);
|
||||
|
||||
onMounted(() => {
|
||||
leaveStore.columns = columns.value;
|
||||
leaveStore.visibleColumns = visibleColumns.value;
|
||||
});
|
||||
|
||||
const pagination = ref({
|
||||
descending: true,
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
});
|
||||
|
||||
const paging = ref<boolean>(true);
|
||||
const paginationLabel = (start: string, end: string, total: string) => {
|
||||
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
|
||||
else return start + "-" + end + " ใน " + total;
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -101,7 +98,6 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
dense
|
||||
class="custom-header-table"
|
||||
:visible-columns="leaveStore.visibleColumns"
|
||||
:pagination-label="paginationLabel"
|
||||
v-model:pagination="pagination"
|
||||
:loading="leaveStore.loadTable"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
//import Stores
|
||||
/** importStores*/
|
||||
import { useLeavelistDataStore } from "@/modules/09_leave/stores/LeaveStore";
|
||||
|
||||
const leaveStore = useLeavelistDataStore();
|
||||
|
|
@ -70,7 +70,13 @@ const { searchDataFn, filterOption } = leaveStore;
|
|||
(inputValue:any, doneFn:Function) =>
|
||||
filterOption(inputValue, doneFn, 'status')
|
||||
"
|
||||
/>
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey"> ไม่มีข้อมูล </q-item-section>
|
||||
</q-item>
|
||||
</template></q-select
|
||||
>
|
||||
</div>
|
||||
<q-space />
|
||||
<div class="col-xs-12 col-sm-3 col-md-2">
|
||||
|
|
@ -99,4 +105,4 @@ const { searchDataFn, filterOption } = leaveStore;
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -134,6 +134,7 @@ async function putRoundDuty(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
//** Function ปิด Popup */
|
||||
function close() {
|
||||
props.closeDialog?.();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, useAttrs, onMounted, reactive } from "vue";
|
||||
import { ref, onMounted, reactive } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
// ค้นหาในตาราง
|
||||
import type { dataPost } from "@/modules/09_leave/interface/request/changeRound";
|
||||
|
|
|
|||
|
|
@ -19,12 +19,8 @@ const { fetchList, clearFilter } = leaveStore;
|
|||
onMounted(() => {
|
||||
fecthLeaveList();
|
||||
});
|
||||
/**
|
||||
* เรียกข้อมูลจาก API
|
||||
*/
|
||||
/** เรียกข้อมูลจาก API*/
|
||||
function fecthLeaveList() {
|
||||
console.log(APIDATA.data);
|
||||
|
||||
const data = APIDATA.data;
|
||||
|
||||
fetchList(data); /** ส่งข้อมูลไป stores*/
|
||||
|
|
|
|||
|
|
@ -1,29 +1,32 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
//import Stores
|
||||
|
||||
/** importStores */
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useWorklistDataStore } from "@/modules/09_leave/stores/WorkStore";
|
||||
//import Components
|
||||
|
||||
/** import Components */
|
||||
import TableList from "@/modules/09_leave/components/1_Work/TableList.vue";
|
||||
import ToolBar from "@/modules/09_leave/components/1_Work/ToolBar.vue";
|
||||
// import Type
|
||||
import type {
|
||||
TableRows,
|
||||
DataRes,
|
||||
} from "@/modules/09_leave/interface/response/work";
|
||||
import ToolBarDate from "../components/1_Work/ToolBarDate.vue";
|
||||
// use Store
|
||||
|
||||
/** import Type */
|
||||
import type { DataRes } from "@/modules/09_leave/interface/response/work";
|
||||
|
||||
/** use Store */
|
||||
const mixin = useCounterMixin();
|
||||
const workStore = useWorklistDataStore();
|
||||
const { date2Thai } = mixin;
|
||||
const { fetchList } = workStore;
|
||||
|
||||
const tab = ref("1")
|
||||
const tab = ref("1");
|
||||
|
||||
/** Hook */
|
||||
onMounted(() => {
|
||||
fecthWorkList();
|
||||
});
|
||||
//เรียกข้อมูลรายการลงเวลาปฏิบัติงาน
|
||||
|
||||
/** เรียกข้อมูลรายการลงเวลาปฏิบัติงาน */
|
||||
function fecthWorkList() {
|
||||
const listData: DataRes[] = [
|
||||
{
|
||||
|
|
@ -98,10 +101,10 @@ function fecthWorkList() {
|
|||
active-bg-color="teal-1"
|
||||
active-class="text-primary"
|
||||
>
|
||||
<q-tab name="1" label="รายการลงเวลาที่ประมวลผลแล้ว"/>
|
||||
<q-tab name="1" label="รายการลงเวลาที่ประมวลผลแล้ว" />
|
||||
<q-tab name="2" label="รายการลงเวลา" />
|
||||
</q-tabs>
|
||||
|
||||
|
||||
<q-separator />
|
||||
|
||||
<q-tab-panels v-model="tab" animated>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue