Merge branch 'develop' into devTee
This commit is contained in:
commit
7e88b119cf
2 changed files with 92 additions and 32 deletions
|
|
@ -1,16 +1,18 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch } from "vue";
|
import { ref, watch } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import type { QTableProps } from "quasar";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
|
|
||||||
const $q = useQuasar();
|
import type { QTableProps } from "quasar";
|
||||||
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useComplainstDataStore } from "@/modules/11_discipline/store/ComplaintsStore";
|
import { useComplainstDataStore } from "@/modules/11_discipline/store/ComplaintsStore";
|
||||||
const complainstStore = useComplainstDataStore();
|
const complainstStore = useComplainstDataStore();
|
||||||
|
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { dialogConfirm, success } = mixin;
|
const $q = useQuasar();
|
||||||
|
|
||||||
|
const { dialogConfirm, dialogMessageNotify, success } = mixin;
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
modal: {
|
modal: {
|
||||||
|
|
@ -112,11 +114,17 @@ const visibleColumns = ref<string[]>([
|
||||||
|
|
||||||
const selected = ref<any>([]);
|
const selected = ref<any>([]);
|
||||||
const inspectionResults = ref<string>("");
|
const inspectionResults = ref<string>("");
|
||||||
const inputRef = ref<any>(null);
|
const filter = ref<string>("");
|
||||||
|
// const inputRef = ref<any>(null);
|
||||||
|
|
||||||
|
const initialPagination = ref<any>({
|
||||||
|
descending: false,
|
||||||
|
rowsPerPage: 25,
|
||||||
|
});
|
||||||
|
|
||||||
function onclickSend() {
|
function onclickSend() {
|
||||||
inputRef.value.validate();
|
// inputRef.value.validate();
|
||||||
if (!inputRef.value.hasError) {
|
if (selected.value.length > 0) {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
async () => {
|
async () => {
|
||||||
|
|
@ -128,6 +136,8 @@ function onclickSend() {
|
||||||
"ยืนยันการส่งไปสืบสวน",
|
"ยืนยันการส่งไปสืบสวน",
|
||||||
"ต้องการยืนยันการส่งไปสืบสวนหรือไม่"
|
"ต้องการยืนยันการส่งไปสืบสวนหรือไม่"
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
dialogMessageNotify($q, "กรุณาเลือกรายชื่อ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -137,49 +147,86 @@ function onClickClose() {
|
||||||
|
|
||||||
watch([() => props.modal], () => {
|
watch([() => props.modal], () => {
|
||||||
inspectionResults.value = props.modal ? "" : "";
|
inspectionResults.value = props.modal ? "" : "";
|
||||||
|
selected.value = props.modal ? [] : [];
|
||||||
|
|
||||||
selected.value.push(complainstStore.rowsAdd);
|
selected.value.push(complainstStore.rowsAdd);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<q-dialog v-model="props.modal">
|
<q-dialog v-model="props.modal">
|
||||||
<q-card style="width: 700px; max-width: 80vw">
|
<q-card style="width: 820px; max-width: 80vw">
|
||||||
<q-toolbar class="q-py-md">
|
<DialogHeader tittle="มีมูลส่งไปสืบสวน" :close="onClickClose" />
|
||||||
<q-toolbar-title class="header-text">มีมูลส่งไปสืบสวน </q-toolbar-title>
|
|
||||||
<q-btn
|
|
||||||
icon="close"
|
|
||||||
unelevated
|
|
||||||
round
|
|
||||||
dense
|
|
||||||
@click="onClickClose"
|
|
||||||
style="color: #ff8080; background-color: #ffdede"
|
|
||||||
/>
|
|
||||||
</q-toolbar>
|
|
||||||
<q-separator />
|
<q-separator />
|
||||||
|
|
||||||
<q-card-section class="q-pt-none q-mt-md">
|
<q-card-section class="q-pt-none q-mt-md">
|
||||||
|
<div class="col-12 row q-pb-sm items-center">
|
||||||
|
<q-space />
|
||||||
|
<div class="items-center" style="display: flex">
|
||||||
|
<!-- ค้นหาข้อความใน table -->
|
||||||
|
<q-input
|
||||||
|
for="inputfilterRef"
|
||||||
|
standout
|
||||||
|
dense
|
||||||
|
v-model="filter"
|
||||||
|
outlined
|
||||||
|
debounce="300"
|
||||||
|
placeholder="ค้นหา"
|
||||||
|
style="max-width: 200px"
|
||||||
|
class="q-ml-sm"
|
||||||
|
>
|
||||||
|
<template v-slot:append>
|
||||||
|
<q-icon v-if="filter == ''" name="search" />
|
||||||
|
<q-icon
|
||||||
|
v-if="filter !== ''"
|
||||||
|
name="clear"
|
||||||
|
class="cursor-pointer"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</q-input>
|
||||||
|
<!-- แสดงคอลัมน์ใน table -->
|
||||||
|
<q-select
|
||||||
|
for="selectVisibleColumns"
|
||||||
|
v-model="visibleColumns"
|
||||||
|
:display-value="$q.lang.table.columns"
|
||||||
|
multiple
|
||||||
|
outlined
|
||||||
|
dense
|
||||||
|
:options="columns"
|
||||||
|
options-dense
|
||||||
|
option-value="name"
|
||||||
|
map-options
|
||||||
|
emit-value
|
||||||
|
style="min-width: 150px"
|
||||||
|
class="gt-xs q-ml-sm"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<d-table
|
<d-table
|
||||||
ref="table"
|
ref="table"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="complainstStore.rowsAdd"
|
:rows="complainstStore.rowsAdd"
|
||||||
|
:filter="filter"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
flat
|
flat
|
||||||
bordered
|
bordered
|
||||||
:paging="true"
|
:paging="false"
|
||||||
dense
|
dense
|
||||||
class="custom-header-table"
|
class="custom-header-table"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
selection="multiple"
|
selection="multiple"
|
||||||
v-model:selected="selected"
|
v-model:selected="selected"
|
||||||
|
:pagination="initialPagination"
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
<q-tr :props="props">
|
<q-tr :props="props">
|
||||||
<q-th auto-width>
|
<q-th auto-width>
|
||||||
<q-checkbox
|
<!-- <q-checkbox
|
||||||
keep-color
|
keep-color
|
||||||
color="primary"
|
color="primary"
|
||||||
dense
|
dense
|
||||||
v-model="props.selected"
|
v-model="props.selected"
|
||||||
/>
|
/> -->
|
||||||
</q-th>
|
</q-th>
|
||||||
<q-th
|
<q-th
|
||||||
v-for="col in props.cols"
|
v-for="col in props.cols"
|
||||||
|
|
@ -212,7 +259,7 @@ watch([() => props.modal], () => {
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
</d-table>
|
</d-table>
|
||||||
<div class="col-xs-12 col-sm-12 q-mt-sm">
|
<!-- <div class="col-xs-12 col-sm-12 q-mt-sm">
|
||||||
<q-input
|
<q-input
|
||||||
for="inputInspectionResults"
|
for="inputInspectionResults"
|
||||||
ref="inputRef"
|
ref="inputRef"
|
||||||
|
|
@ -226,7 +273,7 @@ watch([() => props.modal], () => {
|
||||||
type="textarea"
|
type="textarea"
|
||||||
rows="5"
|
rows="5"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div> -->
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<q-card-actions align="right" class="bg-white text-teal">
|
<q-card-actions align="right" class="bg-white text-teal">
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ onMounted(() => {
|
||||||
* get ข้อมูลเก่ากรณีแก้ไขข้อมูล
|
* get ข้อมูลเก่ากรณีแก้ไขข้อมูล
|
||||||
*/
|
*/
|
||||||
const data = reactive<FormData>({
|
const data = reactive<FormData>({
|
||||||
personalId:"",
|
personalId: "",
|
||||||
prefix: "",
|
prefix: "",
|
||||||
firstname: "",
|
firstname: "",
|
||||||
lastname: "",
|
lastname: "",
|
||||||
|
|
@ -39,19 +39,32 @@ const data = reactive<FormData>({
|
||||||
* ดึงค่าจาก api
|
* ดึงค่าจาก api
|
||||||
*/
|
*/
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
data.prefix = "นาง";
|
showLoader();
|
||||||
data.firstname = "เกสินี";
|
await http
|
||||||
data.lastname = "เจียรสุมัย";
|
.get(config.API.directorbyId(personalId.value))
|
||||||
data.position = "ครู";
|
.then((res) => {
|
||||||
data.phone = "0800808080";
|
const dataApi = res.data.result;
|
||||||
data.email = "e@email.com";
|
personalId.value = dataApi.id;
|
||||||
|
data.prefix = dataApi.prefix;
|
||||||
|
data.firstname = dataApi.firstName;
|
||||||
|
data.lastname = dataApi.lastName;
|
||||||
|
data.position = dataApi.position;
|
||||||
|
data.phone = dataApi.phone;
|
||||||
|
data.email = dataApi.email;
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* บันทึกข้อมูลที่เเก้ไข
|
* บันทึกข้อมูลที่เเก้ไข
|
||||||
* @param id ระบุ บุคคล
|
* @param id ระบุ บุคคล
|
||||||
*/
|
*/
|
||||||
function onSubmit(formData:FormData) {
|
function onSubmit(formData: FormData) {
|
||||||
dialogConfirm($q, () => putData(formData));
|
dialogConfirm($q, () => putData(formData));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -93,6 +106,6 @@ function putData(formData: FormData) {
|
||||||
แก้ไขรายชื่อกรรมการ
|
แก้ไขรายชื่อกรรมการ
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Form :on-submit="onSubmit" :data="data"/>
|
<Form :on-submit="onSubmit" :data="data" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue