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">
|
||||
import { ref, watch } from "vue";
|
||||
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 { useComplainstDataStore } from "@/modules/11_discipline/store/ComplaintsStore";
|
||||
const complainstStore = useComplainstDataStore();
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogConfirm, success } = mixin;
|
||||
const $q = useQuasar();
|
||||
|
||||
const { dialogConfirm, dialogMessageNotify, success } = mixin;
|
||||
|
||||
const props = defineProps({
|
||||
modal: {
|
||||
|
|
@ -112,11 +114,17 @@ const visibleColumns = ref<string[]>([
|
|||
|
||||
const selected = ref<any>([]);
|
||||
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() {
|
||||
inputRef.value.validate();
|
||||
if (!inputRef.value.hasError) {
|
||||
// inputRef.value.validate();
|
||||
if (selected.value.length > 0) {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
|
|
@ -128,6 +136,8 @@ function onclickSend() {
|
|||
"ยืนยันการส่งไปสืบสวน",
|
||||
"ต้องการยืนยันการส่งไปสืบสวนหรือไม่"
|
||||
);
|
||||
} else {
|
||||
dialogMessageNotify($q, "กรุณาเลือกรายชื่อ");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -137,49 +147,86 @@ function onClickClose() {
|
|||
|
||||
watch([() => props.modal], () => {
|
||||
inspectionResults.value = props.modal ? "" : "";
|
||||
selected.value = props.modal ? [] : [];
|
||||
|
||||
selected.value.push(complainstStore.rowsAdd);
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<q-dialog v-model="props.modal">
|
||||
<q-card style="width: 700px; max-width: 80vw">
|
||||
<q-toolbar class="q-py-md">
|
||||
<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-card style="width: 820px; max-width: 80vw">
|
||||
<DialogHeader tittle="มีมูลส่งไปสืบสวน" :close="onClickClose" />
|
||||
|
||||
<q-separator />
|
||||
|
||||
<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
|
||||
ref="table"
|
||||
:columns="columns"
|
||||
:rows="complainstStore.rowsAdd"
|
||||
:filter="filter"
|
||||
row-key="id"
|
||||
flat
|
||||
bordered
|
||||
:paging="true"
|
||||
:paging="false"
|
||||
dense
|
||||
class="custom-header-table"
|
||||
:visible-columns="visibleColumns"
|
||||
selection="multiple"
|
||||
v-model:selected="selected"
|
||||
:pagination="initialPagination"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width>
|
||||
<q-checkbox
|
||||
<!-- <q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="props.selected"
|
||||
/>
|
||||
/> -->
|
||||
</q-th>
|
||||
<q-th
|
||||
v-for="col in props.cols"
|
||||
|
|
@ -212,7 +259,7 @@ watch([() => props.modal], () => {
|
|||
</q-tr>
|
||||
</template>
|
||||
</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
|
||||
for="inputInspectionResults"
|
||||
ref="inputRef"
|
||||
|
|
@ -226,7 +273,7 @@ watch([() => props.modal], () => {
|
|||
type="textarea"
|
||||
rows="5"
|
||||
/>
|
||||
</div>
|
||||
</div> -->
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right" class="bg-white text-teal">
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ onMounted(() => {
|
|||
* get ข้อมูลเก่ากรณีแก้ไขข้อมูล
|
||||
*/
|
||||
const data = reactive<FormData>({
|
||||
personalId:"",
|
||||
personalId: "",
|
||||
prefix: "",
|
||||
firstname: "",
|
||||
lastname: "",
|
||||
|
|
@ -39,19 +39,32 @@ const data = reactive<FormData>({
|
|||
* ดึงค่าจาก api
|
||||
*/
|
||||
const fetchData = async () => {
|
||||
data.prefix = "นาง";
|
||||
data.firstname = "เกสินี";
|
||||
data.lastname = "เจียรสุมัย";
|
||||
data.position = "ครู";
|
||||
data.phone = "0800808080";
|
||||
data.email = "e@email.com";
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.directorbyId(personalId.value))
|
||||
.then((res) => {
|
||||
const dataApi = res.data.result;
|
||||
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 ระบุ บุคคล
|
||||
*/
|
||||
function onSubmit(formData:FormData) {
|
||||
function onSubmit(formData: FormData) {
|
||||
dialogConfirm($q, () => putData(formData));
|
||||
}
|
||||
|
||||
|
|
@ -93,6 +106,6 @@ function putData(formData: FormData) {
|
|||
แก้ไขรายชื่อกรรมการ
|
||||
</div>
|
||||
|
||||
<Form :on-submit="onSubmit" :data="data"/>
|
||||
<Form :on-submit="onSubmit" :data="data" />
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue