From 2a3c19900a0fa51bdc03ec7f73573b200bc908d8 Mon Sep 17 00:00:00 2001 From: wyuu Date: Thu, 16 Oct 2025 11:20:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E9=AA=8C=E5=BD=95=E5=85=A5=E5=B7=A6?= =?UTF-8?q?=E4=BE=A7=E5=8A=A8=E6=80=81=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/liswork/work/LisWork.ts | 51 ++- src/assets/styles/ruoyi.scss | 12 + src/components/SelectTable/index.vue | 88 ++-- src/components/elTable/index.vue | 20 +- src/components/projectsjg/index.vue | 2 + src/components/vxeTable/index.vue | 9 + src/utils/getNextNumber.ts | 57 +++ src/views/liswork/work/charge/index.vue | 159 +++++++ src/views/liswork/work/clinical/index.vue | 11 + src/views/liswork/work/combination/index.vue | 11 + .../liswork/work/components/labpat copy.vue | 398 ++++++++++++++++++ src/views/liswork/work/components/labpat.vue | 246 +++++------ .../liswork/work/components/labpatlist.vue | 4 + src/views/liswork/work/history/index.vue | 147 +++++++ src/views/liswork/work/index.vue | 271 ++++++++---- src/views/liswork/work/others/index.vue | 87 ++++ .../liswork/work/reexamination/index.vue | 11 + src/views/liswork/work/sample/index.vue | 11 + 18 files changed, 1346 insertions(+), 249 deletions(-) create mode 100644 src/utils/getNextNumber.ts create mode 100644 src/views/liswork/work/charge/index.vue create mode 100644 src/views/liswork/work/clinical/index.vue create mode 100644 src/views/liswork/work/combination/index.vue create mode 100644 src/views/liswork/work/components/labpat copy.vue create mode 100644 src/views/liswork/work/history/index.vue create mode 100644 src/views/liswork/work/others/index.vue create mode 100644 src/views/liswork/work/reexamination/index.vue create mode 100644 src/views/liswork/work/sample/index.vue diff --git a/src/api/liswork/work/LisWork.ts b/src/api/liswork/work/LisWork.ts index cde3523..533fe2b 100644 --- a/src/api/liswork/work/LisWork.ts +++ b/src/api/liswork/work/LisWork.ts @@ -44,7 +44,7 @@ export function changeresult(data?: Object) { }) } -//修改病人信息 +//新建样本病人信息 export function updateLabPat(data?: Object) { return request({ url: '/lisworkoper/changepat', @@ -52,6 +52,7 @@ export function updateLabPat(data?: Object) { data }) } +// 修改病人信息 export function changepatcolumn(query?: Object) { return request({ url: '/lisworkoper/changepatcolumn', @@ -159,4 +160,52 @@ export function printListwork(query?: Object) { method: 'get', params: query }) +} +// 查询默认值 +export function loadDefault(query?: Object) { + return request({ + url: '/lisworkoper/loaddefault', + method: 'get', + params: query + }) +} +// 历史对照 +export function historyInfo(query?: Object) { + return request({ + url: '/lisworkpageinfo/history', + method: 'get', + params: query + }) +} +// 其他结果 +export function otherinstr(query?: Object) { + return request({ + url: '/lisworkpageinfo/otherinstr', + method: 'get', + params: query + }) +} +// 收费信息 +export function reqdetail(query?: Object) { + return request({ + url: '/lisworkpageinfo/reqdetail', + method: 'get', + params: query + }) +} +// 获取收费信息报告明细 +export function reqdetailmx(query?: Object) { + return request({ + url: '/lisworkpageinfo/reqdetailmx', + method: 'get', + params: query + }) +} +// 左边form参数 +export function instrdconfig(query?: Object) { + return request({ + url: '/liswork/instrdconfig', + method: 'get', + params: query + }) } \ No newline at end of file diff --git a/src/assets/styles/ruoyi.scss b/src/assets/styles/ruoyi.scss index 5439e5e..e49b5de 100644 --- a/src/assets/styles/ruoyi.scss +++ b/src/assets/styles/ruoyi.scss @@ -200,6 +200,18 @@ &:hover { box-shadow: 0 0 0 1px #1f6dd3 inset !important; } + + + } + + .el-select__wrapper.is-disabled { + background-color: #ccc !important; + color: #000 !important; + } + + .el-input.is-disabled .el-input__wrapper { + background-color: #ccc !important; + color: #000 !important; } diff --git a/src/components/SelectTable/index.vue b/src/components/SelectTable/index.vue index fa0e743..3a4e301 100644 --- a/src/components/SelectTable/index.vue +++ b/src/components/SelectTable/index.vue @@ -18,7 +18,8 @@ @@ -135,8 +89,25 @@ import { ref, reactive, watch, toRaw, computed, onMounted } from 'vue'; import { changepatcolumn, updateLabPat } from "@/api/liswork/work/LisWork"; import SelectTable from '@/components/SelectTable/index.vue'; +// @ts-ignore +import { listUser } from '@/api/system/user.js' +import { PropType } from 'vue'; +interface LabSysItem { + kj: string; + dict: string; + kybj: string; + zdlb: string; + zdmc: string; + zdts: string; + xh: number; + mrts: string; +} const props = defineProps({ + labSysList: { + type: Array as PropType, + required: true + }, labPat: { type: Object, required: true @@ -157,7 +128,7 @@ watch(() => props.labPat, (newVal) => { lastJgbz.value = newVal.jgbz; }) -const emit = defineEmits(['update:labPat']); +const emit = defineEmits(['update:labPat', 'getLabList']); const lastValue = ref(''); const brlyFields = ref([ @@ -169,6 +140,10 @@ const ksdhFields = ref([ { prop: 'value', label: '代号', width: 80, enablePinyinSearch: true }, { prop: 'label', label: '名称', width: 150, enablePinyinSearch: true }, ]) +const ysFields = ref([ + { prop: 'userName', label: '用户代号', width: 80, enablePinyinSearch: true }, + { prop: 'nickName', label: '用户姓名', width: 150, enablePinyinSearch: true }, +]) /** * 通用字段变化处理(失焦、回车触发) */ @@ -184,8 +159,16 @@ const handleFieldChange = async () => { if (changedField) { // 这里可以添加实际的更新逻辑,比如调用接口 try { - changepatcolumn({ ...props.labPatKey, column: changedField?.field, value: changedField?.newValue }).then((res: any) => { - }); + if (props.labPat.id) { + updateLabPat({ ...props.labPatKey, column: changedField?.field, value: changedField?.newValue }).then((res: any) => { + if (res.code == 0) { + emit('getLabList', newObj); + } + }) + } else { + changepatcolumn({ ...props.labPatKey, column: changedField?.field, value: changedField?.newValue }) + } + } catch (error) { console.error('更新失败:', error); // 失败时可以恢复旧值 @@ -256,34 +239,16 @@ const getColor = (type: string) => { return 'default'; } } +const userList = ref([]); +onMounted(() => { + const data = { status: 0, del_flag: 0, pageSize: 1000, pageNum: 1 } + listUser(data).then((res: any) => { + userList.value = res.rows; + }); +}) -/** - * 字典选择完成处理(弹窗选择后触发) - */ -const handleDictSelect = async () => { - // 字典选择后直接触发更新 -}; - -// 重置方法 -const resetMain = () => { - const resetData = { - ...props.labPat, - brly: '', - brlyLabel: '', - ksdh: '', - ksdhLabel: '', - brxb: '', - brxbLabel: '', - nldw: '', - nldwLabel: '', - jzbz: '0', - jgbz: 0 - }; - emit('update:labPat', resetData); - lastValue.value = JSON.stringify(resetData); -}; @@ -294,6 +259,11 @@ const resetMain = () => { flex-direction: column; overflow: hidden; + .check_box { + :deep(.el-checkbox__input.is-checked+.el-checkbox__label) { + color: #f00 !important; + } + } :deep(.el-input__wrapper) { box-shadow: 0 0 0 1px #96B8D9 inset; diff --git a/src/views/liswork/work/components/labpatlist.vue b/src/views/liswork/work/components/labpatlist.vue index f1312cb..234ef2d 100644 --- a/src/views/liswork/work/components/labpatlist.vue +++ b/src/views/liswork/work/components/labpatlist.vue @@ -110,6 +110,9 @@ const tableRef = ref() const setCurrentRow = (row: any) => { tableRef.value.setCurrentRow(row) } +const clearCurrentRow = () => { + tableRef.value.clearCurrentRow() +} // 引入公共组件的字典格式化方法 const formatDict = (v: string, dictType: string) => { return props.dictData[dictType]?.find((item: any) => item.value == v)?.label @@ -118,6 +121,7 @@ const formatDict = (v: string, dictType: string) => { // 暴露公共方法 defineExpose({ setCurrentRow, + clearCurrentRow, tableRef, }) diff --git a/src/views/liswork/work/history/index.vue b/src/views/liswork/work/history/index.vue new file mode 100644 index 0000000..0ccb43e --- /dev/null +++ b/src/views/liswork/work/history/index.vue @@ -0,0 +1,147 @@ + + + + + \ No newline at end of file diff --git a/src/views/liswork/work/index.vue b/src/views/liswork/work/index.vue index 13147ea..4734491 100644 --- a/src/views/liswork/work/index.vue +++ b/src/views/liswork/work/index.vue @@ -23,18 +23,19 @@ value="yq" objKey="yq" :border="true" width="140px" placeholder="请选择仪器" @getDataValue="yqHandleChange" /> - + - +
- - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + +
@@ -119,18 +151,21 @@ import LabResult from './components/labresult.vue'; import LabPatList from './components/labpatlist.vue'; // @ts-ignore import { comDict } from '@/utils/dict' -import { - getDate, queryLabPatList, queryLabResults, updateLabPat, queryLabPat, - check2, uncheck2, unconfirmlog, checkuser, reglimit, queryXmInfo -} from "@/api/liswork/work/LisWork"; +import { queryLabPatList, queryLabResults, loadDefault, queryLabPat, instrdconfig } from "@/api/liswork/work/LisWork"; import { querylabInstrList, querylabInstrListByLisgroup } from "@/api/liswork/dict/LabInstr"; import { getComDicts, queryComDictListService } from "@/api/liswork/dict/ComDict"; - import { ElMessage, ElMessageBox } from "element-plus"; - +import History from './history/index.vue' +import Others from './others/index.vue' +import Reexamination from './reexamination/index.vue' +import Charge from './charge/index.vue' +import Combination from './combination/index.vue' +import Clinical from './clinical/index.vue' +import Sample from './sample/index.vue' +import { getNextNumber, getPreviousNumber } from "@/utils/getNextNumber"; const previewShow = ref(false); - +const lbFlag = ref(false); const queryParams = ref({ pageNum: 1, pageSize: 2000, @@ -187,7 +222,7 @@ const total = ref(0) const rules = ref([]) const instrGroupOptions = ref([]) -const instrOptions = ref<{ label: string, value: string }[]>([]) +const instrOptions = ref<{ yq: string; yqmc: string }[]>([]) const pdfUrl = ref('') const previewHandle = (url: string) => { @@ -205,6 +240,7 @@ const handleinstrGroupChange = (val: any) => { const yqHandleChange = (val: any) => { labResuts.value = [] labPat.value = {} + getSysList() fetchlabPatList() } const instrGroupFields = ref([ @@ -250,7 +286,7 @@ const selectJob = (job: any) => { queryParams.value.ybh = job.ybh; fetchLabResults(); fetchLabPat(); - highlightRowIndex.value = labPatList.value.findIndex((item: any) => item.ybh.toLowerCase().includes(queryParams.value.ybh)); + highlightRowIndex.value = labPatList.value.findIndex((item: any) => item.ybh == queryParams.value.ybh); } const labResuts = ref([]) //载入样本结果表单(中间labresult.vue组件) @@ -274,9 +310,8 @@ const handleQuery = () => { highlightRowIndex.value = -1; return; } - // 查找匹配的行 - const matchedIndex = labPatList.value.findIndex((item: any) => item.ybh.toLowerCase().includes(queryParams.value.ybh)); + const matchedIndex = labPatList.value.findIndex((item: any) => item.ybh == queryParams.value.ybh); const row = labPatList.value[matchedIndex] if (matchedIndex !== -1) { highlightRowIndex.value = matchedIndex; @@ -284,27 +319,83 @@ const handleQuery = () => { nextTick(() => { labPatListRef.value.setCurrentRow(row); }); + selectJob(row); } else { + handleCreate() highlightRowIndex.value = -1; } - selectJob(row); + } -const handlePrev = () => { - if (highlightRowIndex.value > 0) { - highlightRowIndex.value--; - const row = labPatList.value[highlightRowIndex.value]; - labPatListRef.value.setCurrentRow(row); - selectJob(row); - } +// 创建新样本 +const handleCreate = () => { + loadDefault(queryParams.value).then((response: any) => { + if (response.code == 0) { + labPat.value = response.data; + labPat.value.id = `temp_${Date.now()}_${Math.random().toString(36).substr(2, 8)}`; + labResuts.value = [] + + labPatListRef.value?.clearCurrentRow(); + + } + }); } -const handleNext = () => { - if (highlightRowIndex.value < labPatList.value.length - 1) { - highlightRowIndex.value++; - const row = labPatList.value[highlightRowIndex.value]; - labPatListRef.value.setCurrentRow(row); - selectJob(row); + +const getLabList = (data: any) => { + labPatList.value.push(data) + setTimeout(() => { handleQuery(); }, 100) +} +// 上一个样本 +const handlePrev = () => { + if (!lbFlag.value) { + const ybh = getPreviousNumber(queryParams.value.ybh) as string; + queryParams.value.ybh = ybh; + const index = labPatList.value.findIndex((item: any) => item.ybh == ybh) + if (index !== -1) { + highlightRowIndex.value = index; + const row = labPatList.value[index]; + labPatListRef.value.setCurrentRow(row); + selectJob(row); + } else { + handleCreate(); + } + } else { + if (highlightRowIndex.value > 0) { + highlightRowIndex.value--; + const row = labPatList.value[highlightRowIndex.value]; + labPatListRef.value.setCurrentRow(row); + selectJob(row); + } } + +} + +// 下一个样本 +const handleNext = () => { + if (!lbFlag.value) { + const ybh = getNextNumber(queryParams.value.ybh) as string; + queryParams.value.ybh = ybh; + const index = labPatList.value.findIndex((item: any) => item.ybh == ybh) + if (index !== -1) { + highlightRowIndex.value = index; + const row = labPatList.value[index]; + labPatListRef.value.setCurrentRow(row); + selectJob(row); + } else { + handleCreate(); + } + } else { + if (highlightRowIndex.value < labPatList.value.length - 1) { + highlightRowIndex.value++; + const row = labPatList.value[highlightRowIndex.value]; + labPatListRef.value.setCurrentRow(row); + selectJob(row); + } else { + queryParams.value.ybh = getNextNumber(queryParams.value.ybh) as string; + handleCreate(); + } + } + } @@ -369,27 +460,36 @@ interface DictData { BT?: Array; SRD?: Array; HOS?: Array; + ST?: Array; [key: string]: any[] | undefined; // 添加索引签名以支持动态访问 } // 字典数据存储 const dictData = ref({}); - +const labInputcolList = 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 != '!') + } + }); +} +getSysList() onMounted(async () => { - // 加载病人来源字典 - const dictRefs = await comDict('PT', 'AU', 'SX', 'DP', 'BT', 'SRD', 'HOS'); - - // 从 ref 中获取实际数据 - dictData.value = { - PT: toRaw(dictRefs.PT.value) || [], - AU: toRaw(dictRefs.AU.value) || [], - SX: toRaw(dictRefs.SX.value) || [], - DP: toRaw(dictRefs.DP.value) || [], - BT: toRaw(dictRefs.BT.value) || [], - SRD: toRaw(dictRefs.SRD.value) || [], - HOS: toRaw(dictRefs.HOS.value) || [], - }; - + // // 加载病人来源字典 + // const dictRefs = await comDict('PT', 'AU', 'SX', 'DP', 'BT', 'SRD', 'HOS', 'ST'); + // // 从 ref 中获取实际数据 + // dictData.value = { + // PT: toRaw(dictRefs.PT.value) || [], + // AU: toRaw(dictRefs.AU.value) || [], + // SX: toRaw(dictRefs.SX.value) || [], + // DP: toRaw(dictRefs.DP.value) || [], + // BT: toRaw(dictRefs.BT.value) || [], + // SRD: toRaw(dictRefs.SRD.value) || [], + // HOS: toRaw(dictRefs.HOS.value) || [], + // ST: toRaw(dictRefs.ST.value) || [], + // }; }); @@ -428,6 +528,7 @@ onMounted(async () => { border: 1px solid #fff; border-radius: 12px; background-color: #fff; + cursor: pointer; .text { font-weight: 400; diff --git a/src/views/liswork/work/others/index.vue b/src/views/liswork/work/others/index.vue new file mode 100644 index 0000000..8f67b94 --- /dev/null +++ b/src/views/liswork/work/others/index.vue @@ -0,0 +1,87 @@ + + + + + \ No newline at end of file diff --git a/src/views/liswork/work/reexamination/index.vue b/src/views/liswork/work/reexamination/index.vue new file mode 100644 index 0000000..1a5d6ae --- /dev/null +++ b/src/views/liswork/work/reexamination/index.vue @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file diff --git a/src/views/liswork/work/sample/index.vue b/src/views/liswork/work/sample/index.vue new file mode 100644 index 0000000..a8efe06 --- /dev/null +++ b/src/views/liswork/work/sample/index.vue @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file