抗生素
This commit is contained in:
parent
8a286cb65f
commit
b24b232493
@ -75,4 +75,52 @@ export function saveresult(data?: Object) {
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
//获取药敏字典
|
||||
export function getmeddictList(data?: Object) {
|
||||
return request({
|
||||
url: '/lisworkgerm/getmeddict',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
//获取药敏模板
|
||||
export function getmedgroupList(data?: Object) {
|
||||
return request({
|
||||
url: '/lisworkgerm/getmedgrouplist',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
//获取药敏模板明细
|
||||
export function getmedgroupMbList(data?: Object) {
|
||||
return request({
|
||||
url: '/lisworkgerm/getmedgroup',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
//保存药敏结果
|
||||
export function savemedresult(data?: Object) {
|
||||
return request({
|
||||
url: '/lisworkgerm/savemedresult',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
//保存所有药敏结果
|
||||
export function savemedresultall(data?: Object) {
|
||||
return request({
|
||||
url: '/lisworkgerm/savemedresultall',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
//删除药敏结果
|
||||
export function deletemedresult(data?: Object) {
|
||||
return request({
|
||||
url: '/lisworkgerm/deletemedresult',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
@ -97,3 +97,19 @@
|
||||
font-size: 14px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
|
||||
.btn_green {
|
||||
background-color: #aef5ef !important;
|
||||
color: #148A7F;
|
||||
border-color: #aef5ef;
|
||||
}
|
||||
|
||||
.btns_box {
|
||||
padding: .3125rem .625rem !important;
|
||||
font-size: .875rem;
|
||||
height: 1.25rem !important;
|
||||
margin: 5px 0;
|
||||
margin-left: .625rem !important;
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
@ -337,11 +337,6 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.btn_green {
|
||||
background-color: #aef5ef !important;
|
||||
color: #148A7F;
|
||||
border-color: #aef5ef;
|
||||
}
|
||||
|
||||
// 表格input宽度,表格select宽度
|
||||
.full-width-input .el-input__inner .el-select__inner {
|
||||
|
||||
23
src/types/Object.d.ts
vendored
23
src/types/Object.d.ts
vendored
@ -126,4 +126,27 @@ export class XmInfoVs {
|
||||
ckxx?: number;
|
||||
dyckz?: string;
|
||||
|
||||
}
|
||||
|
||||
|
||||
export class LabResultItem {
|
||||
xmdh: string;
|
||||
xmmc: string;
|
||||
csjg: string;
|
||||
qz: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export class ymTableDataItem {
|
||||
zhywdh: string;
|
||||
ywdh: any;
|
||||
ywmc: any;
|
||||
mic: string;
|
||||
rad: string;
|
||||
csjg: string;
|
||||
jgbz: string;
|
||||
ckz: string;
|
||||
bz: string;
|
||||
txtresult: string;
|
||||
cp_bz: string;
|
||||
}
|
||||
@ -52,11 +52,13 @@
|
||||
<el-tabs v-model="activeName" type="card" class="demo-tabs">
|
||||
<el-tab-pane label="鉴定(终报)结果" name="first">
|
||||
<ZbReport ref="labResultRef" v-model:labPat="labInfo" :labPatKey="queryParams" :dictData="dictData"
|
||||
:labResutsData="labResuts" @fetchLabResults="resultsHandle" @changeStatus="changeStatus"
|
||||
:labResutsData="zbLabResuts" @fetchLabResults="resultsHandle" @changeStatus="changeStatus"
|
||||
@previewHandle="previewHandle" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="初级和二级报告" name="second">
|
||||
<CbReport :labResutsData="labResuts" :labPat="labInfo" />
|
||||
<CbReport v-model:labPat="labInfo" :labPatKey="queryParams" :dictData="dictData"
|
||||
:labResutsData="zbLabResuts" @fetchLabResults="resultsHandle" @changeStatus="changeStatus"
|
||||
@previewHandle="previewHandle" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="培养基接种" name="third">
|
||||
<Byj />
|
||||
@ -95,15 +97,16 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="radio_box">
|
||||
<el-radio-group v-model="queryParams.days" @change="fetchlabPatList">
|
||||
<el-radio :value="0">所有</el-radio>
|
||||
<el-radio-group v-model="queryParams.days" @change="fetchlabPatList" :size="aotuSize">
|
||||
<el-radio :value="-1">所有</el-radio>
|
||||
<el-radio :value="30">近30天</el-radio>
|
||||
<el-radio :value="60">近60天</el-radio>
|
||||
<el-radio :value="90">近90天</el-radio>
|
||||
<el-radio :value="7">近7天</el-radio>
|
||||
<el-radio :value="1">此日 -></el-radio>
|
||||
<el-radio :value="0">此日 -></el-radio>
|
||||
</el-radio-group>
|
||||
<el-date-picker v-model="queryParams.jyrq" type="date" :size="aotuSize" @change="fetchlabPatList" />
|
||||
<el-date-picker v-model="queryParams.jyrq" type="date" :size="aotuSize" @change="fetchlabPatList"
|
||||
style="width: 9.375rem;" />
|
||||
</div>
|
||||
<LabPatList ref="labPatListRef" :labPatList="labPatList" :loading="loading" @select="selectJob"
|
||||
:tableKey="queryParams" :dictData="dictData" @search="searchJobs" />
|
||||
@ -186,7 +189,7 @@ const queryParams = ref({
|
||||
ybh: '',
|
||||
instrGroup: '04',
|
||||
problemId: 0,
|
||||
days: 90,
|
||||
days: -1,
|
||||
pageSize: 600,
|
||||
pageNum: 1
|
||||
})
|
||||
@ -252,6 +255,11 @@ interface QueryParams {
|
||||
|
||||
watch(() => labPat.value, (newValue) => {
|
||||
queryParams.value.ybh = newValue.ybh;
|
||||
// if (newValue.jgbz == '2') {
|
||||
// activeName.value = 'first'
|
||||
// } else if (newValue.jgbz == '0' || newValue.jgbz == '3' || newValue.jgbz == '4') {
|
||||
// activeName.value = 'second'
|
||||
// }
|
||||
}, { deep: true });
|
||||
|
||||
// 模糊查询
|
||||
@ -281,7 +289,8 @@ const searchQuery = () => {
|
||||
} else {
|
||||
labPat.value = {};
|
||||
labInfo.value = {};
|
||||
labResuts.value = [];
|
||||
zbLabResuts.value = [];
|
||||
cbLabResuts.value = [];
|
||||
highlightRowIndex.value = -1;
|
||||
}
|
||||
};
|
||||
@ -321,7 +330,8 @@ const handleQueryResult = (params: QueryParams) => {
|
||||
} else {
|
||||
labPat.value = {};
|
||||
labInfo.value = {};
|
||||
labResuts.value = [];
|
||||
zbLabResuts.value = [];
|
||||
cbLabResuts.value = [];
|
||||
highlightRowIndex.value = -1;
|
||||
}
|
||||
};
|
||||
@ -344,7 +354,8 @@ const handleinstrGroupChange = (val: any) => {
|
||||
}
|
||||
const mbStore = useCommonStore();
|
||||
const yqHandleChange = (val: any) => {
|
||||
labResuts.value = []
|
||||
zbLabResuts.value = [];
|
||||
cbLabResuts.value = [];
|
||||
labPat.value = {}
|
||||
labInfo.value = {}
|
||||
mbStore.setLxsrList([]);
|
||||
@ -402,11 +413,20 @@ const selectJob = (job: any) => {
|
||||
fetchLabResults();
|
||||
highlightRowIndex.value = labPatList.value.findIndex((item: any) => item.ybh == labInfo.value.ybh);
|
||||
}
|
||||
const labResuts = ref([])
|
||||
const zbLabResuts = ref([])
|
||||
const cbLabResuts = ref([])
|
||||
//载入样本结果表单(中间labresult.vue组件)
|
||||
const fetchLabResults = async () => {
|
||||
sampleMedInfo({ jyrq: labInfo.value.jyrq ? labInfo.value.jyrq : queryParams.value.jyrq, yq: labInfo.value.yq, ybh: labInfo.value.ybh }).then((response: any) => {
|
||||
labResuts.value = response.data;
|
||||
zbLabResuts.value = response.data;
|
||||
if (labPat.value.jgbz == '2') {
|
||||
}
|
||||
if (labPat.value.jgbz == '3') {
|
||||
cbLabResuts.value = response.data;
|
||||
}
|
||||
|
||||
console.log(' zbLabResuts.value==>', zbLabResuts.value);
|
||||
console.log(' cbLabResuts.value==>', cbLabResuts.value);
|
||||
})
|
||||
}
|
||||
|
||||
@ -466,7 +486,8 @@ const handleCreate = () => {
|
||||
labPat.value = response.data;
|
||||
labInfo.value = response.data;
|
||||
labPat.value.id = `temp_${Date.now()}_${Math.random().toString(36).substr(2, 8)}`;
|
||||
labResuts.value = []
|
||||
zbLabResuts.value = [];
|
||||
cbLabResuts.value = [];
|
||||
labPatListRef.value?.clearCurrentRow();
|
||||
fetchLabResults()
|
||||
}
|
||||
@ -721,7 +742,7 @@ onMounted(async () => {
|
||||
GMC: toRaw(dictRefs.GMC.value) || [],
|
||||
};
|
||||
// 初始化Socket
|
||||
initSocket()
|
||||
// initSocket()
|
||||
});
|
||||
|
||||
const initSocket = () => {
|
||||
@ -797,7 +818,7 @@ const sendMessage = () => {
|
||||
margin: .125rem 0;
|
||||
|
||||
.el-radio {
|
||||
margin-right: 15px;
|
||||
margin-right: .3125rem;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,33 +1,154 @@
|
||||
<template>
|
||||
<div>
|
||||
<CustomTable :data="labResutsData.labResultList" :columns="columns" :config="tableConfig" :enable-column-drag="true"
|
||||
<div class="title"><span>初报人:</span>{{ labPat.confirmer }} <span>报告时间:</span>{{ labPat.confirmdt
|
||||
}} </div>
|
||||
<div>
|
||||
<el-button class="btn_green btns_box" :size="autoSize" v-if="labPat.jgbz != 2"
|
||||
@click="handleCheck(1)">初报审核</el-button>
|
||||
<el-button class="btns_box" :size="autoSize" v-if="labPat.jgbz == 2" @click="handleCheck(3)">取消审核</el-button>
|
||||
<el-button class="btns_box" type="primary" :size="autoSize" plain
|
||||
:disabled="labPat.jgbz != null && labPat.jgbz != 0" @click="openItemDictDialog">新增</el-button>
|
||||
<el-button class="btns_box" type="danger" :size="autoSize" :disabled="labPat.jgbz != null && labPat.jgbz != 0"
|
||||
plain @click="handleBatchDelete">删除</el-button>
|
||||
<el-button class="btn_green btns_box" :size="autoSize" @click="zhHandel">组合项目</el-button>
|
||||
</div>
|
||||
<CustomTable :data="tableData" :columns="columns" :config="tableConfig" :enable-column-drag="true"
|
||||
@column-drag-end="handleColumnDragEnd">
|
||||
<template #xmdh="{ column }">
|
||||
细菌/结果({{ tableData.length }})项
|
||||
</template>
|
||||
<template #od="{ row }">
|
||||
<el-input v-model="row.od" v-if="labPat.jgbz == 0 || labPat.jgbz == null" size="small"
|
||||
class="full-width-input foucs-input" @change="handleCsjgEnter(row)" />
|
||||
<span v-else>{{ row.od }}</span>
|
||||
</template>
|
||||
<template #csjg="{ row }">
|
||||
<el-input v-model="row.csjg" v-if="labPat.jgbz == 0 || labPat.jgbz == null" size="small"
|
||||
class="full-width-input" @change="handleCsjgEnter(row)" @dblclick="handleInputFocus(row)" />
|
||||
<span v-else>{{ row.csjg }}</span>
|
||||
</template>
|
||||
<template #jgbz="{ row }">
|
||||
<el-select v-model="row.jgbz" class="full-width-input" v-if="labPat.jgbz == 0 || labPat.jgbz == null"
|
||||
placeholder="" @change="handleCsjgEnter(row)">
|
||||
<el-option label="阳性" value="P" />
|
||||
<el-option label="阴性" value="N" />
|
||||
</el-select>
|
||||
<span v-else> {{ formatJgbz(row.jgbz) }}</span>
|
||||
</template>
|
||||
<template #cutoff="{ row }">
|
||||
<el-input v-model="row.cutoff" v-if="labPat.jgbz == 0 || labPat.jgbz == null" size="small"
|
||||
class="full-width-input" @change="handleCsjgEnter(row)" />
|
||||
<span v-else>{{ row.cutoff }}</span>
|
||||
</template>
|
||||
<template #alarm_flag="{ row }">
|
||||
<el-select v-model="row.alarm_flag" class="full-width-input" v-if="labPat.jgbz == 0 || labPat.jgbz == null"
|
||||
placeholder="" @change="handleCsjgEnter(row)">
|
||||
<el-option label="危急值" value="H" />
|
||||
<el-option label="无" value="" />
|
||||
</el-select>
|
||||
<span v-else> {{ row.alarm_flag == 'H' ? '危急值' : '' }}</span>
|
||||
</template>
|
||||
<template #germclass="{ row }">
|
||||
{{ formatDict(row.germclass, 'germclass') }}
|
||||
</template>
|
||||
</CustomTable>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import CustomTable from '@/components/elTable/index.vue'
|
||||
import { LabResultItem, ymTableDataItem } from '@/types/index';
|
||||
import { getresultmedList, savetestResult, changeresult, saveresult, newresult, getmeddictList, savemedresult, savemedresultall, deletemedresult } from '@/api/liswork/micro/index';
|
||||
|
||||
import {
|
||||
check1, check2, uncheck2, unconfirmlog, checkuser, reglimit, deleteresult, allPatquery, emrquery, datalink, changeLinkList,
|
||||
viewBackup, queryXmVal, printListwork, getresultchangelog, setinputmdl, lockSample, unLockSample, clearnotComplete, clearPrintflag,
|
||||
noiteMresult, queryXmInfo, setitemInter
|
||||
} from "@/api/liswork/work/LisWork";
|
||||
import emitter from '@/utils/mitt';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { useCommonStore } from "@/store/modules/commonStore";
|
||||
import { classCom } from '@/utils/classCom';
|
||||
const autoSize = classCom.useAutoSize();
|
||||
const props = defineProps({
|
||||
labResutsData: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
//结果主键
|
||||
labPat: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
//结果主键
|
||||
labPatKey: {
|
||||
type: Object,
|
||||
default: () => { }
|
||||
},
|
||||
labResutsData: {
|
||||
type: Array as PropType<LabResultItem[]>,
|
||||
default: () => []
|
||||
},
|
||||
dictData: {
|
||||
type: Object,
|
||||
default: () => { }
|
||||
}
|
||||
})
|
||||
|
||||
const { labPat, labPatKey, labResutsData, dictData } = toRefs(props);
|
||||
|
||||
const mbStore = useCommonStore();
|
||||
watch(labResutsData, (newVal: any) => {
|
||||
if (newVal.length) {
|
||||
tableData.value = newVal.map((item: any) => {
|
||||
return {
|
||||
...item,
|
||||
zhxmdh: item.xmdh + ' ' + item.xmmc,
|
||||
}
|
||||
})
|
||||
console.log('tableData==>', tableData.value);
|
||||
} else {
|
||||
tableData.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 = {
|
||||
...labPatKey.value,
|
||||
mbmc: mbmc,
|
||||
}
|
||||
setinputmdl(data).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
const existingNames = new Set(tableData.value.map((item: any) => item.xmdh))
|
||||
res.data?.forEach((item: any) => {
|
||||
if (!existingNames.has(item.xmdh)) {
|
||||
tableData.value.push({ ...item, jyrq: labPat.value.jyrq, zhxmdh: item.xmdh + ' ' + item.xmmc })
|
||||
existingNames.add(item.xmdh)
|
||||
}
|
||||
})
|
||||
emitter.emit('clearLxsrList')
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
// 事件定义
|
||||
const emits = defineEmits([
|
||||
'fetchLabResults',
|
||||
'changeStatus',
|
||||
'previewHandle'
|
||||
]);
|
||||
|
||||
const tableData = ref<LabResultItem[]>([])
|
||||
|
||||
const columns = ref([
|
||||
{ label: "细菌/结果", prop: "xmdh", align: 'center', visible: true, slot: 'xmdh', width: 150 },
|
||||
{ label: "细菌/结果", prop: "zhxmdh", align: 'center', visible: true, headerSlot: 'xmdh', width: 150 },
|
||||
{ label: "菌落计数", prop: "od", align: 'center', visible: true, slot: 'od' },
|
||||
{ label: "检验结果", prop: "csjg", align: 'center', visible: true, slot: 'csjg' },
|
||||
{ label: "阴阳性", prop: "jgbz", align: 'center', visible: true, slot: 'jgbz' },
|
||||
{ label: "危急值", prop: "alarm_flag", align: 'center', visible: true, slot: 'alarm_flag' },
|
||||
{ label: "菌属", prop: "xmmc", align: 'center', visible: true },
|
||||
{ label: "阴阳性", prop: "jgbz", align: 'center', visible: true, slot: 'jgbz', showOverflowTooltip: false },
|
||||
{ label: "危急值", prop: "alarm_flag", align: 'center', visible: true, slot: 'alarm_flag', showOverflowTooltip: false },
|
||||
{ label: "菌属", prop: "germclass", align: 'center', visible: true, slot: 'germclass' },
|
||||
{ label: "鉴定率", prop: "cutoff", align: 'center', visible: true, slot: 'cutoff' },
|
||||
{ label: "抗生素组", prop: "bz1", align: 'center', visible: true, width: 120 },
|
||||
])
|
||||
|
||||
const CellStyleHd = ({ row, column, rowIndex, columnIndex }: {
|
||||
@ -82,6 +203,135 @@ const handleColumnDragEnd = (data: any) => {
|
||||
columns.value = data.columns;
|
||||
}
|
||||
|
||||
const handleCheck = (checkType: number) => {
|
||||
// yhdh = checkuserid.value
|
||||
switch (checkType) {
|
||||
case 1: // 初审
|
||||
check1({ ...labPatKey.value, jyrq: labPat.value.jyrq, yhdh: props.labPat.yhdh }).then((res: any) => {
|
||||
emits("changeStatus", props.labPat);
|
||||
})
|
||||
break;
|
||||
case 2: // 审核
|
||||
labPatKey.value.problemId = 0
|
||||
// shHandleCheck()
|
||||
break;
|
||||
case 3: // 取消审核
|
||||
labPatKey.value.problemId = 0
|
||||
// unShHandle()
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
const openItemDictDialog = () => {
|
||||
|
||||
};
|
||||
|
||||
const handleBatchDelete = () => { }
|
||||
|
||||
// 项目结果保存
|
||||
const handleCsjgEnter = async (row: any) => {
|
||||
// 判断数据中包含模板新增的数据 flag
|
||||
if (tableData.value.length == 0) return
|
||||
const flag = tableData.value.some((item: any) => item.changeflag == 2)
|
||||
if (flag) {
|
||||
saveresult(tableData.value).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
emitter.emit('wswSaveResult');
|
||||
}
|
||||
})
|
||||
} else {
|
||||
if (!row) return
|
||||
if (row && row.id) {
|
||||
emitter.emit('wswSaveResult');
|
||||
newresult({ ...row, ybh: labPat.value.ybh, jyrq: labPat.value.jyrq, yq: labPat.value.yq }).then((response: any) => {
|
||||
ElMessage.success("结果保存成功");
|
||||
emits('fetchLabResults');
|
||||
}).catch((error: any) => {
|
||||
emits('fetchLabResults');
|
||||
});
|
||||
} else {
|
||||
changeresult(row).then((response: any) => {
|
||||
ElMessage.success("结果保存成功");
|
||||
emits('fetchLabResults');
|
||||
}).catch((error: any) => {
|
||||
emits('fetchLabResults');
|
||||
});
|
||||
}
|
||||
|
||||
// nextTick(() => {
|
||||
// const input = document.activeElement;
|
||||
// if (input?.tagName === "INPUT") input?.blur();
|
||||
// });
|
||||
}
|
||||
|
||||
};
|
||||
const csjgRef = ref()
|
||||
const csjgTableData = ref([])
|
||||
const handleInputFocus = (row: any) => {
|
||||
// dbRow.value = row
|
||||
queryXmVal({ yq: labPatKey.value.yq, xmdh: row.xmdh }).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
csjgTableData.value = res.data
|
||||
}
|
||||
nextTick(() => {
|
||||
csjgRef.value.open()
|
||||
})
|
||||
})
|
||||
};
|
||||
|
||||
const selectItem = (row: any) => {
|
||||
// 查找修改行
|
||||
const index = tableData.value.findIndex((item: any) => item.xmdh == row.xmdh)
|
||||
tableData.value[index].csjg = row.qz
|
||||
handleCsjgEnter(tableData.value[index])
|
||||
};
|
||||
|
||||
|
||||
|
||||
// 组合项目
|
||||
const combinedRef = ref()
|
||||
|
||||
const zhHandel = () => {
|
||||
combinedRef.value.open()
|
||||
};
|
||||
|
||||
const combinedHandel = (row: any) => {
|
||||
if (props.labPat.jgbz != null && props.labPat.jgbz != 0 && props.labPat.jgbz != 'C') return ElMessage.warning('已审核结果不可添加模板项目');
|
||||
const data = {
|
||||
...labPatKey.value,
|
||||
mbmc: row.mbmc,
|
||||
}
|
||||
setinputmdl(data).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
const existingNames = new Set(tableData.value.map((item: any) => item.xmdh))
|
||||
res.data?.forEach((item: any) => {
|
||||
if (!existingNames.has(item.xmdh)) {
|
||||
tableData.value.push({ ...item, jyrq: labPat.value.jyrq, zhxmdh: item.xmdh + ' ' + item.xmmc })
|
||||
existingNames.add(item.xmdh)
|
||||
}
|
||||
})
|
||||
handleCsjgEnter(null)
|
||||
emitter.emit('clearLxsrList')
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const formatDict = (v: string, dictType: string) => {
|
||||
return props.dictData[dictType]?.find((item: any) => item.value == v)?.label || v;
|
||||
}
|
||||
|
||||
const formatJgbz = (v: string) => {
|
||||
return v == 'H' ? '高' : v == 'L' ? '低' : v == 'N' ? '阴性' : v == 'P' ? '阳性' : v == 'Q' ? '弱阳性' : v == 'M' ? '正常' : ''
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
<style scoped lang="scss">
|
||||
.title {
|
||||
|
||||
span {
|
||||
color: #00ff64;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
159
src/views/liswork/micro/labresult/components/kssMb.vue
Normal file
159
src/views/liswork/micro/labresult/components/kssMb.vue
Normal file
@ -0,0 +1,159 @@
|
||||
<template>
|
||||
<div class="dict-input-wrapper">
|
||||
<!-- 字典选择弹窗 -->
|
||||
<el-dialog v-model="dialogVisible" :title="dialogTitle" width="30vw" :close-on-click-modal="false" :draggable="true"
|
||||
@close="handleDialogClose">
|
||||
<el-input ref="inputRef" v-model="searchKey" placeholder="搜索(支持名称、编码、简拼)..." class="mb10" clearable
|
||||
@clear="filterDictData" @input="filterDictData" />
|
||||
|
||||
<el-table :data="filteredDictData" height="300px" border @row-dblclick="selectItem" highlight-current-row>
|
||||
<!-- <el-table-column prop="value" label="抗生素组" align="center" width="150" /> -->
|
||||
<el-table-column prop="label" label="抗生素组" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="pinyin" label="简拼" align="center" width="150" /> <!-- 显示简拼便于调试 -->
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, watch, onMounted } from 'vue';
|
||||
import { getmedgroupList } from '@/api/liswork/micro/index';
|
||||
import { getFirstLetter } from '@/utils/pinyin.js'; // 引入拼音处理工具
|
||||
// 组件参数
|
||||
const props = defineProps({
|
||||
modelValue: { type: [String, Number], default: '' },
|
||||
dictType: { type: String },
|
||||
placeholder: { type: String, default: '请输入或双击选择' },
|
||||
clearable: { type: Boolean, default: true },
|
||||
disabled: { type: Boolean, default: false },
|
||||
dialogTitle: { type: String, default: '选择字典项' },
|
||||
tableKey: { type: Object, default: () => { } },
|
||||
});
|
||||
|
||||
// 组件事件
|
||||
const emit = defineEmits(['select']);
|
||||
|
||||
|
||||
const dictData = ref([]); // 存储带简拼的字典数据
|
||||
const filteredDictData = ref([]);
|
||||
const isDictLoading = ref(false);
|
||||
const dialogVisible = ref(false);
|
||||
const searchKey = ref('');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 加载字典数据(并添加简拼字段)
|
||||
const loadDictData = async () => {
|
||||
try {
|
||||
isDictLoading.value = true;
|
||||
|
||||
const response = await getmedgroupList();
|
||||
|
||||
const rawData = response.data.map((item, index) => {
|
||||
return {
|
||||
value: item.ywzmc || `未知编码_${index}`, // 确保value存在
|
||||
label: item.ywzmc || `未知名称_${index}`, // 确保label存在
|
||||
};
|
||||
});
|
||||
// 为每个字典项添加简拼字段
|
||||
dictData.value = (rawData || []).map(item => ({
|
||||
...item,
|
||||
pinyin: getFirstLetter(item.label) // 新增pinyin字段存储简拼
|
||||
}));
|
||||
|
||||
filteredDictData.value = [...dictData.value];
|
||||
} catch (error) {
|
||||
console.error(`加载${props.dictType}字典失败:`, error);
|
||||
dictData.value = [];
|
||||
filteredDictData.value = [];
|
||||
} finally {
|
||||
isDictLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 核心搜索逻辑(支持模糊搜索+简拼搜索)
|
||||
const filterDictData = () => {
|
||||
const key = searchKey.value.trim().toLowerCase();
|
||||
if (!key) {
|
||||
filteredDictData.value = [...dictData.value];
|
||||
return;
|
||||
}
|
||||
|
||||
filteredDictData.value = dictData.value.filter(item => {
|
||||
// 1. 模糊搜索:匹配label(名称)或value(编码)
|
||||
const matchLabel = item.label.toLowerCase().includes(key);
|
||||
const matchValue = String(item.value).toLowerCase().includes(key);
|
||||
|
||||
// 2. 简拼搜索:匹配首字母简拼
|
||||
const matchPinyin = item.pinyin.toLowerCase().includes(key);
|
||||
|
||||
// 满足任一条件即匹配
|
||||
return matchLabel || matchValue || matchPinyin;
|
||||
});
|
||||
};
|
||||
|
||||
const inputRef = ref()
|
||||
// 关键修改:打开弹窗时重新加载数据
|
||||
const openDictSelector = async () => {
|
||||
if (props.disabled || isDictLoading.value) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 打开弹窗前先加载数据(确保每次打开都是最新的)
|
||||
await loadDictData();
|
||||
|
||||
// 数据加载完成后再显示弹窗
|
||||
dialogVisible.value = true;
|
||||
searchKey.value = '';
|
||||
nextTick(() => {
|
||||
setTimeout(() => {
|
||||
inputRef.value.focus();
|
||||
}, 100);
|
||||
});
|
||||
filterDictData();
|
||||
};
|
||||
|
||||
|
||||
// 选择字典项
|
||||
const selectItem = (item) => {
|
||||
emit('select', item);
|
||||
dialogVisible.value = false;
|
||||
};
|
||||
|
||||
|
||||
const handleDialogClose = () => {
|
||||
dialogVisible.value = false;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
openDictSelector, // 暴露打开弹窗的方法
|
||||
// 可选:暴露其他可能需要的方法(如刷新字典数据)
|
||||
loadDictData
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 样式保持不变 */
|
||||
.dict-input-wrapper {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.select-icon {
|
||||
cursor: pointer;
|
||||
color: #666;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.select-icon:hover {
|
||||
color: #409eff;
|
||||
}
|
||||
|
||||
:deep(.el-input__suffix) {
|
||||
gap: 4px;
|
||||
}
|
||||
</style>
|
||||
159
src/views/liswork/micro/labresult/components/meddict.vue
Normal file
159
src/views/liswork/micro/labresult/components/meddict.vue
Normal file
@ -0,0 +1,159 @@
|
||||
<template>
|
||||
<div class="dict-input-wrapper">
|
||||
<!-- 字典选择弹窗 -->
|
||||
<el-dialog v-model="dialogVisible" :title="dialogTitle" width="30vw" :close-on-click-modal="false" :draggable="true"
|
||||
@close="handleDialogClose">
|
||||
<el-input ref="inputRef" v-model="searchKey" placeholder="搜索(支持名称、编码、简拼)..." class="mb10" clearable
|
||||
@clear="filterDictData" @input="filterDictData" />
|
||||
|
||||
<el-table :data="filteredDictData" height="300px" border @row-dblclick="selectItem" highlight-current-row>
|
||||
<el-table-column prop="value" label="编码" align="center" width="150" />
|
||||
<el-table-column prop="label" label="名称" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="pinyin" label="简拼" align="center" width="150" /> <!-- 显示简拼便于调试 -->
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, watch, onMounted } from 'vue';
|
||||
import { getmeddictList } from '@/api/liswork/micro/index';
|
||||
import { getFirstLetter } from '@/utils/pinyin.js'; // 引入拼音处理工具
|
||||
// 组件参数
|
||||
const props = defineProps({
|
||||
modelValue: { type: [String, Number], default: '' },
|
||||
dictType: { type: String },
|
||||
placeholder: { type: String, default: '请输入或双击选择' },
|
||||
clearable: { type: Boolean, default: true },
|
||||
disabled: { type: Boolean, default: false },
|
||||
dialogTitle: { type: String, default: '选择字典项' },
|
||||
tableKey: { type: Object, default: () => { } },
|
||||
});
|
||||
|
||||
// 组件事件
|
||||
const emit = defineEmits(['select']);
|
||||
|
||||
|
||||
const dictData = ref([]); // 存储带简拼的字典数据
|
||||
const filteredDictData = ref([]);
|
||||
const isDictLoading = ref(false);
|
||||
const dialogVisible = ref(false);
|
||||
const searchKey = ref('');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 加载字典数据(并添加简拼字段)
|
||||
const loadDictData = async () => {
|
||||
try {
|
||||
isDictLoading.value = true;
|
||||
|
||||
const response = await getmeddictList();
|
||||
|
||||
const rawData = response.data.map((item, index) => {
|
||||
return {
|
||||
value: item.ywdh || `未知编码_${index}`, // 确保value存在
|
||||
label: item.ywmc || `未知名称_${index}`, // 确保label存在
|
||||
};
|
||||
});
|
||||
// 为每个字典项添加简拼字段
|
||||
dictData.value = (rawData || []).map(item => ({
|
||||
...item,
|
||||
pinyin: getFirstLetter(item.label) // 新增pinyin字段存储简拼
|
||||
}));
|
||||
|
||||
filteredDictData.value = [...dictData.value];
|
||||
} catch (error) {
|
||||
console.error(`加载${props.dictType}字典失败:`, error);
|
||||
dictData.value = [];
|
||||
filteredDictData.value = [];
|
||||
} finally {
|
||||
isDictLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 核心搜索逻辑(支持模糊搜索+简拼搜索)
|
||||
const filterDictData = () => {
|
||||
const key = searchKey.value.trim().toLowerCase();
|
||||
if (!key) {
|
||||
filteredDictData.value = [...dictData.value];
|
||||
return;
|
||||
}
|
||||
|
||||
filteredDictData.value = dictData.value.filter(item => {
|
||||
// 1. 模糊搜索:匹配label(名称)或value(编码)
|
||||
const matchLabel = item.label.toLowerCase().includes(key);
|
||||
const matchValue = String(item.value).toLowerCase().includes(key);
|
||||
|
||||
// 2. 简拼搜索:匹配首字母简拼
|
||||
const matchPinyin = item.pinyin.toLowerCase().includes(key);
|
||||
|
||||
// 满足任一条件即匹配
|
||||
return matchLabel || matchValue || matchPinyin;
|
||||
});
|
||||
};
|
||||
|
||||
const inputRef = ref()
|
||||
// 关键修改:打开弹窗时重新加载数据
|
||||
const openDictSelector = async () => {
|
||||
if (props.disabled || isDictLoading.value) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 打开弹窗前先加载数据(确保每次打开都是最新的)
|
||||
await loadDictData();
|
||||
|
||||
// 数据加载完成后再显示弹窗
|
||||
dialogVisible.value = true;
|
||||
searchKey.value = '';
|
||||
nextTick(() => {
|
||||
setTimeout(() => {
|
||||
inputRef.value.focus();
|
||||
}, 100);
|
||||
});
|
||||
filterDictData();
|
||||
};
|
||||
|
||||
|
||||
// 选择字典项
|
||||
const selectItem = (item) => {
|
||||
emit('select', item);
|
||||
dialogVisible.value = false;
|
||||
};
|
||||
|
||||
|
||||
const handleDialogClose = () => {
|
||||
dialogVisible.value = false;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
openDictSelector, // 暴露打开弹窗的方法
|
||||
// 可选:暴露其他可能需要的方法(如刷新字典数据)
|
||||
loadDictData
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 样式保持不变 */
|
||||
.dict-input-wrapper {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.select-icon {
|
||||
cursor: pointer;
|
||||
color: #666;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.select-icon:hover {
|
||||
color: #409eff;
|
||||
}
|
||||
|
||||
:deep(.el-input__suffix) {
|
||||
gap: 4px;
|
||||
}
|
||||
</style>
|
||||
@ -51,7 +51,9 @@ const getRecordList = () => {
|
||||
}
|
||||
|
||||
watch(() => props.labPat, (newValue) => {
|
||||
getRecordList()
|
||||
if (newValue.jyrq && newValue.ybh && newValue.yq) {
|
||||
getRecordList()
|
||||
}
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<div>
|
||||
<div>
|
||||
<el-button class="btn_green btns_box" :size="aotuSize" v-if="labPat.jgbz != 2"
|
||||
<el-button class="btn_green btns_box" :size="autoSize" v-if="labPat.jgbz != 2"
|
||||
@click="handleCheck(2)">审核</el-button>
|
||||
<el-button class="btns_box" :size="aotuSize" v-if="labPat.jgbz == 2" @click="handleCheck(3)">取消审核</el-button>
|
||||
<el-button class="btns_box" type="primary" :size="aotuSize" plain
|
||||
<el-button class="btns_box" :size="autoSize" v-if="labPat.jgbz == 2" @click="handleCheck(3)">取消审核</el-button>
|
||||
<el-button class="btns_box" type="primary" :size="autoSize" plain
|
||||
:disabled="labPat.jgbz != null && labPat.jgbz != 0" @click="openItemDictDialog">新增</el-button>
|
||||
<el-button class="btns_box" type="danger" :size="aotuSize" :disabled="labPat.jgbz != null && labPat.jgbz != 0"
|
||||
<el-button class="btns_box" type="danger" :size="autoSize" :disabled="labPat.jgbz != null && labPat.jgbz != 0"
|
||||
plain @click="handleBatchDelete">删除</el-button>
|
||||
<el-button class="btn_green btns_box" :size="aotuSize" @click="zhHandel">组合项目</el-button>
|
||||
<el-button class="btn_green btns_box" :size="autoSize" @click="zhHandel">组合项目</el-button>
|
||||
</div>
|
||||
<CustomTable ref="tableRef" :data="tableData" :columns="columns" :config="tableConfig" :enable-column-drag="true"
|
||||
@column-drag-end="handleColumnDragEnd" @row-click="rowHandle">
|
||||
@ -27,7 +27,7 @@
|
||||
</template>
|
||||
<template #jgbz="{ row }">
|
||||
<el-select v-model="row.jgbz" class="full-width-input" v-if="labPat.jgbz == 0 || labPat.jgbz == null"
|
||||
@change="handleCsjgEnter(row)">
|
||||
placeholder="" @change="handleCsjgEnter(row)">
|
||||
<el-option label="阳性" value="P" />
|
||||
<el-option label="阴性" value="N" />
|
||||
</el-select>
|
||||
@ -51,16 +51,32 @@
|
||||
</template>
|
||||
</CustomTable>
|
||||
<div class="tabs_btns">
|
||||
<el-tabs v-model="activeName2" type="card" class="demo-tabs" :size="aotuSize">
|
||||
<el-tabs v-model="activeName2" type="card" class="demo-tabs" :size="autoSize">
|
||||
<el-tab-pane label="药敏结果" name="first">
|
||||
<CustomTable :data="ymTableData" :columns="ymColumns" :config="ymTableConfig" :enable-column-drag="true"
|
||||
@column-drag-end="ymHandleColumnDragEnd">
|
||||
<CustomTable ref="ymTableRef" :data="ymTableData" :columns="ymColumns" :config="ymTableConfig"
|
||||
:enable-column-drag="true" @row-click="ymRowHandle" @column-drag-end="ymHandleColumnDragEnd">
|
||||
<template #ywdhHead="{ column }">
|
||||
抗生素({{ ymTableData.length }})项
|
||||
</template>
|
||||
<template #mic="{ row }">
|
||||
<el-input v-model="row.mic" v-if="labPat.jgbz == 0 || labPat.jgbz == null" size="small"
|
||||
class="ymFoucs full-width-input" @change="ymHandleEnter(row)" />
|
||||
<span v-else>{{ row.mic }}</span>
|
||||
</template>
|
||||
<template #rad="{ row }">
|
||||
<el-input v-model="row.rad" v-if="labPat.jgbz == 0 || labPat.jgbz == null" size="small"
|
||||
class="full-width-input" @change="ymHandleEnter(row)" />
|
||||
<span v-else>{{ row.rad }}</span>
|
||||
</template>
|
||||
<template #csjg="{ row }">
|
||||
<el-input v-model="row.csjg" v-if="labPat.jgbz == 0 || labPat.jgbz == null" size="small"
|
||||
class="full-width-input" @change="ymHandleEnter(row)" />
|
||||
<span v-else>{{ row.csjg }}</span>
|
||||
</template>
|
||||
|
||||
<template #jgbz="{ row }">
|
||||
<el-radio-group v-model="row.jgbz">
|
||||
<el-radio-group v-model="row.jgbz" :disabled="labPat.jgbz == 0 || labPat.jgbz == null ? false : true"
|
||||
@change="(val: string) => { jgbzHandle(val, row) }">
|
||||
<el-radio value="R">R</el-radio>
|
||||
<el-radio value="I">I</el-radio>
|
||||
<el-radio value="S">S</el-radio>
|
||||
@ -68,6 +84,24 @@
|
||||
<el-radio value="SDD">SDD</el-radio>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
|
||||
<template #bz="{ row }">
|
||||
<el-input v-model="row.bz" v-if="labPat.jgbz == 0 || labPat.jgbz == null" size="small"
|
||||
class="full-width-input" @change="ymHandleEnter(row)" />
|
||||
<span v-else>{{ row.bz }}</span>
|
||||
</template>
|
||||
|
||||
<template #txtresult="{ row }">
|
||||
<el-input v-model="row.txtresult" v-if="labPat.jgbz == 0 || labPat.jgbz == null" size="small"
|
||||
class="full-width-input" @change="ymHandleEnter(row)" />
|
||||
<span v-else>{{ row.txtresult }}</span>
|
||||
</template>
|
||||
|
||||
<template #cp_bz="{ row }">
|
||||
<el-input v-model="row.cp_bz" v-if="labPat.jgbz == 0 || labPat.jgbz == null" size="small"
|
||||
class="full-width-input" @change="ymHandleEnter(row)" />
|
||||
<span v-else>{{ row.cp_bz }}</span>
|
||||
</template>
|
||||
</CustomTable>
|
||||
|
||||
</el-tab-pane>
|
||||
@ -77,12 +111,12 @@
|
||||
</el-tabs>
|
||||
<div class="btns anchor">
|
||||
<template v-if="activeName2 == 'first'">
|
||||
<el-button class="btns_box" type="primary" :size="aotuSize" plain
|
||||
:disabled="labPat.jgbz != null && labPat.jgbz != 0">新增</el-button>
|
||||
<el-button class="btns_box" type="danger" :size="aotuSize" :disabled="labPat.jgbz != null && labPat.jgbz != 0"
|
||||
plain>删除</el-button>
|
||||
<el-button type="primary" class="btns_box" plain :size="autoSize">更换抗生素组</el-button>
|
||||
<el-button type="primary" class="btns_box" plain :size="autoSize">添加抗生素组</el-button>
|
||||
<el-button class="btns_box" type="primary" :size="autoSize" plain
|
||||
:disabled="labPat.jgbz != null && labPat.jgbz != 0" @click="addMed">新增</el-button>
|
||||
<el-button class="btns_box" type="danger" :size="autoSize" :disabled="labPat.jgbz != null && labPat.jgbz != 0"
|
||||
plain @click="delMed">删除</el-button>
|
||||
<el-button type="primary" class="btns_box" plain :size="autoSize" @click="changeKss">更换抗生素组</el-button>
|
||||
<el-button type="primary" class="btns_box" plain :size="autoSize" @click="addKss">添加抗生素组</el-button>
|
||||
</template>
|
||||
|
||||
<template v-if="activeName2 == 'second'">
|
||||
@ -104,6 +138,12 @@
|
||||
<!-- 组合项目 -->
|
||||
<Combined ref="combinedRef" :queryParams="labPatKey" @dbMbHandle="combinedHandel" />
|
||||
|
||||
<!-- 药敏字典 -->
|
||||
<Meddict ref="medDictRef" :dialog-title="'抗生素选择'" :tableKey="labPatKey" @select="medSelect" />
|
||||
|
||||
<!-- 抗生素组模板 -->
|
||||
<kssMb ref="kssMbRef" :dialog-title="'抗生素组选择'" :tableKey="labPatKey" @select="kssSelect" />
|
||||
|
||||
<!-- 操作原因 -->
|
||||
<el-dialog v-model="unCheckshow" title="操作原因" width="500" :close-on-click-modal="false" :draggable="true"
|
||||
@close="unconfirmlogCancel">
|
||||
@ -138,29 +178,27 @@
|
||||
<script setup lang="ts">
|
||||
import CustomTable from "@/components/elTable/index.vue";
|
||||
import { classCom } from "@/utils/classCom";
|
||||
|
||||
import { getresultmedList, savetestResult, changeresult, saveresult, newresult, } from '@/api/liswork/micro/index';
|
||||
import { getresultmedList, savetestResult, changeresult, saveresult, newresult, getmeddictList, savemedresult, savemedresultall, deletemedresult, getmedgroupMbList } from '@/api/liswork/micro/index';
|
||||
import {
|
||||
check1, check2, uncheck2, unconfirmlog, checkuser, reglimit, deleteresult, allPatquery, emrquery, datalink, changeLinkList,
|
||||
check1, check2, uncheck2, unconfirmlog, checkuser, reglimit, deleteresult, allPatquery, emrquery,
|
||||
viewBackup, queryXmVal, printListwork, getresultchangelog, setinputmdl, lockSample, unLockSample, clearnotComplete, clearPrintflag,
|
||||
noiteMresult, queryXmInfo, setitemInter
|
||||
} from "@/api/liswork/work/LisWork";
|
||||
import { useCommonStore } from "@/store/modules/commonStore";
|
||||
// @ts-ignore
|
||||
import ProjectDetails from "@/components/projectDetails/index.vue";
|
||||
import projectsJg from "@/components/projectsjg/index.vue"
|
||||
import projectsJg from "@/components/projectsjg/index.vue";
|
||||
// @ts-ignore
|
||||
import kssMb from "./components/kssMb.vue";
|
||||
import Combined from "./components/combinedDialog.vue";
|
||||
// @ts-ignore
|
||||
import Meddict from "./components/meddict.vue";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import emitter from "@/utils/mitt";
|
||||
const aotuSize = classCom.useAutoSize();
|
||||
const autoSize = classCom.useAutoSize();
|
||||
import { LabResultItem, ymTableDataItem } from '@/types/index';
|
||||
|
||||
|
||||
interface LabResultItem {
|
||||
xmdh: string;
|
||||
xmmc: string;
|
||||
csjg: string;
|
||||
qz: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
const props = defineProps({
|
||||
labPat: {
|
||||
type: Object,
|
||||
@ -189,10 +227,6 @@ const emits = defineEmits([
|
||||
'previewHandle'
|
||||
]);
|
||||
|
||||
|
||||
|
||||
|
||||
const autoSize = classCom.useAutoSize();
|
||||
const activeName2 = ref('first')
|
||||
const textarea = ref('')
|
||||
|
||||
@ -414,7 +448,7 @@ const addRowFromDict = async (rowData: any) => {
|
||||
cutoff: '',
|
||||
};
|
||||
tableData.value.push(newRow);
|
||||
|
||||
newresult({ ...newRow, ybh: labPat.value.ybh, jyrq: labPat.value.jyrq, yq: labPat.value.yq })
|
||||
// 5. 自动聚焦
|
||||
nextTick(() => {
|
||||
selectedRows.value = [newRow];
|
||||
@ -457,6 +491,7 @@ const handleBatchDelete = () => {
|
||||
}).catch(() => {
|
||||
});
|
||||
};
|
||||
|
||||
const mbStore = useCommonStore();
|
||||
const tableData: any = ref([])
|
||||
|
||||
@ -474,6 +509,9 @@ watch(labResutsData, (newVal: any) => {
|
||||
textarea.value = ''
|
||||
rowInfo.value = {}
|
||||
tableData.value = []
|
||||
selectedRows.value = []
|
||||
ymTableData.value = []
|
||||
ymselectedRows.value = []
|
||||
}
|
||||
|
||||
if (props.labPat.jgbz != null && props.labPat.jgbz != 0 && props.labPat.jgbz != 'C') return;
|
||||
@ -531,30 +569,7 @@ const rowHandle = (row: any) => {
|
||||
})
|
||||
}
|
||||
|
||||
const ymTableData = ref([]);
|
||||
|
||||
const ymColumns = ref([
|
||||
{ label: "抗生素", prop: "zhywdh", visible: true, width: 120, headerSlot: 'ywdhHead' },
|
||||
{ label: "Mic", prop: "mic", align: 'center', visible: true, width: 60 },
|
||||
{ label: "KB", prop: "rad", align: 'center', visible: true, width: 40 },
|
||||
{ label: "结果", prop: "csjg", align: 'center', visible: true, width: 50 },
|
||||
{ label: "结果标志", prop: "jgbz", align: 'center', visible: true, slot: 'jgbz', width: 180, showOverflowTooltip: false },
|
||||
{ label: "折点", prop: "ckz", align: 'center', visible: true },
|
||||
{ label: "分组", prop: "bz", align: 'center', visible: true },
|
||||
{ label: "专家值", prop: "txtresult", align: 'center', visible: true },
|
||||
{ label: "引用说明", prop: "cp_bz", align: 'center', visible: true },
|
||||
])
|
||||
|
||||
const ymTableConfig = ref({
|
||||
height: '48vh',
|
||||
border: true,
|
||||
highlightCurrentRow: true,
|
||||
});
|
||||
|
||||
const ymHandleColumnDragEnd = (data: any) => {
|
||||
ymColumns.value = data.columns;
|
||||
}
|
||||
|
||||
// 项目结果保存
|
||||
const handleCsjgEnter = async (row: any) => {
|
||||
// 判断数据中包含模板新增的数据 flag
|
||||
if (tableData.value.length == 0) return
|
||||
@ -622,7 +637,6 @@ const zhHandel = () => {
|
||||
};
|
||||
|
||||
const combinedHandel = (row: any) => {
|
||||
console.log('data==>', row);
|
||||
if (props.labPat.jgbz != null && props.labPat.jgbz != 0 && props.labPat.jgbz != 'C') return ElMessage.warning('已审核结果不可添加模板项目');
|
||||
const data = {
|
||||
...labPatKey.value,
|
||||
@ -643,6 +657,180 @@ const combinedHandel = (row: any) => {
|
||||
});
|
||||
};
|
||||
|
||||
const ymTableRef = ref()
|
||||
const ymTableData = ref<ymTableDataItem[]>([]);
|
||||
|
||||
const ymColumns = ref([
|
||||
{ label: "抗生素", prop: "zhywdh", visible: true, width: 120, headerSlot: 'ywdhHead' },
|
||||
{ label: "Mic", prop: "mic", align: 'center', visible: true, width: 60, slot: 'mic' },
|
||||
{ label: "KB", prop: "rad", align: 'center', visible: true, width: 40, slot: 'rad' },
|
||||
{ label: "结果", prop: "csjg", align: 'center', visible: true, width: 50, slot: 'csjg' },
|
||||
{ label: "结果标志", prop: "jgbz", align: 'center', visible: true, slot: 'jgbz', width: 200, showOverflowTooltip: false },
|
||||
{ label: "折点", prop: "ckz", align: 'center', visible: true, },
|
||||
{ label: "分组", prop: "bz", align: 'center', visible: true, slot: 'bz' },
|
||||
{ label: "专家值", prop: "txtresult", align: 'center', visible: true, slot: 'txtresult' },
|
||||
{ label: "引用说明", prop: "cp_bz", align: 'center', visible: true, slot: 'cp_bz' },
|
||||
])
|
||||
const ymCellStyleHd = ({ row, column, rowIndex, columnIndex }: {
|
||||
row: any;
|
||||
column: any;
|
||||
rowIndex: number;
|
||||
columnIndex: number;
|
||||
}) => {
|
||||
if (column.label == "结果" && row.jgbz == "R") {
|
||||
return { background: '#ffc0c0 !important', color: '#606266' };
|
||||
}
|
||||
if (column.label == "结果" && row.jgbz == "I") {
|
||||
return { background: '#ffff80 !important', color: '#606266' };
|
||||
}
|
||||
}
|
||||
const ymTableConfig = ref({
|
||||
height: '48vh',
|
||||
border: true,
|
||||
highlightCurrentRow: true,
|
||||
cellStyle: ymCellStyleHd,
|
||||
});
|
||||
|
||||
const ymHandleColumnDragEnd = (data: any) => {
|
||||
ymColumns.value = data.columns;
|
||||
}
|
||||
const ymselectedRows = ref<ymTableDataItem[]>([]);
|
||||
|
||||
const ymRowHandle = (row: any) => {
|
||||
ymselectedRows.value = [row];
|
||||
}
|
||||
|
||||
const medDictRef = ref()
|
||||
const kssMbRef = ref()
|
||||
|
||||
const kssType = ref('')
|
||||
// 更换抗生素组
|
||||
const changeKss = () => {
|
||||
kssMbRef.value.openDictSelector();
|
||||
kssType.value = '1'
|
||||
}
|
||||
// 添加抗生素组
|
||||
const addKss = () => {
|
||||
kssMbRef.value.openDictSelector();
|
||||
kssType.value = '2'
|
||||
}
|
||||
|
||||
const kssSelect = (row: any) => {
|
||||
getmedgroupMbList({ mbmc: row.value }).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
if (kssType.value == '1') {
|
||||
ymTableData.value = []
|
||||
res.data?.forEach((item: any, index: number) => {
|
||||
ymTableData.value.push({ ...item, zhywdh: item.ywdh + ' ' + item.ywmc, xh: index + 1 })
|
||||
})
|
||||
} else {
|
||||
const existingNames = new Set(ymTableData.value.map((item: any) => item.ywdh))
|
||||
res.data?.forEach((item: any) => {
|
||||
if (!existingNames.has(item.ywdh)) {
|
||||
ymTableData.value.push({ ...item, zhywdh: item.ywdh + ' ' + item.ywmc, xh: ymTableData.value.length + 1 })
|
||||
existingNames.add(item.ywdh)
|
||||
}
|
||||
})
|
||||
}
|
||||
ymTableData.value.forEach((item: any) => {
|
||||
item.ybh = labPatKey.value.ybh
|
||||
item.yq = labPatKey.value.yq
|
||||
item.jyrq = labPat.value.jyrq
|
||||
item.xmdh = selectedRows.value[0].xmdh
|
||||
})
|
||||
savemedresultall(ymTableData.value).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
rowHandle(selectedRows.value[0])
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
const addMed = () => {
|
||||
medDictRef.value.openDictSelector();
|
||||
}
|
||||
const delMed = () => {
|
||||
if (ymselectedRows.value.length === 0) return ElMessage.warning("请先选择要删除的记录");
|
||||
const arr = ymselectedRows.value.filter((row: any) => !row.id);
|
||||
if (arr.length) {
|
||||
deletemedresult(ymselectedRows.value[0]).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
ElMessage.success('删除成功');
|
||||
rowHandle(selectedRows.value[0])
|
||||
}
|
||||
})
|
||||
} else {
|
||||
const index = ymTableData.value.findIndex((item: any) => item.ywdh === ymselectedRows.value[0].ywdh);
|
||||
if (index > -1) ymTableData.value.splice(index, 1);
|
||||
}
|
||||
|
||||
ymselectedRows.value = [];
|
||||
}
|
||||
const medSelect = (row: any) => {
|
||||
console.log('row==>', row);
|
||||
const ymFlag = tableData.value.some((item: any) => item.ywdh === row.value);
|
||||
if (ymFlag) return ElMessage.warning(`抗生素【${row.label}】已存在`);
|
||||
// 1. 构造新增行数据
|
||||
const newRow = {
|
||||
id: `temp_${Date.now()}_${Math.random().toString(36).substr(2, 8)}`,
|
||||
zhywdh: row.value + ' ' + row.label,
|
||||
ywdh: row.value,
|
||||
ywmc: row.label,
|
||||
mic: '',
|
||||
rad: '',
|
||||
csjg: '',
|
||||
jgbz: '',
|
||||
ckz: '',
|
||||
bz: '',
|
||||
txtresult: '',
|
||||
cp_bz: '',
|
||||
xh: ymTableData.value.length + 1,
|
||||
...labPatKey.value,
|
||||
jyrq: labPat.value.jyrq,
|
||||
xmdh: selectedRows.value[0].xmdh
|
||||
};
|
||||
ymTableData.value.push(newRow);
|
||||
savemedresult(newRow)
|
||||
nextTick(() => {
|
||||
ymselectedRows.value = [newRow];
|
||||
ymTableRef.value.setCurrentRow(newRow);
|
||||
ymTableRef.value.setScrollTo(ymTableData.value.length - 1)
|
||||
// 聚焦到新行的输入框
|
||||
const inputs = Array.from(document.querySelectorAll('.ymFoucs .el-input__inner'))
|
||||
.filter(el => el instanceof HTMLElement) as HTMLElement[];
|
||||
if (inputs.length > 0) {
|
||||
inputs[inputs.length - 1].focus();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 药敏结果保存
|
||||
const ymHandleEnter = async (row: any) => {
|
||||
if (!row) return
|
||||
savemedresult({ ...row, ybh: labPat.value.ybh, jyrq: labPat.value.jyrq, yq: labPat.value.yq, xmdh: selectedRows.value[0].xmdh }).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
ElMessage.success('保存成功');
|
||||
rowHandle(selectedRows.value[0])
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
const jgbzHandle = (val: string, row: any) => {
|
||||
const obj: any = {
|
||||
R: '耐药',
|
||||
I: '中介',
|
||||
S: '敏感',
|
||||
N: '非敏感',
|
||||
SDD: '剂量依赖性敏感'
|
||||
}
|
||||
row.csjg = obj[val]
|
||||
|
||||
ymHandleEnter(row)
|
||||
};
|
||||
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
// 获取模板项目
|
||||
emitter.on('dbMbHandle', (info: any) => {
|
||||
@ -678,14 +866,7 @@ const formatJgbz = (v: string) => {
|
||||
}
|
||||
}
|
||||
|
||||
.btns_box {
|
||||
padding: .3125rem .625rem !important;
|
||||
font-size: .875rem;
|
||||
height: 1.25rem !important;
|
||||
margin: 5px 0;
|
||||
margin-left: .625rem !important;
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
|
||||
|
||||
.tabs_btns {
|
||||
position: relative;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user