Merge branch 'develop' of https://github.com/Frappet/bma-ehr-frontend into develop
This commit is contained in:
commit
ab19e5937f
14 changed files with 247 additions and 89 deletions
|
|
@ -132,6 +132,9 @@ const fecthProfile = async () => {
|
|||
);
|
||||
rows.value = res.data.result.data.map((e: any) => ({
|
||||
id: e.id,
|
||||
prefix:e.prefix,
|
||||
firstName:e.firstName,
|
||||
lastName:e.lastName,
|
||||
fullname: e.prefix + e.firstName + " " + e.lastName,
|
||||
position: e.position,
|
||||
level:
|
||||
|
|
@ -265,10 +268,10 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td>{{ props.rowIndex + 1 }}</q-td>
|
||||
<q-td key="fullname" :props="props">
|
||||
{{ props.row.fullname }}
|
||||
{{ props.row.prefix ? props.row.prefix:'' }}{{ props.row.firstName ? props.row.firstName:'' }} {{ props.row.lastName ? props.row.lastName:'' }}
|
||||
</q-td>
|
||||
<q-td key="position" :props="props">
|
||||
{{ props.row.position }}
|
||||
{{ props.row.position ? props.row.position:'-' }}
|
||||
</q-td>
|
||||
<q-td key="level" :props="props">{{ props.row.level }}</q-td>
|
||||
<q-td
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ const dataProfile = ref<Object>([]);
|
|||
|
||||
/** คอลัมน์ที่แสดง */
|
||||
const columns = ref<any["columns"]>([]);
|
||||
const rows = ref<any>([]);
|
||||
const rows = ref<any[]>([]);
|
||||
const visibleColumns = ref<string[]>([
|
||||
"order",
|
||||
"name",
|
||||
|
|
@ -101,6 +101,9 @@ const fecthlistprofile = async (id: string) => {
|
|||
id: e.id,
|
||||
profileId: e.profileId,
|
||||
order: e.order,
|
||||
prefix: e.prefix,
|
||||
firstName: e.firstName,
|
||||
lastName: e.lastName,
|
||||
name: e.prefix + e.firstName + " " + e.lastName,
|
||||
organization: e.root,
|
||||
position: e.position,
|
||||
|
|
@ -629,7 +632,11 @@ function updatemodalPersonal(modal: boolean) {
|
|||
@click.stop="onclickViewinfo(props.row.profileId)"
|
||||
>
|
||||
<q-td key="order" :props="props">{{ props.row.order }} </q-td>
|
||||
<q-td key="name" :props="props">{{ props.row.name }}</q-td>
|
||||
<q-td key="name" :props="props"
|
||||
>{{ props.row.prefix ? props.row.prefix : ""
|
||||
}}{{ props.row.firstName ? props.row.firstName : "" }}
|
||||
{{ props.row.lastName ? props.row.lastName : "" }}</q-td
|
||||
>
|
||||
<!-- <q-td
|
||||
class="table_ellipsis"
|
||||
key="organizationOrganization"
|
||||
|
|
@ -637,7 +644,7 @@ function updatemodalPersonal(modal: boolean) {
|
|||
>{{ props.row.organizationOrganization }}</q-td
|
||||
> -->
|
||||
<q-td key="position" :props="props">{{
|
||||
props.row.position
|
||||
props.row.position ? props.row.position:'-'
|
||||
}}</q-td>
|
||||
<q-td key="positionType" :props="props"
|
||||
>{{ props.row.positionType ? props.row.positionType : "-" }}
|
||||
|
|
@ -649,7 +656,7 @@ function updatemodalPersonal(modal: boolean) {
|
|||
</q-td>
|
||||
|
||||
<q-td key="positionNumber" :props="props">{{
|
||||
props.row.positionNumber
|
||||
props.row.positionNumber ? props.row.positionNumber:'-'
|
||||
}}</q-td>
|
||||
<!-- <q-td key="organizationAgency" :props="props">{{
|
||||
props.row.organizationAgency
|
||||
|
|
@ -658,7 +665,7 @@ function updatemodalPersonal(modal: boolean) {
|
|||
props.row.organizationGovernmentAgency
|
||||
}}</q-td> -->
|
||||
<q-td class="table_ellipsis" key="organization" :props="props">{{
|
||||
props.row.organization
|
||||
props.row.organization ? props.row.organization:'-'
|
||||
}}</q-td>
|
||||
<!-- <q-td class="table_ellipsis" key="bureau" :props="props">{{
|
||||
props.row.bureau
|
||||
|
|
|
|||
|
|
@ -185,6 +185,8 @@ async function getData() {
|
|||
data.result = dataList.result;
|
||||
data.disciplineComplaintDocs = dataList.disciplineComplaintDocs;
|
||||
data.activeId = dataList.activeId;
|
||||
|
||||
mainStore.fetchDataRowsSend(dataList.persons)
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -217,7 +219,7 @@ async function onSubmit(data: any) {
|
|||
|
||||
/** ยืนยัน มีมูลส่งไปสืบสวน */
|
||||
function sentInvestigate() {
|
||||
if (mainStore.rowsAdd.length > 0) {
|
||||
if (mainStore.rowsSend.length > 0) {
|
||||
modalPopup.value = true;
|
||||
} else {
|
||||
dialogConfirm(
|
||||
|
|
@ -378,7 +380,7 @@ onMounted(() => {
|
|||
:modal="modalPopup"
|
||||
:close="closePopup"
|
||||
@return-person="sendPersonToNext"
|
||||
:rows="mainStore.rowsAdd"
|
||||
:rows="mainStore.rowsSend"
|
||||
:columns="columns"
|
||||
:visibleColumns="visibleColumns"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ const visibleColumns = ref<string[]>([
|
|||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
align: "center",
|
||||
label: "ลำดับ",
|
||||
sortable: false,
|
||||
field: "no",
|
||||
|
|
|
|||
|
|
@ -171,6 +171,8 @@ function getData() {
|
|||
data.isAncestorDNA = dataList.isAncestorDNA;
|
||||
data.investigationExtendHistory =
|
||||
dataList.investigationExtendHistory ?? [];
|
||||
|
||||
mainStore.fetchDataRowsSend(dataList.persons);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -398,7 +400,7 @@ watch(
|
|||
:modal="modalPopup"
|
||||
:close="closePopup"
|
||||
title="ส่งไปสอบสวน"
|
||||
:rows="mainStore.rowsAdd.filter((item: ArrayPersonAdd)=> item.isSend == 'NEW')"
|
||||
:rows="mainStore.rowsSend.filter((item: ArrayPersonAdd)=> item.isSend == 'NEW')"
|
||||
:columns="mainStore.columnsDirector"
|
||||
:visibleColumns="mainStore.visibleColumnsDirector"
|
||||
@return-person="emitPerson"
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import { useInvestigateDisStore } from "@/modules/11_discipline/store/Investigat
|
|||
import { useDisciplineMainStore } from "@/modules/11_discipline/store/main";
|
||||
|
||||
const mainStore = useDisciplineMainStore();
|
||||
|
||||
const isSaveInfo = ref<boolean>(false)
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const store = useInvestigateDisStore();
|
||||
|
|
@ -404,6 +404,7 @@ onMounted(async () => {
|
|||
label="ส่งไปสรุปผลการพิจารณา"
|
||||
color="public"
|
||||
@click="sentIssueGate"
|
||||
:disable="isSaveInfo"
|
||||
/>
|
||||
<q-btn
|
||||
v-if="status === 'NEW'"
|
||||
|
|
@ -462,6 +463,7 @@ onMounted(async () => {
|
|||
:data="data"
|
||||
@submit:disciplinary="onSubmitDisciplinary"
|
||||
:fetchData="fetchDetailDisciplinary"
|
||||
v-model:isSaveInfo="isSaveInfo"
|
||||
/>
|
||||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ import type { OptionData } from "@/modules/07_insignia/interface/index/Main";
|
|||
|
||||
const modalPersonal = ref<boolean>(false);
|
||||
const personId = ref<string>("");
|
||||
|
||||
const isSaveInfo = defineModel<boolean>('isSaveInfo')
|
||||
const calendarModal = ref<boolean>(false);
|
||||
const calendarModalclose = () => (calendarModal.value = !calendarModal.value);
|
||||
const modalPopup = ref<boolean>(false);
|
||||
|
|
@ -211,6 +211,7 @@ function onSubmit() {
|
|||
|
||||
emit("submit:disciplinary", formData);
|
||||
isSave.value = false;
|
||||
isSaveInfo.value = false
|
||||
extendStatus.value = false;
|
||||
});
|
||||
}
|
||||
|
|
@ -232,7 +233,7 @@ async function fetchDatadetail() {
|
|||
if (countNum.value === 1) {
|
||||
isReadonly.value = props.data.status != "NEW" ?? true;
|
||||
isSave.value = false;
|
||||
|
||||
isSaveInfo.value = false
|
||||
formData.respondentType = props.data.respondentType;
|
||||
formData.organizationId = props.data.organizationId;
|
||||
formData.organization = props.data.organization;
|
||||
|
|
@ -524,6 +525,7 @@ async function selectComplainant(val: string) {
|
|||
/** ฟังก์ชั่นเช็คการแก้ไขฟอร์มแล้วไม่ได้กดบันทึก */
|
||||
function changeFormData() {
|
||||
isSave.value = true;
|
||||
isSaveInfo.value = true
|
||||
if (formData.disciplinaryFaultLevel !== "อื่นๆ") {
|
||||
formData.disciplinaryFaultLevelOther = "";
|
||||
}
|
||||
|
|
@ -537,6 +539,7 @@ function changeFormData() {
|
|||
/** เช็ควันที่สิ้นสุดต้องมากกว่า หรือเท่ากับวันเริ่ม */
|
||||
function changeFormDataDate() {
|
||||
isSave.value = true;
|
||||
isSaveInfo.value = true
|
||||
const startDate = new Date(formData.disciplinaryDateStart as Date);
|
||||
const endDate = new Date(formData.disciplinaryDateEnd as Date);
|
||||
|
||||
|
|
|
|||
|
|
@ -345,6 +345,9 @@ onMounted(() => {
|
|||
1
|
||||
}}
|
||||
</div>
|
||||
<div v-else-if="col.name === 'name'" class="table_ellipsis">
|
||||
{{ props.row.prefix ? props.row.prefix : "" }}{{ props.row.firstName ? props.row.firstName : "" }} {{ props.row.lastName ? props.row.lastName : "" }}
|
||||
</div>
|
||||
<div v-else-if="col.name === 'title'" class="table_ellipsis">
|
||||
{{ props.row.title ? props.row.title : "-" }}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ export const useInvestigateFactStore = defineStore(
|
|||
"DisciplineInvestigateFact",
|
||||
() => {
|
||||
const tabMenu = ref<string>("investigatefacts");
|
||||
const rows = ref<InvestigatefactsDataRowType[]>();
|
||||
const rows = ref<InvestigatefactsDataRowType[]>([]);
|
||||
const respondentTypeOps = ref<DataOption[]>(
|
||||
mainStore.complainantoptionsMain
|
||||
);
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
|
|||
{ id: "ไม่ร้ายแรง", name: "ไม่ร้ายแรง" },
|
||||
]);
|
||||
const rowsAdd = ref<ArrayPersonAdd[]>([]);
|
||||
const rowsSend = ref<ArrayPersonAdd[]>([]);
|
||||
const rowsCheck = ref<ArrayPersonAdd[]>([]);
|
||||
/** หัวตารางผู้ถูกร้องเรียน */
|
||||
const columnsRespondent = ref<QTableProps["columns"]>([
|
||||
|
|
@ -330,6 +331,49 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
|
|||
rowsAdd.value = dataList;
|
||||
}
|
||||
|
||||
/**
|
||||
* จัดเก็บข้อมูลไว้ เพื่อใช้ใน POPUP
|
||||
* @param data ข้อมูลรายการบุคคล
|
||||
*/
|
||||
function fetchDataRowsSend(data: ArrayPersonAdd[]) {
|
||||
const dataList: any = data.map((item: any) => ({
|
||||
id: item.id,
|
||||
idcard: item.idcard,
|
||||
name: item.name,
|
||||
prefix: item.prefix,
|
||||
firstName: item.firstName,
|
||||
lastName: item.lastName,
|
||||
position: item.position,
|
||||
positionLevel: item.positionLevel,
|
||||
salary: item.salary === null ? "" : item.salary,
|
||||
personId: item.personId,
|
||||
posNo: item.posNo === null ? "-" : item.posNo,
|
||||
organization: item.organization,
|
||||
root: item.root,
|
||||
rootId: item.rootId,
|
||||
rootShortName: item.rootShortName,
|
||||
child1: item.child1,
|
||||
child1Id: item.child1Id,
|
||||
child1ShortName: item.child1ShortName,
|
||||
child2: item.child2,
|
||||
child2Id: item.child2Id,
|
||||
child2ShortName: item.child2ShortName,
|
||||
child3: item.child3,
|
||||
child3Id: item.child3Id,
|
||||
child3ShortName: item.child3ShortName,
|
||||
child4: item.child4,
|
||||
child4Id: item.child4Id,
|
||||
child4ShortName: item.child4ShortName,
|
||||
posMasterNo: item.posMasterNo,
|
||||
posTypeId: item.posTypeId,
|
||||
posTypeName: item.posTypeName,
|
||||
posLevelId: item.posLevelId,
|
||||
posLevelName: item.posLevelName,
|
||||
isSend: item.isSend,
|
||||
}));
|
||||
rowsSend.value = dataList;
|
||||
}
|
||||
|
||||
return {
|
||||
complainantoptionsMain,
|
||||
convertFault,
|
||||
|
|
@ -348,5 +392,7 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
|
|||
convertStatusResult,
|
||||
rowsCheck,
|
||||
causeTextOptions,
|
||||
rowsSend,
|
||||
fetchDataRowsSend
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -14,6 +14,14 @@ import http from "@/plugins/http";
|
|||
import config from "@/app.config";
|
||||
import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue";
|
||||
|
||||
const total = ref<number>(0);
|
||||
const totalList = ref<number>(1);
|
||||
const pagination = ref({
|
||||
sortBy: "createdAt",
|
||||
descending: true,
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
});
|
||||
const modalPersonal = ref<boolean>(false);
|
||||
const personId = ref<string>("");
|
||||
const $q = useQuasar();
|
||||
|
|
@ -47,10 +55,10 @@ const emit = defineEmits(["formDataReturn"]);
|
|||
//
|
||||
const idCard = ref<string>("");
|
||||
const idCardRef = ref<any>(null);
|
||||
const type = ref<string>("idcard");
|
||||
const type = ref<string>("citizenId");
|
||||
const search = ref<string>("");
|
||||
const typeOps = ref<typeOp[]>([
|
||||
{ id: "idcard", name: "เลขประจำตัวประชาชน" },
|
||||
{ id: "citizenId", name: "เลขประจำตัวประชาชน" },
|
||||
{ id: "firstname", name: "ชื่อ" },
|
||||
{ id: "lastname", name: "นามสกุล" },
|
||||
]);
|
||||
|
|
@ -203,12 +211,21 @@ async function searchInput() {
|
|||
keyword: search.value,
|
||||
};
|
||||
await http
|
||||
.post(config.API.orgSearchPersonal(), body)
|
||||
.post(
|
||||
config.API.orgSearchPersonal() +
|
||||
`?page=${pagination.value.page}&pageSize=${pagination.value.rowsPerPage}`,
|
||||
body
|
||||
)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
const data = res.data.result.data;
|
||||
totalList.value = Math.ceil(
|
||||
res.data.result.total / pagination.value.rowsPerPage
|
||||
);
|
||||
total.value = res.data.result.total;
|
||||
|
||||
const list = data.map((e: ResponsePreson) => ({
|
||||
personId: e.id,
|
||||
idcard: e.idcard,
|
||||
idcard: e.citizenId,
|
||||
prefix: e.prefix,
|
||||
firstName: e.firstName,
|
||||
lastName: e.lastName,
|
||||
|
|
@ -252,6 +269,17 @@ function onclickViewinfo(id: string) {
|
|||
function updatemodalPersonal(modal: boolean) {
|
||||
modalPersonal.value = modal;
|
||||
}
|
||||
function updatePagination(newPagination: any) {
|
||||
pagination.value.page = 1;
|
||||
pagination.value.rowsPerPage = newPagination.rowsPerPage;
|
||||
}
|
||||
|
||||
watch(
|
||||
() => pagination.value.rowsPerPage,
|
||||
async () => {
|
||||
await searchInput();
|
||||
}
|
||||
);
|
||||
</script>
|
||||
<template>
|
||||
<form @submit.prevent.stop="onValidate">
|
||||
|
|
@ -312,7 +340,24 @@ function updatemodalPersonal(modal: boolean) {
|
|||
dense
|
||||
class="custom-header-table"
|
||||
:visible-columns="visibleColumnsRespondent"
|
||||
:rows-per-page-options="[10, 25, 50, 100]"
|
||||
@update:pagination="updatePagination"
|
||||
>
|
||||
<template v-slot:pagination="scope">
|
||||
ทั้งหมด {{ total }} รายการ
|
||||
<q-pagination
|
||||
v-model="pagination.page"
|
||||
active-color="primary"
|
||||
color="dark"
|
||||
:max="Number(totalList)"
|
||||
size="sm"
|
||||
boundary-links
|
||||
direction-links
|
||||
:max-pages="5"
|
||||
@update:model-value="searchInput"
|
||||
></q-pagination>
|
||||
</template>
|
||||
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th
|
||||
|
|
@ -334,7 +379,11 @@ function updatemodalPersonal(modal: boolean) {
|
|||
@click="returnDetail(props.row)"
|
||||
>
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
{{
|
||||
(pagination.page - 1) * pagination.rowsPerPage +
|
||||
props.rowIndex +
|
||||
1
|
||||
}}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'info'">
|
||||
<!-- <router-link
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue