Merge branch 'develop' of github.com:Frappet/bma-ehr-frontend into develop
This commit is contained in:
commit
dad6b02628
37 changed files with 1588 additions and 1243 deletions
|
|
@ -1,9 +1,9 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="icon" href="/favicon.ico">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>ระบบทรัพยากรบุคคล</title>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
|||
6
src/api/09_leave/api.leave.ts
Normal file
6
src/api/09_leave/api.leave.ts
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import env from "../index";
|
||||
const leave = `${env.API_URI}/leave`;
|
||||
export default {
|
||||
roundDutytime: () => `${leave}/duty-time`,
|
||||
roundDutytimeByid: (id: string) => `${leave}/duty-time/${id}`,
|
||||
};
|
||||
|
|
@ -43,6 +43,9 @@ import message from "./api/00_dashboard/api.message";
|
|||
/** API reports */
|
||||
import reports from "./api/reports/api.report";
|
||||
|
||||
/** API ระบบลงเวลา */
|
||||
import leave from "./api/09_leave/api.leave";
|
||||
|
||||
// environment variables
|
||||
export const compettitivePanel = import.meta.env.VITE_COMPETITIVE_EXAM_PANEL;
|
||||
export const qualifyDisableExamPanel = import.meta.env
|
||||
|
|
@ -86,6 +89,9 @@ const API = {
|
|||
|
||||
//reports
|
||||
...reports,
|
||||
|
||||
/**leave */
|
||||
...leave,
|
||||
};
|
||||
|
||||
export default {
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -1,39 +1,71 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, reactive, watchEffect, watch } from "vue";
|
||||
import { ref, reactive, watch } from "vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
/** ImportType */
|
||||
import type {
|
||||
dataRowRound,
|
||||
FormData,
|
||||
MyObjectRoundRef,
|
||||
} from "@/modules/09_leave/interface/response/round";
|
||||
|
||||
/** ImportComponents */
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogConfirm } = mixin;
|
||||
const { dialogConfirm, success, messageError } = mixin;
|
||||
|
||||
/** propsData จาก RoundMain */
|
||||
const props = defineProps({
|
||||
modal: {
|
||||
type: Boolean,
|
||||
require: true,
|
||||
},
|
||||
editCheck: {
|
||||
type: String,
|
||||
require: true,
|
||||
},
|
||||
fetchData: {
|
||||
type: Function,
|
||||
require: true,
|
||||
},
|
||||
closeDialog: {
|
||||
type: Function,
|
||||
require: true,
|
||||
},
|
||||
detailData: {
|
||||
type: Object,
|
||||
require: false,
|
||||
},
|
||||
});
|
||||
|
||||
/** Ref INPUT เวลา*/
|
||||
const amRef = ref<Object | null>(null);
|
||||
const amOutRef = ref<Object | null>(null);
|
||||
const pmRef = ref<Object | null>(null);
|
||||
const pmOutRef = ref<Object | null>(null);
|
||||
|
||||
const formData = reactive<dataRowRound>({
|
||||
am: "",
|
||||
amOut: "",
|
||||
pm: "",
|
||||
pmOut: "",
|
||||
note: "",
|
||||
status: false,
|
||||
isDefault: false,
|
||||
});
|
||||
|
||||
const objectRound: MyObjectRoundRef = {
|
||||
am: amRef,
|
||||
amOut: amOutRef,
|
||||
pm: pmRef,
|
||||
pmOut: pmOutRef,
|
||||
startTimeMorning: amRef,
|
||||
endTimeMorning: amOutRef,
|
||||
startTimeAfternoon: pmRef,
|
||||
endTimeAfternoon: pmOutRef,
|
||||
};
|
||||
|
||||
/** Form ข้อมูล */
|
||||
const formData = reactive<FormData>({
|
||||
startTimeMorning: "",
|
||||
endTimeMorning: "",
|
||||
startTimeAfternoon: "",
|
||||
endTimeAfternoon: "",
|
||||
description: "",
|
||||
isDefault: false,
|
||||
isActive: false,
|
||||
});
|
||||
|
||||
/** Function validateForm*/
|
||||
function validateForm() {
|
||||
const hasError = [];
|
||||
for (const key in objectRound) {
|
||||
|
|
@ -51,48 +83,83 @@ function validateForm() {
|
|||
console.log(hasError);
|
||||
}
|
||||
}
|
||||
|
||||
/** Function ยืนยันการบันทึกข้อมูล*/
|
||||
function onSubmit() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
props.closeDialog?.();
|
||||
const dataId = props.detailData?.id;
|
||||
props.editCheck === "add" ? postRoundDuty() : putRoundDuty(dataId);
|
||||
},
|
||||
"ยืนยันการบันทึกข้อมูล",
|
||||
"ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?"
|
||||
);
|
||||
}
|
||||
const props = defineProps({
|
||||
modal: Boolean,
|
||||
editCheck: String,
|
||||
closeDialog: Function,
|
||||
detailData: Object,
|
||||
});
|
||||
|
||||
function close() {
|
||||
if (props.closeDialog) {
|
||||
props.closeDialog();
|
||||
}
|
||||
/** Function สร้างรอบการปฏิบัติงาน*/
|
||||
async function postRoundDuty() {
|
||||
await http
|
||||
.post(config.API.roundDutytime(), formData)
|
||||
.then(() => {
|
||||
success($q, "บันทึกข้อมูล");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
props.fetchData?.();
|
||||
props.closeDialog?.();
|
||||
});
|
||||
}
|
||||
|
||||
/** Functiom แก้ไข้รอบการปฏิบัติงาน*/
|
||||
async function putRoundDuty(id: string) {
|
||||
const data = {
|
||||
description: formData.description,
|
||||
isDefault: formData.isDefault,
|
||||
isActive: formData.isActive,
|
||||
};
|
||||
await http
|
||||
.put(config.API.roundDutytimeByid(id), data)
|
||||
.then(() => {
|
||||
success($q, "บันทึกข้อมูล");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
props.fetchData?.();
|
||||
props.closeDialog?.();
|
||||
});
|
||||
}
|
||||
|
||||
//** Function ปิด Popup */
|
||||
function close() {
|
||||
props.closeDialog?.();
|
||||
}
|
||||
|
||||
/***/
|
||||
watch(
|
||||
() => props.modal,
|
||||
(newDetailData, oldDetailData) => {
|
||||
if (props.editCheck === "add") {
|
||||
formData.am = "";
|
||||
formData.amOut = "";
|
||||
formData.pm = "";
|
||||
formData.pmOut = "";
|
||||
formData.note = "";
|
||||
formData.startTimeMorning = "";
|
||||
formData.endTimeMorning = "";
|
||||
formData.startTimeAfternoon = "";
|
||||
formData.endTimeAfternoon = "";
|
||||
formData.description = "";
|
||||
formData.isDefault = false;
|
||||
formData.status = false;
|
||||
} else if(props.editCheck === "edit"){
|
||||
formData.isActive = false;
|
||||
} else if (props.editCheck === "edit") {
|
||||
if (props.detailData) {
|
||||
formData.am = props.detailData.am;
|
||||
formData.amOut = props.detailData.amOut;
|
||||
formData.pm = props.detailData.pm;
|
||||
formData.pmOut = props.detailData.pmOut;
|
||||
formData.note = props.detailData.note;
|
||||
formData.startTimeMorning = props.detailData.startTimeMorning;
|
||||
formData.endTimeMorning = props.detailData.endTimeMorning;
|
||||
formData.startTimeAfternoon = props.detailData.startTimeAfternoon;
|
||||
formData.endTimeAfternoon = props.detailData.endTimeAfternoon;
|
||||
formData.description = props.detailData.description;
|
||||
formData.isDefault = props.detailData.isDefault;
|
||||
formData.status = props.detailData.status;
|
||||
formData.isActive = props.detailData.isActive;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -129,21 +196,23 @@ watch(
|
|||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
v-model="formData.am"
|
||||
v-model="formData.startTimeMorning"
|
||||
:rules="[
|
||||
(val) => !!val || 'กรุณากรอกเวลาเข้างาน',
|
||||
(val) => {
|
||||
if (val && formData.amOut) {
|
||||
if (val > formData.amOut) {
|
||||
if (val && formData.endTimeMorning) {
|
||||
if (val > formData.endTimeMorning) {
|
||||
return 'ต้องน้อยกว่าเวลาออกงาน';
|
||||
}
|
||||
if (val >= formData.pm && val <= formData.pmOut) {
|
||||
if (
|
||||
val >= formData.startTimeAfternoon &&
|
||||
val <= formData.endTimeAfternoon
|
||||
) {
|
||||
return 'ช่วงเวลาทับซ้อนกับช่วงบ่าย';
|
||||
}
|
||||
if(val === formData.amOut){
|
||||
return 'เวลาเข้างานช่วงเช้าต้องไม่ซ้ำกับออกงานเช้า'
|
||||
if (val === formData.endTimeAfternoon) {
|
||||
return 'เวลาเข้างานช่วงเช้าต้องไม่ซ้ำกับออกงานเช้า';
|
||||
}
|
||||
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
|
@ -162,21 +231,24 @@ watch(
|
|||
:readonly="props.editCheck === 'edit'"
|
||||
:outlined="props.editCheck === 'add'"
|
||||
dense
|
||||
v-model="formData.amOut"
|
||||
v-model="formData.endTimeMorning"
|
||||
lazy-rules
|
||||
borderless
|
||||
:rules="[
|
||||
(val) => !!val || 'กรุณากรอกเวลาออกงาน',
|
||||
(val) => {
|
||||
if (val && formData.am) {
|
||||
if (val < formData.am) {
|
||||
if (val && formData.startTimeMorning) {
|
||||
if (val < formData.startTimeMorning) {
|
||||
return 'ต้องมากกว่าเวลาเข้างาน';
|
||||
}
|
||||
if (val >= formData.pm && val <= formData.pmOut) {
|
||||
if (
|
||||
val >= formData.startTimeAfternoon &&
|
||||
val <= formData.endTimeAfternoon
|
||||
) {
|
||||
return 'ช่วงเวลาทับซ้อนกับช่วงบ่าย';
|
||||
}
|
||||
if(val === formData.am){
|
||||
return 'เวลาออกงานช่วงเช้าต้องไม่ซ้ำกับเข้างานเช้า'
|
||||
if (val === formData.startTimeMorning) {
|
||||
return 'เวลาออกงานช่วงเช้าต้องไม่ซ้ำกับเข้างานเช้า';
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
@ -199,15 +271,18 @@ watch(
|
|||
:rules="[
|
||||
(val) => !!val || 'กรุณากรอกเวลาเข้างาน',
|
||||
(val) => {
|
||||
if (val && formData.pmOut) {
|
||||
if (val > formData.pmOut) {
|
||||
if (val && formData.endTimeAfternoon) {
|
||||
if (val > formData.endTimeAfternoon) {
|
||||
return 'ต้องน้อยกว่าเวลาออกงาน';
|
||||
}
|
||||
if (val >= formData.am && val <= formData.amOut) {
|
||||
if (
|
||||
val >= formData.startTimeMorning &&
|
||||
val <= formData.endTimeMorning
|
||||
) {
|
||||
return 'ช่วงเวลาทับซ้อนกับช่วงเช้า';
|
||||
}
|
||||
if(val === formData.pmOut){
|
||||
return 'เวลาเข้างานช่วงบ่ายต้องไม่ซ้ำกับออกงานช่วงบ่าย'
|
||||
if (val === formData.endTimeAfternoon) {
|
||||
return 'เวลาเข้างานช่วงบ่ายต้องไม่ซ้ำกับออกงานช่วงบ่าย';
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
@ -219,7 +294,7 @@ watch(
|
|||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
v-model="formData.pm"
|
||||
v-model="formData.startTimeAfternoon"
|
||||
hide-bottom-space
|
||||
type="time"
|
||||
style="width: 140px"
|
||||
|
|
@ -233,15 +308,18 @@ watch(
|
|||
:rules="[
|
||||
(val) => !!val || 'กรุณากรอกเวลาออกงาน',
|
||||
(val) => {
|
||||
if (val && formData.pm) {
|
||||
if (val < formData.pm) {
|
||||
if (val && formData.startTimeAfternoon) {
|
||||
if (val < formData.startTimeAfternoon) {
|
||||
return 'ต้องมากกว่าเวลาเข้างาน';
|
||||
}
|
||||
if (val >= formData.am && val <= formData.amOut) {
|
||||
if (
|
||||
val >= formData.startTimeMorning &&
|
||||
val <= formData.endTimeMorning
|
||||
) {
|
||||
return 'ช่วงเวลาทับซ้อนกับช่วงเช้า';
|
||||
}
|
||||
if(val === formData.pm){
|
||||
return 'เวลาออกงานช่วงบ่ายต้องไม่ซ้ำกับเข้างานช่วงบ่าย'
|
||||
if (val === formData.startTimeAfternoon) {
|
||||
return 'เวลาออกงานช่วงบ่ายต้องไม่ซ้ำกับเข้างานช่วงบ่าย';
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
@ -251,7 +329,7 @@ watch(
|
|||
:readonly="props.editCheck === 'edit'"
|
||||
:outlined="props.editCheck === 'add'"
|
||||
dense
|
||||
v-model="formData.pmOut"
|
||||
v-model="formData.endTimeAfternoon"
|
||||
lazy-rules
|
||||
borderless
|
||||
hide-bottom-space
|
||||
|
|
@ -264,7 +342,7 @@ watch(
|
|||
class="col-12 bg-white q-ma-md"
|
||||
outlined
|
||||
stack-label
|
||||
v-model="formData.note"
|
||||
v-model="formData.description"
|
||||
label="คำอธิบาย"
|
||||
hide-bottom-space
|
||||
type="textarea"
|
||||
|
|
@ -286,7 +364,7 @@ watch(
|
|||
<div class="row items-center q-my-sm justify-between">
|
||||
<p class="q-ma-none">สถานะการใช้งาน</p>
|
||||
<label class="toggle-control">
|
||||
<input type="checkbox" v-model="formData.status" />
|
||||
<input type="checkbox" v-model="formData.isActive" />
|
||||
<span class="control"></span>
|
||||
</label>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -1,40 +1,59 @@
|
|||
interface RoundRows {
|
||||
name: string;
|
||||
position: string;
|
||||
responsibilities: string;
|
||||
email: string;
|
||||
phone: string;
|
||||
name: string;
|
||||
position: string;
|
||||
responsibilities: string;
|
||||
email: string;
|
||||
phone: string;
|
||||
}
|
||||
interface dataRowRound {
|
||||
am: string
|
||||
amOut: string
|
||||
pm: string
|
||||
note:string
|
||||
pmOut: string
|
||||
status: boolean
|
||||
isDefault: boolean
|
||||
id: string;
|
||||
createdAt: string;
|
||||
createdFullName: string;
|
||||
createdUserId: string;
|
||||
description: string;
|
||||
endTimeAfternoon: string;
|
||||
endTimeMorning: string;
|
||||
startTimeMorning: string;
|
||||
startTimeAfternoon: string;
|
||||
lastUpdateFullName: string;
|
||||
lastUpdateUserId: string;
|
||||
lastUpdatedAt: string;
|
||||
isActive: boolean;
|
||||
isDefault: boolean;
|
||||
}
|
||||
interface FormData {
|
||||
startTimeMorning: string;
|
||||
endTimeMorning: string;
|
||||
startTimeAfternoon: string;
|
||||
endTimeAfternoon: string;
|
||||
description: string;
|
||||
isDefault: boolean;
|
||||
isActive: boolean;
|
||||
}
|
||||
interface roundShow {
|
||||
round: string;
|
||||
am: string;
|
||||
amOut: string;
|
||||
pm: string;
|
||||
pmOut: string;
|
||||
amRound: string;
|
||||
pmRound: string;
|
||||
status: boolean;
|
||||
isDefault: boolean;
|
||||
}
|
||||
interface MyObjectRoundRef {
|
||||
am: object | null,
|
||||
amOut: object | null,
|
||||
pm: object | null,
|
||||
pmOut: object | null,
|
||||
[key: string]: any;
|
||||
id: string;
|
||||
round: string;
|
||||
morningRound: string;
|
||||
afternoonRound: string;
|
||||
createdAt: string;
|
||||
createdFullName: string;
|
||||
createdUserId: string;
|
||||
description: string;
|
||||
endTimeAfternoon: string;
|
||||
endTimeMorning: string;
|
||||
startTimeMorning: string;
|
||||
startTimeAfternoon: string;
|
||||
lastUpdateFullName: string;
|
||||
lastUpdateUserId: string;
|
||||
lastUpdatedAt: string;
|
||||
isActive: boolean;
|
||||
isDefault: boolean;
|
||||
}
|
||||
export type {
|
||||
RoundRows,
|
||||
dataRowRound,
|
||||
MyObjectRoundRef,
|
||||
roundShow
|
||||
};
|
||||
interface MyObjectRoundRef {
|
||||
startTimeMorning: object | null;
|
||||
endTimeMorning: object | null;
|
||||
startTimeAfternoon: object | null;
|
||||
endTimeAfternoon: object | null;
|
||||
[key: string]: any;
|
||||
}
|
||||
export type { RoundRows, dataRowRound, FormData, MyObjectRoundRef, roundShow };
|
||||
|
|
|
|||
|
|
@ -1,85 +1,96 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { ref } from "vue";
|
||||
import type { dataRowRound,roundShow } from "@/modules/09_leave/interface/response/round.ts";
|
||||
import type {
|
||||
dataRowRound,
|
||||
roundShow,
|
||||
} from "@/modules/09_leave/interface/response/round.ts";
|
||||
import type { QTableProps } from "quasar";
|
||||
|
||||
// store ลา >> รอบการปฏิบัติงาน
|
||||
export const useRoundDataStore = defineStore(
|
||||
"roundWorkStore",
|
||||
() => {
|
||||
//ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
const visibleColumns = ref<string[]>([
|
||||
"round",
|
||||
"amRound",
|
||||
"pmRound",
|
||||
"note",
|
||||
"status"
|
||||
]);
|
||||
export const useRoundDataStore = defineStore("roundWorkStore", () => {
|
||||
/** ค้นหา คอลัมน์ คอลัมน์ที่แสดง */
|
||||
const visibleColumns = ref<string[]>([
|
||||
"round",
|
||||
"morningRound",
|
||||
"afternoonRound",
|
||||
"isActive",
|
||||
]);
|
||||
|
||||
// หัวตาราง
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "round",
|
||||
align: "left",
|
||||
label: "รอบ",
|
||||
sortable: true,
|
||||
field: "round",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "amRound",
|
||||
align: "left",
|
||||
label: "ช่วงเช้า",
|
||||
sortable: true,
|
||||
field: "amRound",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "pmRound",
|
||||
align: "left",
|
||||
label: "ช่วงบ่าย",
|
||||
sortable: true,
|
||||
field: "pmRound",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "status",
|
||||
align: "center",
|
||||
label: "สถานะการใช้งาน",
|
||||
sortable: true,
|
||||
field: "status",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
/** หัวตาราง */
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "round",
|
||||
align: "left",
|
||||
label: "รอบ",
|
||||
sortable: true,
|
||||
field: "round",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "morningRound",
|
||||
align: "left",
|
||||
label: "ช่วงเช้า",
|
||||
sortable: true,
|
||||
field: "morningRound",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "afternoonRound",
|
||||
align: "left",
|
||||
label: "ช่วงบ่าย",
|
||||
sortable: true,
|
||||
field: "afternoonRound",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "isActive",
|
||||
align: "center",
|
||||
label: "สถานะการใช้งาน",
|
||||
sortable: true,
|
||||
field: "isActive",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
|
||||
// ข้อมูลในตาราง
|
||||
const rows = ref<dataRowRound[]>([]);
|
||||
function fetchData(data: dataRowRound[]) {
|
||||
let datalist: roundShow[] = data.map((e: dataRowRound) => {
|
||||
return {
|
||||
round:`${e.am}-${e.pmOut}`,
|
||||
am: e.am,
|
||||
amOut: e.amOut,
|
||||
pm: e.pm,
|
||||
pmOut: e.pmOut,
|
||||
amRound:`${e.am}-${e.amOut}`,
|
||||
pmRound:`${e.pm}-${e.pmOut}`,
|
||||
status: e.status,
|
||||
isDefault: e.isDefault,
|
||||
};
|
||||
/** ข้อมูลในตาราง */
|
||||
const rows = ref<dataRowRound[]>([]);
|
||||
/**
|
||||
* Function รับข้อมูลจาก API map
|
||||
* @param data รับข้อมูลจาก API
|
||||
*/
|
||||
function fetchData(data: dataRowRound[]) {
|
||||
let datalist: roundShow[] = data.map((e: dataRowRound) => {
|
||||
return {
|
||||
id: e.id,
|
||||
round: `${e.startTimeMorning}-${e.endTimeAfternoon}`,
|
||||
morningRound: `${e.startTimeMorning}-${e.endTimeMorning}`,
|
||||
afternoonRound: `${e.startTimeAfternoon}-${e.endTimeAfternoon}`,
|
||||
createdAt: e.createdAt,
|
||||
createdFullName: e.createdFullName,
|
||||
createdUserId: e.createdUserId,
|
||||
description: e.description,
|
||||
endTimeAfternoon: e.endTimeAfternoon,
|
||||
endTimeMorning: e.endTimeMorning,
|
||||
startTimeMorning: e.startTimeMorning,
|
||||
startTimeAfternoon: e.startTimeAfternoon,
|
||||
lastUpdateFullName: e.lastUpdateFullName,
|
||||
lastUpdateUserId: e.lastUpdateUserId,
|
||||
lastUpdatedAt: e.lastUpdatedAt,
|
||||
isActive: e.isActive,
|
||||
isDefault: e.isDefault,
|
||||
};
|
||||
});
|
||||
rows.value = datalist;
|
||||
}
|
||||
|
||||
return {
|
||||
visibleColumns,
|
||||
columns,
|
||||
rows,
|
||||
fetchData
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
return {
|
||||
visibleColumns,
|
||||
columns,
|
||||
rows,
|
||||
fetchData,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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([
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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,18 +1,29 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, useAttrs, onMounted } from "vue";
|
||||
|
||||
import router from "@/router";
|
||||
import { useQuasar } from "quasar";
|
||||
import DialogForm from "@/modules/09_leave/components/3_WorkTime/DialogForm.vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
/** ImportStores*/
|
||||
import { useRoundDataStore } from "@/modules/09_leave/stores/RoundStores";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
/** ImportComponents*/
|
||||
import DialogForm from "@/modules/09_leave/components/3_WorkTime/DialogForm.vue";
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const dataStore = useRoundDataStore();
|
||||
const { fetchData } = dataStore;
|
||||
|
||||
const { showLoader, hideLoader, messageError, dialogRemove, success } = mixin;
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
|
||||
const attrs = ref<any>(useAttrs());
|
||||
|
||||
const modal = ref<boolean>(false);
|
||||
const detailData = ref<any>();
|
||||
const editCheck = ref<string>("");
|
||||
// ค้นหาในตาราง
|
||||
|
||||
/** ค้นหาข้อมูลใน Table */
|
||||
const filterKeyword = ref<string>("");
|
||||
const filterRef = ref<HTMLInputElement | null>(null);
|
||||
const resetFilter = () => {
|
||||
|
|
@ -22,19 +33,52 @@ const resetFilter = () => {
|
|||
}
|
||||
};
|
||||
|
||||
const attrs = ref<any>(useAttrs());
|
||||
const paging = ref<boolean>(true);
|
||||
const pagination = ref({
|
||||
// sortBy: "desc",
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
onMounted(() => {
|
||||
fetchListRoind();
|
||||
});
|
||||
const paginationLabel = (start: string, end: string, total: string) => {
|
||||
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
|
||||
else return start + "-" + end + " ใน " + total;
|
||||
};
|
||||
|
||||
/** Function get ข้อมูลรายการรอบการปฏิบัติงาน */
|
||||
async function fetchListRoind() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.roundDutytime())
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
fetchData(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Function delete รายการรอบการปฏิบัติงาน
|
||||
* @param id ค่า ID ของ rows
|
||||
*/
|
||||
function onClickDelete(id: string) {
|
||||
dialogRemove($q, async () => {
|
||||
await http
|
||||
.delete(config.API.roundDutytimeByid(id))
|
||||
.then(() => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchListRoind();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param data ข้อมูลรอบการปฏิบัติงาน
|
||||
* @param check action แก้ไข,เพิ่ม
|
||||
*/
|
||||
function openModal(data: any, check: string) {
|
||||
modal.value = true;
|
||||
editCheck.value = check;
|
||||
|
|
@ -43,45 +87,18 @@ function openModal(data: any, check: string) {
|
|||
}
|
||||
}
|
||||
|
||||
/** Function ปิด popup รายละเอียดและการเพิ่ม*/
|
||||
function closeDialog() {
|
||||
modal.value = false;
|
||||
editCheck.value = "add";
|
||||
}
|
||||
onMounted(() => {
|
||||
dataStore.fetchData([
|
||||
{
|
||||
am: "07:30",
|
||||
amOut: "12:00",
|
||||
pm: "13:00",
|
||||
pmOut: "15:30",
|
||||
status: true,
|
||||
isDefault: true,
|
||||
},
|
||||
{
|
||||
am: "08:30",
|
||||
amOut: "12:00",
|
||||
pm: "13:00",
|
||||
pmOut: "15:30",
|
||||
status: false,
|
||||
isDefault: false,
|
||||
},
|
||||
{
|
||||
am: "09:30",
|
||||
amOut: "12:00",
|
||||
pm: "13:00",
|
||||
pmOut: "15:30",
|
||||
status: true,
|
||||
isDefault: false,
|
||||
},
|
||||
{
|
||||
am: "10:30",
|
||||
amOut: "12:00",
|
||||
pm: "13:00",
|
||||
pmOut: "15:30",
|
||||
status: true,
|
||||
isDefault: false,
|
||||
},
|
||||
]);
|
||||
|
||||
/** pagination */
|
||||
const pagination = ref({
|
||||
// sortBy: "desc",
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
|
|
@ -158,7 +175,6 @@ onMounted(() => {
|
|||
class="custom-header-table"
|
||||
v-bind="attrs"
|
||||
:visible-columns="dataStore.visibleColumns"
|
||||
:pagination-label="paginationLabel"
|
||||
v-model:pagination="pagination"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
|
|
@ -172,6 +188,7 @@ onMounted(() => {
|
|||
>
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
<q-th auto-width></q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
|
|
@ -192,15 +209,15 @@ onMounted(() => {
|
|||
:props="props"
|
||||
@click.prevent="openModal(props.row, 'edit')"
|
||||
>
|
||||
<div v-if="col.name === 'status'" class="text-center">
|
||||
<div v-if="col.name === 'isActive'" class="text-center">
|
||||
<q-icon
|
||||
v-if="props.row.status === true"
|
||||
v-if="props.row.isActive === true"
|
||||
name="mdi-check"
|
||||
size="sm"
|
||||
color="positive"
|
||||
/>
|
||||
<q-icon
|
||||
v-if="props.row.status === false"
|
||||
v-if="props.row.isActive === false"
|
||||
name="mdi-close"
|
||||
size="sm"
|
||||
color="grey"
|
||||
|
|
@ -210,6 +227,19 @@ onMounted(() => {
|
|||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td>
|
||||
<q-btn
|
||||
v-if="
|
||||
props.row.isDefault === false && props.row.isActive === false
|
||||
"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
color="red"
|
||||
icon="delete"
|
||||
@click="onClickDelete(props.row.id)"
|
||||
/>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
|
|
@ -220,6 +250,7 @@ onMounted(() => {
|
|||
:closeDialog="closeDialog"
|
||||
:editCheck="editCheck"
|
||||
:detailData="detailData"
|
||||
:fetchData="fetchListRoind"
|
||||
/>
|
||||
</template>
|
||||
<style scoped lang="scss">
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
<script setup lang="ts">
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import Form from "@/modules/11_discipline/components/1_Complaint/Form.vue";
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
// บันทึกข้อมูล
|
||||
const onSubmit = async () => {
|
||||
// post
|
||||
/** บันทึกข้อมูล */
|
||||
async function onSubmit () {
|
||||
/** post */
|
||||
console.log("add");
|
||||
router.push(`/discipline/complaints`);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,17 +1,14 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, reactive, ref } from "vue";
|
||||
import Form from "@/modules/11_discipline/components/1_Complaint/Form.vue";
|
||||
import type { FormData } from "@/modules/11_discipline/interface/request/complaint";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import type { FormData } from "@/modules/11_discipline/interface/request/complaint";
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const id = ref<string>(route.params.id as string);
|
||||
onMounted(() => {
|
||||
fetchData();
|
||||
});
|
||||
|
||||
// get ข้อมูลเก่ากรณีแก้ไขข้อมูล
|
||||
/** ข้อมูล v-model ของฟอร์ม */
|
||||
const data = reactive<FormData>({
|
||||
complainantType: "",
|
||||
complainant: "",
|
||||
|
|
@ -28,8 +25,9 @@ const data = reactive<FormData>({
|
|||
petitioner: "",
|
||||
files: null,
|
||||
});
|
||||
|
||||
/** ดึงค่าจาก api */
|
||||
const fetchData = async () => {
|
||||
// ดึงค่าจาก api
|
||||
data.complainantType = "2"
|
||||
data.complainant = "1"
|
||||
data.office = "0"
|
||||
|
|
@ -46,12 +44,16 @@ const fetchData = async () => {
|
|||
data.files = ""
|
||||
};
|
||||
|
||||
// แก้ไขข้อมูล
|
||||
const onSubmit = async () => {
|
||||
// put
|
||||
/** ฟังชั่น แก้ไข */
|
||||
async function onSubmit() {
|
||||
console.log("edit");
|
||||
router.push(`/discipline/complaints`);
|
||||
};
|
||||
|
||||
/** เรียกใช้งาน ฟังชั่น ตอนเริ่มโหลดหน้า */
|
||||
onMounted(() => {
|
||||
fetchData();
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<div class="col-xs-12 col-sm-12 col-md-11">
|
||||
|
|
|
|||
|
|
@ -3,15 +3,44 @@ import { ref, onMounted, reactive, watch } from "vue";
|
|||
import { useQuasar } from "quasar";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
// import Type
|
||||
/** import Type */
|
||||
import type { DataOption } from "@/modules/11_discipline/interface/index/Main";
|
||||
import type {
|
||||
FormData,
|
||||
MyObjectComplaintsRef,
|
||||
} from "@/modules/11_discipline/interface/request/complaint";
|
||||
// importStroe
|
||||
|
||||
/** importStroe*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useComplainstDataStore } from "@/modules/11_discipline/store/ComplaintsStore";
|
||||
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const fileDocDataUpload = ref<File[]>([]);
|
||||
|
||||
/** เรียกใช้ store */
|
||||
const mixin = useCounterMixin();
|
||||
const complainstStore = useComplainstDataStore();
|
||||
const { date2Thai, dialogConfirm } = mixin;
|
||||
const { selectComplainantTpye, filterSelector } = complainstStore; // function จาก store complainstStore
|
||||
|
||||
/** validateForm */
|
||||
const complainantTypeRef = ref<Object | null>(null);
|
||||
const complainantRef = ref<Object | null>(null);
|
||||
const officeRef = ref<Object | null>(null);
|
||||
const agencyRef = ref<Object | null>(null);
|
||||
const topicComplaintRef = ref<Object | null>(null);
|
||||
const detailRef = ref<Object | null>(null);
|
||||
const datereceiveRef = ref<Object | null>();
|
||||
const dateconsiderationRef = ref<Object | null>(null);
|
||||
const offenseDescriptionRef = ref<Object | null>(null);
|
||||
const considerationLevelRef = ref<Object | null>(null);
|
||||
const datewarnRef = ref<Object | null>(null);
|
||||
const receivecomplaintsRef = ref<Object | null>(null);
|
||||
const petitionerRef = ref<Object | null>(null);
|
||||
const filesRef = ref<Object | null>(null);
|
||||
|
||||
/** รับ props มาจากหน้าหลัก */
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
|
|
@ -22,17 +51,44 @@ const props = defineProps({
|
|||
default: () => "",
|
||||
},
|
||||
});
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, dialogConfirm } = mixin; //function จาก stores หลัก
|
||||
|
||||
const complainstStore = useComplainstDataStore();
|
||||
const { selectComplainantTpye, filterSelector } = complainstStore; // function จาก store complainstStore
|
||||
|
||||
// options ทั้งหมด
|
||||
/** ข้อมูล form*/
|
||||
const formData = reactive<FormData>({
|
||||
complainantType: "",
|
||||
complainant: "",
|
||||
office: "",
|
||||
agency: "",
|
||||
topicComplaint: "",
|
||||
detail: "",
|
||||
datereceive: null,
|
||||
dateconsideration: null,
|
||||
offenseDescription: "",
|
||||
considerationLevel: "",
|
||||
datewarn: null,
|
||||
receivecomplaints: "",
|
||||
petitioner: "",
|
||||
files: null,
|
||||
});
|
||||
|
||||
/** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */
|
||||
const objectComplaintsRef: MyObjectComplaintsRef = {
|
||||
complainantType: complainantTypeRef,
|
||||
complainant: complainantRef,
|
||||
office: officeRef,
|
||||
agency: agencyRef,
|
||||
topicComplaint: topicComplaintRef,
|
||||
detail: detailRef,
|
||||
datereceive: datereceiveRef,
|
||||
dateconsideration: dateconsiderationRef,
|
||||
offenseDescription: offenseDescriptionRef,
|
||||
considerationLevel: considerationLevelRef,
|
||||
datewarn: datewarnRef,
|
||||
receivecomplaints: receivecomplaintsRef,
|
||||
petitioner: petitionerRef,
|
||||
files: filesRef,
|
||||
};
|
||||
|
||||
/** options ทั้งหมด*/
|
||||
const offenseDescriptiontoptions = ref<DataOption[]>([
|
||||
{ id: "0", name: "ยังไม่ระบุ" },
|
||||
{ id: "1", name: "ไม่ร้ายแรง" },
|
||||
|
|
@ -52,26 +108,11 @@ const receivecomplaintstoptions = ref<DataOption[]>([
|
|||
{ id: "5", name: "โทรศัพท์" },
|
||||
{ id: "6", name: "บอกกล่าว" },
|
||||
]);
|
||||
// ข้อมูล form
|
||||
const formData = reactive<FormData>({
|
||||
complainantType: "",
|
||||
complainant: "",
|
||||
office: "",
|
||||
agency: "",
|
||||
topicComplaint: "",
|
||||
detail: "",
|
||||
datereceive: null,
|
||||
dateconsideration: null,
|
||||
offenseDescription: "",
|
||||
considerationLevel: "",
|
||||
datewarn: null,
|
||||
receivecomplaints: "",
|
||||
petitioner: "",
|
||||
files: null,
|
||||
});
|
||||
const fileDocDataUpload = ref<File[]>([]);
|
||||
|
||||
// เลือกผู้ร้องเรียน
|
||||
/**
|
||||
* รับค่าผู้ถูกร้องเรียน
|
||||
* @param val บุคคล หน่วยงาน กทม
|
||||
*/
|
||||
async function selectComplainant(val: string) {
|
||||
formData.complainant = "";
|
||||
formData.office = "";
|
||||
|
|
@ -82,7 +123,8 @@ async function selectComplainant(val: string) {
|
|||
await fetchOffice(); // ถ้าเลือกหน่วยงานจะเรียก function fetchOffice เรียกโครงสร้างสำนักงาน
|
||||
}
|
||||
}
|
||||
// เรียกรายชื่อ
|
||||
|
||||
/** เรียกรายชื่อ */
|
||||
async function fetchListname() {
|
||||
const listName = [
|
||||
{
|
||||
|
|
@ -100,30 +142,24 @@ async function fetchListname() {
|
|||
];
|
||||
selectComplainantTpye(listName);
|
||||
}
|
||||
// เรียกโครงสร้างสำนักงาน
|
||||
async function fetchOffice() {
|
||||
// const listOffice = [
|
||||
// {
|
||||
// id: "1",
|
||||
// name: "สำนักเอ",
|
||||
// },
|
||||
// {
|
||||
// id: "2",
|
||||
// name: "สำนักเอ",
|
||||
// },
|
||||
// {
|
||||
// id: "3",
|
||||
// name: "สำนักเอ",
|
||||
// },
|
||||
// ];
|
||||
}
|
||||
// อัพโหลดไฟล์
|
||||
const fileUploadDoc = async (files: any) => {
|
||||
|
||||
/** เรียกโครงสร้างสำนักงาน */
|
||||
async function fetchOffice() {}
|
||||
|
||||
/**
|
||||
* ฟังชั่นอัปโหลดไฟล์
|
||||
* @param files ไฟล์ที่รับมา
|
||||
*/
|
||||
async function fileUploadDoc(files: any) {
|
||||
files.forEach((file: any) => {
|
||||
fileDocDataUpload.value.push(file);
|
||||
});
|
||||
};
|
||||
// เลือกระดับการพิจารณา
|
||||
}
|
||||
|
||||
/**
|
||||
* เลือกระดับการพิจารณา
|
||||
* @param val รับตัวเลข ในรูปแบบ string
|
||||
*/
|
||||
function selectLevel(val: string) {
|
||||
let dayNum = 0;
|
||||
if (val == "3") {
|
||||
|
|
@ -143,38 +179,7 @@ function selectLevel(val: string) {
|
|||
}
|
||||
}
|
||||
|
||||
// validateForm
|
||||
const complainantTypeRef = ref<Object | null>(null);
|
||||
const complainantRef = ref<Object | null>(null);
|
||||
const officeRef = ref<Object | null>(null);
|
||||
const agencyRef = ref<Object | null>(null);
|
||||
const topicComplaintRef = ref<Object | null>(null);
|
||||
const detailRef = ref<Object | null>(null);
|
||||
const datereceiveRef = ref<Object | null>();
|
||||
const dateconsiderationRef = ref<Object | null>(null);
|
||||
const offenseDescriptionRef = ref<Object | null>(null);
|
||||
const considerationLevelRef = ref<Object | null>(null);
|
||||
const datewarnRef = ref<Object | null>(null);
|
||||
const receivecomplaintsRef = ref<Object | null>(null);
|
||||
const petitionerRef = ref<Object | null>(null);
|
||||
const filesRef = ref<Object | null>(null);
|
||||
|
||||
const objectComplaintsRef: MyObjectComplaintsRef = {
|
||||
complainantType: complainantTypeRef,
|
||||
complainant: complainantRef,
|
||||
office: officeRef,
|
||||
agency: agencyRef,
|
||||
topicComplaint: topicComplaintRef,
|
||||
detail: detailRef,
|
||||
datereceive: datereceiveRef,
|
||||
dateconsideration: dateconsiderationRef,
|
||||
offenseDescription: offenseDescriptionRef,
|
||||
considerationLevel: considerationLevelRef,
|
||||
datewarn: datewarnRef,
|
||||
receivecomplaints: receivecomplaintsRef,
|
||||
petitioner: petitionerRef,
|
||||
files: filesRef,
|
||||
};
|
||||
/** ฟังก์ชั่นตรวจสอบความถูกต้องของข้อมูลในฟอร์ม */
|
||||
function validateForm() {
|
||||
const hasError = [];
|
||||
for (const key in objectComplaintsRef) {
|
||||
|
|
@ -192,19 +197,25 @@ function validateForm() {
|
|||
console.log("ไม่ผ่าน ");
|
||||
}
|
||||
}
|
||||
// บันทึกข้อมูล
|
||||
|
||||
/** ฟังชั่น บันทึก */
|
||||
function onSubmit() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
console.log(formData);
|
||||
props.onSubmit()
|
||||
props.onSubmit();
|
||||
},
|
||||
"ยืนยันการบันทึกข้อมูล",
|
||||
"ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* เช็คข้อมูลจาก props
|
||||
* เมื่อมีข้อมูล
|
||||
* เก็บข้อมูลลง formData
|
||||
*/
|
||||
watch(props.data, async () => {
|
||||
formData.complainantType = props.data.complainantType;
|
||||
formData.complainant = props.data.complainant;
|
||||
|
|
@ -227,29 +238,27 @@ watch(props.data, async () => {
|
|||
<q-card flat bordered>
|
||||
<form @submit.prevent="validateForm">
|
||||
<div class="col-12 row q-pa-md">
|
||||
<div
|
||||
class="col-xs-12 col-sm-12 row q-col-gutter-md"
|
||||
>
|
||||
<div class="col-xs-12 col-sm-12 row q-col-gutter-md">
|
||||
<div class="col-xs-12 col-sm-3" id="complainantType">
|
||||
<q-select
|
||||
for="SelectcomplainantType"
|
||||
v-model="formData.complainantType"
|
||||
ref="complainantTypeRef"
|
||||
dense
|
||||
outlined
|
||||
v-model="formData.complainantType"
|
||||
:options="complainstStore.complainantoptions"
|
||||
label="ผู้ถูกร้องเรียน"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
emit-value
|
||||
use-input
|
||||
map-options
|
||||
hide-bottom-space
|
||||
:options="complainstStore.complainantoptions"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกผู้ร้องเรียน'}`]"
|
||||
lazy-rules
|
||||
@update:model-value="
|
||||
selectComplainant(formData.complainantType)
|
||||
"
|
||||
use-input
|
||||
@filter="(inputValue: any,
|
||||
doneFn: Function) => filterSelector(inputValue, doneFn, 'filtercomplainantType'
|
||||
)"
|
||||
|
|
@ -297,6 +306,7 @@ watch(props.data, async () => {
|
|||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="col-xs-12 col-sm-3"
|
||||
v-if="formData.complainantType === '1'"
|
||||
|
|
@ -315,6 +325,7 @@ watch(props.data, async () => {
|
|||
lazy-rules
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-3" id="agency">
|
||||
<q-select
|
||||
ref="agencyRef"
|
||||
|
|
@ -345,6 +356,7 @@ watch(props.data, async () => {
|
|||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-12" id="topicComplaint">
|
||||
<q-input
|
||||
for="inputTopicComplaint"
|
||||
|
|
@ -360,6 +372,7 @@ watch(props.data, async () => {
|
|||
rows="5"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-12" id="detail">
|
||||
<q-input
|
||||
for="inputDetail"
|
||||
|
|
@ -375,6 +388,7 @@ watch(props.data, async () => {
|
|||
rows="5"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-3" id="datereceive">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
|
|
@ -442,6 +456,7 @@ watch(props.data, async () => {
|
|||
@update:model-value="selectLevel(formData.considerationLevel)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-3" id="dateconsideration">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
|
|
@ -490,6 +505,7 @@ watch(props.data, async () => {
|
|||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-3" id="offenseDescription">
|
||||
<q-select
|
||||
for="selectOffenseDescription"
|
||||
|
|
@ -557,6 +573,7 @@ watch(props.data, async () => {
|
|||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-3" id="receivecomplaints">
|
||||
<q-select
|
||||
for="selectReceivecomplaints"
|
||||
|
|
@ -575,6 +592,7 @@ watch(props.data, async () => {
|
|||
lazy-rules
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-12" id="petitioner">
|
||||
<q-input
|
||||
for="inputPetitioner"
|
||||
|
|
@ -590,6 +608,7 @@ watch(props.data, async () => {
|
|||
rows="5"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12" id="files">
|
||||
<q-file
|
||||
for="inputFiles"
|
||||
|
|
|
|||
|
|
@ -11,21 +11,17 @@ import TableComplaint from "@/modules/11_discipline/components/1_Complaint/Table
|
|||
|
||||
const router = useRouter();
|
||||
|
||||
/** stoer */
|
||||
const complainstStore = useComplainstDataStore();
|
||||
const { fetchComplainst } = complainstStore; // function จาก stores
|
||||
const { fetchComplainst } = complainstStore;
|
||||
|
||||
//ข้อมูล Table
|
||||
const filterTable = ref<string>("");
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchListComplaints();
|
||||
});
|
||||
|
||||
// เรีนกรายการเรื่องร้องเรียน
|
||||
/**เรีนกรายการเรื่องร้องเรียน */
|
||||
async function fetchListComplaints() {
|
||||
const listData: DataList[] = [
|
||||
{
|
||||
id:'001',
|
||||
id: "001",
|
||||
subject: "ทุจริตในหน้าที่",
|
||||
detail: "มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน",
|
||||
complainant: "นางศิรินภา คงน้อย",
|
||||
|
|
@ -35,7 +31,7 @@ async function fetchListComplaints() {
|
|||
considerationDeadlineDate: new Date("2023-12-02"),
|
||||
},
|
||||
{
|
||||
id:'002',
|
||||
id: "002",
|
||||
subject: "ทุจริตในหน้าที่",
|
||||
detail: "มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน",
|
||||
complainant: "นายแก้ว คำ",
|
||||
|
|
@ -45,7 +41,7 @@ async function fetchListComplaints() {
|
|||
considerationDeadlineDate: new Date("2023-12-02"),
|
||||
},
|
||||
{
|
||||
id:'003',
|
||||
id: "003",
|
||||
subject: "ทุจริตในหน้าที่",
|
||||
detail:
|
||||
"มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน",
|
||||
|
|
@ -58,9 +54,15 @@ async function fetchListComplaints() {
|
|||
];
|
||||
await fetchComplainst(listData);
|
||||
}
|
||||
/** ไปยังหน้าเพิ่มข้อมูล */
|
||||
function redirectToPageadd() {
|
||||
router.push(`/discipline/complaints/add`);
|
||||
}
|
||||
|
||||
/** เรียกใช้งาน ฟังชั่น ตอนเริ่มโหลดหน้า */
|
||||
onMounted(async () => {
|
||||
await fetchListComplaints();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -80,7 +82,9 @@ function redirectToPageadd() {
|
|||
><q-tooltip>เพิ่มเรื่องร้องเรียน </q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
|
||||
<q-space />
|
||||
|
||||
<q-input
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
id="filterTable"
|
||||
|
|
@ -95,6 +99,7 @@ function redirectToPageadd() {
|
|||
<q-icon name="search" />
|
||||
</template>
|
||||
</q-input>
|
||||
|
||||
<q-select
|
||||
id="visibleColumns"
|
||||
for="visibleColumns"
|
||||
|
|
@ -112,6 +117,7 @@ function redirectToPageadd() {
|
|||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<TableComplaint :filterTable="filterTable" />
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -5,16 +5,19 @@ import type { QTableProps } from "quasar";
|
|||
// importStroe
|
||||
import { useComplainstDataStore } from "@/modules/11_discipline/store/ComplaintsStore";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
const router = useRouter();
|
||||
|
||||
const router = useRouter();
|
||||
const complainstStore = useComplainstDataStore();
|
||||
|
||||
/** รับ props มาจากหน้าหลัก */
|
||||
const props = defineProps({
|
||||
filterTable: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
});
|
||||
|
||||
/** หัวตาราง */
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
|
|
@ -89,6 +92,8 @@ const columns = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
|
||||
/** หัวข้อที่เเสดงในตาราง */
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"subject",
|
||||
|
|
@ -100,17 +105,22 @@ const visibleColumns = ref<string[]>([
|
|||
"considerationDeadlineDate",
|
||||
]);
|
||||
|
||||
/** เริ่มโหลดหน้า page เอาข้อมูลไปเก็บ ใน store*/
|
||||
onMounted(() => {
|
||||
complainstStore.columns = columns.value;
|
||||
complainstStore.visibleColumns = visibleColumns.value;
|
||||
});
|
||||
|
||||
//pagination
|
||||
/** แสดงจำนวนในตาราง */
|
||||
const pagination = ref({
|
||||
descending: true,
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
});
|
||||
/**
|
||||
* ฟังชั่นสำหรับ เปลี่ยน route ตาม id ที่รับมา
|
||||
* @param id ไอดีระบุ
|
||||
*/
|
||||
function OpenEdit(id:string){
|
||||
console.log(id)
|
||||
router.push(`/discipline/complaints/${id}`)
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<script setup lang="ts">
|
||||
import Form from "@/modules/11_discipline/components/2_InvestigateFacts/Form.vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
// บันทึกข้อมูล
|
||||
const onSubmit = async () => {
|
||||
// post
|
||||
/** บันทึกข้อมูลเเละ route กลับหน้าหลัก */
|
||||
async function onSubmit(){
|
||||
console.log("add");
|
||||
router.push(`/discipline/investigatefacts`);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -7,11 +7,9 @@ import { useRouter, useRoute } from "vue-router";
|
|||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const id = ref<string>(route.params.id as string);
|
||||
onMounted(() => {
|
||||
fetchData();
|
||||
});
|
||||
|
||||
// get ข้อมูลเก่ากรณีแก้ไขข้อมูล
|
||||
|
||||
/** ข้อมูล v-model ของฟอร์ม */
|
||||
const data = reactive<FormData>({
|
||||
complaint: "",
|
||||
complaintdetail: "",
|
||||
|
|
@ -29,6 +27,7 @@ const data = reactive<FormData>({
|
|||
causeText: "",
|
||||
});
|
||||
|
||||
/** จำลองข้อมูลจาก api */
|
||||
const fetchData = async () => {
|
||||
// ดึงค่าจาก api
|
||||
data.complaint = "เรื่องที่ 1";
|
||||
|
|
@ -47,12 +46,20 @@ const fetchData = async () => {
|
|||
data.causeText = "";
|
||||
};
|
||||
|
||||
// แก้ไขข้อมูล
|
||||
const onSubmit = async (id: string) => {
|
||||
/**
|
||||
* บันทึกข้อมูลที่เเก้ไข
|
||||
* @param id ระบุ บุคคล
|
||||
*/
|
||||
async function onSubmit(id:string){
|
||||
// put
|
||||
console.log("edit");
|
||||
console.log("edit",id);
|
||||
router.push(`/discipline/investigatefacts`);
|
||||
};
|
||||
|
||||
/** โหลดข้อมูลเมื่อเข้าหน้านี้ */
|
||||
onMounted(() => {
|
||||
fetchData();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
|||
|
|
@ -12,26 +12,16 @@ import { diffDates } from "@fullcalendar/core/internal";
|
|||
|
||||
const $q = useQuasar();
|
||||
|
||||
const investigateFactStore = useInvestigateFactStore(); // เรียกใช้ store
|
||||
const { filterFnOptionsType } = investigateFactStore; // เรียกใช้ filterFnOptionsType จาก store
|
||||
|
||||
const mixin = useCounterMixin(); // เรียกใช้ mixin
|
||||
const { date2Thai, dialogConfirm } = mixin; // เรียกใช้ date2Thai, dialogConfirm จาก mixin
|
||||
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
default: null,
|
||||
},
|
||||
onSubmit: {
|
||||
type: Function,
|
||||
default: () => "",
|
||||
},
|
||||
});
|
||||
/**เรียกใช้ store */
|
||||
const investigateFactStore = useInvestigateFactStore();
|
||||
const mixin = useCounterMixin();
|
||||
const { filterFnOptionsType } = investigateFactStore;
|
||||
const { date2Thai, dialogConfirm } = mixin;
|
||||
|
||||
const complaintsOptions = ref<any>([]);
|
||||
const isUpdate = ref<boolean>(false);
|
||||
|
||||
/** ตัวแปร ref สำหรับแสดง validate */
|
||||
const complaintRef = ref<Object | null>(null);
|
||||
const complaintdetailRef = ref<Object | null>(null);
|
||||
const detailRef = ref<Object | null>(null);
|
||||
|
|
@ -47,6 +37,19 @@ const daysExtendRef = ref<Object | null>(null);
|
|||
const statusResultRef = ref<Object | null>(null);
|
||||
const causeTextRef = ref<Object | null>(null);
|
||||
|
||||
/** รับ props มาจากหน้าหลัก */
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
default: null,
|
||||
},
|
||||
onSubmit: {
|
||||
type: Function,
|
||||
default: () => "",
|
||||
},
|
||||
});
|
||||
|
||||
/** ข้อมูล v-model ของฟอร์ม */
|
||||
const formData = reactive<FormData>({
|
||||
complaint: "",
|
||||
complaintdetail: "",
|
||||
|
|
@ -64,6 +67,7 @@ const formData = reactive<FormData>({
|
|||
causeText: "",
|
||||
});
|
||||
|
||||
/** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */
|
||||
const objectInvestigate: MyObjectInvestigateRef = {
|
||||
complaint: complaintRef,
|
||||
complaintdetail: complaintdetailRef,
|
||||
|
|
@ -117,12 +121,21 @@ function onSubmit() {
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังชั้นคำนวณเวลาวันที่สิ้นสุดจาก วันที่เริ่ม
|
||||
* @param val วันที่เริ่ม
|
||||
*/
|
||||
function calEndDate(val: string) {
|
||||
const date = new Date(props.data.dateEnd);
|
||||
const dateNew = new Date();
|
||||
formData.dateEnd = new Date(dateNew.setDate(date.getDate() + Number(val)));
|
||||
}
|
||||
|
||||
/**
|
||||
* เช็คข้อมูลจาก props
|
||||
* เมื่อมีข้อมูล
|
||||
* เก็บข้อมูลลง formData
|
||||
*/
|
||||
watch(props.data, async () => {
|
||||
if (props.data !== null) {
|
||||
isUpdate.value = true;
|
||||
|
|
@ -175,6 +188,7 @@ watch(props.data, async () => {
|
|||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
<div class="col-3">
|
||||
<q-select
|
||||
for="#fault"
|
||||
|
|
@ -202,6 +216,7 @@ watch(props.data, async () => {
|
|||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
<div class="col-3">
|
||||
<q-select
|
||||
for="#investigation"
|
||||
|
|
@ -229,6 +244,7 @@ watch(props.data, async () => {
|
|||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
<div v-if="formData.investigation === '003'" class="col-12">
|
||||
<q-input
|
||||
for="#other"
|
||||
|
|
@ -249,6 +265,7 @@ watch(props.data, async () => {
|
|||
]"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="row col-12">
|
||||
<q-card
|
||||
bordered
|
||||
|
|
@ -271,7 +288,9 @@ watch(props.data, async () => {
|
|||
keep-color
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12"><q-separator /></div>
|
||||
|
||||
<div class="col-xs-12 col-sm-12 q-pa-sm row">
|
||||
<div class="q-col-gutter-sm row">
|
||||
<datepicker
|
||||
|
|
@ -400,6 +419,7 @@ watch(props.data, async () => {
|
|||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
for="#complaintdetail"
|
||||
|
|
@ -418,6 +438,7 @@ watch(props.data, async () => {
|
|||
type="textarea"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<q-file
|
||||
for="#fileComplaint"
|
||||
|
|
@ -435,6 +456,7 @@ watch(props.data, async () => {
|
|||
</template>
|
||||
</q-file>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
for="#detail"
|
||||
|
|
@ -451,6 +473,7 @@ watch(props.data, async () => {
|
|||
type="textarea"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<q-file
|
||||
for="#evidenceFiles"
|
||||
|
|
@ -458,9 +481,9 @@ watch(props.data, async () => {
|
|||
dense
|
||||
ref="evidenceFilesRef"
|
||||
v-model="formData.evidenceFiles"
|
||||
label="ไฟล์หลักฐานการรับ"
|
||||
label="ไฟล์เอกสารหลักฐาน"
|
||||
lazy-rules
|
||||
:rules="[(val) => !!val || 'กรุณาเลือกไฟล์หลักฐานการรับ']"
|
||||
:rules="[(val) => !!val || 'กรุณาเลือกไฟล์เอกสารหลักฐาน']"
|
||||
hide-bottom-space
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
|
|
@ -468,6 +491,7 @@ watch(props.data, async () => {
|
|||
</template>
|
||||
</q-file>
|
||||
</div>
|
||||
|
||||
<div class="row col-12 q-col-gutter-md">
|
||||
<div class="col-3">
|
||||
<q-select
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ const { fecthList } = dataInvestigate;
|
|||
// } = mixin;
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
|
||||
// ค้นหาในตาราง
|
||||
/** ค้นหาข้อมูลในตาราง */
|
||||
const filterKeyword = ref<string>("");
|
||||
const filterRef = ref<HTMLInputElement | null>(null);
|
||||
const resetFilter = () => {
|
||||
|
|
@ -34,6 +34,8 @@ const resetFilter = () => {
|
|||
};
|
||||
|
||||
const attrs = ref<any>(useAttrs());
|
||||
|
||||
/** แสดงจำนวนในตาราง */
|
||||
const pagination = ref({
|
||||
// sortBy: "desc",
|
||||
descending: false,
|
||||
|
|
@ -41,9 +43,22 @@ const pagination = ref({
|
|||
rowsPerPage: 10,
|
||||
});
|
||||
|
||||
/**ไปยังหน้าเพิ่มข้อมูล */
|
||||
const clickAdd = () => {
|
||||
router.push(`/discipline/investigatefacts/add`);
|
||||
};
|
||||
|
||||
/**
|
||||
* ไปหน้าแก้ไข
|
||||
* @param id ไอดีเฉพาะ รายบุคคล
|
||||
*/
|
||||
function editPage(id: string) {
|
||||
router.push(`/discipline/investigatefacts/${id}`);
|
||||
}
|
||||
|
||||
/**เมื่อเริ่มโหลดหน้า
|
||||
* ส่งข้อมูลจำลองไปยัง store
|
||||
*/
|
||||
onMounted(async () => {
|
||||
await fecthList([
|
||||
{
|
||||
|
|
@ -80,9 +95,6 @@ onMounted(async () => {
|
|||
},
|
||||
]);
|
||||
});
|
||||
function editPage(id: string) {
|
||||
router.push(`/discipline/investigatefacts/${id}`);
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
|
|
@ -144,6 +156,7 @@ function editPage(id: string) {
|
|||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<d-table
|
||||
ref="table"
|
||||
|
|
|
|||
|
|
@ -3,9 +3,8 @@ import Form from "@/modules/11_discipline/components/3_InvestigateDisciplinary/F
|
|||
import { useRoute, useRouter } from "vue-router";
|
||||
const router = useRouter();
|
||||
|
||||
// บันทึกข้อมูล
|
||||
/** บันทึกข้อมูลเเละ route กลับหน้าหลัก */
|
||||
const onSubmit = async () => {
|
||||
// post
|
||||
console.log("add");
|
||||
router.push(`/discipline/disciplinary`);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ const selected = ref<directorType[]>([]);
|
|||
const mixin = useCounterMixin();
|
||||
const { showLoader, success, messageError, dialogConfirm, hideLoader } = mixin;
|
||||
|
||||
//ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
/** ค้นหาคอลัม */
|
||||
const visibleColumns2 = ref<string[]>([
|
||||
"no",
|
||||
"nameDirector",
|
||||
|
|
@ -24,6 +24,8 @@ const visibleColumns2 = ref<string[]>([
|
|||
"telephone",
|
||||
"role"
|
||||
]);
|
||||
|
||||
/**ข้อมูลหัว ตาราง*/
|
||||
const columns2 = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
|
|
@ -104,6 +106,7 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
},
|
||||
]);
|
||||
|
||||
/** รับ props มาจากหน้าหลัก */
|
||||
const props = defineProps({
|
||||
Modal: Boolean,
|
||||
clickClose: Function,
|
||||
|
|
@ -119,8 +122,8 @@ const checkSelected = computed(() => {
|
|||
console.log(checkSelected.value);
|
||||
});
|
||||
|
||||
//popup ยืนยันส่งัว
|
||||
const saveDirector = () => {
|
||||
/** popup ยืนยันส่งัว */
|
||||
function saveDirector(){
|
||||
dialogConfirm(
|
||||
$q,
|
||||
() => DirectorSave(),
|
||||
|
|
@ -128,17 +131,22 @@ const saveDirector = () => {
|
|||
"ต้องการยืนยันเพิ่มรายชื่อกรรมการ?"
|
||||
);
|
||||
};
|
||||
//ส่งไปออกคำสั่ง
|
||||
const DirectorSave = async () => {};
|
||||
|
||||
/** ส่งไปออกคำสั่ง */
|
||||
async function DirectorSave(){};
|
||||
|
||||
const emit = defineEmits(["update:filterKeyword2", "update:selected"]);
|
||||
const updateInput = (value: any) => {
|
||||
|
||||
function updateInput(value: any){
|
||||
emit("update:filterKeyword2", value);
|
||||
};
|
||||
//รีเซ็ตค่าในช่องค้นหา
|
||||
const Reset = () => {
|
||||
|
||||
/**รีเซ็ตค่าในช่องค้นหา */
|
||||
function Reset(){
|
||||
emit("update:filterKeyword2", "");
|
||||
};
|
||||
|
||||
/** เช็คค่า props.Modal === true */
|
||||
watchEffect(() => {
|
||||
if (props.Modal === true) {
|
||||
selected.value = [];
|
||||
|
|
@ -172,6 +180,7 @@ watchEffect(() => {
|
|||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
|
||||
<d-table
|
||||
:columns="columns2"
|
||||
:rows="rows2"
|
||||
|
|
@ -181,15 +190,6 @@ watchEffect(() => {
|
|||
selection="multiple"
|
||||
v-model:selected="selected"
|
||||
>
|
||||
<template v-slot:header-selection="scope">
|
||||
<!-- <q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="scope.selected"
|
||||
/> -->
|
||||
</template>
|
||||
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td>
|
||||
|
|
|
|||
|
|
@ -5,10 +5,12 @@ import type { Pagination } from "@/modules/04_registry/interface/index/Main";
|
|||
const attrs = ref<any>(useAttrs());
|
||||
const table = ref<any>(null);
|
||||
const filterRef = ref<any>(null);
|
||||
|
||||
const initialPagination = ref<Pagination>({
|
||||
rowsPerPage: 0,
|
||||
});
|
||||
|
||||
/** รับ props มาจากหน้าหลัก */
|
||||
const props = defineProps({
|
||||
count: Number,
|
||||
pass: Number,
|
||||
|
|
@ -46,10 +48,12 @@ const emit = defineEmits([
|
|||
"update:inputvisible",
|
||||
"update:editvisible",
|
||||
]);
|
||||
const updateInput = (value: string | number | null) => {
|
||||
|
||||
function updateInput(value: string | number | null){
|
||||
emit("update:inputfilter", value);
|
||||
};
|
||||
const updateVisible = (value: []) => {
|
||||
|
||||
function updateVisible(value: []){
|
||||
emit("update:inputvisible", value);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -7,13 +7,11 @@ import { useRouter, useRoute } from "vue-router";
|
|||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const id = ref<string>(route.params.id as string);
|
||||
onMounted(() => {
|
||||
fetchData();
|
||||
});
|
||||
|
||||
// get ข้อมูลเก่ากรณีแก้ไขข้อมูล
|
||||
|
||||
/** ข้อมูล v-model ของฟอร์ม */
|
||||
const data = reactive<FormData>({
|
||||
Complaint: "",
|
||||
complaint: "",
|
||||
dateInvestigate: null,
|
||||
dateAllegation: null,
|
||||
dateEvident: null,
|
||||
|
|
@ -33,8 +31,10 @@ const data = reactive<FormData>({
|
|||
filesWitnesses: null,
|
||||
filesEtc: null,
|
||||
});
|
||||
|
||||
/** จำลองข้อมูลจาก api */
|
||||
const fetchData = async () => {
|
||||
data.Complaint = "test1"
|
||||
data.complaint = "test1"
|
||||
data.dateInvestigate = new Date("2023-11-08T14:58:00")
|
||||
data.dateAllegation = new Date("2023-11-08T14:58:00")
|
||||
data.dateEvident = new Date("2023-11-08T14:58:00")
|
||||
|
|
@ -55,12 +55,19 @@ const fetchData = async () => {
|
|||
data.filesEtc = null
|
||||
};
|
||||
|
||||
// แก้ไขข้อมูล
|
||||
const onSubmit = async () => {
|
||||
// put
|
||||
/**
|
||||
* บันทึกข้อมูลที่เเก้ไข
|
||||
* @param id ระบุ บุคคล
|
||||
*/
|
||||
const onSubmit = async (id:string) => {
|
||||
console.log("edit");
|
||||
router.push(`/discipline/disciplinary`);
|
||||
};
|
||||
|
||||
/** โหลดข้อมูลเมื่อเข้าหน้านี้ */
|
||||
onMounted(() => {
|
||||
fetchData();
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<div class="col-xs-12 col-sm-12 col-md-11">
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,23 +1,36 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
|
||||
import Table from "@/modules/11_discipline/components/3_InvestigateDisciplinary/Table.vue";
|
||||
import { useInvestigateDisStore } from "../../store/InvestigateDisStore";
|
||||
|
||||
import { useRouter } from "vue-router";
|
||||
const dataInvestigateDis = useInvestigateDisStore();
|
||||
const { fecthList } = dataInvestigateDis;
|
||||
import Table from "@/modules/11_discipline/components/3_InvestigateDisciplinary/Table.vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useInvestigateDisStore } from "../../store/InvestigateDisStore";
|
||||
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
|
||||
|
||||
const $q = useQuasar(); // show dialog
|
||||
const mixin = useCounterMixin();
|
||||
const router = useRouter();
|
||||
const { hideLoader } = mixin;
|
||||
const filter = ref<string>(""); //search data table
|
||||
const mixin = useCounterMixin();
|
||||
const dataInvestigateDis = useInvestigateDisStore();
|
||||
const { hideLoader } = mixin;
|
||||
const { fecthList } = dataInvestigateDis;
|
||||
|
||||
const initialPagination = ref<Pagination>({
|
||||
rowsPerPage: 0,
|
||||
});
|
||||
|
||||
/**
|
||||
* ไปหน้าแก้ไข
|
||||
* @param id ไอดีเฉพาะ รายบุคคล
|
||||
*/
|
||||
function openEdit(id:string) {
|
||||
console.log(id)
|
||||
router.push(`/discipline/disciplinary/${id}`)
|
||||
}
|
||||
|
||||
/**เมื่อเริ่มโหลดหน้า
|
||||
* ส่งข้อมูลจำลองไปยัง store
|
||||
*/
|
||||
onMounted(async () => {
|
||||
fecthList([
|
||||
{
|
||||
|
|
@ -67,14 +80,6 @@ onMounted(async () => {
|
|||
]);
|
||||
await hideLoader();
|
||||
});
|
||||
|
||||
const clickAdd = () => {
|
||||
router.push(`/discipline/InvestigateDisciplinary/add`);
|
||||
};
|
||||
function openEdit(id:string) {
|
||||
console.log(id)
|
||||
router.push(`/discipline/disciplinary/${id}`)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -93,7 +98,6 @@ function openEdit(id:string) {
|
|||
v-model:inputvisible="dataInvestigateDis.visibleColumns"
|
||||
:pagination="initialPagination"
|
||||
:nornmalData="true"
|
||||
:add="clickAdd"
|
||||
:paging="true"
|
||||
:titleText="''"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -1,59 +1,122 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, useAttrs } from "vue";
|
||||
import type { Pagination } from "@/modules/04_registry/interface/index/Main";
|
||||
|
||||
const table = ref<any>(null);
|
||||
const filterRef = ref<any>(null);
|
||||
const attrs = ref<any>(useAttrs());
|
||||
const paging = ref<boolean>(true);
|
||||
const pagination = ref({
|
||||
// sortBy: "desc",
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
});
|
||||
|
||||
/** รับ props มาจากหน้าหลัก */
|
||||
const props = defineProps({
|
||||
count: Number,
|
||||
pass: Number,
|
||||
notpass: Number,
|
||||
inputfilter: String,
|
||||
name: String,
|
||||
icon: String,
|
||||
inputvisible: Array,
|
||||
editvisible: Boolean,
|
||||
validate: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
nornmalData: {
|
||||
type: Boolean,
|
||||
defualt: true,
|
||||
},
|
||||
conclude: {
|
||||
type: Boolean,
|
||||
defualt: false,
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits([
|
||||
"update:inputfilter",
|
||||
"update:inputvisible",
|
||||
"update:editvisible",
|
||||
]);
|
||||
|
||||
function paginationLabel(start: string, end: string, total: string) {
|
||||
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
|
||||
else return start + "-" + end + " ใน " + total;
|
||||
}
|
||||
|
||||
function updateInput(value: string | number | null) {
|
||||
emit("update:inputfilter", value);
|
||||
}
|
||||
|
||||
function updateVisible(value: []) {
|
||||
emit("update:inputvisible", value);
|
||||
}
|
||||
|
||||
function resetFilter() {
|
||||
// reset ค่าที่ค้นหาเมื่อกดปุ่ม X ในกล่องค้นหา
|
||||
emit("update:inputfilter", "");
|
||||
filterRef.value.focus();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="q-pb-sm row q-col-gutter-sm">
|
||||
<!-- -->
|
||||
<div class="q-gutter-sm" v-if="nornmalData == true">
|
||||
<q-btn
|
||||
to="/discipline/investigate-disciplinary/add"
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="add"
|
||||
@click="checkAdd"
|
||||
icon="mdi-plus"
|
||||
>
|
||||
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<q-space />
|
||||
<!-- ค้นหาข้อความใน table -->
|
||||
<q-input
|
||||
standout
|
||||
dense
|
||||
:model-value="inputfilter"
|
||||
ref="filterRef"
|
||||
@update:model-value="updateInput"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="inputfilter == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="inputfilter !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<!-- แสดงคอลัมน์ใน table -->
|
||||
<q-select
|
||||
:model-value="inputvisible"
|
||||
@update:model-value="updateVisible"
|
||||
:display-value="$q.lang.table.columns"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
:options="attrs.columns"
|
||||
options-dense
|
||||
option-value="name"
|
||||
map-options
|
||||
emit-value
|
||||
class="col-xs-12 col-sm-3 col-md-2 gt-xs"
|
||||
>
|
||||
<template> </template>
|
||||
</q-select>
|
||||
<!-- ค้นหาข้อความใน table -->
|
||||
<q-input
|
||||
standout
|
||||
dense
|
||||
:model-value="inputfilter"
|
||||
ref="filterRef"
|
||||
@update:model-value="updateInput"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="inputfilter == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="inputfilter !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<!-- แสดงคอลัมน์ใน table -->
|
||||
<q-select
|
||||
:model-value="inputvisible"
|
||||
@update:model-value="updateVisible"
|
||||
:display-value="$q.lang.table.columns"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
:options="attrs.columns"
|
||||
options-dense
|
||||
option-value="name"
|
||||
map-options
|
||||
emit-value
|
||||
class="col-xs-12 col-sm-3 col-md-2 gt-xs"
|
||||
>
|
||||
</q-select>
|
||||
</div>
|
||||
<d-table
|
||||
ref="table"
|
||||
|
|
@ -76,92 +139,9 @@
|
|||
<template #body="props">
|
||||
<slot v-bind="props" name="columns"></slot>
|
||||
</template>
|
||||
<!-- <template v-slot:pagination="scope">
|
||||
<q-pagination
|
||||
v-model="pagination.page"
|
||||
active-color="primary"
|
||||
color="dark"
|
||||
:max="scope.pagesNumber"
|
||||
:max-pages="5"
|
||||
size="sm"
|
||||
boundary-links
|
||||
direction-links
|
||||
></q-pagination>
|
||||
</template> -->
|
||||
</d-table>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, useAttrs } from "vue";
|
||||
import type { Pagination } from "@/modules/04_registry/interface/index/Main";
|
||||
|
||||
const attrs = ref<any>(useAttrs());
|
||||
const paging = ref<boolean>(true);
|
||||
const pagination = ref({
|
||||
// sortBy: "desc",
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
});
|
||||
const paginationLabel = (start: string, end: string, total: string) => {
|
||||
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
|
||||
else return start + "-" + end + " ใน " + total;
|
||||
};
|
||||
const table = ref<any>(null);
|
||||
const filterRef = ref<any>(null);
|
||||
const initialPagination = ref<Pagination>({
|
||||
rowsPerPage: 0,
|
||||
});
|
||||
|
||||
const props = defineProps({
|
||||
count: Number,
|
||||
pass: Number,
|
||||
notpass: Number,
|
||||
|
||||
inputfilter: String,
|
||||
name: String,
|
||||
icon: String,
|
||||
inputvisible: Array,
|
||||
editvisible: Boolean,
|
||||
add: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
validate: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
nornmalData: {
|
||||
type: Boolean,
|
||||
defualt: true,
|
||||
},
|
||||
conclude: {
|
||||
type: Boolean,
|
||||
defualt: false,
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits([
|
||||
"update:inputfilter",
|
||||
"update:inputvisible",
|
||||
"update:editvisible",
|
||||
]);
|
||||
const updateInput = (value: string | number | null) => {
|
||||
emit("update:inputfilter", value);
|
||||
};
|
||||
const updateVisible = (value: []) => {
|
||||
emit("update:inputvisible", value);
|
||||
};
|
||||
|
||||
const checkAdd = () => {
|
||||
props.add();
|
||||
};
|
||||
|
||||
const resetFilter = () => {
|
||||
// reset ค่าที่ค้นหาเมื่อกดปุ่ม X ในกล่องค้นหา
|
||||
emit("update:inputfilter", "");
|
||||
filterRef.value.focus();
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.icon-color {
|
||||
color: #4154b3;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
interface FormData {
|
||||
Complaint: string;
|
||||
complaint: string;
|
||||
dateInvestigate: Date | null;
|
||||
dateAllegation: Date | null;
|
||||
dateEvident: Date | null;
|
||||
|
|
@ -21,7 +21,7 @@ interface FormData {
|
|||
}
|
||||
|
||||
interface disciplinaryRef {
|
||||
Complaint: object | null;
|
||||
complaint: object | null;
|
||||
dateInvestigate: object | null;
|
||||
dateAllegation: object | null;
|
||||
dateEvident: object | null;
|
||||
|
|
@ -43,4 +43,4 @@ interface disciplinaryRef {
|
|||
[key: string]: any;
|
||||
}
|
||||
|
||||
export type { FormData, disciplinaryRef, investigateDisDataRowType };
|
||||
export type { FormData, disciplinaryRef };
|
||||
|
|
|
|||
|
|
@ -8,11 +8,11 @@ const investigatefactsEdit = () =>
|
|||
import("@/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue");
|
||||
const disciplinaryMain = () =>
|
||||
import(
|
||||
"@/modules/11_discipline/components/3_InvestigateDisciplinary/MainPage.vue"
|
||||
"@/modules/11_discipline/components/3_investigateDisciplinary/MainPage.vue"
|
||||
);
|
||||
const disciplinaryEdit = () =>
|
||||
import(
|
||||
"@/modules/11_discipline/components/3_InvestigateDisciplinary/EditPage.vue"
|
||||
"@/modules/11_discipline/components/3_investigateDisciplinary/EditPage.vue"
|
||||
);
|
||||
const oredrMain = () =>
|
||||
import("@/modules/11_discipline/components/4_Order/MainPage.vue");
|
||||
|
|
@ -47,7 +47,7 @@ const reportType = () =>
|
|||
|
||||
const InvestigateDisciplinaryAdd = () =>
|
||||
import(
|
||||
"@/modules/11_discipline/components/3_InvestigateDisciplinary/AddPage.vue"
|
||||
"@/modules/11_discipline/components/3_investigateDisciplinary/AddPage.vue"
|
||||
);
|
||||
const orderPage = () =>
|
||||
import("@/modules/11_discipline/components/4_Order/OrderPage.vue");
|
||||
|
|
@ -204,8 +204,8 @@ export default [
|
|||
},
|
||||
},
|
||||
{
|
||||
path: "/discipline/InvestigateDisciplinary/add",
|
||||
name: "/discipline-InvestigateDisciplinaryAdd",
|
||||
path: "/discipline/investigate-disciplinary/add",
|
||||
name: "discipline_investigate_disciplinary_add",
|
||||
component: InvestigateDisciplinaryAdd,
|
||||
meta: {
|
||||
Auth: true,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue