ปรับ ผู้ร้้องเรียน ปรับ dialog

This commit is contained in:
setthawutttty 2023-11-22 12:03:33 +07:00
parent e9529f11a7
commit f10b77a34b
7 changed files with 149 additions and 105 deletions

View file

@ -22,7 +22,7 @@ const personOj = reactive<ArrayPerson>({
name: "",
position: "",
positionLevel: "",
educationQualification: "",
salary: "",
organization: "",
});
const data = reactive<FormData>({
@ -68,7 +68,7 @@ const fetchData = async () => {
name: "นางศิรินภา คงน้อย",
position: "ธุรการ",
positionLevel: "ต้น",
educationQualification: "ปริญญาตรี",
salary: "10000",
organization: "สกจ.",
},
]

View file

@ -62,7 +62,7 @@ const personOj = reactive<ArrayPerson>({
name: "",
position: "",
positionLevel: "",
educationQualification: "",
salary: "",
organization: "",
});
@ -173,18 +173,18 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px",
},
{
name: "educationQualification",
name: "salary",
align: "left",
label: "วุฒิการศึกษา",
label: "เงินเดือน",
sortable: true,
field: "educationQualification",
field: "salary",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "organization",
align: "left",
label: "สังกัด",
label: "หน่วยงาน",
sortable: true,
field: "organization",
headerStyle: "font-size: 14px",
@ -199,7 +199,7 @@ const visibleColumns = ref<string[]>([
"name",
"position",
"positionLevel",
"educationQualification",
"salary",
"organization",
]);
@ -315,7 +315,7 @@ async function addPerson() {
name: "นางศิรินภา คงน้อย",
position: "ตำเเหน่ง1",
positionLevel: "level1",
educationQualification: "ป.ตรี",
salary: "10000",
organization: "สำนักงาน 1",
},
{
@ -324,7 +324,7 @@ async function addPerson() {
name: "นายแก้ว คำ",
position: "ตำแหน่ง2",
positionLevel: "level2",
educationQualification: "ป.โท",
salary: "1000",
organization: "สำนักงาน 2",
},
{
@ -333,7 +333,7 @@ async function addPerson() {
name: "นายภัทรานุย คงนอย",
position: "ตำแหน่ง2",
positionLevel: "level3",
educationQualification: "ป.เอก",
salary: "100",
organization: "สำนักงาน 3",
},
];
@ -482,75 +482,81 @@ onMounted(() => {
</template>
</q-select>
</div>
<div class="full-width" v-if="formData.respondentType === 'PERSON'">
<div class="row col-12 q-mb-xs">
<q-space />
<q-btn
color="blue"
outline
@click="toggleModal"
v-if="
formData.complaintStatus === 'NEW' ||
formData.complaintStatus === ''
"
<div class="row col-12" v-if="formData.respondentType === 'PERSON'">
<q-card
bordered
class="row col-12"
style="border: 1px solid #d6dee1"
>
<div
class="col-xs-12 col-sm-12 text-weight-medium bg-grey-1 q-py-xs q-px-md"
>
<q-icon left name="add" />
<div>เพ</div>
</q-btn>
<DialogAddPersonal
:modal="modal"
btn-title="เพิ่มรายชื่อผู้ถูกสอบสวน"
:close="toggleModal"
:save="addPerson"
@returnData="handleSave"
/>
</div>
<div class="col-12">
<d-table
ref="table"
:columns="complainstStore.columns"
:rows="complainstStore.rowsAdd"
row-key="interrogated"
flat
bordered
:paging="true"
dense
class="custom-header-table"
:visible-columns="complainstStore.visibleColumns"
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th
v-for="col in props.cols"
:key="col.name"
:props="props"
style="color: #000000; font-weight: 500"
>
<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-for="col in props.cols"
:key="col.name"
:props="props"
>
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</div>
<div>
{{ col.value }}
</div>
</q-td>
</q-tr>
</template>
</d-table>
</div>
กรองเรยน
<q-btn
v-if="
formData.complaintStatus === 'NEW' ||
formData.complaintStatus === ''
"
size="12px"
flat
round
dense
color="add"
class="q-ml-sm"
@click="toggleModal"
icon="mdi-plus"
>
<q-tooltip>เพมผกรองเรยน</q-tooltip>
</q-btn>
</div>
<div class="col-12"><q-separator /></div>
<div class="col-xs-12 q-pa-sm">
<d-table
ref="table"
:columns="complainstStore.columns"
:rows="complainstStore.rowsAdd"
row-key="interrogated"
flat
bordered
:paging="true"
dense
class="custom-header-table"
:visible-columns="complainstStore.visibleColumns"
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th
v-for="col in props.cols"
:key="col.name"
:props="props"
style="color: #000000; font-weight: 500"
>
<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-for="col in props.cols"
:key="col.name"
:props="props"
>
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</div>
<div>
{{ col.value }}
</div>
</q-td>
</q-tr>
</template>
</d-table>
</div>
</q-card>
</div>
<div class="col-xs-12 col-sm-12" id="title">
<q-input
for="inputTopicComplaint"
@ -899,6 +905,14 @@ onMounted(() => {
</form>
</q-card>
</div>
<DialogAddPersonal
:modal="modal"
btn-title="เพิ่มรายชื่อผู้ถูกสอบสวน"
:close="toggleModal"
:save="addPerson"
@returnData="handleSave"
/>
</template>
<style scoped></style>

View file

@ -88,6 +88,7 @@ const formData = reactive<FormData>({
recordAccuser: "",
witnesses: "",
InvestResults: "",
complaintStatus:"",
filesEvidence: null,
filesRecordAccuser: null,
filesWitnesses: null,

View file

@ -14,9 +14,9 @@ interface FormData {
documentFile: any | null
complaintStatus: string
persons: ArrayPerson[]
personId: Array
personId: any
organizationId:string|null
respondentId:Array
respondentId:any
}
interface ArrayPerson {
@ -24,7 +24,7 @@ interface ArrayPerson {
name: string,
position: string,
positionLevel: string,
educationQualification: string,
salary: string,
organization: string,
}
interface MyObjectComplaintsRef {
@ -50,7 +50,7 @@ interface DataAddRequest {
name: string
position: string
positionLevel: string
educationQualification: string
salary: string
organization: string
}
export type {

View file

@ -15,7 +15,7 @@ interface DataAdd {
name:string
position:string
positionLevel:string
educationQualification:string
salary:string
organization:string
}
interface DataAddResponse {
@ -24,7 +24,7 @@ interface DataAddResponse {
name:string
position:string
positionLevel:string
educationQualification:string
salary:string
organization:string
}
interface DataList {

View file

@ -24,18 +24,24 @@ export const useComplainstDataStore = defineStore("DisciplineComplainst", () =>
const columns = ref<QTableProps["columns"]>([]);
function fetchComplainstAdd(data: DataAddResponse[]) {
console.log(data)
let datalist = data.map((e: DataAddResponse) => ({
id: e.id,
idcard: e.idcard,
name: e.name,
position: e.position,
positionLevel: e.positionLevel,
educationQualification: e.educationQualification,
salary: addCommas(e.salary),
organization: e.organization,
}))
rowsAdd.value = datalist
}
function addCommas(salaryString: string): string {
const salaryNumber = parseFloat(salaryString.replace(/,/g, ''));
return salaryNumber.toLocaleString();
}
function fetchComplainst(data: DataList[]) {
let datalist: DataListRow[] = data.map((e: DataList) => ({
id: e.id,