popup ส่งไปสืบสวน
This commit is contained in:
parent
e5c91bcbed
commit
7b7886fad2
1 changed files with 43 additions and 9 deletions
|
|
@ -1,9 +1,17 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, watch } from "vue";
|
||||||
|
import { useQuasar } from "quasar";
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
|
|
||||||
|
const $q = useQuasar();
|
||||||
|
|
||||||
|
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 { dialogConfirm, success } = mixin;
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
modal: {
|
modal: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
|
|
@ -103,12 +111,34 @@ const visibleColumns = ref<string[]>([
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const selected = ref<any>([]);
|
const selected = ref<any>([]);
|
||||||
|
const inspectionResults = ref<string>("");
|
||||||
|
const inputRef = ref<any>(null);
|
||||||
|
|
||||||
console.log(complainstStore.rowsAdd);
|
function onclickSend() {
|
||||||
|
inputRef.value.validate();
|
||||||
|
if (!inputRef.value.hasError) {
|
||||||
|
dialogConfirm(
|
||||||
|
$q,
|
||||||
|
async () => {
|
||||||
|
success($q, "ส่งข้อมูลไปสืบสวนสำเร็จ");
|
||||||
|
console.log(selected.value);
|
||||||
|
|
||||||
|
props.close?.();
|
||||||
|
},
|
||||||
|
"ยืนยันการส่งไปสืบสวน",
|
||||||
|
"ต้องการยืนยันการส่งไปสืบสวนหรือไม่"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function onClickClose() {
|
function onClickClose() {
|
||||||
props.close?.();
|
props.close?.();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watch([() => props.modal], () => {
|
||||||
|
inspectionResults.value = props.modal ? "" : "";
|
||||||
|
selected.value.push(complainstStore.rowsAdd);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<q-dialog v-model="props.modal">
|
<q-dialog v-model="props.modal">
|
||||||
|
|
@ -138,6 +168,8 @@ function onClickClose() {
|
||||||
dense
|
dense
|
||||||
class="custom-header-table"
|
class="custom-header-table"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
|
selection="multiple"
|
||||||
|
v-model:selected="selected"
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
<q-tr :props="props">
|
<q-tr :props="props">
|
||||||
|
|
@ -146,7 +178,7 @@ function onClickClose() {
|
||||||
keep-color
|
keep-color
|
||||||
color="primary"
|
color="primary"
|
||||||
dense
|
dense
|
||||||
v-model="selected"
|
v-model="props.selected"
|
||||||
/>
|
/>
|
||||||
</q-th>
|
</q-th>
|
||||||
<q-th
|
<q-th
|
||||||
|
|
@ -166,7 +198,7 @@ function onClickClose() {
|
||||||
keep-color
|
keep-color
|
||||||
color="primary"
|
color="primary"
|
||||||
dense
|
dense
|
||||||
v-model="selected"
|
v-model="props.selected"
|
||||||
/>
|
/>
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
|
|
@ -180,15 +212,17 @@ function onClickClose() {
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
</d-table>
|
</d-table>
|
||||||
<div class="col-xs-12 col-sm-12 q-mt-sm" id="title">
|
<div class="col-xs-12 col-sm-12 q-mt-sm">
|
||||||
<q-input
|
<q-input
|
||||||
for="input"
|
for="inputInspectionResults"
|
||||||
|
ref="inputRef"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:rules="[(val) => !!val || 'กรุณาการข้อมูล']"
|
v-model="inspectionResults"
|
||||||
|
:rules="[(val) => !!val || 'กรุณากรอกผลการตรวจสอบเรื่องร้องเรียน']"
|
||||||
lazy-rules
|
lazy-rules
|
||||||
label="เรื่องร้องเรียน"
|
label="ผลการตรวจสอบเรื่องร้องเรียน"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
rows="5"
|
rows="5"
|
||||||
/>
|
/>
|
||||||
|
|
@ -196,7 +230,7 @@ function onClickClose() {
|
||||||
</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">
|
||||||
<q-btn label="มีมูลส่งไปสืบสวน" color="public" />
|
<q-btn label="มีมูลส่งไปสืบสวน" color="public" @click="onclickSend" />
|
||||||
</q-card-actions>
|
</q-card-actions>
|
||||||
</q-card>
|
</q-card>
|
||||||
</q-dialog>
|
</q-dialog>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue