ปรับหน้าเรื่องร้องเรียนของวินัย
This commit is contained in:
parent
bb8f96c78a
commit
e18386db65
7 changed files with 221 additions and 305 deletions
|
|
@ -69,7 +69,7 @@ const data = reactive<FormData>({
|
|||
documentFile: null,
|
||||
status: "",
|
||||
persons: [personOj],
|
||||
result: '',
|
||||
result: "",
|
||||
disciplineComplaintDocs: [fileListOj],
|
||||
});
|
||||
|
||||
|
|
@ -175,7 +175,6 @@ async function onSubmit(data: any) {
|
|||
.then((res) => {
|
||||
console.log(res);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
router.push(`/discipline/complaints`);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -183,19 +182,12 @@ async function onSubmit(data: any) {
|
|||
.finally(async () => {
|
||||
hideLoader();
|
||||
});
|
||||
console.log("edit", data);
|
||||
// router.push(`/discipline/complaints`);
|
||||
}
|
||||
|
||||
/** ยืนยัน มีมูลส่งไปสืบสวน */
|
||||
function sentInvestigate() {
|
||||
modalPopup.value = true;
|
||||
// dialogConfirm(
|
||||
// $q,
|
||||
// () => confirmSentInvestigate(),
|
||||
// "ยืนยันส่งไปสืบสวน",
|
||||
// "ต้องการยืนยันส่งไปสืบสวนใช่หรือไม่?"
|
||||
// );
|
||||
}
|
||||
|
||||
function closePopup() {
|
||||
|
|
@ -222,21 +214,16 @@ function cancelInvestigate() {
|
|||
);
|
||||
}
|
||||
|
||||
/** ฟังชั่น มีมูลส่งไปสืบสวน*/
|
||||
function confirmSentInvestigate() {
|
||||
console.log("sent");
|
||||
}
|
||||
|
||||
/** ฟังชั่น ยุติเรื่อง*/
|
||||
function confirmEndInvestigate() {
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.complaintReject(id.value))
|
||||
.get(config.API.complaintReject(id.value))
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
success($q, "ยุติเรื่องสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q,e);
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await getData();
|
||||
|
|
@ -250,7 +237,7 @@ function confirmCancelInvestigate() {
|
|||
http
|
||||
.get(config.API.complaintResume(id.value))
|
||||
.then((res) => {
|
||||
getData()
|
||||
getData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -261,16 +248,14 @@ function confirmCancelInvestigate() {
|
|||
console.log("sent");
|
||||
}
|
||||
|
||||
function emitPerson(data:ArrayPerson[]){
|
||||
console.log('person',data)
|
||||
const dataMapId = data.map((item:ArrayPerson) =>
|
||||
item.personId
|
||||
)
|
||||
console.log('id',dataMapId)
|
||||
showLoader();
|
||||
function emitPerson(data: ArrayPerson[]) {
|
||||
console.log("person", data);
|
||||
const dataMapId = data.map((item: ArrayPerson) => item.personId);
|
||||
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.complaintApprove(id.value),{
|
||||
persons:dataMapId
|
||||
.put(config.API.complaintApprove(id.value), {
|
||||
persons: dataMapId,
|
||||
})
|
||||
.then((res) => {
|
||||
router.push(`/discipline/complaints`);
|
||||
|
|
@ -317,7 +302,7 @@ onMounted(() => {
|
|||
class="q-mr-sm"
|
||||
@click="$router.push(`/discipline/complaints`)"
|
||||
/>
|
||||
<div class="q-ma-none">แก้ไขเรื่องร้องเรียน {{ id }}#id</div>
|
||||
<div class="q-ma-none">แก้ไขเรื่องร้องเรียน</div>
|
||||
<q-space />
|
||||
<div class="q-gutter-x-sm">
|
||||
<q-btn
|
||||
|
|
@ -341,11 +326,11 @@ onMounted(() => {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<Form
|
||||
:on-submit="onSubmit"
|
||||
:data="data"
|
||||
:get-data="getData"
|
||||
<Form :on-submit="onSubmit" :data="data" :get-data="getData" />
|
||||
<Popup
|
||||
:modal="modalPopup"
|
||||
:close="closePopup"
|
||||
@return-person="emitPerson"
|
||||
/>
|
||||
<Popup :modal="modalPopup" :close="closePopup" @return-person="emitPerson"/>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -72,8 +72,6 @@ const props = defineProps({
|
|||
},
|
||||
});
|
||||
|
||||
|
||||
|
||||
const fileListOj = reactive<ArrayFileList>({
|
||||
id: "",
|
||||
pathName: "",
|
||||
|
|
@ -96,12 +94,11 @@ const formData = reactive<FormData>({
|
|||
appellant: "",
|
||||
documentFile: null,
|
||||
status: "",
|
||||
result: '',
|
||||
result: "",
|
||||
persons: [],
|
||||
disciplineComplaintDocs: fileList.value ?? null,
|
||||
});
|
||||
|
||||
|
||||
/** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */
|
||||
const objectComplaintsRef: MyObjectComplaintsRef = {
|
||||
respondentType: respondentTypeRef,
|
||||
|
|
@ -142,6 +139,15 @@ const complaintFromtoptions = ref<DataOption[]>([
|
|||
|
||||
/** หัวตาราง */
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "info",
|
||||
align: "left",
|
||||
label: "",
|
||||
sortable: false,
|
||||
field: "info",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
|
|
@ -218,6 +224,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
|
||||
/** หัวข้อที่เเสดงในตาราง */
|
||||
const visibleColumns = ref<string[]>([
|
||||
"info",
|
||||
"no",
|
||||
"idcard",
|
||||
"name",
|
||||
|
|
@ -235,32 +242,12 @@ const visibleColumns = ref<string[]>([
|
|||
async function selectComplainant(val: string) {
|
||||
formData.organizationId = "";
|
||||
formData.consideredAgency = "";
|
||||
if (val === "0") {
|
||||
await fetchListname(); // ถ้าเลือกบุกคลจะเรียก function fetchListname เรียกรายชื่อจากทะเบียน
|
||||
} else if (val === "1") {
|
||||
|
||||
if (val === "1") {
|
||||
await fetchOffice(); // ถ้าเลือกหน่วยงานจะเรียก function fetchOffice เรียกโครงสร้างสำนักงาน
|
||||
}
|
||||
}
|
||||
|
||||
/** เรียกรายชื่อ */
|
||||
async function fetchListname() {
|
||||
const listName = [
|
||||
{
|
||||
id: "1",
|
||||
name: "นายเอ",
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
name: "นายบี",
|
||||
},
|
||||
{
|
||||
id: "3",
|
||||
name: "นายชี",
|
||||
},
|
||||
];
|
||||
selectComplainantTpye(listName);
|
||||
}
|
||||
|
||||
/** เรียกโครงสร้างสำนักงาน */
|
||||
async function fetchOffice() {}
|
||||
|
||||
|
|
@ -600,7 +587,15 @@ onMounted(() => {
|
|||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div>
|
||||
<div v-else-if="col.name == 'info'">
|
||||
<router-link :to="`/registry/${props.row.personId}`"
|
||||
><q-icon name="info" color="info" size="sm"
|
||||
><q-tooltip>ดูข้อมูลในทะเบียนประวัติ</q-tooltip>
|
||||
</q-icon></router-link
|
||||
>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
|
|
@ -638,7 +633,7 @@ onMounted(() => {
|
|||
v-model="formData.description"
|
||||
:rules="[(val) => !!val || 'กรุณาการข้อมูล']"
|
||||
lazy-rules
|
||||
label="รายละเอียดที่เกี่นวข้องกับเรื่องที่ต้องการจะข้อเรียน"
|
||||
label="รายละเอียดเรื่องร้องเรียน"
|
||||
type="textarea"
|
||||
rows="5"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -3,8 +3,6 @@ import { ref, onMounted, watch } from "vue";
|
|||
import { useRouter } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
// import type
|
||||
import type { DataList } from "@/modules/11_discipline/interface/response/complaint";
|
||||
// importStroe
|
||||
import { useComplainstDataStore } from "@/modules/11_discipline/store/ComplaintsStore";
|
||||
// impoet Components
|
||||
|
|
@ -29,10 +27,10 @@ const maxPage = ref<number>(1);
|
|||
const page = ref<number>(1);
|
||||
const rowsPerPage = ref<number>(10);
|
||||
|
||||
async function updatePagingProp(rowPerpage:number,pageCurrent:number) {
|
||||
rowsPerPage.value = rowPerpage
|
||||
page.value = pageCurrent
|
||||
await getList()
|
||||
async function updatePagingProp(rowPerpage: number, pageCurrent: number) {
|
||||
rowsPerPage.value = rowPerpage;
|
||||
page.value = pageCurrent;
|
||||
await getList();
|
||||
}
|
||||
|
||||
async function getList() {
|
||||
|
|
@ -44,11 +42,10 @@ async function getList() {
|
|||
rowsPerPage.value,
|
||||
filterKeyword.value
|
||||
)
|
||||
|
||||
)
|
||||
//
|
||||
//
|
||||
.then((res) => {
|
||||
maxPage.value = Math.ceil(res.data.result.total/ rowsPerPage.value);
|
||||
maxPage.value = Math.ceil(res.data.result.total / rowsPerPage.value);
|
||||
const data = res.data.result.data;
|
||||
fetchComplainst(data);
|
||||
})
|
||||
|
|
@ -62,7 +59,7 @@ async function getList() {
|
|||
|
||||
/** ไปยังหน้าเพิ่มข้อมูล */
|
||||
function redirectToPageadd() {
|
||||
complainstStore.fetchComplainstAdd([])
|
||||
complainstStore.fetchComplainstAdd([]);
|
||||
router.push(`/discipline/complaints/add`);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,27 +45,27 @@ const columns = ref<QTableProps["columns"]>([
|
|||
{
|
||||
name: "title",
|
||||
align: "left",
|
||||
label: "เรื่อง",
|
||||
label: "เรื่องร้องเรียน",
|
||||
sortable: true,
|
||||
field: "title",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "description",
|
||||
name: "dateReceived",
|
||||
align: "left",
|
||||
label: "รายละเอียด",
|
||||
label: "วันที่รับเรื่อง",
|
||||
sortable: true,
|
||||
field: "description",
|
||||
field: "dateReceived",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "appellant",
|
||||
name: "respondentType",
|
||||
align: "left",
|
||||
label: "ผู้ถูกร้องเรียน",
|
||||
sortable: true,
|
||||
field: "appellant",
|
||||
field: "respondentType",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
|
@ -78,15 +78,6 @@ const columns = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "createdAt",
|
||||
align: "left",
|
||||
label: "วันที่สร้างเรื่องร้องเรียน",
|
||||
sortable: true,
|
||||
field: "createdAt",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "levelConsideration",
|
||||
align: "left",
|
||||
|
|
@ -108,7 +99,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
{
|
||||
name: "status",
|
||||
align: "left",
|
||||
label: "สถานะเรื่องร้องเรียน",
|
||||
label: "สถานะ",
|
||||
sortable: true,
|
||||
field: "status",
|
||||
headerStyle: "font-size: 14px",
|
||||
|
|
@ -120,8 +111,8 @@ const columns = ref<QTableProps["columns"]>([
|
|||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"title",
|
||||
"description",
|
||||
"appellant",
|
||||
"dateReceived",
|
||||
"respondentType",
|
||||
"offenseDetails",
|
||||
"createdAt",
|
||||
"levelConsideration",
|
||||
|
|
@ -216,11 +207,6 @@ watch(
|
|||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-if="col.name == 'description'">
|
||||
<div class="table_ellipsis">
|
||||
{{ props.row.description }}
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,55 +1,51 @@
|
|||
interface DataListRow {
|
||||
id:string
|
||||
title: string
|
||||
description: string
|
||||
appellant: string
|
||||
offenseDetails: string
|
||||
createdAt: string
|
||||
levelConsideration: string
|
||||
dateConsideration: string
|
||||
status: string
|
||||
id: string;
|
||||
personId: string;
|
||||
title: string;
|
||||
dateReceived: Date | "-";
|
||||
respondentType: string;
|
||||
offenseDetails: string;
|
||||
createdAt: string;
|
||||
levelConsideration: string;
|
||||
dateConsideration: string;
|
||||
status: string;
|
||||
}
|
||||
interface DataAdd {
|
||||
id:string
|
||||
idcard:string
|
||||
name:string
|
||||
positionNo:string
|
||||
position:string
|
||||
positionLevel:string
|
||||
salary:string
|
||||
organization:string
|
||||
id: string;
|
||||
idcard: string;
|
||||
name: string;
|
||||
positionNo: string;
|
||||
position: string;
|
||||
positionLevel: string;
|
||||
salary: string;
|
||||
organization: string;
|
||||
}
|
||||
interface DataAddResponse {
|
||||
id:string
|
||||
idcard:string
|
||||
name:string
|
||||
positionNo:string
|
||||
position:string
|
||||
positionLevel:string
|
||||
salary:string
|
||||
organization:string
|
||||
id: string;
|
||||
idcard: string;
|
||||
name: string;
|
||||
positionNo: string;
|
||||
position: string;
|
||||
positionLevel: string;
|
||||
salary: string;
|
||||
organization: string;
|
||||
}
|
||||
interface DataList {
|
||||
id:string
|
||||
title: string
|
||||
description: string
|
||||
appellant: string
|
||||
offenseDetails: string
|
||||
createdAt: Date
|
||||
levelConsideration: string
|
||||
dateConsideration: Date
|
||||
status: string
|
||||
id: string;
|
||||
personId: string;
|
||||
title: string;
|
||||
dateReceived: Date | "-";
|
||||
respondentType: string;
|
||||
offenseDetails: string;
|
||||
createdAt: Date;
|
||||
levelConsideration: string;
|
||||
dateConsideration: Date;
|
||||
status: string;
|
||||
}
|
||||
|
||||
interface ocListType{
|
||||
organizationId:string
|
||||
organizationName:string
|
||||
interface ocListType {
|
||||
organizationId: string;
|
||||
organizationName: string;
|
||||
}
|
||||
|
||||
export type {
|
||||
DataList,
|
||||
DataListRow,
|
||||
DataAdd,
|
||||
DataAddResponse,
|
||||
ocListType
|
||||
}
|
||||
export type { DataList, DataListRow, DataAdd, DataAddResponse, ocListType };
|
||||
|
|
|
|||
|
|
@ -3,140 +3,158 @@ import { ref } from "vue";
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
import type { DataOption } from "@/modules/11_discipline/interface/index/Main";
|
||||
import type { DataList, DataListRow, DataAdd, ArrayPerson,ocListType } from "@/modules/11_discipline/interface/response/complaint"
|
||||
import type {
|
||||
DataList,
|
||||
DataListRow,
|
||||
DataAdd,
|
||||
ArrayPerson,
|
||||
ocListType,
|
||||
} from "@/modules/11_discipline/interface/response/complaint";
|
||||
import type { QTableProps } from "quasar";
|
||||
|
||||
const mixin = useCounterMixin()
|
||||
const { date2Thai } = mixin
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai } = mixin;
|
||||
|
||||
// id
|
||||
// cardId
|
||||
// prefix
|
||||
// firstName
|
||||
// lastName
|
||||
// position
|
||||
// level
|
||||
// oc
|
||||
export const useComplainstDataStore = defineStore("DisciplineComplainst", () => {
|
||||
const rows = ref<DataListRow[]>([])
|
||||
const rowsAdd = ref<ArrayPerson[]>([])
|
||||
export const useComplainstDataStore = defineStore(
|
||||
"DisciplineComplainst",
|
||||
() => {
|
||||
const rows = ref<DataListRow[]>([]);
|
||||
const rowsAdd = ref<ArrayPerson[]>([]);
|
||||
const visibleColumns = ref<string[]>([]);
|
||||
const columns = ref<QTableProps["columns"]>([]);
|
||||
|
||||
function fetchComplainstAdd(data: ArrayPerson[]) {
|
||||
rowsAdd.value = data
|
||||
rowsAdd.value = data;
|
||||
}
|
||||
|
||||
function addCommas(salaryString: string): string {
|
||||
const salaryNumber = parseFloat(salaryString.replace(/,/g, ''));
|
||||
return salaryNumber.toLocaleString();
|
||||
const salaryNumber = parseFloat(salaryString.replace(/,/g, ""));
|
||||
return salaryNumber.toLocaleString();
|
||||
}
|
||||
|
||||
function fetchComplainst(data: DataList[]) {
|
||||
let datalist: DataListRow[] = data.map((e: DataList) => ({
|
||||
id: e.id,
|
||||
title: e.title,
|
||||
description: e.description,
|
||||
appellant: e.appellant,
|
||||
offenseDetails: offenseDetailsTran(e.offenseDetails),
|
||||
createdAt: date2Thai(e.createdAt)!,
|
||||
levelConsideration: levelConsiderationTran(e.levelConsideration),
|
||||
dateConsideration: date2Thai(e.dateConsideration)!,
|
||||
status: statusTothai(e.status),
|
||||
}));
|
||||
rows.value = datalist;
|
||||
}
|
||||
|
||||
let datalist: DataListRow[] = data.map((e: DataList) => ({
|
||||
id: e.id,
|
||||
personId: e.personId,
|
||||
title: e.title,
|
||||
dateReceived: e.dateReceived ? e.dateReceived : "-",
|
||||
respondentType: convertComplaintType(e.respondentType),
|
||||
offenseDetails: offenseDetailsTran(e.offenseDetails),
|
||||
createdAt: date2Thai(e.createdAt)!,
|
||||
levelConsideration: levelConsiderationTran(e.levelConsideration),
|
||||
dateConsideration: date2Thai(e.dateConsideration)!,
|
||||
status: statusTothai(e.status),
|
||||
}));
|
||||
rows.value = datalist;
|
||||
}
|
||||
|
||||
// filter options
|
||||
const complainantoptionsMain = ref<DataOption[]>([
|
||||
{ id: "PERSON", name: "บุคคล" },
|
||||
{ id: "ORGANIZATION", name: "หน่วยงาน" },
|
||||
{ id: "BANGKOK", name: "กรุงเทพมหานคร" },
|
||||
{ id: "PERSON", name: "บุคคล" },
|
||||
{ id: "ORGANIZATION", name: "หน่วยงาน" },
|
||||
{ id: "BANGKOK", name: "กรุงเทพมหานคร" },
|
||||
]);
|
||||
const complainantoptions = ref<DataOption[]>(complainantoptionsMain.value)
|
||||
|
||||
function convertComplaintType(val: string) {
|
||||
const result = complainantoptionsMain.value.find(
|
||||
(x: any) => x.id == val
|
||||
)?.name;
|
||||
return result ? result : "-";
|
||||
}
|
||||
|
||||
const complainantoptions = ref<DataOption[]>(complainantoptionsMain.value);
|
||||
const consideredAgencytoptions = ref<DataOption[]>([]);
|
||||
const organizationIdOp = ref<DataOption[]>([]);
|
||||
|
||||
const statusTothai = (val: string) => {
|
||||
switch (val) {
|
||||
case 'NEW': return "ใหม่";
|
||||
case 'STOP': return "ยุติเรื่อง";
|
||||
case 'SEND_INVESTIGATE': return "มีมูลส่งไปสืบสวนแล้ว";
|
||||
default: return "-";
|
||||
}
|
||||
switch (val) {
|
||||
case "NEW":
|
||||
return "ใหม่";
|
||||
case "STOP":
|
||||
return "ยุติเรื่อง";
|
||||
case "SEND_INVESTIGATE":
|
||||
return "มีมูลส่งไปสืบสวนแล้ว";
|
||||
default:
|
||||
return "-";
|
||||
}
|
||||
};
|
||||
|
||||
function offenseDetailsTran(val: string){
|
||||
switch (val) {
|
||||
case 'NOT_SPECIFIED': return "ยังไม่ระบุ";
|
||||
case 'NOT_DEADLY': return "ร้ายแรง";
|
||||
case 'DEADLY': return "ไม่ร้ายแรง";
|
||||
default: return "-";
|
||||
}
|
||||
function offenseDetailsTran(val: string) {
|
||||
switch (val) {
|
||||
case "NOT_SPECIFIED":
|
||||
return "ยังไม่ระบุ";
|
||||
case "NOT_DEADLY":
|
||||
return "ร้ายแรง";
|
||||
case "DEADLY":
|
||||
return "ไม่ร้ายแรง";
|
||||
default:
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
function levelConsiderationTran(val: string){
|
||||
switch (val) {
|
||||
case 'NORMAL': return "ปกติ";
|
||||
case 'URGENT': return "ด่วน";
|
||||
case 'VERT_URGENT': return "ด่วนมาก";
|
||||
default: return "-";
|
||||
}
|
||||
function levelConsiderationTran(val: string) {
|
||||
switch (val) {
|
||||
case "NORMAL":
|
||||
return "ปกติ";
|
||||
case "URGENT":
|
||||
return "ด่วน";
|
||||
case "VERT_URGENT":
|
||||
return "ด่วนมาก";
|
||||
default:
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
|
||||
const agencytoptions = ref<DataOption[]>(consideredAgencytoptions.value)
|
||||
const optionListNameMain = ref<DataOption[]>([])
|
||||
const optionListName = ref<DataOption[]>([])
|
||||
const agencytoptions = ref<DataOption[]>(consideredAgencytoptions.value);
|
||||
const optionListNameMain = ref<DataOption[]>([]);
|
||||
const optionListName = ref<DataOption[]>([]);
|
||||
|
||||
function selectComplainantTpye(list: any) {
|
||||
optionListNameMain.value = list
|
||||
optionListName.value = list
|
||||
optionListNameMain.value = list;
|
||||
optionListName.value = list;
|
||||
}
|
||||
|
||||
function filterSelector(val: string, update: Function, type: string) {
|
||||
update(() => {
|
||||
const needle = val.toLowerCase();
|
||||
update(() => {
|
||||
const needle = val.toLowerCase();
|
||||
|
||||
if (type === "filtercomplainantType") {
|
||||
complainantoptions.value = complainantoptionsMain.value.filter(
|
||||
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
|
||||
} else if (type === "filteragencytoptions") {
|
||||
agencytoptions.value = consideredAgencytoptions.value.filter(
|
||||
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
} else if (type === "filtercomplainantOP") {
|
||||
optionListName.value = optionListNameMain.value.filter(
|
||||
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
}
|
||||
|
||||
});
|
||||
if (type === "filtercomplainantType") {
|
||||
complainantoptions.value = complainantoptionsMain.value.filter(
|
||||
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
} else if (type === "filteragencytoptions") {
|
||||
agencytoptions.value = consideredAgencytoptions.value.filter(
|
||||
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
} else if (type === "filtercomplainantOP") {
|
||||
optionListName.value = optionListNameMain.value.filter(
|
||||
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function ocListFn(data:ocListType[]){
|
||||
let dataList:DataOption[] = data.map((item:ocListType)=>({
|
||||
id:item.organizationId,
|
||||
name:item.organizationName
|
||||
}))
|
||||
consideredAgencytoptions.value = dataList
|
||||
organizationIdOp.value = dataList
|
||||
|
||||
function ocListFn(data: ocListType[]) {
|
||||
let dataList: DataOption[] = data.map((item: ocListType) => ({
|
||||
id: item.organizationId,
|
||||
name: item.organizationName,
|
||||
}));
|
||||
consideredAgencytoptions.value = dataList;
|
||||
organizationIdOp.value = dataList;
|
||||
}
|
||||
return {
|
||||
rows,
|
||||
rowsAdd,
|
||||
visibleColumns,
|
||||
columns,
|
||||
fetchComplainst,
|
||||
selectComplainantTpye,
|
||||
filterSelector,
|
||||
complainantoptions,
|
||||
consideredAgencytoptions,
|
||||
optionListName,
|
||||
fetchComplainstAdd,
|
||||
organizationIdOp,
|
||||
ocListFn
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
rows,
|
||||
rowsAdd,
|
||||
visibleColumns,
|
||||
columns,
|
||||
fetchComplainst,
|
||||
selectComplainantTpye,
|
||||
filterSelector,
|
||||
complainantoptions,
|
||||
consideredAgencytoptions,
|
||||
optionListName,
|
||||
fetchComplainstAdd,
|
||||
organizationIdOp,
|
||||
ocListFn,
|
||||
};
|
||||
}
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue