diff --git a/src/api/liswork/micro/index.ts b/src/api/liswork/micro/index.ts index 0acd6c5..bc1ae45 100644 --- a/src/api/liswork/micro/index.ts +++ b/src/api/liswork/micro/index.ts @@ -19,6 +19,14 @@ export function wswsamplelistpage(query?: Object) { }) } // 获取微生物样本信息 +export function wswsampleinfo(query?: Object) { + return request({ + url: '/lisworkgerm/germsampleinfo', + method: 'get', + params: query + }) +} +// 获取微生物结果信息 export function sampleMedInfo(query?: Object) { return request({ url: '/lisworkgerm/getresultlist', diff --git a/src/assets/styles/ruoyi.scss b/src/assets/styles/ruoyi.scss index 7e7c07d..c69d1db 100644 --- a/src/assets/styles/ruoyi.scss +++ b/src/assets/styles/ruoyi.scss @@ -5,67 +5,67 @@ /** 基础通用 **/ .pt5 { - padding-top: 5px; + padding-top: .3125rem; } .pr5 { - padding-right: 5px; + padding-right: .3125rem; } .pb5 { - padding-bottom: 5px; + padding-bottom: .3125rem; } .mt5 { - margin-top: 5px; + margin-top: .3125rem; } .mr5 { - margin-right: 5px; + margin-right: .3125rem; } .mb5 { - margin-bottom: 5px; + margin-bottom: .3125rem; } .mb8 { - margin-bottom: 8px; + margin-bottom: .5rem; } .ml5 { - margin-left: 5px; + margin-left: .3125rem; } .mt10 { - margin-top: 10px; + margin-top: .625rem; } .mr10 { - margin-right: 10px; + margin-right: .625rem; } .mb10 { - margin-bottom: 10px; + margin-bottom: .625rem; } .ml10 { - margin-left: 10px; + margin-left: .625rem; } .mt20 { - margin-top: 20px; + margin-top: 1.25rem; } .mr20 { - margin-right: 20px; + margin-right: 1.25rem; } .mb20 { - margin-bottom: 20px; + margin-bottom: 1.25rem; } .ml20 { - margin-left: 20px; + margin-left: 1.25rem; } .cp { @@ -213,8 +213,8 @@ .el-table__body-wrapper .el-table-column--selection>.cell { padding: 0 !important; - height: 30px; - line-height: 30px; + height: 1.875rem; + line-height: 1.875rem; } .el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell { @@ -224,8 +224,8 @@ .cell.el-tooltip { padding: 0 !important; - height: 30px; - line-height: 30px; + height: 1.875rem; + line-height: 1.875rem; } .el-table-header-cell .cell { @@ -241,8 +241,8 @@ .el-table__cell { padding: 0 !important; - height: 30px; - line-height: 30px; + height: 1.875rem; + line-height: 1.875rem; } .el-checkbox { diff --git a/src/utils/request.js b/src/utils/request.js index 311bc7a..e37edb9 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -120,6 +120,9 @@ service.interceptors.response.use(res => { if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') { return res.data } + if (code == -1) { + return Promise.resolve(res.data) + } if (code === 401) { if (!isRelogin.show) { isRelogin.show = true; diff --git a/src/views/liswork/components/history/index.vue b/src/views/liswork/components/history/index.vue index eff959b..81a8e66 100644 --- a/src/views/liswork/components/history/index.vue +++ b/src/views/liswork/components/history/index.vue @@ -134,6 +134,9 @@ const formatHeader = (column: any, prefix: string) => { const getList = () => { historyInfo(queryParams.value).then((res: any) => { + tableData.value = [] + getEcharts(null) + if (!res.data) return const periods = ['first', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']; const dataMaps = new Map(); @@ -194,9 +197,12 @@ const getList = () => { return row; }); nextTick(() => { - tableRef.value.setCurrentRow(tableData.value[0]); - getEcharts(tableData.value[0]) + if (tableData.value.length) { + tableRef.value.setCurrentRow(tableData.value[0]); + getEcharts(tableData.value[0]) + } }) + // console.log('合并后的表格数据==>', tableData.value); }); }; @@ -217,9 +223,27 @@ const handleRowClick = (row: any) => { const myEcharts = ref() const getEcharts = (data: any) => { const periods = ['nine', 'eight', 'seven', 'six', 'five', 'four', 'three', 'two', 'one', 'first'] - if (!data) return + + if (!data) { + // 数据为空时清空图表 + if (myEcharts.value) { + const existingInstance = echarts.getInstanceByDom(myEcharts.value); + if (existingInstance) { + existingInstance.clear(); + } + } + return; + } const xData = periods.map(period => { return data[`${period}Date`] })?.filter(Boolean) //过滤掉空值 const yData = periods.map(period => { return data[`${period}Csjg`] })?.filter(Boolean) + // 先获取已有实例并销毁 + if (myEcharts.value) { + const existingInstance = echarts.getInstanceByDom(myEcharts.value); + if (existingInstance) { + echarts.dispose(existingInstance); + } + } + const Intance = echarts.init(myEcharts.value); diff --git a/src/views/liswork/components/othersResult/index.vue b/src/views/liswork/components/othersResult/index.vue index 6a002f9..bb28c2e 100644 --- a/src/views/liswork/components/othersResult/index.vue +++ b/src/views/liswork/components/othersResult/index.vue @@ -153,7 +153,10 @@ const formatHeader = (column: any, prefix: string) => { }; // 获取其他结果信息 const getOthersInfo = () => { + tableData.value = [] + tableDataDetail.value = [] otherinstr(queryParams.value).then((res: any) => { + if (!res.data) return tableData.value = res.data.map((item: any) => { return { ...item, @@ -185,6 +188,7 @@ const handleRowClick = (row: any) => { ybh: row.ybh } otherInstrDetail(data).then((res: any) => { + if (!res.data) return const periods = ['first', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']; const dataMaps = new Map(); diff --git a/src/views/liswork/components/wswHistory/index.vue b/src/views/liswork/components/wswHistory/index.vue new file mode 100644 index 0000000..a0dfb53 --- /dev/null +++ b/src/views/liswork/components/wswHistory/index.vue @@ -0,0 +1,210 @@ + + + + + \ No newline at end of file diff --git a/src/views/liswork/micro/index.vue b/src/views/liswork/micro/index.vue index 86fe029..3477757 100644 --- a/src/views/liswork/micro/index.vue +++ b/src/views/liswork/micro/index.vue @@ -159,7 +159,7 @@ import tabView from '@/components/tabViews/index.vue'; // @ts-ignore import iFrame from "@/components/iFrame/index.vue"; import LabPatList from './labpatlist.vue'; -import History from '../components/history/index.vue' +import History from '../components/wswHistory/index.vue' import OthersResult from '../components/othersResult/index.vue' import Reexamination from '../components/reexamination/index.vue' import Charge from '../components/charge/index.vue' @@ -176,8 +176,8 @@ import Pyj from './labresult/pyj.vue'; import Record from './labresult/record.vue'; // @ts-ignore import { comDict } from '@/utils/dict' -import { queryLabResults, loadDefault, queryLabPat, instrdconfig, delSample, getGroupInstrdList, checkuser, updateLabPat } from "@/api/liswork/work/LisWork"; -import { wswsamplelistpage, sampleMedInfo, changepatjyrq } from "@/api/liswork/micro/index"; +import { queryLabResults, loadDefault, instrdconfig, delSample, getGroupInstrdList, checkuser, updateLabPat } from "@/api/liswork/work/LisWork"; +import { wswsamplelistpage, sampleMedInfo, changepatjyrq, wswsampleinfo } from "@/api/liswork/micro/index"; import { getComDicts, queryComDictListService } from "@/api/liswork/dict/ComDict"; import { ElMessage, ElMessageBox } from "element-plus"; import BatchCode from '../work/components/batchCode.vue'; @@ -481,7 +481,7 @@ const fetchLabPat = () => { yq: labInfo.value.yq, ybh: labInfo.value.ybh } - queryLabPat(data).then((response: any) => { + wswsampleinfo(data).then((response: any) => { labPat.value = response.data; }) } @@ -506,19 +506,25 @@ const handleQuery = () => { // queryParams.value = { ...queryParams.value }; // 查找匹配的行 const matchedIndex = labPatList.value.findIndex((item: any) => item.ybh == queryParams.value.ybh); - const row = labPatList.value[matchedIndex] - if (matchedIndex !== -1) { - highlightRowIndex.value = matchedIndex; - // 等待DOM更新后滚动到目标行 - nextTick(() => { - labPatListRef.value.setCurrentRow(row); - }); - selectJob(row); - } else { - handleCreate() - highlightRowIndex.value = -1; - } + // 查询样本信息是否存在 + wswsampleinfo(queryParams.value).then((response: any) => { + if (response.data) { + if (matchedIndex !== -1) { + highlightRowIndex.value = matchedIndex; + // 等待DOM更新后滚动到目标行 + nextTick(() => { + if (activeTab.value == 'LabPatList') { + labPatListRef.value.setCurrentRow(response.data); + } + }); + } + selectJob(response.data); + } else { + handleCreate() + highlightRowIndex.value = -1; + } + }) } @@ -652,7 +658,7 @@ const changeStatus = (updatedPat: any, flag: boolean) => { yq: updatedPat.yq.trim(), ybh: updatedPat.ybh, } - queryLabPat(data).then((response: any) => { + wswsampleinfo(data).then((response: any) => { if (response.code == 0) { labPat.value = response.data; const index = labPatList.value.findIndex((item: any) => item.ybh == updatedPat.ybh); diff --git a/src/views/liswork/micro/labresult/zbReport.vue b/src/views/liswork/micro/labresult/zbReport.vue index 31ef8a5..88f9ce2 100644 --- a/src/views/liswork/micro/labresult/zbReport.vue +++ b/src/views/liswork/micro/labresult/zbReport.vue @@ -128,7 +128,7 @@ 评语模板 确定 + @click="handleTextarea">保存 清除 @@ -670,6 +670,8 @@ const mbStore = useCommonStore(); const tableData: any = ref([]) watch(labResutsData, (newVal: any) => { + console.log("🚀 ~ newVal:", newVal) + if (newVal.length) { tableData.value = newVal.map((item: any) => { return { @@ -688,7 +690,7 @@ watch(labResutsData, (newVal: any) => { ymselectedRows.value = [] } - if (props.labPat.jgbz != null && props.labPat.jgbz != 0 && props.labPat.jgbz != 'C') return; + if (labPat.value.jgbz == 2) return; // console.log('mbStore==>', mbStore.lxsrs); if (mbStore.lxsrs.length > 0) { mbStore.lxsrs.forEach((mbmc) => { @@ -714,7 +716,6 @@ watch(labResutsData, (newVal: any) => { const handleTextarea = () => { if (!rowInfo.value.xmdh) return - if (!textarea.value) return ElMessage.warning('请填写专家评语!') savetestResult({ ...rowInfo.value, textresult: textarea.value }).then((res: any) => { if (res.code == 0) { ElMessage.success('保存成功'); @@ -723,15 +724,16 @@ const handleTextarea = () => { }; const rowInfo: any = ref({}) const rowHandle = (row: any) => { + console.log('row==>', row); selectedRows.value = [row]; emitter.emitWithCache('refreshClinical', row); rowInfo.value = row textarea.value = row.textresult const data = { - ybh: labPat.value.ybh, - yq: labPat.value.yq, - jyrq: labPat.value.jyrq, + ybh: row.ybh, + yq: row.yq, + jyrq: row.jyrq, xmdh: row.xmdh } getresultmedList(data).then((res: any) => { @@ -1053,6 +1055,7 @@ const formatJgbz = (v: string) => { .el-radio { margin-right: .3125rem; + height: 1.875rem; :deep(.el-radio__label) { padding-left: 2px !important; diff --git a/src/views/liswork/work/index.vue b/src/views/liswork/work/index.vue index 9905d24..7bba2ab 100644 --- a/src/views/liswork/work/index.vue +++ b/src/views/liswork/work/index.vue @@ -399,22 +399,27 @@ const handleQuery = () => { return; } queryParams.value = { ...queryParams.value }; + + // 查找匹配的行 const matchedIndex = labPatList.value.findIndex((item: any) => item.ybh == queryParams.value.ybh); - const row = labPatList.value[matchedIndex] - - if (matchedIndex !== -1) { - highlightRowIndex.value = matchedIndex; - // 等待DOM更新后滚动到目标行 - nextTick(() => { - labPatListRef.value.setCurrentRow(row); - }); - selectJob(row); - } else { - handleCreate() - highlightRowIndex.value = -1; - } + // 查询样本信息是否存在 + queryLabPat(queryParams.value).then((response: any) => { + if (response.data) { + highlightRowIndex.value = matchedIndex; + // 等待DOM更新后滚动到目标行 + nextTick(() => { + if (activeTab.value == 'LabPatList') { + labPatListRef.value.setCurrentRow(response.data); + } + }); + selectJob(response.data); + } else { + handleCreate() + highlightRowIndex.value = -1; + } + }) } // 创建新样本