API การสืบสวนข้อเท็จจริง
This commit is contained in:
parent
d3ec604478
commit
cc2e45666e
6 changed files with 249 additions and 107 deletions
|
|
@ -4,7 +4,7 @@ import Form from "@/modules/11_discipline/components/1_Complaint/Form.vue";
|
|||
import Popup from "@/modules/11_discipline/components/1_Complaint/Popup.vue";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import type { QTableProps } from "quasar";
|
||||
import config from "@/app.config";
|
||||
import http from "@/plugins/http";
|
||||
|
||||
|
|
@ -14,7 +14,8 @@ import type {
|
|||
ArrayFileList,
|
||||
} from "@/modules/11_discipline/interface/request/complaint";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
import { useComplainstDataStore } from "@/modules/11_discipline/store/ComplaintsStore";
|
||||
const complainstStore = useComplainstDataStore();
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
|
|
@ -134,6 +135,92 @@ const data = reactive<FormData>({
|
|||
// ]);
|
||||
// };
|
||||
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: false,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "idcard",
|
||||
align: "left",
|
||||
label: "เลขบัตรประชาชน",
|
||||
sortable: true,
|
||||
field: "idcard",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
align: "left",
|
||||
label: "ชื่อ - นามสกุล",
|
||||
sortable: true,
|
||||
field: "name",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "positionNo",
|
||||
align: "left",
|
||||
label: "ตำแหน่งเลขที่",
|
||||
sortable: true,
|
||||
field: "positionNo",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "position",
|
||||
align: "left",
|
||||
label: "ตำแหน่ง",
|
||||
sortable: true,
|
||||
field: "position",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "positionLevel",
|
||||
align: "left",
|
||||
label: "ระดับ",
|
||||
sortable: true,
|
||||
field: "positionLevel",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "salary",
|
||||
align: "left",
|
||||
label: "เงินเดือน",
|
||||
sortable: true,
|
||||
field: "salary",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "organization",
|
||||
align: "left",
|
||||
label: "หน่วยงาน",
|
||||
sortable: true,
|
||||
field: "organization",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
/** หัวข้อที่เเสดงในตาราง */
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"idcard",
|
||||
"name",
|
||||
"positionNo",
|
||||
"position",
|
||||
"positionLevel",
|
||||
"salary",
|
||||
"organization",
|
||||
]);
|
||||
|
||||
async function getData() {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -314,6 +401,9 @@ onMounted(() => {
|
|||
:modal="modalPopup"
|
||||
:close="closePopup"
|
||||
@return-person="emitPerson"
|
||||
:rows="complainstStore.rowsAdd"
|
||||
:columns="columns"
|
||||
:visibleColumns="visibleColumns"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -911,8 +911,7 @@ onMounted(() => {
|
|||
</form>
|
||||
</q-card>
|
||||
</div>
|
||||
|
||||
<div class="col-12 q-mt-sm q-mb-lg" v-if="props.data && fileList.length > 0">
|
||||
<div class="col-12 q-mt-sm q-mb-lg" v-if="props.data">
|
||||
<q-card flat bordered>
|
||||
<div
|
||||
class="col-xs-12 col-sm-12 text-weight-medium bg-grey-1 q-py-xs q-px-md"
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { ref, watch } from "vue";
|
|||
import { useQuasar } from "quasar";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
import type { QTableProps } from "quasar";
|
||||
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useComplainstDataStore } from "@/modules/11_discipline/store/ComplaintsStore";
|
||||
|
|
@ -31,97 +31,23 @@ const props = defineProps({
|
|||
type: Function,
|
||||
default: () => "",
|
||||
},
|
||||
rows: {
|
||||
type: Array,
|
||||
default: [],
|
||||
},
|
||||
columns: {
|
||||
type: Array,
|
||||
default: [],
|
||||
},
|
||||
visibleColumns: {
|
||||
type: Array,
|
||||
default: [],
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits([
|
||||
"returnPerson"
|
||||
])
|
||||
const emit = defineEmits(["returnPerson"]);
|
||||
/** หัวตาราง */
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: false,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "idcard",
|
||||
align: "left",
|
||||
label: "เลขบัตรประชาชน",
|
||||
sortable: true,
|
||||
field: "idcard",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
align: "left",
|
||||
label: "ชื่อ - นามสกุล",
|
||||
sortable: true,
|
||||
field: "name",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "positionNo",
|
||||
align: "left",
|
||||
label: "ตำแหน่งเลขที่",
|
||||
sortable: true,
|
||||
field: "positionNo",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "position",
|
||||
align: "left",
|
||||
label: "ตำแหน่ง",
|
||||
sortable: true,
|
||||
field: "position",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "positionLevel",
|
||||
align: "left",
|
||||
label: "ระดับ",
|
||||
sortable: true,
|
||||
field: "positionLevel",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "salary",
|
||||
align: "left",
|
||||
label: "เงินเดือน",
|
||||
sortable: true,
|
||||
field: "salary",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "organization",
|
||||
align: "left",
|
||||
label: "หน่วยงาน",
|
||||
sortable: true,
|
||||
field: "organization",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
/** หัวข้อที่เเสดงในตาราง */
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"idcard",
|
||||
"name",
|
||||
"positionNo",
|
||||
"position",
|
||||
"positionLevel",
|
||||
"salary",
|
||||
"organization",
|
||||
]);
|
||||
|
||||
|
||||
const selected = ref<any>([]);
|
||||
const inspectionResults = ref<string>("");
|
||||
|
|
@ -143,7 +69,7 @@ function onclickSend() {
|
|||
async () => {
|
||||
success($q, `ส่งข้อมูล${props.title}สำเร็จ`);
|
||||
console.log(selected.value);
|
||||
emit('returnPerson',selected.value)
|
||||
emit("returnPerson", selected.value);
|
||||
props.close?.();
|
||||
},
|
||||
`ยืนยันการส่ง${props.title}`,
|
||||
|
|
@ -161,10 +87,9 @@ function onClickClose() {
|
|||
watch([() => props.modal], () => {
|
||||
inspectionResults.value = props.modal ? "" : "";
|
||||
selected.value = props.modal ? [] : [];
|
||||
if(props.modal === true){
|
||||
selected.value = complainstStore.rowsAdd;
|
||||
if (props.modal === true) {
|
||||
selected.value = props.rows;
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
|
|
@ -202,12 +127,12 @@ watch([() => props.modal], () => {
|
|||
<!-- แสดงคอลัมน์ใน table -->
|
||||
<q-select
|
||||
for="selectVisibleColumns"
|
||||
v-model="visibleColumns"
|
||||
v-model="props.visibleColumns"
|
||||
:display-value="$q.lang.table.columns"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
:options="columns"
|
||||
:options="props.columns"
|
||||
options-dense
|
||||
option-value="name"
|
||||
map-options
|
||||
|
|
@ -219,8 +144,8 @@ watch([() => props.modal], () => {
|
|||
</div>
|
||||
<d-table
|
||||
ref="table"
|
||||
:columns="columns"
|
||||
:rows="complainstStore.rowsAdd"
|
||||
:columns="props.columns"
|
||||
:rows="props.rows"
|
||||
:filter="filter"
|
||||
row-key="personId"
|
||||
flat
|
||||
|
|
@ -228,7 +153,7 @@ watch([() => props.modal], () => {
|
|||
:paging="false"
|
||||
dense
|
||||
class="custom-header-table"
|
||||
:visible-columns="visibleColumns"
|
||||
:visible-columns="props.visibleColumns"
|
||||
selection="multiple"
|
||||
v-model:selected="selected"
|
||||
:pagination="initialPagination"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue