fixing registy

This commit is contained in:
Warunee Tamkoo 2024-09-05 10:07:52 +07:00
parent 3666cd61a9
commit 96a1722435
5 changed files with 22 additions and 11 deletions

View file

@ -352,9 +352,13 @@ watch(
class="text-weight-medium" class="text-weight-medium"
> >
{{ {{
`${props.row.prefix ? props.row.prefix : ""}${ `${
props.row.firstName props.row.rank
} ${props.row.lastName}` ? props.row.rank
: props.row.prefix
? props.row.prefix
: ""
}${props.row.firstName} ${props.row.lastName}`
}} }}
</div> </div>
<div <div
@ -367,9 +371,13 @@ watch(
> >
<q-tooltip>รายละเอยด</q-tooltip> <q-tooltip>รายละเอยด</q-tooltip>
{{ {{
`${props.row.prefix ? props.row.prefix : ""}${ `${
props.row.firstName props.row.rank
} ${props.row.lastName}` ? props.row.rank
: props.row.prefix
? props.row.prefix
: ""
}${props.row.firstName} ${props.row.lastName}`
}} }}
<q-icon name="mdi-open-in-new" size="xs"></q-icon> <q-icon name="mdi-open-in-new" size="xs"></q-icon>
</div> </div>

View file

@ -3,6 +3,7 @@ interface FormFilter {
pageSize: number; pageSize: number;
keyword: string; keyword: string;
type: string; type: string;
searchType?: string;
posType: string; posType: string;
posLevel: string; posLevel: string;
retireYear: string | null; retireYear: string | null;

View file

@ -22,6 +22,7 @@ interface DataPerson {
posTypeId: string; posTypeId: string;
position: string; position: string;
prefix: string; prefix: string;
rank?: string;
} }
export type { DataType, DataLevel, DataPerson }; export type { DataType, DataLevel, DataPerson };

View file

@ -64,6 +64,7 @@ export const useRegistryNewDataStore = defineStore("registryNew", () => {
isAll: true, isAll: true,
nodeId: null, nodeId: null,
node: null, node: null,
searchType: "fullName",
}); });
const labelOption = reactive({ const labelOption = reactive({

View file

@ -34,7 +34,7 @@ const isShowFilter = ref<boolean>(true);
const isShowBtnFilter = ref<boolean>(false); const isShowBtnFilter = ref<boolean>(false);
const empType = ref<string>("officer"); // officer / employee / perm const empType = ref<string>("officer"); // officer / employee / perm
const searchType = ref<string>("fullName"); // const searchType = ref<string>("fullName");
const node = ref<any>([]); const node = ref<any>([]);
const expanded = ref<any>([]); const expanded = ref<any>([]);
const maxPage = ref<number>(1); const maxPage = ref<number>(1);
@ -117,7 +117,7 @@ function fetchDataPerson() {
if (store.formFilter.keyword) { if (store.formFilter.keyword) {
queryParams = Object.assign({}, queryParams, { queryParams = Object.assign({}, queryParams, {
searchField: searchType.value, searchField: store.formFilter.searchType,
searchKeyword: store.formFilter.keyword, searchKeyword: store.formFilter.keyword,
}); });
} }
@ -264,9 +264,9 @@ async function selectType() {
empType.value === "officer" empType.value === "officer"
? "เลือกหน่วยงาน/ส่วนราชการ" ? "เลือกหน่วยงาน/ส่วนราชการ"
: "เลือกหน่วยงาน"; : "เลือกหน่วยงาน";
store.formFilter.searchType = "fullName";
} else { } else {
// filter // filter
if ( if (
store.formFilter.keyword != "" || store.formFilter.keyword != "" ||
store.labelOption.posType != "ทั้งหมด" || store.labelOption.posType != "ทั้งหมด" ||
@ -391,7 +391,7 @@ onMounted(async () => {
<q-select <q-select
borderless borderless
bg-color="white" bg-color="white"
v-model="searchType" v-model="store.formFilter.searchType"
:options="store.searchTypeOption" :options="store.searchTypeOption"
emit-value emit-value
dense dense
@ -572,7 +572,7 @@ onMounted(async () => {
inset inset
vertical vertical
class="lineFil" class="lineFil"
v-if="empType !== 'officer'" v-if="empType !== 'officer' && store.formFilter.nodeId"
/> />
<q-toggle <q-toggle