多条件查询
This commit is contained in:
parent
d99aa6377d
commit
07ef4268eb
@ -45,7 +45,7 @@
|
||||
<script setup lang="ts">
|
||||
import { reactive, ref, onMounted, watch, nextTick, toRaw } from "vue";
|
||||
// @ts-ignore
|
||||
import { getFirstLetter } from '@/api/pinyin.js';
|
||||
import { getFirstLetter } from '@/utils/pinyin.js';
|
||||
import { ElEmpty } from 'element-plus';
|
||||
// @ts-ignore
|
||||
import { comDict } from '@/utils/dict'
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, watch, computed, reactive, toRaw } from 'vue';
|
||||
// @ts-ignore
|
||||
import { getFirstLetter } from '@/api/pinyin.js';
|
||||
import { getFirstLetter } from '@/utils/pinyin.js';
|
||||
|
||||
|
||||
interface Props {
|
||||
|
||||
266
src/components/selectSearch/index.vue
Normal file
266
src/components/selectSearch/index.vue
Normal file
@ -0,0 +1,266 @@
|
||||
<template>
|
||||
<el-popover :visible="selectVisible" placement="bottom" :width="'16vw'">
|
||||
<el-form :model="queryParams" class="query-form" label-width="90px">
|
||||
<!-- 病人类型选择 -->
|
||||
<el-form-item label="病人类型:" prop="brly">
|
||||
<el-select v-model="queryParams.brly" placeholder="全部" clearable>
|
||||
<el-option v-for="item in brlyOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="完成状态:" prop="finish">
|
||||
<el-radio-group v-model="queryParams.finish" @change="handleRadioChange">
|
||||
<el-radio value="1" @click.native="handleRadioClick('1', 'finish')">已完成</el-radio>
|
||||
<el-radio value="0" @click.native="handleRadioClick('0', 'finish')">未完成</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<!-- 审核状态选择 -->
|
||||
<el-form-item label="审核状态:" prop="jgbz">
|
||||
<el-radio-group v-model="queryParams.jgbz" @change="handleRadioChange">
|
||||
<el-radio value="2" @click.native="handleRadioClick('2', 'jgbz')">已审核</el-radio>
|
||||
<el-radio value="0" @click.native="handleRadioClick('0', 'jgbz')">未审核</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<!-- 自审状态选择 -->
|
||||
<el-form-item label-width="10px" prop="autojgbz">
|
||||
<el-checkbox v-model="queryParams.autojgbz" true-value="1" false-value=""> 自审 </el-checkbox>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<!-- 危急值选择 -->
|
||||
<el-form-item prop="alarmflag" label-width="0">
|
||||
<el-checkbox v-model="queryParams.alarmflag" true-value="1" false-value=""> 危急值 </el-checkbox>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<!-- 急诊选择 -->
|
||||
<el-form-item prop="jzbz" label-width="0">
|
||||
<el-checkbox v-model="queryParams.jzbz" true-value="1" false-value=""> 急诊 </el-checkbox>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 打印状态选择 -->
|
||||
<el-form-item label="打印状态:" prop="dybz">
|
||||
<el-radio-group v-model="queryParams.dybz" @chnage="handleRadioChange">
|
||||
<el-radio value="1" @click.native="handleRadioClick('1', 'dybz')">已打印</el-radio>
|
||||
<el-radio value="0" @click.native="handleRadioClick('0', 'dybz')">未打印</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleQuery" :size="props.size">确认查询</el-button>
|
||||
<el-button @click="handleReset" style="margin-left: 8px" :size="props.size">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<template #reference>
|
||||
<el-input v-model="selectShowValue" :size="props.size" @clear="clearHandle"
|
||||
@click="selectVisible = !selectVisible" :placeholder="props.placeholder" readonly
|
||||
:style="{ width: props.width }" suffix-icon="ArrowDown" :clearable="props.clearable" />
|
||||
</template>
|
||||
</el-popover>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, defineProps, defineEmits, nextTick, watch } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
// 定义下拉选项类型
|
||||
interface OptionItem {
|
||||
label: string
|
||||
value: string | number
|
||||
}
|
||||
|
||||
// 定义查询参数类型
|
||||
interface QueryParams {
|
||||
brly?: string | number
|
||||
jgbz?: string | number
|
||||
dybz?: string | number
|
||||
alarmflag?: string | number
|
||||
jzbz?: string | number
|
||||
finish?: string | number
|
||||
autojgbz?: string | number
|
||||
}
|
||||
|
||||
// 定义组件Props
|
||||
const props = defineProps<{
|
||||
// 可传入初始查询参数
|
||||
initialParams?: Partial<QueryParams>,
|
||||
// 宽度
|
||||
width?: string,
|
||||
// 是否禁用
|
||||
disabled?: boolean,
|
||||
// 是否可清空
|
||||
clearable?: boolean,
|
||||
// 是否显示查询按钮
|
||||
showQueryButton?: boolean,
|
||||
// 是否显示重置按钮
|
||||
showResetButton?: boolean,
|
||||
// 尺寸
|
||||
size?: 'large' | 'default' | 'small',
|
||||
// 占位符
|
||||
placeholder?: string,
|
||||
dictData?: any
|
||||
}>()
|
||||
|
||||
|
||||
watch(() => props.dictData, () => {
|
||||
brlyOptions.value = props.dictData.PT
|
||||
optionMaps.brly = props.dictData.PT
|
||||
})
|
||||
|
||||
// 定义组件事件
|
||||
const emit = defineEmits<{
|
||||
// 查询事件,返回查询参数
|
||||
(e: 'query', params: QueryParams): void
|
||||
// 重置事件
|
||||
(e: 'reset'): void
|
||||
}>()
|
||||
const selectVisible = ref(false)
|
||||
const selectShowValue = ref('')
|
||||
const selectRef = ref()
|
||||
// 病人类型选项
|
||||
const brlyOptions = ref<OptionItem[]>([])
|
||||
// 审核状态选项
|
||||
const jgbzOptions: OptionItem[] = [
|
||||
{ label: '未审核', value: 0 },
|
||||
{ label: '已审核', value: 2 },
|
||||
]
|
||||
|
||||
// 打印状态选项
|
||||
const dybzOptions: OptionItem[] = [
|
||||
{ label: '未打印', value: 0 },
|
||||
{ label: '已打印', value: 1 },
|
||||
]
|
||||
|
||||
// 危急值选项
|
||||
const alarmflagOptions: OptionItem[] = [
|
||||
{ label: '危急值', value: 1 },
|
||||
{ label: '无', value: 0 }
|
||||
]
|
||||
|
||||
// 急诊选项
|
||||
const emergencyOptions: OptionItem[] = [
|
||||
{ label: '急诊', value: 1 },
|
||||
{ label: '否', value: 0 }
|
||||
]
|
||||
|
||||
// 完成状态选项
|
||||
const finishOptions: OptionItem[] = [
|
||||
{ label: '未完成', value: 0 },
|
||||
{ label: '已完成', value: 1 },
|
||||
]
|
||||
|
||||
// 自审状态选项
|
||||
const autojgbzOptions: OptionItem[] = [
|
||||
{ label: '否', value: 0 },
|
||||
{ label: '自审', value: 1 },
|
||||
]
|
||||
|
||||
|
||||
// 创建选项映射关系,方便查找label
|
||||
const optionMaps = {
|
||||
brly: props.dictData.PT,
|
||||
jgbz: jgbzOptions,
|
||||
dybz: dybzOptions,
|
||||
alarmflag: alarmflagOptions,
|
||||
jzbz: emergencyOptions,
|
||||
finish: finishOptions,
|
||||
autojgbz: autojgbzOptions
|
||||
}
|
||||
|
||||
// 查询参数
|
||||
const queryParams = ref<QueryParams>({
|
||||
...props.initialParams
|
||||
})
|
||||
|
||||
// 记录上一次选中的值
|
||||
const lastRadioValue = ref<string | undefined>(undefined);
|
||||
const handleRadioChange = (value: string) => {
|
||||
lastRadioValue.value = value;
|
||||
};
|
||||
const handleRadioClick = (value: string, zd: keyof QueryParams) => {
|
||||
if (value === lastRadioValue.value) {
|
||||
setTimeout(() => {
|
||||
queryParams.value[zd] = undefined;
|
||||
lastRadioValue.value = undefined;
|
||||
}, 100);
|
||||
} else {
|
||||
lastRadioValue.value = value;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const clearHandle = () => {
|
||||
queryParams.value = {}
|
||||
selectShowValue.value = ''
|
||||
}
|
||||
|
||||
// 根据值和选项列表获取对应的label
|
||||
const getLabelByValue = (value: string | number | undefined, options: OptionItem[]) => {
|
||||
if (value === undefined || value === null || value === '') return ''
|
||||
const item = options.find(option => option.value == value)
|
||||
return item ? item.label : ''
|
||||
}
|
||||
|
||||
// 处理查询
|
||||
const handleQuery = () => {
|
||||
// 过滤空值参数
|
||||
const filteredParams = Object.fromEntries(
|
||||
Object.entries(queryParams.value).filter(([_, v]) => v !== undefined && v !== null && v !== '')
|
||||
) as QueryParams
|
||||
|
||||
// 收集所有选中项的label
|
||||
const labels: string[] = []
|
||||
Object.entries(filteredParams).forEach(([key, value]) => {
|
||||
// @ts-ignore
|
||||
const options = optionMaps[key]
|
||||
if (options) {
|
||||
const label = getLabelByValue(value, options)
|
||||
if (label) labels.push(label)
|
||||
}
|
||||
})
|
||||
|
||||
// 拼接label并设置到显示值
|
||||
selectShowValue.value = labels.join(',')
|
||||
console.log('selectShowValue.value==>', selectShowValue.value);
|
||||
|
||||
emit('query', filteredParams)
|
||||
|
||||
selectVisible.value = false;
|
||||
}
|
||||
|
||||
// 处理重置
|
||||
const handleReset = () => {
|
||||
selectShowValue.value = ''
|
||||
queryParams.value = {}
|
||||
selectVisible.value = false;
|
||||
emit('reset')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.query-form {
|
||||
|
||||
:deep(.el-form-item) {
|
||||
margin-bottom: .5rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* 响应式调整 */
|
||||
@media (max-width: 768px) {
|
||||
.query-form {
|
||||
:deep(.el-form-item) {
|
||||
margin-bottom: 12px;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -114,7 +114,6 @@ import { ref, onMounted, onUnmounted, Ref } from 'vue';
|
||||
*/
|
||||
function useAutoSize() {
|
||||
const autoSize = ref<'small' | 'default'>('default');
|
||||
console.log('333==>', 333);
|
||||
// 防抖函数,避免频繁触发
|
||||
const debounce = (fn: Function, delay: number) => {
|
||||
let timer: number;
|
||||
@ -126,7 +125,6 @@ function useAutoSize() {
|
||||
|
||||
const calculateSize = () => {
|
||||
const screenWidth = window.innerWidth || document.documentElement.clientWidth;
|
||||
console.log('screenWidth==>', screenWidth);
|
||||
autoSize.value = screenWidth < 1600 ? 'small' : 'default';
|
||||
};
|
||||
|
||||
|
||||
@ -1,16 +1,11 @@
|
||||
<template>
|
||||
<div class="dict-input-wrapper">
|
||||
<el-input
|
||||
v-model="displayValue"
|
||||
:placeholder="placeholder"
|
||||
:clearable="clearable"
|
||||
:disabled="isDictLoading || disabled"
|
||||
@blur="handleBlur"
|
||||
@clear="handleClear"
|
||||
@dblclick="handleDblClick"
|
||||
>
|
||||
<el-input v-model="displayValue" :placeholder="placeholder" :clearable="clearable"
|
||||
:disabled="isDictLoading || disabled" @blur="handleBlur" @clear="handleClear" @dblclick="handleDblClick">
|
||||
<template #prefix>
|
||||
<el-icon v-if="isDictLoading" size="16"><Loading /></el-icon>
|
||||
<el-icon v-if="isDictLoading" size="16">
|
||||
<Loading />
|
||||
</el-icon>
|
||||
</template>
|
||||
<template #suffix>
|
||||
<el-icon @click="openDictSelector" size="16" class="select-icon">
|
||||
@ -20,28 +15,11 @@
|
||||
</el-input>
|
||||
|
||||
<!-- 字典选择弹窗 -->
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="dialogTitle"
|
||||
width="500px"
|
||||
@close="handleDialogClose"
|
||||
>
|
||||
<el-input
|
||||
v-model="searchKey"
|
||||
placeholder="搜索(支持名称、编码、简拼)..."
|
||||
class="mb-4"
|
||||
clearable
|
||||
@clear="filterDictData"
|
||||
@input="filterDictData"
|
||||
/>
|
||||
<el-dialog v-model="dialogVisible" :title="dialogTitle" width="500px" @close="handleDialogClose">
|
||||
<el-input v-model="searchKey" placeholder="搜索(支持名称、编码、简拼)..." class="mb-4" clearable @clear="filterDictData"
|
||||
@input="filterDictData" />
|
||||
|
||||
<el-table
|
||||
:data="filteredDictData"
|
||||
height="300px"
|
||||
border
|
||||
@row-click="selectItem"
|
||||
@row-dblclick="selectItem"
|
||||
>
|
||||
<el-table :data="filteredDictData" height="300px" border @row-click="selectItem" @row-dblclick="selectItem">
|
||||
<el-table-column prop="value" label="编码" width="100" />
|
||||
<el-table-column prop="label" label="名称" width="200" />
|
||||
<el-table-column prop="pinyin" label="简拼" width="150" /> <!-- 显示简拼便于调试 -->
|
||||
@ -59,7 +37,7 @@
|
||||
import { ref, computed, watch, onMounted } from 'vue';
|
||||
import { Loading, ArrowDown } from '@element-plus/icons-vue';
|
||||
|
||||
import { getFirstLetter } from '@/api/pinyin.js'; // 引入拼音处理工具
|
||||
import { getFirstLetter } from '@/utils/pinyin.js'; // 引入拼音处理工具
|
||||
// 组件参数
|
||||
const props = defineProps({
|
||||
modelValue: { type: [String, Number], default: '' },
|
||||
|
||||
@ -1,25 +1,14 @@
|
||||
<template>
|
||||
<!-- 遮罩层 -->
|
||||
<div
|
||||
v-if="visible"
|
||||
class="dialog-mask"
|
||||
@click="handleCancel"
|
||||
></div>
|
||||
<div v-if="visible" class="dialog-mask" @click="handleCancel"></div>
|
||||
|
||||
<!-- 弹窗主体 -->
|
||||
<div
|
||||
v-if="visible"
|
||||
class="dialog-container"
|
||||
>
|
||||
<div v-if="visible" class="dialog-container">
|
||||
<div class="dialog-box">
|
||||
<!-- 标题区域 -->
|
||||
<div class="dialog-header">
|
||||
<h3 class="dialog-title">{{ title }}</h3>
|
||||
<button
|
||||
class="dialog-close"
|
||||
@click="handleCancel"
|
||||
aria-label="关闭"
|
||||
>
|
||||
<button class="dialog-close" @click="handleCancel" aria-label="关闭">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
@ -27,24 +16,12 @@
|
||||
<!-- 内容区域 -->
|
||||
<div class="dialog-body">
|
||||
<!-- 搜索框 -->
|
||||
<el-input
|
||||
v-model="searchKey"
|
||||
placeholder="搜索(支持名称、编码、简拼)..."
|
||||
class="search-input"
|
||||
clearable
|
||||
@clear="filterDictData"
|
||||
@input="filterDictData"
|
||||
/>
|
||||
<el-input v-model="searchKey" placeholder="搜索(支持名称、编码、简拼)..." class="search-input" clearable
|
||||
@clear="filterDictData" @input="filterDictData" />
|
||||
|
||||
<!-- 字典列表 -->
|
||||
<el-table
|
||||
:data="filteredDictData"
|
||||
height="300px"
|
||||
border
|
||||
@row-click="selectItem"
|
||||
@row-dblclick="selectItem"
|
||||
:loading="isDictLoading"
|
||||
>
|
||||
<el-table :data="filteredDictData" height="300px" border @row-click="selectItem" @row-dblclick="selectItem"
|
||||
:loading="isDictLoading">
|
||||
<el-table-column prop="value" label="编码" width="100" />
|
||||
<el-table-column prop="label" label="名称" width="200" />
|
||||
<el-table-column prop="pinyin" label="简拼" width="150" />
|
||||
@ -61,7 +38,7 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, watch, onMounted } from 'vue';
|
||||
import { getFirstLetter } from '@/api/pinyin.js'; // 拼音处理工具
|
||||
import { getFirstLetter } from '@/utils/pinyin.js'; // 拼音处理工具
|
||||
|
||||
// 组件参数
|
||||
const props = defineProps({
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
import { ref, computed, watch, onMounted } from 'vue';
|
||||
import { Loading, ArrowDown } from '@element-plus/icons-vue';
|
||||
|
||||
import { getFirstLetter } from '@/api/pinyin.js'; // 引入拼音处理工具
|
||||
import { getFirstLetter } from '@/utils/pinyin.js'; // 引入拼音处理工具
|
||||
// 组件参数
|
||||
const props = defineProps({
|
||||
modelValue: { type: [String, Number], default: '' },
|
||||
|
||||
@ -1,12 +1,7 @@
|
||||
<template>
|
||||
<div class="custom-select2">
|
||||
<Select2
|
||||
v-model="currentValue"
|
||||
:options="processedOptions"
|
||||
:settings="select2Settings"
|
||||
@update:modelValue="handleChange"
|
||||
:disabled="isDisabled"
|
||||
/>
|
||||
<Select2 v-model="currentValue" :options="processedOptions" :settings="select2Settings"
|
||||
@update:modelValue="handleChange" :disabled="isDisabled" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -14,7 +9,7 @@
|
||||
//import { ref, computed, watch, defineProps, defineEmits } from 'vue';
|
||||
import Select2 from 'vue3-select2-component';
|
||||
import 'select2/dist/css/select2.min.css';
|
||||
import { processOptions } from '@/api/pinyin.js'; // 引入拼音处理工具
|
||||
import { processOptions } from '@/utils/pinyin.js'; // 引入拼音处理工具
|
||||
|
||||
// 定义组件props
|
||||
const props = defineProps({
|
||||
|
||||
@ -69,12 +69,11 @@
|
||||
<el-button type="primary" :size="aotuSize" icon="RefreshRight" @click="fetchlabPatList">刷新</el-button>
|
||||
<el-button type="danger" :size="aotuSize" @click="delSampleHd">删除</el-button>
|
||||
<el-button class="btn_green" :size="aotuSize" icon="top" @click="handlePrev">上一个</el-button>
|
||||
<el-button class="btn_green" :size="aotuSize" icon="bottom" @click="handleNext">下一个</el-button>
|
||||
<el-select placeholder="所有" :size="aotuSize" style="width: 8rem" class="ml5">
|
||||
<el-option label="option" value="item.value" />
|
||||
</el-select>
|
||||
<el-input clearable :size="aotuSize" @keyup.enter="handleQuery" @clear="handleQuery"
|
||||
style="width: 6rem" />
|
||||
<el-button class="btn_green mr5" :size="aotuSize" icon="bottom" @click="handleNext">下一个</el-button>
|
||||
<PatientQueryForm :initial-params="initialParams" @query="handleQueryResult" @reset="handleReset"
|
||||
width="9rem" :size="aotuSize" placeholder="查询条件" :dict-data="dictData" :clearable="true" />
|
||||
<el-input v-model="searchText" clearable :size="aotuSize" @keyup.enter="searchQuery"
|
||||
@clear="clearSearch" style="width: 6rem" />
|
||||
</div>
|
||||
<div>
|
||||
<el-checkbox v-model="lbFlag" :size="aotuSize"> 列表翻页 </el-checkbox>
|
||||
@ -159,9 +158,11 @@ import ResultGraph from './resultGraph/index.vue'
|
||||
import { getNextNumber, getPreviousNumber } from "@/utils/getNextNumber";
|
||||
import { useCommonStore } from '@/store/modules/commonStore';
|
||||
import { classCom } from '@/utils/classCom';
|
||||
const aotuSize = classCom.useAutoSize();
|
||||
import PatientQueryForm from '@/components/selectSearch/index.vue'
|
||||
|
||||
|
||||
const aotuSize = classCom.useAutoSize();
|
||||
|
||||
const previewShow = ref(false);
|
||||
const lbFlag = ref(false);
|
||||
const queryParams = ref({
|
||||
@ -187,41 +188,105 @@ const tabList = ref([
|
||||
{ label: '临床意义', value: 7 },
|
||||
{ label: '样本流转', value: 8 },
|
||||
])
|
||||
const labPat = ref<any>(
|
||||
{
|
||||
jyrq: '',
|
||||
yq: '',
|
||||
ybh: '',
|
||||
brly: '',
|
||||
jzbz: '0',
|
||||
brdh: '',
|
||||
brxm: '',
|
||||
brxb: '',
|
||||
nl: null,
|
||||
nldw: '1',
|
||||
ksdh: '',
|
||||
ch: '',
|
||||
sjys: '',
|
||||
sqsj: '',
|
||||
cyrq: '',
|
||||
dysj: '',
|
||||
zd: '',
|
||||
bz: '',
|
||||
yhdh: '',
|
||||
hdys: '',
|
||||
jgbz: '0',
|
||||
yblx: '',
|
||||
},
|
||||
)
|
||||
const labPat = ref<any>({},)
|
||||
const labPatList = ref<Array<{ ybh: string; jgbz: string }>>([]);
|
||||
const originalLabPatList = ref([]) //原始数据
|
||||
const loading = ref(false)
|
||||
const total = ref(0)
|
||||
const searchText = ref('')
|
||||
|
||||
const rules = ref([])
|
||||
const instrGroupOptions = ref<any[]>([])
|
||||
const instrOptions = ref<{ yq: string; yqmc: string }[]>([])
|
||||
|
||||
const pdfUrl = ref('')
|
||||
|
||||
// 初始查询参数(可选)
|
||||
const initialParams = {}
|
||||
|
||||
// 定义查询参数类型
|
||||
interface QueryParams {
|
||||
brly?: string | number
|
||||
jgbz?: string | number
|
||||
dybz?: string | number
|
||||
alarmflag?: string | number
|
||||
jzbz?: string | number
|
||||
finish?: string | number
|
||||
autojgbz?: string | number
|
||||
}
|
||||
// 模糊查询
|
||||
const searchQuery = () => {
|
||||
let filterMhList = [...originalLabPatList.value];
|
||||
|
||||
if (searchText.value) {
|
||||
const searchStr = searchText.value.trim().toLowerCase();
|
||||
filterMhList = filterMhList.filter((item: any) => {
|
||||
// 处理 zjf大写转为小写
|
||||
const matchZjf = item.zjf && typeof item.zjf === 'string'
|
||||
? item.zjf.toLowerCase().includes(searchStr)
|
||||
: false; const matchBrxm = item.brxm && typeof item.brxm === 'string' && item.brxm.includes(searchStr);
|
||||
const matchSqh = item.sqh && typeof item.sqh === 'string' && item.sqh.includes(searchStr);
|
||||
return matchZjf || matchBrxm || matchSqh;
|
||||
});
|
||||
}
|
||||
labPatList.value = filterMhList;
|
||||
|
||||
getTotals();
|
||||
|
||||
if (filterMhList.length > 0) {
|
||||
highlightRowIndex.value = 0;
|
||||
const firstRow = filterMhList[0];
|
||||
labPatListRef.value.setCurrentRow(firstRow);
|
||||
selectJob(firstRow);
|
||||
} else {
|
||||
labPat.value = {};
|
||||
labResuts.value = [];
|
||||
highlightRowIndex.value = -1;
|
||||
}
|
||||
};
|
||||
|
||||
const clearSearch = () => {
|
||||
searchText.value = ''
|
||||
searchQuery()
|
||||
}
|
||||
|
||||
// 多条件查询
|
||||
const handleQueryResult = (params: QueryParams) => {
|
||||
// console.log('查询参数:', params);
|
||||
// 复制原始列表作为筛选基础
|
||||
let filteredList = [...originalLabPatList.value];
|
||||
|
||||
// 遍历所有查询参数,进行筛选
|
||||
Object.entries(params).forEach(([key, value]) => {
|
||||
filteredList = filteredList.filter((item: any) => {
|
||||
if (value == 0) {
|
||||
return item[key] == null;
|
||||
} else {
|
||||
return item[key] == value;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
labPatList.value = filteredList;
|
||||
|
||||
getTotals();
|
||||
|
||||
if (filteredList.length > 0) {
|
||||
highlightRowIndex.value = 0;
|
||||
const firstRow = filteredList[0];
|
||||
labPatListRef.value.setCurrentRow(firstRow);
|
||||
selectJob(firstRow);
|
||||
} else {
|
||||
labPat.value = {};
|
||||
labResuts.value = [];
|
||||
highlightRowIndex.value = -1;
|
||||
}
|
||||
};
|
||||
|
||||
// 处理重置
|
||||
const handleReset = () => {
|
||||
labPatList.value = [...originalLabPatList.value];
|
||||
getTotals();
|
||||
}
|
||||
const previewHandle = (url: string) => {
|
||||
if (!url) return ElMessage.warning('未查询到文件')
|
||||
pdfUrl.value = `data:application/pdf;base64,${url}`
|
||||
@ -491,6 +556,7 @@ const fetchlabPatList = () => {
|
||||
queryLabPatList(queryParams.value).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
labPatList.value = res.data;
|
||||
originalLabPatList.value = res.data
|
||||
loading.value = false;
|
||||
if (res.data.length > 0) {
|
||||
highlightRowIndex.value = 0;
|
||||
|
||||
@ -1,36 +1,15 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-button
|
||||
@click="handleClick"
|
||||
>查询病人</el-button>
|
||||
<el-button @click="handleClick">查询病人</el-button>
|
||||
|
||||
<!-- 病人选择弹窗 -->
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="props.dialogTitle"
|
||||
width="500px"
|
||||
@close="handleDialogClose"
|
||||
>
|
||||
<el-input
|
||||
v-model="searchKey"
|
||||
placeholder="搜索(支持姓名、病人ID、简拼)..."
|
||||
class="mb-4"
|
||||
clearable
|
||||
@clear="filteredPatData"
|
||||
@input="filteredPatData"
|
||||
@keyup.down="navigateTable('down')"
|
||||
@keyup.up="navigateTable('up')"
|
||||
@keyup.enter="selectActiveItem"
|
||||
/>
|
||||
<el-dialog v-model="dialogVisible" :title="props.dialogTitle" width="500px" @close="handleDialogClose">
|
||||
<el-input v-model="searchKey" placeholder="搜索(支持姓名、病人ID、简拼)..." class="mb-4" clearable @clear="filteredPatData"
|
||||
@input="filteredPatData" @keyup.down="navigateTable('down')" @keyup.up="navigateTable('up')"
|
||||
@keyup.enter="selectActiveItem" />
|
||||
|
||||
<el-table
|
||||
:data="filteredPatData"
|
||||
height="300px"
|
||||
border
|
||||
@row-click="selectItem"
|
||||
@row-dblclick="selectItem"
|
||||
class="compact-form my-table"
|
||||
>
|
||||
<el-table :data="filteredPatData" height="300px" border @row-click="selectItem" @row-dblclick="selectItem"
|
||||
class="compact-form my-table">
|
||||
<template #empty>
|
||||
<div v-if="isPatLoading">加载中...</div>
|
||||
<div v-else>没有匹配的病人数据</div>
|
||||
@ -51,7 +30,7 @@
|
||||
<script setup>
|
||||
import { ref, computed, watch, onMounted } from 'vue';
|
||||
import { queryPatList } from "@/api/mzcx/cydj.js";
|
||||
import { getFirstLetter } from '@/api/pinyin.js'; // 引入拼音处理工具
|
||||
import { getFirstLetter } from '@/utils/pinyin.js'; // 引入拼音处理工具
|
||||
// 组件参数
|
||||
const props = defineProps({
|
||||
pidValue: { type: [String, Number], default: '' },
|
||||
@ -153,22 +132,32 @@ const handleDialogClose = () => {
|
||||
:deep(.el-table__row.active) {
|
||||
background-color: #e6f7ff !important;
|
||||
}
|
||||
|
||||
::v-deep .my-table .el-table__row td {
|
||||
padding: 1px 0; /* 减小行高 */
|
||||
padding: 1px 0;
|
||||
/* 减小行高 */
|
||||
}
|
||||
|
||||
::v-deep .my-table .el-table__header-wrapper th {
|
||||
padding: 6px 0; /* 表头内边距 */
|
||||
background-color: #b3d8ff !important; /* 表头背景色(保留之前的设置) */
|
||||
color: #333; /* 文字颜色加深,提升可读性 */
|
||||
font-weight: 500; /* 文字加粗 */
|
||||
padding: 6px 0;
|
||||
/* 表头内边距 */
|
||||
background-color: #b3d8ff !important;
|
||||
/* 表头背景色(保留之前的设置) */
|
||||
color: #333;
|
||||
/* 文字颜色加深,提升可读性 */
|
||||
font-weight: 500;
|
||||
/* 文字加粗 */
|
||||
}
|
||||
|
||||
::v-deep .my-table .el-table__cell {
|
||||
padding: 0 2px; /* 减小列间距 */
|
||||
padding: 0 2px;
|
||||
/* 减小列间距 */
|
||||
}
|
||||
|
||||
/* 可选:调整表格整体样式 */
|
||||
::v-deep .my-table {
|
||||
font-size: 13px; /* 适当减小字体 */
|
||||
font-size: 13px;
|
||||
/* 适当减小字体 */
|
||||
}
|
||||
|
||||
::v-deep .my-table .el-table__cell,
|
||||
|
||||
@ -40,8 +40,8 @@ export default defineConfig(({
|
||||
proxy: {
|
||||
// https://cn.vitejs.dev/config/#server-proxy
|
||||
'/dev-api': {
|
||||
target: 'http://localhost:9801',
|
||||
//target: 'http://47.97.125.165:8904',
|
||||
// target: 'http://localhost:9801',
|
||||
target: 'http://47.97.125.165:8904',
|
||||
// target: 'http://192.168.1.114:9801',
|
||||
changeOrigin: true,
|
||||
rewrite: (p) => p.replace(/^\/dev-api/, '')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user