Compare commits
No commits in common. "2138f98df2e795a6a443e97f0f01e0dfdfd7be17" and "d233336e634268c9f721c89ee28e64ce58c5ebf4" have entirely different histories.
2138f98df2
...
d233336e63
@ -45,7 +45,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive, ref, onMounted, watch, nextTick, toRaw } from "vue";
|
import { reactive, ref, onMounted, watch, nextTick, toRaw } from "vue";
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { getFirstLetter } from '@/utils/pinyin.js';
|
import { getFirstLetter } from '@/api/pinyin.js';
|
||||||
import { ElEmpty } from 'element-plus';
|
import { ElEmpty } from 'element-plus';
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { comDict } from '@/utils/dict'
|
import { comDict } from '@/utils/dict'
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, ref, watch, computed, reactive, toRaw } from 'vue';
|
import { onMounted, ref, watch, computed, reactive, toRaw } from 'vue';
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { getFirstLetter } from '@/utils/pinyin.js';
|
import { getFirstLetter } from '@/api/pinyin.js';
|
||||||
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|||||||
@ -1,266 +0,0 @@
|
|||||||
<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,6 +114,7 @@ import { ref, onMounted, onUnmounted, Ref } from 'vue';
|
|||||||
*/
|
*/
|
||||||
function useAutoSize() {
|
function useAutoSize() {
|
||||||
const autoSize = ref<'small' | 'default'>('default');
|
const autoSize = ref<'small' | 'default'>('default');
|
||||||
|
console.log('333==>', 333);
|
||||||
// 防抖函数,避免频繁触发
|
// 防抖函数,避免频繁触发
|
||||||
const debounce = (fn: Function, delay: number) => {
|
const debounce = (fn: Function, delay: number) => {
|
||||||
let timer: number;
|
let timer: number;
|
||||||
@ -125,6 +126,7 @@ function useAutoSize() {
|
|||||||
|
|
||||||
const calculateSize = () => {
|
const calculateSize = () => {
|
||||||
const screenWidth = window.innerWidth || document.documentElement.clientWidth;
|
const screenWidth = window.innerWidth || document.documentElement.clientWidth;
|
||||||
|
console.log('screenWidth==>', screenWidth);
|
||||||
autoSize.value = screenWidth < 1600 ? 'small' : 'default';
|
autoSize.value = screenWidth < 1600 ? 'small' : 'default';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -1,11 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="dict-input-wrapper">
|
<div class="dict-input-wrapper">
|
||||||
<el-input v-model="displayValue" :placeholder="placeholder" :clearable="clearable"
|
<el-input
|
||||||
:disabled="isDictLoading || disabled" @blur="handleBlur" @clear="handleClear" @dblclick="handleDblClick">
|
v-model="displayValue"
|
||||||
|
:placeholder="placeholder"
|
||||||
|
:clearable="clearable"
|
||||||
|
:disabled="isDictLoading || disabled"
|
||||||
|
@blur="handleBlur"
|
||||||
|
@clear="handleClear"
|
||||||
|
@dblclick="handleDblClick"
|
||||||
|
>
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
<el-icon v-if="isDictLoading" size="16">
|
<el-icon v-if="isDictLoading" size="16"><Loading /></el-icon>
|
||||||
<Loading />
|
|
||||||
</el-icon>
|
|
||||||
</template>
|
</template>
|
||||||
<template #suffix>
|
<template #suffix>
|
||||||
<el-icon @click="openDictSelector" size="16" class="select-icon">
|
<el-icon @click="openDictSelector" size="16" class="select-icon">
|
||||||
@ -15,11 +20,28 @@
|
|||||||
</el-input>
|
</el-input>
|
||||||
|
|
||||||
<!-- 字典选择弹窗 -->
|
<!-- 字典选择弹窗 -->
|
||||||
<el-dialog v-model="dialogVisible" :title="dialogTitle" width="500px" @close="handleDialogClose">
|
<el-dialog
|
||||||
<el-input v-model="searchKey" placeholder="搜索(支持名称、编码、简拼)..." class="mb-4" clearable @clear="filterDictData"
|
v-model="dialogVisible"
|
||||||
@input="filterDictData" />
|
: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="value" label="编码" width="100" />
|
||||||
<el-table-column prop="label" label="名称" width="200" />
|
<el-table-column prop="label" label="名称" width="200" />
|
||||||
<el-table-column prop="pinyin" label="简拼" width="150" /> <!-- 显示简拼便于调试 -->
|
<el-table-column prop="pinyin" label="简拼" width="150" /> <!-- 显示简拼便于调试 -->
|
||||||
@ -37,16 +59,16 @@
|
|||||||
import { ref, computed, watch, onMounted } from 'vue';
|
import { ref, computed, watch, onMounted } from 'vue';
|
||||||
import { Loading, ArrowDown } from '@element-plus/icons-vue';
|
import { Loading, ArrowDown } from '@element-plus/icons-vue';
|
||||||
|
|
||||||
import { getFirstLetter } from '@/utils/pinyin.js'; // 引入拼音处理工具
|
import { getFirstLetter } from '@/api/pinyin.js'; // 引入拼音处理工具
|
||||||
// 组件参数
|
// 组件参数
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
modelValue: { type: [String, Number], default: '' },
|
modelValue: { type: [String, Number], default: '' },
|
||||||
dictType: { type: String, required: true },
|
dictType: { type: String, required: true },
|
||||||
placeholder: { type: String, default: '请输入或双击选择' },
|
placeholder: { type: String, default: '请输入或双击选择' },
|
||||||
clearable: { type: Boolean, default: true },
|
clearable: { type: Boolean, default: true },
|
||||||
disabled: { type: Boolean, default: false },
|
disabled: {type: Boolean, default: false},
|
||||||
fetchDict: { type: Function, required: true },
|
fetchDict: {type: Function, required: true},
|
||||||
dialogTitle: { type: String, default: '选择字典项' }
|
dialogTitle: {type: String, default: '选择字典项'}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 组件事件
|
// 组件事件
|
||||||
@ -162,7 +184,7 @@ watch(() => props.modelValue, (newVal) => {
|
|||||||
labelValue.value = matched?.label || newVal;
|
labelValue.value = matched?.label || newVal;
|
||||||
emit('update:labelValue', labelValue.value);
|
emit('update:labelValue', labelValue.value);
|
||||||
}
|
}
|
||||||
}, { immediate: true });
|
}, {immediate: true});
|
||||||
|
|
||||||
// 组件挂载时加载字典
|
// 组件挂载时加载字典
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|||||||
@ -1,14 +1,25 @@
|
|||||||
<template>
|
<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-box">
|
||||||
<!-- 标题区域 -->
|
<!-- 标题区域 -->
|
||||||
<div class="dialog-header">
|
<div class="dialog-header">
|
||||||
<h3 class="dialog-title">{{ title }}</h3>
|
<h3 class="dialog-title">{{ title }}</h3>
|
||||||
<button class="dialog-close" @click="handleCancel" aria-label="关闭">
|
<button
|
||||||
|
class="dialog-close"
|
||||||
|
@click="handleCancel"
|
||||||
|
aria-label="关闭"
|
||||||
|
>
|
||||||
<span>×</span>
|
<span>×</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@ -16,12 +27,24 @@
|
|||||||
<!-- 内容区域 -->
|
<!-- 内容区域 -->
|
||||||
<div class="dialog-body">
|
<div class="dialog-body">
|
||||||
<!-- 搜索框 -->
|
<!-- 搜索框 -->
|
||||||
<el-input v-model="searchKey" placeholder="搜索(支持名称、编码、简拼)..." class="search-input" clearable
|
<el-input
|
||||||
@clear="filterDictData" @input="filterDictData" />
|
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"
|
<el-table
|
||||||
:loading="isDictLoading">
|
: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="value" label="编码" width="100" />
|
||||||
<el-table-column prop="label" label="名称" width="200" />
|
<el-table-column prop="label" label="名称" width="200" />
|
||||||
<el-table-column prop="pinyin" label="简拼" width="150" />
|
<el-table-column prop="pinyin" label="简拼" width="150" />
|
||||||
@ -38,7 +61,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, watch, onMounted } from 'vue';
|
import { ref, computed, watch, onMounted } from 'vue';
|
||||||
import { getFirstLetter } from '@/utils/pinyin.js'; // 拼音处理工具
|
import { getFirstLetter } from '@/api/pinyin.js'; // 拼音处理工具
|
||||||
|
|
||||||
// 组件参数
|
// 组件参数
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -135,7 +158,7 @@ const loadDictData = async () => {
|
|||||||
const syncLabelWithValue = () => {
|
const syncLabelWithValue = () => {
|
||||||
if (props.modelValue) {
|
if (props.modelValue) {
|
||||||
const matched = dictData.value.find(
|
const matched = dictData.value.find(
|
||||||
item => String(item.value) === String(props.modelValue)
|
item => String(item.value) === String(props.modelValue)
|
||||||
);
|
);
|
||||||
labelValue.value = matched?.label || props.modelValue;
|
labelValue.value = matched?.label || props.modelValue;
|
||||||
emit('update:labelValue', labelValue.value);
|
emit('update:labelValue', labelValue.value);
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
import { ref, computed, watch, onMounted } from 'vue';
|
import { ref, computed, watch, onMounted } from 'vue';
|
||||||
import { Loading, ArrowDown } from '@element-plus/icons-vue';
|
import { Loading, ArrowDown } from '@element-plus/icons-vue';
|
||||||
|
|
||||||
import { getFirstLetter } from '@/utils/pinyin.js'; // 引入拼音处理工具
|
import { getFirstLetter } from '@/api/pinyin.js'; // 引入拼音处理工具
|
||||||
// 组件参数
|
// 组件参数
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
modelValue: { type: [String, Number], default: '' },
|
modelValue: { type: [String, Number], default: '' },
|
||||||
|
|||||||
@ -1,7 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="custom-select2">
|
<div class="custom-select2">
|
||||||
<Select2 v-model="currentValue" :options="processedOptions" :settings="select2Settings"
|
<Select2
|
||||||
@update:modelValue="handleChange" :disabled="isDisabled" />
|
v-model="currentValue"
|
||||||
|
:options="processedOptions"
|
||||||
|
:settings="select2Settings"
|
||||||
|
@update:modelValue="handleChange"
|
||||||
|
:disabled="isDisabled"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -9,7 +14,7 @@
|
|||||||
//import { ref, computed, watch, defineProps, defineEmits } from 'vue';
|
//import { ref, computed, watch, defineProps, defineEmits } from 'vue';
|
||||||
import Select2 from 'vue3-select2-component';
|
import Select2 from 'vue3-select2-component';
|
||||||
import 'select2/dist/css/select2.min.css';
|
import 'select2/dist/css/select2.min.css';
|
||||||
import { processOptions } from '@/utils/pinyin.js'; // 引入拼音处理工具
|
import { processOptions } from '@/api/pinyin.js'; // 引入拼音处理工具
|
||||||
|
|
||||||
// 定义组件props
|
// 定义组件props
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -63,9 +68,9 @@ const select2Settings = computed(() => ({
|
|||||||
|
|
||||||
// 检查文本、拼音或拼音首字母是否匹配
|
// 检查文本、拼音或拼音首字母是否匹配
|
||||||
if (
|
if (
|
||||||
data.text.toLowerCase().includes(term) ||
|
data.text.toLowerCase().includes(term) ||
|
||||||
data.pinyin.toLowerCase().includes(term) ||
|
data.pinyin.toLowerCase().includes(term) ||
|
||||||
data.firstLetters.toLowerCase().includes(term)
|
data.firstLetters.toLowerCase().includes(term)
|
||||||
) {
|
) {
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -69,11 +69,12 @@
|
|||||||
<el-button type="primary" :size="aotuSize" icon="RefreshRight" @click="fetchlabPatList">刷新</el-button>
|
<el-button type="primary" :size="aotuSize" icon="RefreshRight" @click="fetchlabPatList">刷新</el-button>
|
||||||
<el-button type="danger" :size="aotuSize" @click="delSampleHd">删除</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="top" @click="handlePrev">上一个</el-button>
|
||||||
<el-button class="btn_green mr5" :size="aotuSize" icon="bottom" @click="handleNext">下一个</el-button>
|
<el-button class="btn_green" :size="aotuSize" icon="bottom" @click="handleNext">下一个</el-button>
|
||||||
<PatientQueryForm :initial-params="initialParams" @query="handleQueryResult" @reset="handleReset"
|
<el-select placeholder="所有" :size="aotuSize" style="width: 8rem" class="ml5">
|
||||||
width="9rem" :size="aotuSize" placeholder="查询条件" :dict-data="dictData" :clearable="true" />
|
<el-option label="option" value="item.value" />
|
||||||
<el-input v-model="searchText" clearable :size="aotuSize" @keyup.enter="searchQuery"
|
</el-select>
|
||||||
@clear="clearSearch" style="width: 6rem" />
|
<el-input clearable :size="aotuSize" @keyup.enter="handleQuery" @clear="handleQuery"
|
||||||
|
style="width: 6rem" />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-checkbox v-model="lbFlag" :size="aotuSize"> 列表翻页 </el-checkbox>
|
<el-checkbox v-model="lbFlag" :size="aotuSize"> 列表翻页 </el-checkbox>
|
||||||
@ -158,11 +159,9 @@ import ResultGraph from './resultGraph/index.vue'
|
|||||||
import { getNextNumber, getPreviousNumber } from "@/utils/getNextNumber";
|
import { getNextNumber, getPreviousNumber } from "@/utils/getNextNumber";
|
||||||
import { useCommonStore } from '@/store/modules/commonStore';
|
import { useCommonStore } from '@/store/modules/commonStore';
|
||||||
import { classCom } from '@/utils/classCom';
|
import { classCom } from '@/utils/classCom';
|
||||||
import PatientQueryForm from '@/components/selectSearch/index.vue'
|
|
||||||
|
|
||||||
|
|
||||||
const aotuSize = classCom.useAutoSize();
|
const aotuSize = classCom.useAutoSize();
|
||||||
|
|
||||||
|
|
||||||
const previewShow = ref(false);
|
const previewShow = ref(false);
|
||||||
const lbFlag = ref(false);
|
const lbFlag = ref(false);
|
||||||
const queryParams = ref({
|
const queryParams = ref({
|
||||||
@ -188,105 +187,41 @@ const tabList = ref([
|
|||||||
{ label: '临床意义', value: 7 },
|
{ label: '临床意义', value: 7 },
|
||||||
{ label: '样本流转', value: 8 },
|
{ label: '样本流转', value: 8 },
|
||||||
])
|
])
|
||||||
const labPat = ref<any>({},)
|
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 labPatList = ref<Array<{ ybh: string; jgbz: string }>>([]);
|
const labPatList = ref<Array<{ ybh: string; jgbz: string }>>([]);
|
||||||
const originalLabPatList = ref([]) //原始数据
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const searchText = ref('')
|
const total = ref(0)
|
||||||
|
|
||||||
const rules = ref([])
|
const rules = ref([])
|
||||||
const instrGroupOptions = ref<any[]>([])
|
const instrGroupOptions = ref<any[]>([])
|
||||||
const instrOptions = ref<{ yq: string; yqmc: string }[]>([])
|
const instrOptions = ref<{ yq: string; yqmc: string }[]>([])
|
||||||
|
|
||||||
const pdfUrl = ref('')
|
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) => {
|
const previewHandle = (url: string) => {
|
||||||
if (!url) return ElMessage.warning('未查询到文件')
|
if (!url) return ElMessage.warning('未查询到文件')
|
||||||
pdfUrl.value = `data:application/pdf;base64,${url}`
|
pdfUrl.value = `data:application/pdf;base64,${url}`
|
||||||
@ -556,7 +491,6 @@ const fetchlabPatList = () => {
|
|||||||
queryLabPatList(queryParams.value).then((res: any) => {
|
queryLabPatList(queryParams.value).then((res: any) => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
labPatList.value = res.data;
|
labPatList.value = res.data;
|
||||||
originalLabPatList.value = res.data
|
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
if (res.data.length > 0) {
|
if (res.data.length > 0) {
|
||||||
highlightRowIndex.value = 0;
|
highlightRowIndex.value = 0;
|
||||||
|
|||||||
@ -1,27 +1,48 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<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-dialog
|
||||||
<el-input v-model="searchKey" placeholder="搜索(支持姓名、病人ID、简拼)..." class="mb-4" clearable @clear="filteredPatData"
|
v-model="dialogVisible"
|
||||||
@input="filteredPatData" @keyup.down="navigateTable('down')" @keyup.up="navigateTable('up')"
|
:title="props.dialogTitle"
|
||||||
@keyup.enter="selectActiveItem" />
|
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"
|
<el-table
|
||||||
class="compact-form my-table">
|
:data="filteredPatData"
|
||||||
|
height="300px"
|
||||||
|
border
|
||||||
|
@row-click="selectItem"
|
||||||
|
@row-dblclick="selectItem"
|
||||||
|
class="compact-form my-table"
|
||||||
|
>
|
||||||
<template #empty>
|
<template #empty>
|
||||||
<div v-if="isPatLoading">加载中...</div>
|
<div v-if="isPatLoading">加载中...</div>
|
||||||
<div v-else>没有匹配的病人数据</div>
|
<div v-else>没有匹配的病人数据</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<el-table-column prop="pid" label="病人ID" width="100" show-overflow-tooltip />
|
<el-table-column prop="pid" label="病人ID" width="100" show-overflow-tooltip/>
|
||||||
<el-table-column prop="name" label="姓名" width="100" show-overflow-tooltip />
|
<el-table-column prop="name" label="姓名" width="100" show-overflow-tooltip/>
|
||||||
<el-table-column prop="xb" label="性别" width="80" show-overflow-tooltip />
|
<el-table-column prop="xb" label="性别" width="80" show-overflow-tooltip/>
|
||||||
<el-table-column prop="nl" label="年龄" width="80" show-overflow-tooltip />
|
<el-table-column prop="nl" label="年龄" width="80" show-overflow-tooltip/>
|
||||||
<el-table-column prop="ks" label="科室" width="100" show-overflow-tooltip />
|
<el-table-column prop="ks" label="科室" width="100" show-overflow-tooltip/>
|
||||||
<el-table-column prop="ch" label="床号" width="80" show-overflow-tooltip />
|
<el-table-column prop="ch" label="床号" width="80" show-overflow-tooltip/>
|
||||||
<el-table-column prop="pinyin" label="简拼" width="150" show-overflow-tooltip />
|
<el-table-column prop="pinyin" label="简拼" width="150" show-overflow-tooltip/>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
@ -29,8 +50,8 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, watch, onMounted } from 'vue';
|
import { ref, computed, watch, onMounted } from 'vue';
|
||||||
import { queryPatList } from "@/api/mzcx/cydj.js";
|
import {queryPatList} from "@/api/mzcx/cydj.js";
|
||||||
import { getFirstLetter } from '@/utils/pinyin.js'; // 引入拼音处理工具
|
import { getFirstLetter } from '@/api/pinyin.js'; // 引入拼音处理工具
|
||||||
// 组件参数
|
// 组件参数
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
pidValue: { type: [String, Number], default: '' },
|
pidValue: { type: [String, Number], default: '' },
|
||||||
@ -54,17 +75,17 @@ const activeRowIndex = ref(-1); // 键盘导航选中行索引
|
|||||||
|
|
||||||
// 加载病人数据
|
// 加载病人数据
|
||||||
const loadPatData = async () => {
|
const loadPatData = async () => {
|
||||||
isPatLoading.value = true;
|
isPatLoading.value = true;
|
||||||
queryPatList().then(response => {
|
queryPatList().then(response => {
|
||||||
// console.log('response:', response.data);
|
// console.log('response:', response.data);
|
||||||
PatData.value = (response.data || []).map(item => ({
|
PatData.value = (response.data || []).map(item => ({
|
||||||
...item,
|
...item,
|
||||||
pinyin: getFirstLetter(item.name)
|
pinyin: getFirstLetter(item.name)
|
||||||
}));
|
}));
|
||||||
}).catch(() => {
|
}).catch (() =>{
|
||||||
console.error(`加载病人列表失败:`, error);
|
console.error(`加载病人列表失败:`, error);
|
||||||
PatData.value = [];
|
PatData.value = [];
|
||||||
}).finally(() => {
|
}).finally (() =>{
|
||||||
isPatLoading.value = false;
|
isPatLoading.value = false;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -86,11 +107,11 @@ const filteredPatData = computed(() => {
|
|||||||
// 点击按钮事件处理
|
// 点击按钮事件处理
|
||||||
const handleClick = () => {
|
const handleClick = () => {
|
||||||
loadPatData();
|
loadPatData();
|
||||||
// if (!props.disabled && !isPatLoading.value) {
|
// if (!props.disabled && !isPatLoading.value) {
|
||||||
dialogVisible.value = true;
|
dialogVisible.value = true;
|
||||||
searchKey.value = '';
|
searchKey.value = '';
|
||||||
activeRowIndex.value = -1;
|
activeRowIndex.value = -1;
|
||||||
// }
|
// }
|
||||||
};
|
};
|
||||||
|
|
||||||
// 选择病人项
|
// 选择病人项
|
||||||
@ -132,32 +153,22 @@ const handleDialogClose = () => {
|
|||||||
:deep(.el-table__row.active) {
|
:deep(.el-table__row.active) {
|
||||||
background-color: #e6f7ff !important;
|
background-color: #e6f7ff !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep .my-table .el-table__row td {
|
::v-deep .my-table .el-table__row td {
|
||||||
padding: 1px 0;
|
padding: 1px 0; /* 减小行高 */
|
||||||
/* 减小行高 */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep .my-table .el-table__header-wrapper th {
|
::v-deep .my-table .el-table__header-wrapper th {
|
||||||
padding: 6px 0;
|
padding: 6px 0; /* 表头内边距 */
|
||||||
/* 表头内边距 */
|
background-color: #b3d8ff !important; /* 表头背景色(保留之前的设置) */
|
||||||
background-color: #b3d8ff !important;
|
color: #333; /* 文字颜色加深,提升可读性 */
|
||||||
/* 表头背景色(保留之前的设置) */
|
font-weight: 500; /* 文字加粗 */
|
||||||
color: #333;
|
|
||||||
/* 文字颜色加深,提升可读性 */
|
|
||||||
font-weight: 500;
|
|
||||||
/* 文字加粗 */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep .my-table .el-table__cell {
|
::v-deep .my-table .el-table__cell {
|
||||||
padding: 0 2px;
|
padding: 0 2px; /* 减小列间距 */
|
||||||
/* 减小列间距 */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 可选:调整表格整体样式 */
|
/* 可选:调整表格整体样式 */
|
||||||
::v-deep .my-table {
|
::v-deep .my-table {
|
||||||
font-size: 13px;
|
font-size: 13px; /* 适当减小字体 */
|
||||||
/* 适当减小字体 */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep .my-table .el-table__cell,
|
::v-deep .my-table .el-table__cell,
|
||||||
|
|||||||
@ -40,8 +40,8 @@ export default defineConfig(({
|
|||||||
proxy: {
|
proxy: {
|
||||||
// https://cn.vitejs.dev/config/#server-proxy
|
// https://cn.vitejs.dev/config/#server-proxy
|
||||||
'/dev-api': {
|
'/dev-api': {
|
||||||
// target: 'http://localhost:9801',
|
target: 'http://localhost:9801',
|
||||||
target: 'http://47.97.125.165:8904',
|
//target: 'http://47.97.125.165:8904',
|
||||||
// target: 'http://192.168.1.114:9801',
|
// target: 'http://192.168.1.114:9801',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: (p) => p.replace(/^\/dev-api/, '')
|
rewrite: (p) => p.replace(/^\/dev-api/, '')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user