ปรับหน้าเรื่องร้องเรียนของวินัย
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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue