Merge branch 'develop' of github.com:Frappet/bma-ehr-frontend into develop
This commit is contained in:
commit
84ae839226
6 changed files with 199 additions and 168 deletions
|
|
@ -12,6 +12,8 @@ import DialogEdit from "@/modules/09_leave/components/1_Work/DialogEdit.vue";
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useWorklistDataStore } from "@/modules/09_leave/stores/WorkStore";
|
||||
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
|
||||
/** useStore */
|
||||
const mixin = useCounterMixin();
|
||||
const workStore = useWorklistDataStore();
|
||||
|
|
@ -132,16 +134,31 @@ onMounted(() => {
|
|||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width v-if="typeTab === 'time-record'"></q-th>
|
||||
<q-th auto-width></q-th>
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td v-if="typeTab === 'time-record'">
|
||||
<q-tr :props="props">
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="info"
|
||||
icon="mdi-eye"
|
||||
@click.prevent="clickDetail(props.row)"
|
||||
>
|
||||
<q-tooltip>รายละเอียด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsGet &&
|
||||
checkPermission($route)?.attrIsUpdate && typeTab === 'time-record'
|
||||
"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
|
|
@ -149,15 +166,10 @@ onMounted(() => {
|
|||
icon="edit"
|
||||
@click.prevent="onClickEdit(props.row)"
|
||||
>
|
||||
<q-tooltip>แก้ไข</q-tooltip>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click.prevent="clickDetail(props.row)"
|
||||
>
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<div v-if="col.name == 'no'">
|
||||
{{
|
||||
(currentPage - 1) * Number(pagination.rowsPerPage) +
|
||||
|
|
@ -189,7 +201,6 @@ onMounted(() => {
|
|||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ const $q = useQuasar();
|
|||
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogConfirm, success, messageError } = mixin;
|
||||
|
||||
const isRead = defineModel<boolean>("isRead", { required: true });
|
||||
/** propsData จาก RoundMain */
|
||||
const props = defineProps({
|
||||
modal: {
|
||||
|
|
@ -145,6 +145,7 @@ async function putRoundDuty(id: string) {
|
|||
//** Function ปิด Popup */
|
||||
function close() {
|
||||
props.closeDialog?.();
|
||||
isRead.value = false;
|
||||
}
|
||||
|
||||
/***/
|
||||
|
|
@ -183,7 +184,9 @@ watch(
|
|||
props.editCheck === 'add'
|
||||
? 'เพิ่มรอบการปฏิบัติงาน'
|
||||
: props.detailData
|
||||
? `แก้ไขรอบ ${props.detailData.round}`
|
||||
? isRead
|
||||
? `รายละเอียดรอบ ${props.detailData.round}`
|
||||
: `แก้ไขรอบ ${props.detailData.round}`
|
||||
: ''
|
||||
"
|
||||
:close="close"
|
||||
|
|
@ -199,7 +202,7 @@ watch(
|
|||
<q-input
|
||||
ref="amRef"
|
||||
class="inputgreen"
|
||||
:readonly="props.editCheck === 'edit'"
|
||||
:readonly="props.editCheck === 'edit' || isRead"
|
||||
:outlined="props.editCheck === 'add'"
|
||||
dense
|
||||
lazy-rules
|
||||
|
|
@ -236,7 +239,7 @@ watch(
|
|||
<q-input
|
||||
ref="amOutRef"
|
||||
class="inputgreen"
|
||||
:readonly="props.editCheck === 'edit'"
|
||||
:readonly="props.editCheck === 'edit' || isRead"
|
||||
:outlined="props.editCheck === 'add'"
|
||||
dense
|
||||
v-model="formData.endTimeMorning"
|
||||
|
|
@ -297,7 +300,7 @@ watch(
|
|||
},
|
||||
]"
|
||||
class="inputgreen"
|
||||
:readonly="props.editCheck === 'edit'"
|
||||
:readonly="props.editCheck === 'edit' || isRead"
|
||||
:outlined="props.editCheck === 'add'"
|
||||
dense
|
||||
lazy-rules
|
||||
|
|
@ -334,7 +337,7 @@ watch(
|
|||
},
|
||||
]"
|
||||
class="inputgreen"
|
||||
:readonly="props.editCheck === 'edit'"
|
||||
:readonly="props.editCheck === 'edit' || isRead"
|
||||
:outlined="props.editCheck === 'add'"
|
||||
dense
|
||||
v-model="formData.endTimeAfternoon"
|
||||
|
|
@ -350,6 +353,7 @@ watch(
|
|||
class="col-12 bg-white q-ma-md"
|
||||
outlined
|
||||
stack-label
|
||||
:readonly="isRead"
|
||||
v-model="formData.description"
|
||||
label="คำอธิบาย"
|
||||
hide-bottom-space
|
||||
|
|
@ -360,8 +364,9 @@ watch(
|
|||
>
|
||||
<div class="row items-center q-my-sm justify-between">
|
||||
<p class="q-ma-none">เวลา Default</p>
|
||||
<label class="toggle-control">
|
||||
<label :class="`toggle-control ${isRead ? 'no-pointer-events' : ''}`">
|
||||
<input
|
||||
:readonly="isRead"
|
||||
type="checkbox"
|
||||
v-model="formData.isDefault"
|
||||
@change="checkDefault()"
|
||||
|
|
@ -375,7 +380,7 @@ watch(
|
|||
>
|
||||
<div class="row items-center q-my-sm justify-between">
|
||||
<p class="q-ma-none">สถานะการใช้งาน</p>
|
||||
<label class="toggle-control">
|
||||
<label :class="`toggle-control ${isRead ? 'no-pointer-events' : ''}`">
|
||||
<input
|
||||
type="checkbox"
|
||||
v-model="formData.isActive"
|
||||
|
|
@ -386,8 +391,8 @@ watch(
|
|||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator color="grey-4" />
|
||||
<div class="q-pa-sm">
|
||||
<q-separator color="grey-4" v-if="!isRead"/>
|
||||
<div class="q-pa-sm" v-if="!isRead">
|
||||
<div class="row justify-end">
|
||||
<q-btn
|
||||
id="onSubmit"
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
|
||||
/** ImportComponents*/
|
||||
import DialogForm from "@/modules/09_leave/components/3_WorkTime/DialogForm.vue";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const dataStore = useRoundDataStore();
|
||||
|
|
@ -20,6 +21,7 @@ const $q = useQuasar(); //ใช้ noti quasar
|
|||
const attrs = ref<any>(useAttrs());
|
||||
|
||||
const modal = ref<boolean>(false);
|
||||
const isRead = ref<boolean>(false);
|
||||
const detailData = ref<any>();
|
||||
const editCheck = ref<string>("");
|
||||
|
||||
|
|
@ -83,6 +85,20 @@ function openModal(data: any, check: string) {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param data ข้อมูลรอบการปฏิบัติงาน
|
||||
* @param check action แก้ไข,เพิ่ม
|
||||
*/
|
||||
function openModalDetail(data: any, check: string) {
|
||||
modal.value = true;
|
||||
editCheck.value = check;
|
||||
if (check === "edit") {
|
||||
isRead.value = true;
|
||||
detailData.value = data;
|
||||
}
|
||||
}
|
||||
|
||||
/** Function ปิด popup รายละเอียดและการเพิ่ม*/
|
||||
function closeDialog() {
|
||||
modal.value = false;
|
||||
|
|
@ -109,9 +125,10 @@ onMounted(() => {
|
|||
<div class="row col-12 q-col-gutter-sm q-mb-sm">
|
||||
<div>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsCreate"
|
||||
for="#addInvestigatefacts"
|
||||
@click="openModal(null, 'add')"
|
||||
size="12px"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
color="add"
|
||||
|
|
@ -179,7 +196,6 @@ onMounted(() => {
|
|||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width></q-th>
|
||||
<q-th auto-width></q-th>
|
||||
<q-th
|
||||
v-for="col in props.cols"
|
||||
|
|
@ -192,18 +208,42 @@ onMounted(() => {
|
|||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td>
|
||||
<q-tr :props="props">
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
color="info"
|
||||
icon="mdi-eye"
|
||||
@click.prevent="openModalDetail(props.row, 'edit')"
|
||||
>
|
||||
<q-tooltip>รายละเอียด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsGet &&
|
||||
checkPermission($route)?.attrIsUpdate
|
||||
"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
color="edit"
|
||||
icon="edit"
|
||||
@click.prevent="openModal(props.row, 'edit')"
|
||||
><q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsDelete"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
color="red"
|
||||
icon="delete"
|
||||
@click="onClickDelete(props.row.id)"
|
||||
/>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
><q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-icon
|
||||
v-if="props.row.isDefault === true"
|
||||
name="mdi-bookmark"
|
||||
|
|
@ -213,12 +253,7 @@ onMounted(() => {
|
|||
<q-tooltip>เวลา Default</q-tooltip>
|
||||
</q-icon>
|
||||
</q-td>
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click.prevent="openModal(props.row, 'edit')"
|
||||
>
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<div v-if="col.name === 'isActive'" class="text-center">
|
||||
<q-icon
|
||||
v-if="props.row.isActive === true"
|
||||
|
|
@ -248,6 +283,7 @@ onMounted(() => {
|
|||
:editCheck="editCheck"
|
||||
:detailData="detailData"
|
||||
:fetchData="fetchListRoind"
|
||||
v-model:isRead="isRead"
|
||||
/>
|
||||
</template>
|
||||
<style scoped lang="scss">
|
||||
|
|
|
|||
|
|
@ -12,12 +12,21 @@ import type { FormData } from "@/modules/11_discipline/interface/request/directo
|
|||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import Form from "@/modules/12_evaluatePersonal/components/Director/Form.vue";
|
||||
|
||||
/**
|
||||
* importStore
|
||||
*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
/**
|
||||
* use
|
||||
*/
|
||||
const $q = useQuasar();
|
||||
const { messageError, showLoader, hideLoader, dialogConfirm, success } =
|
||||
useCounterMixin();
|
||||
|
||||
/**
|
||||
* props
|
||||
*/
|
||||
const modal = defineModel<boolean>("modal", { required: true });
|
||||
const directorId = defineModel<string>("directorId", { required: true });
|
||||
const actionType = defineModel<string>("actionType", { required: true });
|
||||
|
|
@ -25,6 +34,7 @@ const props = defineProps({
|
|||
fetchDataList: { type: Function, required: true },
|
||||
});
|
||||
|
||||
// ชื่อ Dialog
|
||||
const title = computed(() =>
|
||||
actionType.value === "VIEW" ? "รายละเอียด" : "แก้ไขรายชื่อกรรมการ"
|
||||
);
|
||||
|
|
@ -44,7 +54,7 @@ const dataDettail = reactive<FormData>({
|
|||
});
|
||||
|
||||
/**
|
||||
* ดึงค่าจาก api
|
||||
* function fetch ช้อมูลชื่อกรรมการ
|
||||
*/
|
||||
function fetchData() {
|
||||
showLoader();
|
||||
|
|
@ -66,6 +76,10 @@ function fetchData() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function ยืนยันการบันทึกการแก้ไขข้อมุล
|
||||
* @param formData ข้อมุลชื่อกรรมการ
|
||||
*/
|
||||
function onSubmit(formData: FormData) {
|
||||
dialogConfirm($q, () => {
|
||||
showLoader();
|
||||
|
|
@ -92,6 +106,9 @@ function onSubmit(formData: FormData) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ปิด dialog
|
||||
*/
|
||||
function onCloseDialog() {
|
||||
modal.value = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,39 +1,36 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, reactive, watch, onMounted, computed } from "vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
/**
|
||||
* importTypr
|
||||
*/
|
||||
import type { QTableProps } from "quasar";
|
||||
import type {
|
||||
FormData,
|
||||
FormRef,
|
||||
typeOp,
|
||||
ResponsePreson,
|
||||
tableType,
|
||||
} from "@/modules/11_discipline/interface/request/director";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
/**
|
||||
* importComponenst
|
||||
*/
|
||||
import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue";
|
||||
|
||||
const total = ref<number>(0);
|
||||
const totalList = ref<number>(1);
|
||||
const pagination = ref({
|
||||
sortBy: "createdAt",
|
||||
descending: true,
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
});
|
||||
const modalPersonal = ref<boolean>(false);
|
||||
const personId = ref<string>("");
|
||||
/**
|
||||
* importStore
|
||||
*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
/**
|
||||
* use
|
||||
*/
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
messageError,
|
||||
showLoader,
|
||||
dialogMessageNotify,
|
||||
dialogConfirm,
|
||||
success,
|
||||
hideLoader,
|
||||
} = mixin;
|
||||
const { showLoader, hideLoader, messageError } = useCounterMixin();
|
||||
|
||||
/**
|
||||
* รับ props มาจาก page หลัก
|
||||
*/
|
||||
|
|
@ -48,16 +45,11 @@ const props = defineProps({
|
|||
default: () => "",
|
||||
},
|
||||
});
|
||||
// const isReadonly = ref<boolean>(false); // อ่านได้อย่างเดียว
|
||||
const emit = defineEmits(["formDataReturn"]);
|
||||
const isReadonly = computed(() => (actionType.value === "VIEW" ? true : false));
|
||||
|
||||
/**
|
||||
* ข้อมูลเลขประจำตัวประชาชน
|
||||
*/
|
||||
//
|
||||
const idCard = ref<string>("");
|
||||
const idCardRef = ref<any>(null);
|
||||
const isReadonly = computed(() => (actionType.value === "VIEW" ? true : false));
|
||||
const modalPersonal = ref<boolean>(false);
|
||||
const personId = ref<string>("");
|
||||
const type = ref<string>("citizenId");
|
||||
const search = ref<string>("");
|
||||
const typeOps = ref<typeOp[]>([
|
||||
|
|
@ -80,19 +72,18 @@ const formData = reactive<FormData>({
|
|||
qualification: "",
|
||||
});
|
||||
|
||||
/** หัวข้อที่เเสดงในตารางผู้ถูกร้องเรียน */
|
||||
/**
|
||||
* ตารางผู้ถูกร้องเรียน
|
||||
*/
|
||||
const searchRef = ref<any>(null);
|
||||
const rows = ref<tableType[]>([]);
|
||||
const visibleColumnsRespondent = ref<string[]>([
|
||||
"info",
|
||||
"no",
|
||||
// "idcard",
|
||||
"name",
|
||||
// "posNo",
|
||||
"position",
|
||||
// "positionLevel",
|
||||
// "salary",
|
||||
"organization",
|
||||
]);
|
||||
|
||||
const columnsRespondent = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "info",
|
||||
|
|
@ -140,72 +131,33 @@ const columnsRespondent = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
const total = ref<number>(0);
|
||||
const totalList = ref<number>(1);
|
||||
const pagination = ref({
|
||||
sortBy: "createdAt",
|
||||
descending: true,
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
});
|
||||
|
||||
/**
|
||||
* เช็คข้อมูลจาก props
|
||||
* เมื่อมีข้อมูล
|
||||
* เก็บข้อมูลลง formData
|
||||
* บันทึกข้อมูล
|
||||
*/
|
||||
// watch(props.data, async () => {
|
||||
// // console.log("data==>", props.data)
|
||||
// formData.prefix = props.data.prefix;
|
||||
// formData.firstname = props.data.firstname;
|
||||
// formData.lastname = props.data.lastname;
|
||||
// formData.position = props.data.position;
|
||||
// formData.phone = props.data.phone;
|
||||
// formData.email = props.data.email;
|
||||
// });
|
||||
function onSubmit() {
|
||||
props.onSubmit(formData);
|
||||
}
|
||||
|
||||
/**
|
||||
* ตรวจสอบข้อมูลก่อนส่งไปยัง api
|
||||
* update เมื่อเปลี่ยน option
|
||||
*/
|
||||
const rows = ref<tableType[]>([]);
|
||||
const searchRef = ref<any>(null);
|
||||
const prefixRef = ref<object | null>(null);
|
||||
const firstnameRef = ref<object | null>(null);
|
||||
const lastnameRef = ref<object | null>(null);
|
||||
const positionRef = ref<object | null>(null);
|
||||
const phoneRef = ref<object | null>(null);
|
||||
const emailRef = ref<object | null>(null);
|
||||
const formRef: FormRef = {
|
||||
prefix: prefixRef,
|
||||
firstname: firstnameRef,
|
||||
lastname: lastnameRef,
|
||||
position: positionRef,
|
||||
phone: phoneRef,
|
||||
email: emailRef,
|
||||
};
|
||||
|
||||
/** ฟังชั่นตรวจสอบความถูกต้องก่อน บันทึก */
|
||||
function onValidate() {
|
||||
const hasError = [];
|
||||
for (const key in formRef) {
|
||||
if (Object.prototype.hasOwnProperty.call(formRef, key)) {
|
||||
const property = formRef[key];
|
||||
if (property.value && typeof property.value.validate === "function") {
|
||||
const isValid = property.value.validate();
|
||||
hasError.push(isValid);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasError.every((result) => result === true)) {
|
||||
props.onSubmit(formData);
|
||||
}
|
||||
}
|
||||
|
||||
function inputEdit(val: boolean) {
|
||||
return {
|
||||
"full-width cursor-pointer ": val,
|
||||
"full-width cursor-pointer inputgreen": !val,
|
||||
};
|
||||
}
|
||||
|
||||
/** update เมื่อเปลี่ยน option */
|
||||
function updateSelect() {
|
||||
search.value = "";
|
||||
}
|
||||
|
||||
async function searchInput() {
|
||||
/**
|
||||
* ค้นหารายชื่อ
|
||||
*/
|
||||
function searchInput() {
|
||||
searchRef.value.validate();
|
||||
if (!searchRef.value.hasError) {
|
||||
showLoader();
|
||||
|
|
@ -213,7 +165,7 @@ async function searchInput() {
|
|||
fieldName: type.value,
|
||||
keyword: search.value,
|
||||
};
|
||||
await http
|
||||
http
|
||||
.post(
|
||||
config.API.orgSearchPersonal() +
|
||||
`?page=${pagination.value.page}&pageSize=${pagination.value.rowsPerPage}`,
|
||||
|
|
@ -225,7 +177,6 @@ async function searchInput() {
|
|||
res.data.result.total / pagination.value.rowsPerPage
|
||||
);
|
||||
total.value = res.data.result.total;
|
||||
|
||||
const list = data.map((e: ResponsePreson) => ({
|
||||
personId: e.id,
|
||||
idcard: e.citizenId,
|
||||
|
|
@ -244,13 +195,18 @@ async function searchInput() {
|
|||
|
||||
rows.value = list;
|
||||
})
|
||||
.catch((err) => {})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* เลืือกชื่อกรรมการ
|
||||
*/
|
||||
function returnDetail(data: any) {
|
||||
formData.prefix = data.prefix;
|
||||
formData.firstname = data.firstName;
|
||||
|
|
@ -269,9 +225,13 @@ function onclickViewinfo(id: string) {
|
|||
personId.value = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* เปิด,ปิด popup ทะเบียนประวัติ
|
||||
*/
|
||||
function updatemodalPersonal(modal: boolean) {
|
||||
modalPersonal.value = modal;
|
||||
}
|
||||
|
||||
function updatePagination(newPagination: any) {
|
||||
pagination.value.page = 1;
|
||||
pagination.value.rowsPerPage = newPagination.rowsPerPage;
|
||||
|
|
@ -279,8 +239,8 @@ function updatePagination(newPagination: any) {
|
|||
|
||||
watch(
|
||||
() => pagination.value.rowsPerPage,
|
||||
async () => {
|
||||
await searchInput();
|
||||
() => {
|
||||
searchInput();
|
||||
}
|
||||
);
|
||||
|
||||
|
|
@ -293,6 +253,13 @@ function fetchForm(data: any) {
|
|||
formData.email = data.email;
|
||||
}
|
||||
|
||||
function inputEdit(val: boolean) {
|
||||
return {
|
||||
"full-width cursor-pointer ": val,
|
||||
"full-width cursor-pointer inputgreen": !val,
|
||||
};
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (props.data) {
|
||||
showLoader();
|
||||
|
|
@ -304,7 +271,7 @@ onMounted(() => {
|
|||
});
|
||||
</script>
|
||||
<template>
|
||||
<form @submit.prevent.stop="onValidate">
|
||||
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
||||
<q-card bordered>
|
||||
<div class="col-12 row q-pa-md">
|
||||
<div class="row col-12 q-col-gutter-md">
|
||||
|
|
@ -331,10 +298,10 @@ onMounted(() => {
|
|||
v-model="search"
|
||||
outlined
|
||||
clearable
|
||||
@clear="search = ''"
|
||||
hide-bottom-space
|
||||
dense
|
||||
label="คำค้น"
|
||||
:rules="[(val) => !!val || `กรุณากรอกคำค้น`]"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
@ -398,7 +365,7 @@ onMounted(() => {
|
|||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click="returnDetail(props.row)"
|
||||
@click.stop.pervent="returnDetail(props.row)"
|
||||
>
|
||||
<div v-if="col.name == 'no'">
|
||||
{{
|
||||
|
|
@ -408,17 +375,15 @@ onMounted(() => {
|
|||
}}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'info'">
|
||||
<!-- <router-link
|
||||
target="_blank"
|
||||
:to="`/registry/${props.row.personId}`"
|
||||
> -->
|
||||
<q-btn
|
||||
dense
|
||||
flat
|
||||
round
|
||||
color="info"
|
||||
icon="info"
|
||||
@click="onclickViewinfo(props.row.personId)"
|
||||
@click.stop.pervent="
|
||||
onclickViewinfo(props.row.personId)
|
||||
"
|
||||
>
|
||||
<q-tooltip>ดูข้อมูลในทะเบียนประวัติ</q-tooltip>
|
||||
</q-btn>
|
||||
|
|
@ -531,12 +496,12 @@ onMounted(() => {
|
|||
id="formSubmit"
|
||||
color="secondary"
|
||||
label="บันทึก"
|
||||
@click.stop="onValidate"
|
||||
type="onSubmit"
|
||||
><q-tooltip>บับทึกข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
</q-card>
|
||||
</form>
|
||||
</q-form>
|
||||
|
||||
<PopupPersonal
|
||||
:modal="modalPersonal"
|
||||
|
|
|
|||
|
|
@ -38,6 +38,9 @@ const pagination = ref({
|
|||
rowsPerPage: 10,
|
||||
});
|
||||
|
||||
/**
|
||||
* function fetch ข้อมูลรายการชื่อกรรมการ
|
||||
*/
|
||||
function getList() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -55,33 +58,32 @@ function getList() {
|
|||
}
|
||||
|
||||
/**
|
||||
* ลบข้อมูล
|
||||
* ยืนยัน การลบข้อมูลรายการชื่อกรรมการ
|
||||
* @param id ไอดีของข้อมูล
|
||||
*/
|
||||
function clickDelete(id: string) {
|
||||
dialogRemove($q, async () => deleteData(id), `ลบข้อมูล`);
|
||||
dialogRemove($q, async () => {
|
||||
showLoader();
|
||||
http
|
||||
.delete(config.API.evaluateDirectorById(id))
|
||||
.then(async () => {
|
||||
getList();
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ลบข้อมูล
|
||||
* @param id type
|
||||
* function ดูรายละเอียดของข้อมูล
|
||||
* @param id รายการชื่อกรรมการ
|
||||
* @param type ดูรายละเอียด,แก้ไขข้อมูล
|
||||
*/
|
||||
function deleteData(id: string) {
|
||||
showLoader();
|
||||
http
|
||||
.delete(config.API.evaluateDirectorById(id))
|
||||
.then(async () => {
|
||||
getList();
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
function onOpenDetail(id: string, type: string) {
|
||||
directorId.value = id;
|
||||
actionType.value = type;
|
||||
|
|
@ -101,10 +103,6 @@ function resetFilter() {
|
|||
}
|
||||
}
|
||||
|
||||
function filterFn() {
|
||||
getList();
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
|
@ -137,7 +135,6 @@ onMounted(() => {
|
|||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter.prevent="filterFn"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filterKeyword == ''" name="search" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue