fix: ตัวแปร ค้นหาขั้นสูง เก็บใน store
This commit is contained in:
parent
3a7cfad344
commit
9dcb54a384
8 changed files with 330 additions and 384 deletions
|
|
@ -7,14 +7,16 @@ import http from "@/plugins/http";
|
|||
import router from "@/router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useInvestigateFactStore } from "@/modules/11_discipline/store/InvestigateFactStore";
|
||||
import { useDisciplineMainStore } from "@/modules/11_discipline/store/Main";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
|
||||
import DialogSearchAdvanced from "@/modules/11_discipline/components/DialogSearchAdvanced.vue";
|
||||
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
const store = useDisciplineMainStore();
|
||||
const mixin = useCounterMixin();
|
||||
const dataInvestigate = useInvestigateFactStore();
|
||||
const { messageError, showLoader, hideLoader } = mixin;
|
||||
const { messageError, showLoader, hideLoader, convertDateToAPI } = mixin;
|
||||
|
||||
const option = ref<any[]>(dataInvestigate.statusOptions);
|
||||
|
||||
|
|
@ -36,36 +38,45 @@ const pagination = ref({
|
|||
const attrs = ref<any>(useAttrs());
|
||||
|
||||
/** ดึงข้อมูลบสวน */
|
||||
async function getList(data?: any) {
|
||||
async function getList(page?: number) {
|
||||
const body = {
|
||||
page: pagination.value.page,
|
||||
page: page ? page : pagination.value.page,
|
||||
pageSize: pagination.value.rowsPerPage,
|
||||
keyword: filterKeyword.value.trim(),
|
||||
status: statusFilter.value,
|
||||
...(data && data.respondentType
|
||||
? { respondentType: data.respondentType }
|
||||
: {}),
|
||||
...(data && data.offenseDetails
|
||||
? { offenseDetails: data.offenseDetails }
|
||||
: {}),
|
||||
...(data && data.investigationDetail
|
||||
? { investigationDetail: data.investigationDetail }
|
||||
: {}),
|
||||
...(data && data.investigationDateStart
|
||||
? { investigationDateStart: data.investigationDateStart }
|
||||
: {}),
|
||||
...(data && data.investigationDateEnd
|
||||
? { investigationDateEnd: data.investigationDateEnd }
|
||||
: {}),
|
||||
...(data && data.dateReceivedStart
|
||||
? { dateReceivedStart: data.dateReceivedStart }
|
||||
: {}),
|
||||
...(data && data.dateReceivedEnd
|
||||
? { dateReceivedEnd: data.dateReceivedEnd }
|
||||
: {}),
|
||||
...(data && data.investigationStatusResult
|
||||
? { investigationStatusResult: data.investigationStatusResult }
|
||||
: {}),
|
||||
...(store.formInvestigateFacts.respondentType && {
|
||||
respondentType: store.formInvestigateFacts.respondentType,
|
||||
}),
|
||||
...(store.formInvestigateFacts.offenseDetails && {
|
||||
offenseDetails: store.formInvestigateFacts.offenseDetails,
|
||||
}),
|
||||
...(store.formInvestigateFacts.investigationDetail && {
|
||||
investigationDetail: store.formInvestigateFacts.investigationDetail,
|
||||
}),
|
||||
...(store.formInvestigateFacts.investigationDate?.[0] && {
|
||||
investigationDateStart: convertDateToAPI(
|
||||
store.formInvestigateFacts.investigationDate[0]
|
||||
),
|
||||
}),
|
||||
...(store.formInvestigateFacts.investigationDate?.[1] && {
|
||||
investigationDateEnd: convertDateToAPI(
|
||||
store.formInvestigateFacts.investigationDate[1]
|
||||
),
|
||||
}),
|
||||
...(store.formInvestigateFacts.dateReceived?.[0] && {
|
||||
dateReceivedStart: convertDateToAPI(
|
||||
store.formInvestigateFacts.dateReceived[0]
|
||||
),
|
||||
}),
|
||||
...(store.formInvestigateFacts.dateReceived?.[1] && {
|
||||
dateReceivedEnd: convertDateToAPI(
|
||||
store.formInvestigateFacts.dateReceived[1]
|
||||
),
|
||||
}),
|
||||
...(store.formInvestigateFacts.investigationStatusResult && {
|
||||
investigationStatusResult:
|
||||
store.formInvestigateFacts.investigationStatusResult,
|
||||
}),
|
||||
};
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -148,7 +159,7 @@ onMounted(async () => {
|
|||
รายการสืบสวนข้อเท็จจริง
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm q-pa-md">
|
||||
<div class="row col-12 q-col-gutter-sm q-mb-sm">
|
||||
<div class="row col-12 q-col-gutter-sm q-mb-sm items-center">
|
||||
<q-select
|
||||
v-model="statusFilter"
|
||||
label="สถานะ"
|
||||
|
|
@ -184,7 +195,7 @@ onMounted(async () => {
|
|||
</q-select>
|
||||
|
||||
<q-space />
|
||||
<DialogSearchAdvanced :get-data="(value:any)=> getList(value)" />
|
||||
<DialogSearchAdvanced :get-data="(value:number)=> getList(value)" />
|
||||
<q-input
|
||||
for="#search"
|
||||
standout
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue