Merge branch 'develop' into devTee

This commit is contained in:
setthawutttty 2023-11-10 15:32:31 +07:00
commit 0af2e8a5d1
14 changed files with 119 additions and 72 deletions

View file

@ -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;
}

View file

@ -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,

View file

@ -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());

View file

@ -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());

View file

@ -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") {

View file

@ -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"
>

View file

@ -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>

View file

@ -16,7 +16,7 @@ import { useQuasar } from "quasar";
const $q = useQuasar();
const mixin = useCounterMixin();
const { showLoader, dialogConfirm, success, messageError } = mixin;
const { dialogConfirm, success, messageError } = mixin;
/** propsData จาก RoundMain */
const props = defineProps({
@ -134,6 +134,7 @@ async function putRoundDuty(id: string) {
});
}
//** Function Popup */
function close() {
props.closeDialog?.();
}

View file

@ -1,17 +1,23 @@
<script setup lang="ts">
import { ref, reactive, watchEffect, watch } from "vue";
import { ref, reactive, watch } from "vue";
import { useQuasar } from "quasar";
/** importType */
import type {
changeRoundEdit,
MyObjectRoundChangeRef,
} from "@/modules/09_leave/interface/request/changeRound";
/** importStore */
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
import { useChangeRoundDataStore } from "@/modules/09_leave/stores/ChangeRoundStore";
/** useStore */
const dataStore = useChangeRoundDataStore();
const $q = useQuasar();
const mixin = useCounterMixin();
const { dialogConfirm, date2Thai } = mixin;
const $q = useQuasar();
const roundRef = ref<Object | null>(null);
const resonRef = ref<Object | null>(null);
const effectiveDateRef = ref<Object | null>(null);
@ -38,6 +44,7 @@ const objectRoundChange: MyObjectRoundChangeRef = {
effectiveDate: effectiveDateRef,
};
/** Function validateForm */
function validateForm() {
const hasError = [];
for (const key in objectRoundChange) {
@ -55,6 +62,8 @@ function validateForm() {
console.log(hasError);
}
}
/** Function ยืนยันการบันทึกข้อมูล */
function onSubmit() {
dialogConfirm(
$q,

View file

@ -1,16 +1,25 @@
<script setup lang="ts">
import { ref, useAttrs, onMounted, reactive } from "vue";
import { ref, onMounted, reactive } from "vue";
import { useQuasar } from "quasar";
//
/** importType */
import type { dataPost } from "@/modules/09_leave/interface/request/changeRound";
import { useChangeRoundDataStore } from "@/modules/09_leave/stores/ChangeRoundStore";
/** importComponents */
import Dialogform from "@/modules/09_leave/components/4_ChangeRound/DialogForm.vue";
import Modal from "@/modules/05_placement/components/AppointEmployee/Modal.vue";
/** importStore */
import { useCounterMixin } from "@/stores/mixin";
const $q = useQuasar();
import { useChangeRoundDataStore } from "@/modules/09_leave/stores/ChangeRoundStore";
/** useStore */
const mixin = useCounterMixin();
const { dialogConfirm, date2Thai, dialogMessageNotify } = mixin;
const dataStore = useChangeRoundDataStore();
/** use */
const $q = useQuasar();
const modal = ref<boolean>(false);
const editCheck = ref<string>("");
const DataRow = ref<any>();
@ -20,16 +29,23 @@ const formData = reactive<dataPost>({
lastName: "",
});
/**
* Function openPopup
* @param check action edit,history
* @param detail รายละเอยดขอมลรอบการปฏของผใชงาน
*/
function Openmodal(check: string, detail: any) {
DataRow.value = detail;
modal.value = true;
editCheck.value = check;
}
/** Function closePopup */
function closeDialog() {
modal.value = false;
}
/** Function ค้นหาข้อมูล */
function searchData() {
if (formData.cardId || formData.firstName || formData.lastName) {
dataStore.fetchDataForCardId(formData, "click");
@ -37,6 +53,8 @@ function searchData() {
dialogMessageNotify($q, "กรุณากรอกข้อมูลอย่างน้อย 1 ช่อง");
}
}
/** Hook */
onMounted(() => {
dataStore.fetchDatainHistory([
{

View file

@ -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*/

View file

@ -229,7 +229,9 @@ const pagination = ref({
</q-td>
<q-td>
<q-btn
v-if="props.row.isActive === false"
v-if="
props.row.isDefault === false && props.row.isActive === false
"
dense
flat
round

View file

@ -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>

View file

@ -376,11 +376,12 @@ export const useCounterMixin = defineStore("mixin", () => {
},
});
} else {
const message = e.response.data.result ?? e.response.data.message;
q.dialog({
component: CustomComponent,
componentProps: {
title: `พบข้อผิดพลาด`,
message: `${e.response.data.message}`,
message: `${message}`,
icon: "warning",
color: "red",
onlycancel: true,