ปรับ ผู้ร้้องเรียน ปรับ 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

@ -41,10 +41,12 @@ const typeOps = ref<typeOp[]>([
/** หัวข้อที่เเสดงในตาราง */ /** หัวข้อที่เเสดงในตาราง */
const visibleColumns = ref<string[]>([ const visibleColumns = ref<string[]>([
"no", "no",
"cardId", "idcard",
"fullName", "fullName",
"position", "position",
"level", "positionLevel",
"salary",
"organization",
]); ]);
/** หัวตาราง */ /** หัวตาราง */
@ -59,11 +61,11 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px", style: "font-size: 14px",
}, },
{ {
name: "cardId", name: "idcard",
align: "left", align: "left",
label: "เลขประจำตัวประชาชน", label: "เลขบัตรประชาชน",
sortable: true, sortable: true,
field: "cardId", field: "idcard",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
@ -86,11 +88,29 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px", style: "font-size: 14px",
}, },
{ {
name: "level", name: "positionLevel",
align: "left", align: "left",
label: "ระดับ", label: "ระดับ",
sortable: true, sortable: true,
field: "level", 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", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
@ -155,7 +175,7 @@ function saveData() {
function searchInput() { function searchInput() {
const data = dataObject.value; const data = dataObject.value;
if (type.value === "idcard") { if (type.value === "idcard") {
rows.value = data.filter((item: any) => item.cardId === search.value); rows.value = data.filter((item: any) => item.idcard === search.value);
} else if (type.value === "firstname") { } else if (type.value === "firstname") {
rows.value = data.filter((item: any) => item.firstName === search.value); rows.value = data.filter((item: any) => item.firstName === search.value);
} else if (type.value === "lastname") { } else if (type.value === "lastname") {
@ -181,38 +201,38 @@ onMounted(() => {
const data = [ const data = [
{ {
id: "001", id: "001",
cardId: "0000000000001", idcard: "0000000000001",
prefix: "นาง", prefix: "นาง",
firstName: "ศิรินภา", firstName: "ศิรินภา",
lastName: "คงน้อย", lastName: "คงน้อย",
position: "ตำเเหน่ง1", position: "ตำเเหน่ง1",
level: "level1", positionLevel: "level1",
degree: "ป.ตรี", salary: "100",
oc: "สำนักงาน 1", organization: "สำนักงาน 1",
fullName: "นางศิรินภา คงน้อย", fullName: "นางศิรินภา คงน้อย",
}, },
{ {
id: "002", id: "002",
cardId: "0000000000002", idcard: "0000000000002",
prefix: "นาย", prefix: "นาย",
firstName: "แก้ว", firstName: "แก้ว",
lastName: "คำ", lastName: "คำ",
position: "ตำแหน่ง2", position: "ตำแหน่ง2",
level: "level2", positionLevel: "level2",
degree: "ป.โท", salary: "100",
oc: "สำนักงาน 2", organization: "สำนักงาน 2",
fullName: "นางแก้ว คำ", fullName: "นางแก้ว คำ",
}, },
{ {
id: "003", id: "003",
cardId: "0000000000003", idcard: "0000000000003",
prefix: "นาย", prefix: "นาย",
firstName: "ภัทรานุย", firstName: "ภัทรานุย",
lastName: "คงนอย", lastName: "คงนอย",
position: "ตำแหน่ง2", position: "ตำแหน่ง2",
level: "level3", positionLevel: "level3",
degree: "ป.เอก", salary: "100",
oc: "สำนักงาน 3", organization: "สำนักงาน 3",
fullName: "นางภัทรานุย คงนอย", fullName: "นางภัทรานุย คงนอย",
}, },
]; ];
@ -336,6 +356,9 @@ onMounted(() => {
<div v-if="col.name == 'no'"> <div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }} {{ props.rowIndex + 1 }}
</div> </div>
<div v-if="col.name === 'fullName'">
{{ props.prefix }}
</div>
<div> <div>
{{ col.value }} {{ col.value }}
</div> </div>

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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