Compare commits

..

2 Commits

20 changed files with 353 additions and 115 deletions

View File

@ -28,6 +28,7 @@
"js-cookie": "3.0.5",
"jsbarcode": "^3.12.1",
"jsencrypt": "3.3.2",
"mitt": "^3.0.1",
"nprogress": "0.2.0",
"pinia": "2.1.7",
"pinyin-pro": "^3.26.0",

View File

@ -1,15 +1,69 @@
<template>
<div class="app-container" ref="appContainer">
<div class="app-content">
<router-view />
</div>
</div>
</template>
<script setup>
import useSettingsStore from '@/store/modules/settings'
import { handleThemeStyle } from '@/utils/theme'
import { ref, onMounted, onUnmounted, nextTick } from 'vue';
const appContainer = ref(null);
const appContent = ref(null);
// 设计稿基准尺寸
const baseWidth = 1920;
const baseHeight = 1080;
// 计算缩放比例并应用
const calcScale = () => {
if (!appContent.value) return;
// 当前窗口尺寸
const clientWidth = window.innerWidth;
const clientHeight = window.innerHeight;
// 计算宽高方向的缩放比例(取最小值,避免内容溢出)
const scaleX = clientWidth / baseWidth;
const scaleY = clientHeight / baseHeight;
const scale = Math.min(scaleX, scaleY);
// 应用缩放
appContent.value.style.transform = `scale(${scale})`;
};
onMounted(() => {
calcScale(); // 初始化
window.addEventListener('resize', calcScale);
nextTick(() => {
// 初始化主题样式
handleThemeStyle(useSettingsStore().theme)
})
})
onUnmounted(() => {
window.removeEventListener('resize', calcScale);
});
</script>
<style lang="scss" scoped>
.app-container {
/* 占满整个窗口 */
width: 100vw;
height: 100vh;
overflow: hidden;
/* 避免缩放后出现滚动条 */
}
.app-content {
/* 设计稿基准尺寸 */
width: 1920px;
height: 1080px;
margin: 0 auto;
/* 水平居中 */
transform-origin: top center;
/* 缩放原点(避免偏移) */
}
</style>

View File

@ -257,6 +257,23 @@ export function inputmdl(query?: Object) {
params: query
})
}
// 项目模板输入结果
export function setinputmdl(query?: Object) {
return request({
url: '/liswork/setinputmdl',
method: 'get',
params: query
})
}
// 保存病人结果
export function saveResult(query?: Object) {
return request({
url: '/lisworkoper/saveresult',
method: 'post',
data: query
})
}
// 获取复查结果
export function redoResult(query?: Object) {
return request({
@ -282,3 +299,4 @@ export function getresultchangelog(query?: Object) {
})
}

View File

@ -292,6 +292,12 @@
// 高亮
.vxe-table--render-default .vxe-body--row.row--current {
background-color: #a4beef !important;
color: #FFF !important;
}
.vxe-table--render-default .vxe-body--row.row--current .vxe-cell {
background-color: #a4beef !important;
color: #FFF !important;
}
// 滚动条

View File

@ -208,9 +208,8 @@ watch(() => props.data, (newVal) => {
// 输入框键盘事件处理(专门处理上下键)
const handleInputKeydown = (e: KeyboardEvent) => {
// 仅处理上下方向键
if (e.key !== "ArrowUp" && e.key !== "ArrowDown") return;
// 仅处理上下方向回车键
if (!['ArrowUp', 'ArrowDown', 'Enter'].includes(e.key)) return;
// 阻止事件冒泡到输入框父元素
e.stopPropagation();
@ -229,6 +228,12 @@ const handleInputKeydown = (e: KeyboardEvent) => {
const event = new KeyboardEvent('keydown', { key: e.key });
tableContainer?.dispatchEvent(event);
});
// 回车确认
if (e.key === "Enter") {
const currentRow = filterData.value[currentIndex.value];
handleRowChange(currentRow);
}
}
};

View File

@ -214,11 +214,11 @@ defineExpose({
// 表格边框
:deep(.vxe-table--render-default.border--full .vxe-body--column) {
background-image: linear-gradient(#96B8D9, #96B8D9), linear-gradient(#96B8D9, #96B8D9);
background-image: linear-gradient(#96B8D9, #96B8D9), linear-gradient(#96B8D9, #96B8D9) !important;
}
// 表头边框
:deep(.vxe-table--render-default.border--full .vxe-header--column) {
background-image: linear-gradient(#1F6DD3, #1F6DD3), linear-gradient(#1F6DD3, #1F6DD3);
background-image: linear-gradient(#1F6DD3, #1F6DD3), linear-gradient(#1F6DD3, #1F6DD3) !important;
}
</style>

View File

@ -0,0 +1,13 @@
//公共状态管理
import { defineStore } from 'pinia'
export const useCommonStore = defineStore('commonStore', {
state: () => ({
lxsrs: [] as string[], // 存储项目模板名称
}),
actions: {
setLxsrList(list: any[]) {
this.lxsrs = list
},
}
})

5
src/utils/mitt.ts Normal file
View File

@ -0,0 +1,5 @@
// utils/mitt.ts
import mitt from "mitt"
const emitter = mitt()
export default emitter

View File

@ -75,8 +75,8 @@ service.interceptors.request.use(config => {
const s_time = sessionObj.time; // 请求时间
const interval = 1000; // 间隔时间(ms),小于此时间视为重复提交
if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) {
const message = '数据正在处理,请勿重复提交';
console.warn(`[${s_url}]: ` + message)
// const message = '数据正在处理,请勿重复提交';
// console.warn(`[${s_url}]: ` + message)
return Promise.reject(new Error(message))
} else {
cache.session.setJSON('sessionObj', requestObj)

View File

@ -249,12 +249,12 @@ const loading = ref(true);
const tableData = ref([])
// 配置项
const columns = ref([
{ type: 'selection', visible: true, align: 'center', width: 40, label: '多选框' },
{ type: 'selection', visible: true, align: 'center', width: 35, label: '多选框' },
// { type: 'index', visible: true, align: 'center', width: 60, label: '序号' },
{ prop: 'zt', label: '印', visible: true, align: 'center', slot: 'dy', width: 20 },
{ prop: 'jzbz', label: '急', align: 'center', visible: true, slot: 'jzbz', width: 20 },
{ prop: 'ch', label: '床号', visible: true, align: 'center', width: 30 },//sortable: true,
{ prop: 'brxm', label: '姓名', align: 'center', visible: true, width: 40 },
{ prop: 'zt', label: '打印', visible: true, align: 'center', slot: 'dy', width: 40 },
{ prop: 'jzbz', label: '急', align: 'center', visible: true, slot: 'jzbz', width: 30 },
{ prop: 'ch', label: '床号', visible: true, align: 'center', width: 40 },//sortable: true,
{ prop: 'brxm', label: '姓名', align: 'center', visible: true, width: 50 },
{ prop: 'brxbname', label: '性别', align: 'center', visible: true, width: 30 },
{ prop: 'jymd', label: '项目名称', visible: true, width: 130 },
{ prop: 'bgddhname', label: '类别', align: 'center', visible: true, width: 80 },
@ -557,7 +557,7 @@ onMounted(async () => {
// 字典格式化方法
const formatDict = (v: string, dictType: string) => {
return dictData.value[dictType]?.find((item: any) => item.value == v)?.label;
return dictData.value[dictType]?.find((item: any) => item.value == v)?.label || v;
};
// 计算table高度

View File

@ -134,10 +134,10 @@ const handleColumnDragEnd = (data: any) => {
};
const formatDict = (v: string, dictType: string) => {
return dictData.value[dictType]?.find((item: any) => item.value == v)?.label
return dictData.value[dictType]?.find((item: any) => item.value == v)?.label || v;
}
const formatys = (v: string) => {
return userList.value.find((item: any) => item.userName == v)?.nickName
return userList.value.find((item: any) => item.userName == v)?.nickName || v;
}
const getSummaries = ({ columns, data }: { columns: any, data: any }) => {

View File

@ -1,8 +1,9 @@
<template>
<div class="bination_box">
<CustomTable ref="tableRef" :data="tableData" :columns="columns" :config="tableConfig">
<CustomTable ref="tableRef" :data="tableData" :columns="columns" :config="tableConfig"
@row-dblclick="handleRowDblclick">
<template #lxsr="{ row }">
<el-checkbox :model-value="row.lxsr == '1'" readonly />
<el-checkbox v-model="row.lxsr" @change="changeLxsr(row)" />
</template>
<template #zdsr="{ row }">
<el-checkbox :model-value="row.zdsr == 'Y'" readonly />
@ -15,8 +16,8 @@
import { ref, watch, toRefs, onMounted, computed } from 'vue'
import { inputmdl } from "@/api/liswork/work/LisWork";
import CustomTable from '@/components/elTable/index.vue'
import emitter from '@/utils/mitt'
import { useCommonStore } from '@/store/modules/commonStore';
const props = defineProps({
// 主键
queryParams: {
@ -24,7 +25,7 @@ const props = defineProps({
default: {}
},
})
const mbStore = useCommonStore();
const { queryParams } = toRefs(props);
const tableData = ref([])
const columns = ref([
@ -46,15 +47,28 @@ const tableConfig = ref({
const getCombination = () => {
inputmdl(queryParams.value).then((res: any) => {
if (res.code == 0) {
tableData.value = res.data || []
tableData.value = res.data?.map((item: any) => {
return {
...item,
lxsr: mbStore.lxsrs.includes(item.mbmc) ? true : false,
}
})
}
})
};
watch(() => props.queryParams, (newValue) => {
watch(() => props.queryParams.yq, (newValue) => {
getCombination()
}, { immediate: true })
// 解构 props
const changeLxsr = (row: any) => {
const lxsrs = tableData.value.filter((item: any) => item.lxsr).map((item: any) => item.mbmc);
console.log('lxsrs==>', lxsrs);
mbStore.setLxsrList(lxsrs);
}
const handleRowDblclick = (row: any) => {
emitter.emit('dbMbHandle', row);
}
</script>

View File

@ -55,7 +55,7 @@
<el-input v-model="labPat.ch" placeholder="请输入床号" @change="handleFieldChange" size="small" />
</el-form-item>
<el-form-item label="样本类型">
<SelectTable v-model:data="labPat.yblx" :fields="ksdhFields" :tableData="dictData.DP || []" label="label"
<SelectTable v-model:data="labPat.yblx" :fields="ksdhFields" :tableData="dictData.BT || []" label="label"
value="value" objKey="value" :border="true" placeholder="请选择" size="small"
@getDataValue="handleFieldChange" />
</el-form-item>

View File

@ -14,24 +14,22 @@
<el-col :span="18">
<el-form-item :label="v.zdts" v-if="v.kj == '1'">
<SelectTable v-model:data="labPat[v.zdmc]" :fields="brlyFields" :dictType="v.dict" placeholder=""
label="label" value="value" objKey="value" :border="true" size="small" @getDataValue="handleFieldChange"
:disabled="v.kybj == '0'" />
label="label" value="value" objKey="value" :border="true" size="small"
@getDataValue="handleFieldChange" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-checkbox v-model="labPat.jzbz" true-value="1" :disabled="v.kybj == '0'" class="check_box"> 急诊
</el-checkbox>
<el-checkbox v-model="labPat.jzbz" true-value="1" class="check_box"> 急诊 </el-checkbox>
<!-- :disabled="v.kybj == '0'" -->
</el-col>
</el-row>
<el-form-item :label="v.zdts" v-if="v.kj == '1' && !v.dict && v.mrts != '年龄'">
<el-input v-if="v.zdlb == '1'" v-model="labPat[v.zdmc]" @change="handleFieldChange" size="small"
:disabled="v.kybj == '0'" />
<el-input v-if="v.zdlb == '1'" v-model="labPat[v.zdmc]" @change="handleFieldChange" size="small" />
<el-date-picker v-if="v.zdlb == '3'" v-model="labPat[v.zdmc]" type="datetime" :disabled="v.kybj == '0'"
format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" @change="handleFieldChange" size="small"
style="width: 100%;" />
<el-date-picker v-if="v.zdlb == '3'" v-model="labPat[v.zdmc]" type="datetime" format="YYYY-MM-DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss" @change="handleFieldChange" size="small" style="width: 100%;" />
</el-form-item>
@ -53,13 +51,11 @@
<el-form-item :label="v.zdts" v-if="v.mrts == '检验医师' && v.kj == '1'">
<SelectTable v-model:data="labPat[v.zdmc]" :fields="ysFields" :tableData="userList || []" label="nickName"
value="userName" objKey="userName" :border="true" size="small" @getDataValue="getJyysData"
:disabled="v.kybj == '0'" placeholder="" />
value="userName" objKey="userName" :border="true" size="small" @getDataValue="getJyysData" placeholder="" />
</el-form-item>
<el-form-item :label="v.zdts" v-if="v.mrts == '核对医师' && v.kj == '1'">
<SelectTable v-model:data="labPat[v.zdmc]" :fields="ysFields" :tableData="userList || []" label="nickName"
value="userName" objKey="userName" :border="true" size="small" @getDataValue="getHdysData"
:disabled="v.kybj == '0'" placeholder="" />
value="userName" objKey="userName" :border="true" size="small" @getDataValue="getHdysData" placeholder="" />
</el-form-item>
</template>
</el-form>
@ -119,6 +115,7 @@ import SelectTable from '@/components/SelectTable/index.vue';
// @ts-ignore
import { listUser } from '@/api/system/user.js'
import { PropType } from 'vue';
import emitter from '@/utils/mitt';
interface LabSysItem {
kj: string;
@ -152,9 +149,10 @@ const sqhRef = ref();
watch(() => props.labPat, (newVal) => {
lastValue.value = JSON.stringify(newVal);
lastJgbz.value = newVal.jgbz;
sqhValue.value = '';
})
const emit = defineEmits(['update:labPat', 'getLabList', 'changeStatus']);
const emit = defineEmits(['update:labPat', 'changeStatus']);
const lastValue = ref('');
const brlyFields = ref([
@ -250,6 +248,7 @@ const getHdysData = (data: any) => {
})
}
/**
* 通用字段变化处理(失焦、回车触发)
*/
@ -258,6 +257,7 @@ const handleFieldChange = async () => {
const currentValue = JSON.stringify(props.labPat);
// 对比与上一次保存的值是否有变化
if (currentValue !== lastValue.value) {
emitter.emit('saveLab');
// 找出变化的字段
const oldObj = JSON.parse(lastValue.value);
const newObj = props.labPat;
@ -265,10 +265,21 @@ const handleFieldChange = async () => {
if (changedField) {
// 这里可以添加实际的更新逻辑,比如调用接口
try {
saveLabPat(changedField)
} catch (error) {
console.error('更新失败:', error);
// 失败时可以恢复旧值
emit('update:labPat', oldObj);
lastValue.value = JSON.stringify(oldObj);
}
}
}
};
// 保存病人信息
const saveLabPat = async (changedField: any) => {
if (props.labPat.id) {
updateLabPat({ ...props.labPatKey, ...props.labPat }).then((res: any) => {
if (res.code == 0) {
emit('getLabList', newObj);
if (sqhFlag.value) {
sqhValue.value = ''
sqhRef.value.focus()
@ -276,7 +287,7 @@ const handleFieldChange = async () => {
if (res.data) {
emit('update:labPat', res.data)
emit("changeStatus", props.labPat, sqhFlag.value);
emit("changeStatus", res.data, sqhFlag.value);
} else {
emit("changeStatus", props.labPat, sqhFlag.value);
}
@ -284,6 +295,7 @@ const handleFieldChange = async () => {
}
})
} else {
if (!changedField) return
changepatcolumn({ ...props.labPatKey, column: changedField?.field, value: changedField?.newValue }).then((res: any) => {
if (res.code == 0) {
if (sqhFlag.value) {
@ -303,14 +315,6 @@ const handleFieldChange = async () => {
})
}
} catch (error) {
console.error('更新失败:', error);
// 失败时可以恢复旧值
emit('update:labPat', oldObj);
lastValue.value = JSON.stringify(oldObj);
}
}
}
};
// 完善字段变化检测方法
@ -379,6 +383,11 @@ onMounted(() => {
listUser(data).then((res: any) => {
userList.value = res.rows;
});
// 监听保存病人结果
emitter.on('saveResult', () => {
saveLabPat(null)
})
})

View File

@ -2,7 +2,7 @@
<div class="table-container">
<CommonTable :table-data="labPatList" :loading="loading" :columns="tableColumns" :dict-data="dictData"
:row-config="{ isHover: true, keyField: 'ybh' }" @current-change="handleRowClick" size="small"
:cell-style="cellStyle" class="mytable-style" ref="tableRef" :enable-column-drag="true"
:row-style="rowStyle" :cell-style="cellStyle" class="mytable-style" ref="tableRef" :enable-column-drag="true"
@column-drag-end="handleColumnDragEnd">
<!-- 完成状态列 -->
<template #finish="{ row }">
@ -19,12 +19,18 @@
<template #brly="{ row }">
{{ formatDict(row.brly, 'PT') }}
</template>
<template #brxm="{ row }">
<span :style="{ color: row.jzbz == '1' ? '#f00' : '' }">{{ row.brxm }}</span>
</template>
<template #brxb="{ row }">
{{ formatDict(row.brxb, 'SX') }}
</template>
<template #nldw="{ row }">
{{ formatDict(row.nldw, 'AU') }}
</template>
<template #yblx="{ row }">
{{ formatDict(row.yblx, 'BT') }}
</template>
<template #ksdh="{ row }">
{{ formatDict(row.ksdh, 'DP') }}
</template>
@ -54,6 +60,7 @@
<script setup lang="ts">
import { ref, nextTick, onMounted } from 'vue'
import CommonTable from '@/components/vxeTable/index.vue'
import { color } from 'echarts'
const props = defineProps({
labPatList: {
@ -84,14 +91,14 @@ const tableColumns = ref([
{ field: 'autojgbz', title: '自', width: 20, align: 'center', slotName: 'autojgbz', resizable: true },
{ field: 'brly', title: '类型', width: 50, align: 'center', slotName: 'brly', resizable: true },
{ field: 'ybh', title: '样本号', width: 45, align: 'center', resizable: true },
{ field: 'brxm', title: '姓名', width: 40, align: 'center', resizable: true },
{ field: 'brxm', title: '姓名', width: 40, align: 'center', resizable: true, slotName: 'brxm' },
{ field: 'brdh', title: '病历号', width: 80, align: 'center', resizable: true },
{ field: 'ch', title: '床号', width: 40, align: 'center', resizable: true },
{ field: 'brxb', title: '性别', width: 30, align: 'center', slotName: 'brxb', resizable: true },
{ field: 'nl', title: '年', width: 30, align: 'center', resizable: true },
{ field: 'nldw', title: '龄', width: 20, align: 'center', slotName: 'nldw', resizable: true },
{ field: 'ksdh', title: '科室', width: 80, align: 'center', slotName: 'ksdh', resizable: true },
{ field: 'yblx', title: '标本', width: 50, align: 'center', resizable: true },
{ field: 'yblx', title: '标本', width: 50, align: 'center', resizable: true, slotName: 'yblx' },
{ field: 'dybz', title: '印', width: 20, align: 'center', slotName: 'dybz', resizable: true },
{ field: 'fslx', title: '发送', width: 30, align: 'center', slotName: 'fslx', resizable: true },
{ field: 'shcs', title: '次数', width: 30, align: 'center', resizable: true },
@ -125,15 +132,38 @@ const clearCurrentRow = () => {
const cellStyle = ({ row, column }: any) => {
if (column.title == "警" && row.alarmflag == 1) {
return { background: '#f00 !important', color: '#FFF' };
return { background: '#f00 !important' };
}
if (column.title == "审" && row.jgbz == '2') {
return { background: '#ffc0c0 !important', color: '#FFF' };
return { background: '#ffc0c0 !important' };
}
if (column.title == "类型" && row.brly == '1') { //门诊
return { background: '#e9e930 !important' };
}
if (column.title == "类型" && row.brly == '3') { // 住院
return { background: '#8bdaf1 !important' };
}
if (column.title == "类型" && row.brly == '4') { //体检
return { background: '#9ae382 !important' };
}
}
const rowStyle = ({ row }: any) => {
if (row.dybz == '1') {
return { background: '#C0C0C0 !important' };
}
if (row.lstd == '1') {
return { background: '#ed4ced !important' };
}
if (row.jgbz == '2') {
return { background: '#C0FFC0 !important' };
}
}
// 引入公共组件的字典格式化方法
const formatDict = (v: string, dictType: string) => {
return props.dictData[dictType]?.find((item: any) => item.value == v)?.label
return props.dictData[dictType]?.find((item: any) => item.value == v)?.label || v;
}
onMounted(() => {
const row = props.labPatList.find((item: any) => item.ybh == props.tableKey.ybh)

View File

@ -161,7 +161,7 @@
import { ref, toRefs, watch, nextTick, onMounted } from "vue";
import {
check1, check2, uncheck2, unconfirmlog, checkuser, reglimit, queryXmInfo, deleteresult, changeresult,
newresult, queryXmVal, printListwork, getresultchangelog
newresult, queryXmVal, printListwork, getresultchangelog, setinputmdl, saveResult
} from "@/api/liswork/work/LisWork";
import { ElMessageBox, ElMessage } from "element-plus";
import ItemInput from "@/views/liswork/work/components/ItemInput.vue";
@ -171,6 +171,10 @@ import CustomTable from '@/components/elTable/index.vue'
import dayjs from 'dayjs';
// @ts-ignore
import { listUser } from '@/api/system/user.js'
import emitter from "@/utils/mitt";
import { useCommonStore } from "@/store/modules/commonStore";
import { set } from "@vueuse/core";
// 组件属性定义
const props = defineProps({
resultSysList: { type: Array, required: true },
@ -185,6 +189,8 @@ const props = defineProps({
const { tableData, tableKey, } = toRefs(props);
const selectedRows = ref([]);
const lastjyrq = ref('');
const mbStore = useCommonStore();
watch(() => props.tableData, (newVal) => {
selectedRows.value = [];
if (newVal) {
@ -195,6 +201,30 @@ watch(() => props.tableData, (newVal) => {
lastjyrq.value = '上次结果'
}
}
if (props.labPat.jgbz != null && props.labPat.jgbz != 0 && props.labPat.jgbz != 'C') return;
// console.log('mbStore==>', mbStore.lxsrs);
if (mbStore.lxsrs.length > 0) {
mbStore.lxsrs.forEach((mbmc) => {
const data = {
...tableKey.value,
mbmc: mbmc,
}
setinputmdl(data).then((res) => {
if (res.code == 0) {
const existingNames = new Set(tableData.value.map(item => item.xmdh))
res.data?.forEach(item => {
if (!existingNames.has(item.xmdh)) {
tableData.value.push(item)
existingNames.add(item.xmdh)
}
})
}
});
});
}
});
watch(() => props.resultSysList, (newVal) => {
@ -601,8 +631,18 @@ const selectItem = (row) => {
*/
const handleCsjgEnter = async (row) => {
// 判断数据中包含模板新增的数据 flag
if (tableData.value.length == 0) return
const flag = tableData.value.some(item => item.changeflag == 2)
if (flag) {
saveResult(tableData.value).then((res) => {
if (res.code == 0) {
emitter.emit('saveResult');
}
})
} else {
if (row.id) {
emitter.emit('saveResult');
newresult(row).then(response => {
ElMessage.success("结果保存成功");
emits('fetchLabResults');
@ -622,6 +662,8 @@ const handleCsjgEnter = async (row) => {
const input = document.activeElement;
if (input.tagName === "INPUT") input.blur();
});
}
};
/**
@ -790,6 +832,32 @@ onMounted(() => {
listUser(data).then((res) => {
userList.value = res.rows;
});
// 获取模板项目
emitter.on('dbMbHandle', (info) => {
// console.log('data==>', info);
if (props.labPat.jgbz != null && props.labPat.jgbz != 0 && props.labPat.jgbz != 'C') return ElMessage.warning('已审核结果不可添加模板项目');
const data = {
...tableKey.value,
mbmc: info.mbmc,
}
setinputmdl(data).then((res) => {
if (res.code == 0) {
const existingNames = new Set(tableData.value.map(item => item.xmdh))
res.data?.forEach(item => {
if (!existingNames.has(item.xmdh)) {
tableData.value.push(item)
existingNames.add(item.xmdh)
}
})
handleCsjgEnter(null)
}
});
})
// 监听病人信息修改同时保存病人结果
emitter.on('saveLab', () => {
handleCsjgEnter(null)
})
});
const formatYs = (v) => {

View File

@ -34,7 +34,7 @@
<el-row :gutter="5">
<el-col :span="8">
<LabPat ref="labPatRef" v-model:labPat="labPat" :labPatKey="queryParams" :labSysList="labInputcolList"
@getLabList="getLabList" @changeStatus="changeStatus" />
@changeStatus="changeStatus" />
</el-col>
<el-col :span="16">
<LabResult ref="labResultRef" v-model:labPat="labPat" :tableData="labResuts" :tableKey="queryParams"
@ -142,6 +142,7 @@ import Clinical from './clinical/index.vue'
import Sample from './sample/index.vue'
import ResultGraph from './resultGraph/index.vue'
import { getNextNumber, getPreviousNumber } from "@/utils/getNextNumber";
import { useCommonStore } from '@/store/modules/commonStore';
const previewShow = ref(false);
@ -215,10 +216,11 @@ const handleinstrGroupChange = (val: any) => {
// labPat.value = {}
getYqConfig()
}
const mbStore = useCommonStore();
const yqHandleChange = (val: any) => {
labResuts.value = []
labPat.value = {}
mbStore.setLxsrList([]);
getSysList()
fetchlabPatList()
}
@ -327,11 +329,6 @@ const handleCreate = () => {
});
}
const getLabList = (data: any) => {
labPatList.value.push(data)
setTimeout(() => { handleQuery(); }, 10)
getTotals()
}
// 删除样本
const delSampleHd = () => {
@ -422,11 +419,12 @@ const handleNext = () => {
// 改变样本列表中样本状态
const changeStatus = (updatedPat: any, flag: boolean) => {
console.log('flag==>', flag, updatedPat);
console.log('changeStatusflag==>', flag, updatedPat);
queryLabPat(queryParams.value).then((response: any) => {
if (response.code == 0) {
labPat.value = response.data[0];
const index = labPatList.value.findIndex((item: any) => item.ybh == updatedPat.ybh);
console.log('index==>', index);
if (index !== -1) {
labPatList.value = labPatList.value.map((item, i) =>
i === index ? { ...labPat.value } : item
@ -436,11 +434,27 @@ const changeStatus = (updatedPat: any, flag: boolean) => {
nextTick(() => {
labPatListRef.value.setCurrentRow(labPat.value);
});
// selectJob(labPat.value);
console.log('changeStatusflag==>', flag);
// 条码号输入后操作
if (flag) {
setTimeout(() => { handleNext() }, 10)
} else {
fetchLabResults()
}
} else {
// 条码号输入后操作
if (flag) {
setTimeout(() => { handleNext() }, 10)
} else {
fetchLabResults()
}
labPatList.value.push(labPat.value)
setTimeout(() => {
nextTick(() => {
labPatListRef.value.setCurrentRow(labPat.value);
});
}, 10)
getTotals()
}
}
});
@ -506,10 +520,11 @@ const resultConfig = ref([])
const getSysList = () => {
instrdconfig({ yq: queryParams.value.yq }).then((res: any) => {
if (res.code == 0) {
labInputcolList.value = res.data.labInputcolList.filter((item: any) => item.mrts != '年龄单位' || item.mrts != '!')
labInputcolList.value = res.data.labInputcolList.filter((item: any) => item.mrts != "年龄单位" && item.mrts != "!")
resultConfig.value = res.data.ResultConfig
}
});
mbStore.setLxsrList([]);
}
getSysList()
onMounted(async () => {

View File

@ -248,11 +248,11 @@ const handleRowClick = (row: any) => {
const formatDict = (v: string, dictType: string) => {
return dictData.value[dictType]?.find((item: any) => item.value == v)?.label
return dictData.value[dictType]?.find((item: any) => item.value == v)?.label || v;
}
const formatyq = (v: string) => {
return instrOptions.value.find((item: any) => item.yq == v.trim())?.yqmc
return instrOptions.value.find((item: any) => item.yq == v.trim())?.yqmc || v;
}
</script>

View File

@ -539,7 +539,7 @@ onMounted(async () => {
// 字典格式化方法
const formatDict = (v: string, dictType: string) => {
return dictData.value[dictType]?.find((item: any) => item.value == v)?.label;
return dictData.value[dictType]?.find((item: any) => item.value == v)?.label || v;
};
</script>

View File

@ -615,7 +615,7 @@ onMounted(async () => {
// 字典格式化方法
const formatDict = (v: string, dictType: string) => {
return dictData.value[dictType]?.find((item: any) => item.value == v)?.label;
return dictData.value[dictType]?.find((item: any) => item.value == v)?.label || v;
};
</script>