|
|
<template> <div> <div @contextmenu.prevent="onContextmenu"> <el-table :data="doctorCheck.checkItemList" style="width: 100%" :height="tableHeight" border highlight-current-row @row-click="rowClick" @row-dblclick="dblClick" size="small"> <el-table-column prop="itemName" label="项目" min-width="160" /> <el-table-column prop="result" label="结果" min-width="420"> <template slot-scope="scope"> <div style="display: flex;"> <el-autocomplete style="width: 100%" type="textarea" v-model="scope.row.result" placeholder="请输入结果值" :disabled="rowResultDisabled(scope.row)" :autosize="{ minRows: 1, maxRows: 10 }" :ref="scope.row.itemId" :trigger-on-focus="false" :fetch-suggestions="querySearch" :data-lineModeFlag="scope.row.lineModeFlag" @input=" madeTooltips(scope.$index); computeFun(scope.$index); " v-bind:class="scope.row.class"> </el-autocomplete> <el-button style="min-width: 23px; padding: 2px" icon="el-icon-caret-bottom" @click="btnMoreResult(scope.row, scope.$index)" :disabled="rowResultDisabled(scope.row)" size="small"></el-button> <el-button style="min-width: 23px; padding: 2px; margin-left: 2px" @click="btnPacsResult(scope.row, scope.$index)" :disabled="rowResultDisabled(scope.row)" size="small">P</el-button> <el-button style="min-width: 23px; padding: 5.8px; margin-left: 2px" :disabled="rowResultDisabled(scope.row)" @click="btnPacsRessulst(scope.row)" size="small">S</el-button> <!-- <el-popover placement="top-end" width="500" trigger="click" :title="scope.row.itemName" > <el-tabs v-model="activeName"> <el-tab-pane label="文字结果" name="first"> <el-table :data="gridData"> <el-table-column property="checkDate" label="检查日期" align="center" ></el-table-column> <el-table-column property="itemResult" label="项目结果" align="center" ></el-table-column> </el-table> </el-tab-pane> <el-tab-pane label="折线图" name="second"> <div style="height: 200px; width: 200px" ref="chart" ></div> </el-tab-pane> </el-tabs> <el-button slot="reference" style="min-width: 23px; padding: 5.8px; margin-left: 2px" :disabled="rowResultDisabled(scope.row)" @click="btnPacsRessulst(scope.row)" size="small" >S</el-button > </el-popover> --> </div> </template> </el-table-column> <el-table-column prop="unit" label="单位" width="90" align="center" /> <el-table-column prop="referenceRangeValue" label="参考范围" width="120" align="center" /> <el-table-column prop="resultStatusId" label="提示" width="40" align="center"> <template slot-scope="scope"> <div> {{ dddw( resultStatus, "id", scope.row.resultStatusId, "dataInputPrompt" ) }} </div> </template> </el-table-column> <el-table-column prop="criticalFlag" label="危急值" width="50" align="center"> <template slot-scope="scope"> <el-button :style="[ { minWidth: '23px' }, { padding: '6px 2px' }, { backgroundColor: scope.row.isCriticalValue == 'Y' ? 'red' : '', }, ]" @click="btnCritical(scope.row)" size="small">W</el-button> </template> </el-table-column> </el-table> </div> <!--模拟弹窗--> <div v-show="hisResultDetailDialogVisible" :style="`z-index:2;border-radius: 10px;border: 1px solid #ddd;background-color:#FFF; position: absolute;top:0px;right:0px;width:200px;height: 600px;opacity:1;`"> <div style="display: flex;justify-content:space-between;"> <div style="margin-left: 5px;">历次明细结果</div> <div> <el-tooltip content="关闭历次明细窗口" placement="bottom" effect="light"> <i class="el-icon-close" @click="hisResultDetailDialogVisible = false" style="font-size: 24px;color: red;cursor:pointer;"></i> </el-tooltip> </div> </div>
<!-- 明细历次结果 --> <el-table :data="gridData" border width="100%" height="575" size="small" highlight-current-row style="border-radius:10px;"> <el-table-column prop="checkDate" label="检查日期" min-width="90" align="center" /> <el-table-column prop="itemResult" label="项目结果" min-width="100"> <template slot-scope="scope"> <div style="margin-left: 2px;">{{ scope.row.itemResult }}</div> </template> </el-table-column> </el-table> </div> <!--弹窗--> <div> <!-- 结果录入模版 --> <el-dialog title="结果录入模版" :visible.sync="dialogWinMoreResult" width="800px" :close-on-click-modal="false"> <div style="margin-top: -10px" @contextmenu.prevent="onContextmenuTemplate"> <el-checkbox v-model="LocalConfig.doctorCheck.isSplitChooseResult" size="small" true-label="Y" false-label="N">选结果模板时自动添加分隔符;</el-checkbox> <div style=" overflow-y: auto; height: 300px; width: 100%; display: flex; flex-wrap: wrap; align-content: flex-start; "> <div v-for="item in moreResult.data" :key="item.id" style="margin: 5px; cursor: pointer" @click="clickResult(item)" @dblclick="dblclickResult(item)"> <el-tag size="samll" style=" padding: 0 3px; height: 24px; line-height: 24px; font-size: 14px; color: #303133; background-color: white; ">{{ item.result }}</el-tag> </div> </div> <div>特殊符号:</div> <div style=" overflow-y: auto; width: 100%; display: flex; flex-wrap: wrap; align-content: flex-start; "> <div v-for="item in symbols" :key="item.id" style="margin: 1px 2px; cursor: pointer" @click="insertSymbols(item.displayName)"> <el-tag style=" padding: 0 3px; height: 24px; line-height: 24px; font-size: 15px; color: #303133; background-color: white; "> {{ item.displayName }} </el-tag> </div> </div> <div style="display: flex; justify-content: space-between"> <div style="margin-top: 5px">录入结果:</div> <div style="overflow-y: auto; display: flex; flex-wrap: wrap"> <div v-for="item in splitSymbols" :key="item" style="margin: 1px 2px; cursor: pointer" @click="insertSymbols(item)"> <el-tag style=" padding: 0 3px; height: 24px; line-height: 24px; font-size: 15px; color: #303133; background-color: white; "> {{ item }} </el-tag> </div> </div> </div> <el-input id="resultBox" style="width: 100%" class="commonFont" type="textarea" :autosize="{ minRows: 4, maxRows: 4 }" v-model="moreResult.result" /> </div> <span slot="footer" class="dialog-footer"> <el-button @click="btnClear">清 除</el-button> <el-button type="primary" @click="btnOkResult('defaultResult')">默认结果</el-button> <el-button type="primary" @click="btnOkResult('')">确 定</el-button> <el-button @click="dialogWinMoreResult = false">关 闭</el-button> </span> </el-dialog>
<!--Pacs结果录入模版--> <el-dialog :title="'Pacs结果录入模版 -- ' + doctorCheck.checkItemList[pacsParams.index].itemName" v-if="dialogWinPacsTemplate" :visible.sync="dialogWinPacsTemplate" width="880px" :close-on-click-modal="false"> <PacsTemplate :refParams="pacsParams" :refFuncOther="handlePacsResult" /> </el-dialog>
<!--历史结果与折线图--> <el-dialog :title="curRow.itemName" :visible.sync="previousResults" width="500px" :close-on-click-modal="true" :show-close="false" @close="resultsclose"> <el-tabs v-model="activeName"> <el-tab-pane label="文字结果" name="first"> <el-table :data="gridData"> <el-table-column property="checkDate" label="检查日期" align="center"></el-table-column> <el-table-column property="itemResult" label="项目结果" align="center"></el-table-column> </el-table> </el-tab-pane> <el-tab-pane label="折线图" name="second"> <div style="height: 400px; width: 500px" ref="chart1"></div> </el-tab-pane> </el-tabs> </el-dialog> </div> </div></template><script>// 0-无参考范围,1-数字型,2-字符型,3-性激素
import { mapState } from "vuex";import { getapi, postapi, putapi, deletapi } from "@/api/api";import { arrayExistObj, dddw, deepCopy, getPagePriv, checkPagePriv } from "../../utlis/proFunc";
import PacsTemplate from "./PacsTemplate.vue";import * as echarts from "echarts";export default { components: { PacsTemplate, }, props: ["isCheckPicture", "registerCheckId", "doctor_check_check_charge"], data() { return { pagePriv: { routeUrlorPageName: "doctorCheck", //当前页面归属路由或归属页面权限名称
privs: [], // 页面权限
}, activeName: "first", previousResults: false, gridData: [], resultStatus: [], //结果状态提示数据
tipsNormal: { id: "01", displayName: "正常", dataInputPrompt: "正常", reportPrompt: "正常", reportBackgroundColor: 16777215, reportFontColor: 0, dataInputBackgroundColor: 16777215, dataInputFontColor: 0, }, //正常提示
tipsError: {}, //错误提示
tipsNegative: {}, //阴性提示
tipsLowPositive: {}, //弱阳性提示
tipsPositive: {}, //阳性提示
tipsLow: {}, //偏低提示
tipsHigh: {}, //偏高提示
tipsSuperLow: {}, //超低提示
tipsSuperHigh: {}, //超高提示
tipsSuper: {}, //文字型危急值
restaurants: [], //结果模版
currentRow: -1, //当前操作的行
dialogWinMoreResult: false, dialogWinPacsTemplate: false, moreResult: { data: [], result: "", defaultResult: "", index: 0, // 明细序列
}, //结果模版
selection: { // 光标位置
start: 0, end: 0, }, symbols: [], //特殊符号
splitSymbols: [";", "、"], // 分隔符
userInfo: { operatorType: "0", userId: "", user: "", },
// pacs 结果录入
pacsParams: { from: "doctor", refresh: -1, // 强制刷新
row: {}, index: 0, result: "", summary: "", }, curRow: {},
// 医生诊台相关的本地设置
LocalConfig: { doctorCheck: { isSelectAll: 'N', // 录入结果时,是否全选
pacsDescFontSize: "14px", //描述内容的字体大小
isSplitChooseResult: "Y", // 选结果时,是否自动加上分隔符
} },
hisResultDetailDialogVisible: false, // 历史结果显示页面
// 避免双击与单击冲突
clickTime1: 0, //第一次点时间
clickTime2: 0, //第二次点时间
//身高体重血压仪项目
comData: { height_item_id: '', //身高明细项目编号
weight_item_id: '', //体重明细项目编号
hb_item_id: '', //收缩压(高压)明细项目编号
lb_item_id: '', //舒张压(低压)明细项目编号
},
}; },
created() { //获取用户当前页面的权限
let userPriv = window.sessionStorage.getItem("userPriv"); if (userPriv) this.pagePriv.privs = deepCopy( getPagePriv(this.pagePriv.routeUrlorPageName) );
this.dictInit();
let LocalConfig = JSON.parse(window.localStorage.getItem("LocalConfig") || null) if (LocalConfig?.doctorCheck?.isSelectAll) this.LocalConfig.doctorCheck.isSelectAll = LocalConfig.doctorCheck.isSelectAll if (LocalConfig?.doctorCheck?.pacsDescFontSize) this.LocalConfig.doctorCheck.pacsDescFontSize = LocalConfig.doctorCheck.pacsDescFontSize + 'px' if (LocalConfig?.doctorCheck?.isSplitChooseResult) this.LocalConfig.doctorCheck.isSplitChooseResult = LocalConfig.doctorCheck.isSplitChooseResult },
//挂载完成
mounted() { // 监听来自 Electron 的调用
if (this.$peisAPI) { try { // 右击
this.$peisAPI.onContextMenuAction((data) => { this.onContextMenuDIY(data) });
// 身高体重仪、血压仪
this.$peisAPI.onSerialData((data) => { this.onSerialData(data) }); } catch (error) { console.error(error) } }
this.checkItemList(this.dataTransOpts.tableS.register_check.id); this.userInfo.operatorType = window.sessionStorage.getItem("operatorType") || '0'; this.userInfo.userId = window.sessionStorage.getItem("userId") || null; this.userInfo.user = window.sessionStorage.getItem("user") || null; },
computed: { ...mapState([ "window", "dataTransOpts", "dict", "dialogWin", "doctorCheck", ]), tableHeight() { let temp = this.window.pageHeight < 600 ? 600 : this.window.pageHeight; return Math.floor( ((temp - 315 - (this.isCheckPicture ? 110 : 0)) * 3) / 5 ); }, },
methods: { dddw, dictInit() { // 获取系统参数(是否显示历次明细结果)
postapi('/api/app/SysParmValue/GetSysParmValueBySysParmId', { sysParmId: 'doctor_check_disp_hisdetail' }) .then(res => { if (res.code > -1) { let hisResultDetailDialogVisible = res.data || "N" if (hisResultDetailDialogVisible == 'Y') { this.hisResultDetailDialogVisible = true } } })
// 获取系统参数(身高明细项目ID)
postapi('/api/app/SysParmValue/GetSysParmValueBySysParmId', { sysParmId: 'height_item_id' }) .then(res => { if (res.code > -1) { this.comData.height_item_id = res.data || "" } })
// 获取系统参数(体重明细项目ID)
postapi('/api/app/SysParmValue/GetSysParmValueBySysParmId', { sysParmId: 'weight_item_id' }) .then(res => { if (res.code > -1) { this.comData.weight_item_id = res.data || "" } })
// 获取系统参数(收缩压(高压)明细项目ID)
postapi('/api/app/SysParmValue/GetSysParmValueBySysParmId', { sysParmId: 'hb_item_id' }) .then(res => { if (res.code > -1) { this.comData.hb_item_id = res.data || "" } })
// 获取系统参数(舒张压(低压)明细项目ID)
postapi('/api/app/SysParmValue/GetSysParmValueBySysParmId', { sysParmId: 'lb_item_id' }) .then(res => { if (res.code > -1) { this.comData.lb_item_id = res.data || "" } })
//获取结果状态提示数据
getapi("/api/app/result-status").then((res) => { if (res.code != -1) { this.resultStatus = res.data; this.resultStatus.forEach((e) => { switch (e.id) { case "01": // 正常
e.tooltips = "tipsNormal"; this.colorTrans(e, e.tooltips); break; case "02": // 错误
e.tooltips = "tipsError"; this.colorTrans(e, e.tooltips); break; case "03": // 阴性
e.tooltips = "tipsNegative"; this.colorTrans(e, e.tooltips); break; case "04": // 阳性
e.tooltips = "tipsPositive"; this.colorTrans(e, e.tooltips); break; case "05": // 弱阳性
e.tooltips = "tipsLowPositive"; this.colorTrans(e, e.tooltips); break; case "06": // 偏低
e.tooltips = "tipsLow"; this.colorTrans(e, e.tooltips); break; case "07": // 偏高
e.tooltips = "tipsHigh"; this.colorTrans(e, e.tooltips); break; case "08": // 危急值下限
e.tooltips = "tipsSuperLow"; this.colorTrans(e, e.tooltips); break; case "09": // 危急值上限
e.tooltips = "tipsSuperHigh"; this.colorTrans(e, e.tooltips); break; case "10": // 危急值
e.tooltips = "tipsSuper"; this.colorTrans(e, e.tooltips); break; default: e.tooltips = "tipsNormal"; this.colorTrans(e, e.tooltips); break; } }); } });
//获取结果状态提示数据
postapi("/api/app/CommonChar/GetCommonCharList", {}).then((res) => { if (res.code >= 0) { this.symbols = res.data; } }); },
btnPacsRessulst(row) { this.curRow = row; postapi("/api/app/RegisterCheckItem/GetItemTwoHistoricalResults", { registerCheckId: row.registerCheckId, itemId: row.itemId, }).then((res) => { if (res.code != -1) { this.previousResults = true; this.gridData = res.data; this.$nextTick(() => { this.initEcharts(); }); } }); }, initEcharts() { let yAxisData = []; let xAxisData = []; for (let i = 0; i < this.gridData.length; i++) { if (this.gridData[i].checkDate) { xAxisData.push(this.gridData[i].checkDate); yAxisData.push(this.gridData[i].itemResult); } } let myChart = echarts.init(this.$refs.chart1); let option1 = { tooltip: { trigger: "axis", confine: true, }, legend: { type: "scroll", orient: "horizontal", // 垂直
right: "3%", // 左对齐
top: "0%", // 位于顶部
}, grid: { show: false, left: "2%", right: "2%", top: "6%", bottom: "0%", containLabel: true, }, xAxis: { type: "category", data: xAxisData, axisLabel: { textStyle: { fontSize: "14", }, }, axisLine: { show: true, }, }, yAxis: { type: "value", axisLabel: { textStyle: { fontSize: "14", }, }, }, series: [ { name: "项目结果", type: "line", data: yAxisData, }, ], }; myChart.setOption(option1); }, resultsclose() { this.activeName = "first"; }, // chartTabs(tab) {
// if (tab.name == "second") {
// this.$nextTick(() => {
// this.initEcharts();
// });
// }
// },
// 颜色转换
// displayName: "错误",
// dataInputPrompt: "×",
// reportPrompt: "×",
// reportBackgroundColor: 2427166,
// reportFontColor: 1070166,
// dataInputBackgroundColor: 321313,
// dataInputFontColor: 12991019,
colorTrans(dataColor, frontColor) { let tempColor = "000000" + Number(dataColor.dataInputBackgroundColor).toString(16); let backgroundColor = "#" + tempColor.substring(tempColor.length - 6); tempColor = "000000" + Number(dataColor.dataInputFontColor).toString(16); let color = "#" + tempColor.substring(tempColor.length - 6); this[frontColor] = Object.assign({}, dataColor, { backgroundColor, color, }); console.log(`this.${frontColor}`, this[frontColor]); },
// "referenceRangeValue": "15-55",
// "referenceRangeTypeFlag": "1",
// "criticalRangeValue": null,
// "result"
madeTooltips(index) { // let ts = confirm('提示')
let checkItem = this.doctorCheck.checkItemList[index]; let tooltips = "tipsNormal"; checkItem.class = tooltips; let referenceRangeTypeFlag = checkItem.referenceRangeTypeFlag || "0"; //参考范围类别0-无参考范围,1-数字型,2-字符型,3-性激素
// console.log('madeTooltips',index,referenceRangeTypeFlag)
switch (referenceRangeTypeFlag) { case "3": // 1 是数字型,3 是性激素期
case "1": // console.log('1、3')
if (checkItem.result) { let tempResult = checkItem.result .replaceAll("<", "") .replaceAll("≤", "") .replaceAll("≦", "") .replaceAll(">", "") .replaceAll("≥", "") .replaceAll("≧", "") .replaceAll("=", "") .replaceAll(" ", ""); console.log("tempResult", isNaN(tempResult), tempResult); if (isNaN(tempResult)) break; let result = Number(tempResult);
if (checkItem.referenceRangeValue) { let criticalRangeValue = checkItem.criticalRangeValue; let valueArr = checkItem.referenceRangeValue .replaceAll("--", "-") .replaceAll("〜", "-") .replaceAll("~", "-") .split("-"); if (valueArr.length == 1) valueArr.unshift(0);
// console.log('valueArr',checkItem.referenceRangeValue,valueArr)
if (criticalRangeValue) { let criticalArr = criticalRangeValue .replaceAll("--", "-") .replaceAll("〜", "-") .replaceAll("~", "-") .split("-"); if (criticalArr.length == 1) criticalArr.unshift(0);
// console.log('criticalArr',checkItem.criticalRangeValue,criticalArr)
if (result < Number(criticalArr[0])) { tooltips = "tipsSuperLow"; } else if (result > Number(criticalArr[1])) { tooltips = "tipsSuperHigh"; } else if (result < Number(valueArr[0])) { tooltips = "tipsLow"; } else if (result > Number(valueArr[1])) { tooltips = "tipsHigh"; } } else { if (result < Number(valueArr[0])) { tooltips = "tipsLow"; } else if (result > Number(valueArr[1])) { tooltips = "tipsHigh"; } } }
//错误值校验
let errArr = []; if (checkItem.inputCheck) { errArr = checkItem.inputCheck .replaceAll("--", "-") .replaceAll("〜", "-") .replaceAll("~", "-") .split("-"); if (errArr.length == 1) errArr.unshift(-1); } if (errArr && errArr.length > 1) { if (result < Number(errArr[0]) || result > Number(errArr[1])) { tooltips = "tipsError"; console.log("checkItem", checkItem); } } } break; case "2": if (checkItem.result) { if ( checkItem.result.indexOf("阴性") > -1 || checkItem.result.indexOf("-") > -1 ) { tooltips = "tipsNegative"; } else if ( checkItem.result.indexOf("弱阳性") > -1 || checkItem.result.indexOf("±") > -1 ) { tooltips = "tipsLowPositive"; } else if ( checkItem.result.indexOf("阳性") > -1 || checkItem.result.indexOf("+") > -1 ) { tooltips = "tipsPositive"; } } break; default: break; }
// 判断后重新赋值
checkItem.class = tooltips; // 保存过检查时,直接取数据库
checkItem.resultStatusId = this[tooltips].id; //名称 dataInputPrompt
// console.log('checkItem',checkItem)
// console.log(`this.${tooltips}`,this[tooltips])
},
// 行结果是否可编辑
rowResultDisabled(row) { return ( row.isCalculationItem == "Y" || this.doctorCheck.RegisterCheckEdit.completeFlag == "1" || this.doctorCheck.RegisterCheckEdit.completeFlag == "2" ); }, btnCritical(row) { this.dialogWin.FollowCriticalCheck = true; this.doctorCheck.combinationCriticalValue = false; this.doctorCheck.singleDetailedProject = row; }, //项目列为计算函数
computeFun(index) { // 有计算项的,才调用计算函数
let haveComputeFun = false; let checkItem = this.doctorCheck.checkItemList[index]; console.log("checkItem", checkItem); let body = { registerCheckId: checkItem.registerCheckId, items: [], };
this.doctorCheck.checkItemList.forEach((e) => { body.items.push({ itemId: e.itemId, result: e.result, }); if (e.isCalculationItem == "Y") haveComputeFun = true; }); if (!haveComputeFun) return; // 有计算项的,才调用计算函数
let lfind = -1; postapi( "/api/app/diagnosisfunction/getcalculationfunctionresult", body ).then((res) => { if (res.code != -1) { // console.log('res.data',res.data)
res.data.items.forEach((e) => { lfind = arrayExistObj( this.doctorCheck.checkItemList, "itemId", e.itemId ); if (lfind > -1) { if (e.result != this.doctorCheck.checkItemList[lfind].result) { this.doctorCheck.checkItemList[lfind].result = e.result; console.log("e", lfind, this.doctorCheck.checkItemList[lfind]); this.madeTooltips(lfind); } } }); } }); },
// 点击结果模版按钮
btnMoreResult(row, index) { this.moreResult.data = deepCopy(row.itemResultTemplates); this.moreResult.result = row.result; this.moreResult.defaultResult = row.defaultResult; this.moreResult.index = index; // "itemId": "3a0c517f-cbdb-9fff-e300-1f76b3e47580",
// "result": "00000",
// "diagnosisId": "3a0ed8a2-72d9-ee50-78aa-5b1f474f2921",
// "isNameIntoSummary": "N",
// "isResultIntoSummary": "Y",
// "resultStatusId": "01",
// "simpleCode": "0"
this.dialogWinMoreResult = true;
this.watchSelection(); },
// pacs结果模板
btnPacsResult(row, index) { let result = row.result; let summary = "";
this.doctorCheck.checkSummaryList.forEach((e, i) => { summary += e.summary; });
this.pacsParams.row = row; this.pacsParams.index = index; this.pacsParams.result = result; this.pacsParams.summary = summary; this.pacsParams.refresh++;
this.dialogWinPacsTemplate = true; },
// pacs结果模板(备份)
btnPacsResultBak(row, index) { let result = row.result; let summary = "";
this.doctorCheck.checkSummaryList.forEach((e, i) => { summary += e.summary; });
this.pacsParams.row = row; this.pacsParams.index = index; this.pacsParams.result = result; this.pacsParams.summary = summary; this.pacsParams.refresh++;
this.dialogWinPacsTemplate = true; },
// 双击选择结果模版的结果
dblclickResult(item) { this.moreResult.result = ""; this.clickResult(item); this.btnOkResult(""); },
// 单击选择结果模版的结果
clickResult(item) { let moreResult = this.moreResult.result || '' // console.log('this.moreResult',JSON.stringify(this.moreResult))
// console.log('item',item)
//点击结果前 == 默认结果
if (!moreResult || moreResult == this.moreResult.defaultResult ) { this.moreResult.result = item.result this.selection.start = length(item.result) - 1 this.selection.end = this.selection.start }else if(moreResult.includes(item.result)){ // 结果包含已选时,不作处理
}else { let choosedResult = item.result if(this.LocalConfig.doctorCheck.isSplitChooseResult == 'Y') choosedResult = ';' + choosedResult this.insertSymbols(choosedResult) }
},
// 清除结果值
btnClear() { this.moreResult.result = ""; },
btnOkResult(result) { this.doctorCheck.checkItemList[this.moreResult.index].result = result ? this.moreResult[result] : this.moreResult.result; this.madeTooltips(this.moreResult.index); this.computeFun(this.moreResult.index); this.dialogWinMoreResult = false; },
// 处理 pacs 结果录入的情况
handlePacsResult(row, index, pacsResult) { // console.log('row,index,pacsResult', row, index, pacsResult)
// this.doctorCheck.checkItemList[index].result = pacsResult.result;
/* 新词条录入方式,取消合并 this.doctorCheck.checkSummaryList = [ { id: Math.random(), registerCheckId: this.doctorCheck.RegisterCheckEdit.id, summary: pacsResult.summary, summaryFlag: "N", }, ]; */ this.dialogWinPacsTemplate = false; },
//选择项目
rowClick(row) { this.clickTime1 = new Date().getTime() console.log('this.clickTime1', this.clickTime1) this.doctorCheck.checkItem = row; this.restaurants = row.itemResultTemplates;
// 防止与双击冲突
setTimeout(() => { // 首次点击才执行
if (this.clickTime1 > this.clickTime2) { //显示历史明细结果
if (this.hisResultDetailDialogVisible) { this.gridData = [] postapi("/api/app/RegisterCheckItem/GetItemTwoHistoricalResults", { registerCheckId: row.registerCheckId, itemId: row.itemId, }).then((res) => { if (res.code != -1) { this.gridData = res.data; } }); } } }, 400);
},
// 双击调出模版
dblClick(row) { this.clickTime2 = new Date().getTime() console.log('this.clickTime2', this.clickTime2) //@click="btnMoreResult(scope.row, scope.$index)" :disabled="rowResultDisabled(scope.row)"
if (this.rowResultDisabled(row)) { return } let lfind = arrayExistObj(this.doctorCheck.checkItemList, 'itemId', row.itemId) this.btnMoreResult(row, lfind) },
//检查组合项目下所包含的明细项目
checkItemList(RegisterCheckId) { // this.doctorCheck.checkItem = null
if (!RegisterCheckId) { this.doctorCheck.checkItemList = []; this.doctorCheck.RegisterCheckEdit = { id: "", checkDoctorId: "", checkDate: "", LastModifierId: "", LastModificationTime: "", completeFlag: "", }; return; } console.log( `/api/app/registercheckitem/getlistinregistercheckid?RegisterCheckId=${RegisterCheckId}` );
getapi(`/api/app/registercheck/getregistercheck?id=${RegisterCheckId}`) .then((res) => { if (res.code > -1) { this.doctorCheck.RegisterCheckEdit = res.data; if ( res.data.isCharge != "Y" && this.doctor_check_check_charge == "Y" ) { this.$message.warning({ showClose: true, message: `该体检人员未缴清费用!`, }); } if (this.doctorCheck.RegisterCheckEdit.completeFlag == "0") { // 当前用户是检查医生时,默认当前用户
if (this.userInfo.operatorType == '1' || this.userInfo.operatorType == '3') { this.doctorCheck.RegisterCheckEdit.checkDoctorId = this.userInfo.userId; } this.doctorCheck.RegisterCheckEdit.checkDate = new Date(); } return getapi( `/api/app/registercheckitem/getlistinregistercheckid?RegisterCheckId=${RegisterCheckId}&PatientRegisterId=${this.dataTransOpts.tableS.patient_register.id}` ); } }) .then((res) => { // console.log("checkItemList", res.data);
if (res && res.code > -1) { res.data.forEach((e, i) => { // 虚拟显示危急状态
e["criticalFlag"] = "N"; }); //console.log('this.doctorCheck.checkItemList',res.data)
this.doctorCheck.checkItemList = res.data;
this.doctorCheck.checkItemList.forEach((e, i) => { if (this.doctorCheck.RegisterCheckEdit.completeFlag == "0") { this.madeTooltips(i); } else { let lfind = arrayExistObj( this.resultStatus, "id", e.resultStatusId ); if (lfind > -1) { e.class = this.resultStatus[lfind].tooltips; } } });
// 光标定位第一个输入框
this.$nextTick(() => { this.$refs[res.data[0].itemId].focus(); //打开光标定位到条码栏里
}); // 监听回车代替tab键
this.enterToTab(); } }) .catch((err) => { this.$message.error({ showClose: true, message: `操作失败,原因:${err}`, }); }); },
querySearch(queryString, cb) { var restaurants = []; //不需要字典库显示 deepCopy(this.restaurants) [{ value: '阴性' },{ value: '阳性' }]
restaurants.forEach((item) => { return (item.value = item.result); }); // console.log("restaurants", restaurants);
var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants; // 调用 callback 返回建议列表的数据
cb(results); },
createFilter(queryString) { return (restaurant) => { return ( restaurant["value"].toLowerCase().indexOf(queryString.toLowerCase()) > -1 ); }; }, handleSelect(item) { console.log("item", item); },
//回车替代tab键
enterToTab() { // console.log('enterToTab');
this.$nextTick(() => { let inputs = document.querySelectorAll(["textarea", "input"]); //用数组可以读取多个标签的元素 //.inline-input
// console.log('inputs', typeof inputs, inputs)
// 为每个输入框添加键盘事件监听器
inputs.forEach((input, i) => { // console.log('input',input);
input.addEventListener("keydown", (event) => { // 如果按下的是回车键
// console.log('data-lineModeFlag', input, input.getAttribute('data-lineModeFlag'), i);
// console.log('event.keyCode', event.keyCode)
switch (event.keyCode) { case 13: if ( event.keyCode === 13 && input.getAttribute("data-lineModeFlag") == "0" ) { event.preventDefault(); } else { break; } case 9: // tab 键
event.preventDefault(); case 40: // ↓ 键
for (let j = i + 1; j < inputs.length; j++) { // console.log(inputs[j], inputs[j].getAttribute('type'), inputs[j].getAttribute('placeholder'))
if (inputs[j].getAttribute("placeholder") == "请输入结果值") { if (inputs[j].getAttribute("disabled") != "disabled") { // console.log('inputs[j]', inputs[j])
inputs[j].focus(); break; } } } break; case 38: // ↑ 键
for (let j = i - 1; j > -1; j--) { // console.log(inputs[j], inputs[j].getAttribute('type'), inputs[j].getAttribute('placeholder'))
if (inputs[j].getAttribute("placeholder") == "请输入结果值") { if (inputs[j].getAttribute("disabled") != "disabled") { // console.log('inputs[j]', inputs[j])
inputs[j].focus(); break; } } } break; default: break; } });
// 点击时全选结果
input.addEventListener("click", (event) => { if (this.LocalConfig.doctorCheck.isSelectAll == 'Y') { input.select(); } }); }); }); },
// 光标位置插入特殊符号(插入结果)
insertSymbols(symbols) { let result = this.moreResult.result || ""; if (result) { result = result.substring(0, this.selection.start) + symbols + result.substring(this.selection.end); } else { result = symbols; } this.moreResult.result = result; this.selection.start = this.selection.start + length(symbols); this.selection.end = this.selection.start; }, // 获取光标位置的函数
getCaretPosition() { let input = document.getElementById("resultBox"); this.selection.start = input.selectionStart; this.selection.end = input.selectionEnd; // console.log('selection',this.selection)
}, watchSelection() { this.$nextTick(() => { let that = this; let resultBox = document.getElementById("resultBox"); //用数组可以读取多个标签的元素 //.inline-input
// 绑定键盘事件到文本框
resultBox.addEventListener("click", function (event) { // 获取光标位置
that.getCaretPosition(); });
resultBox.addEventListener("input", function (event) { // 获取光标位置
that.getCaretPosition(); }); }); },
// 录入结果区域 右击事件(无壳)
onContextmenuNoShell(event) {
//菜单项
let items = []; // items.push({
// label: "一级菜单",
// children: [
// { label: "修改姓名", onClick: () => { this.fnUpBaseInfo(row, 'patientName'); } }
// ],
// onClick: () => { //菜单事件 }
// })
// 显示明细历次结果
items.push({ label: "显示明细历次结果", onClick: () => { this.hisResultDetailDialogVisible = true }, })
// 预览影像报告
//if(checkPagePriv(this.pagePriv.privs, "预览影像报告"))
items.push({ label: "预览影像报告", onClick: () => { this.pacsReportView(); }, })
this.$contextmenu({ items, event, x: event.clientX, y: event.clientY, customClass: "custom-class", zIndex: 3, minWidth: 80, });
return false; },
// 右击菜单
onContextmenu(event) { if (!this.$peisAPI) { this.onContextmenuNoShell(event) } else { let menus = [ { type: 'separator' }, { label: '显示明细历次结果', itemId: '显示明细历次结果', enabled: true }, { label: '预览影像报告', itemId: '预览影像报告', enabled: true } // { label: '测试菜单', itemId: '测试菜单', enabled: true },
// {
// label: '更多操作',
// submenu: [
// { label: '子菜单', itemId: '子菜单', enabled: true }
// ]
// }
]
this.$peisAPI.showContextMenu(menus) .then(res => { console.log('res', res) }) .catch(err => { console.log('err', err) }) .finally(() => { console.log('finally') }) }
},
// 模板右击
onContextmenuTemplate(event) { if (!this.$peisAPI) return let menus = [ // { label: '测试菜单', itemId: '测试菜单', enabled: true },
// {
// label: '更多操作',
// submenu: [
// { label: '子菜单', itemId: '子菜单', enabled: true }
// ]
// }
]
this.$peisAPI.showContextMenu(menus) .then(res => { console.log('res', res) }) .catch(err => { console.log('err', err) }) .finally(() => { console.log('finally') }) },
// 自定义右击事件
onContextMenuDIY(data) { //this.$message({showClose:true,message:data})
switch (data) { case '显示明细历次结果': this.hisResultDetailDialogVisible = true break; case '预览影像报告': this.pacsReportView(); break; default: break; } },
// 预览影像报告
pacsReportView() {
if (!this.$peisAPI) { this.$message.info("此功能,需要在壳客户端才可运行!") return } ///3a0c990e-5756-2dc0-19d5-69a617fe4048
let ReportCode = '0011'; let BusinessCode = this.doctorCheck.RegisterCheckId
let token = window.sessionStorage.getItem('token'); let user = window.sessionStorage.getItem('user'); let toOutShell = { ReportCode, token, BusinessCode, isBuildImage: 'N', IsUploadPdf: 'N', preViewCanPrint: 'Y', Parameters: [ { Name: 'printer', Value: user }, { Name: 'LTS', Value: 'Y' }, //Y、N N只看不能打印
{ Name: "firstPage", Value: "pic/peisReportFirstPage.jpg" }, { Name: "pageHeader", Value: "pic/peisReportPageHeader.jpg" }, { Name: "pageFooter", Value: "pic/peisReportPageFooter.jpg" }, { Name: "orgSign", Value: this.dataTransOpts.tableS.patient_register.isPatientOccupationalDisease == 'Y' ? "pic/orgSignOcc.png" : "pic/orgSign.png" }, { Name: 'picExtOne', Value: 'pic/hisLog.jpg' }, { Name: 'resultSign', Value: 'pic/resultSign.png' }, ], };
let JSONtoOutShell = JSON.stringify(toOutShell) console.log('$peisAPI.printPre', JSONtoOutShell) this.$peisAPI.printPre(JSONtoOutShell) .then(res => { if (res) { let lres = JSON.parse(res) if (lres.code < 0) this.$message.error({ showClose: true, message: lres.message }) } }) .catch(err => { this.$message.warning(err); });
},
// 身高体重、血压仪
onSerialData(data) { console.log('onSerialData.data', data) let array = data.data for (let index = 0; index < array.length; index++) { this.setSerialData(array[index]['deviceType'], array[index]['value']) } },
// 接收仪器的数据设置到体检
setSerialData(deviceType, value) { try { let itemIds = this.comData[deviceType].split(',') let lfind = -1
for (let index = 0; index < itemIds.length; index++) { lfind = arrayExistObj(this.doctorCheck.checkItemList, 'itemId', itemIds[index]) if (lfind > -1) break } if (lfind > -1) { this.doctorCheck.checkItemList[lfind]['result'] = String(value) this.madeTooltips(lfind); this.computeFun(lfind); }
} catch (err) { console.error('身高体重仪数据设置体检出错:', err) this.$message.error({ showClose: true, message: err.message }) }
},
},
//监听事件
watch: { //检查项目切换
// "doctorCheck.RegisterCheckId":{
// immediate:true,
// handler(newVal, oldVal) {
// console.log(
// "watch doctorCheck.RegisterCheckId newVal:",
// newVal,
// " oldVal:",
// oldVal
// );
// this.checkItemList(newVal);
// }
// },
//检查项目未切换换时 也可以强制刷新数据
"dataTransOpts.refresh.register_check_item.M": { // immediate: true,
handler(newVal, oldVal) { console.log( `watch 检查明细 newVal:${newVal} oldVal:${oldVal} registerCheckId: ${this.dataTransOpts.tableS.register_check.id}` ); this.checkItemList(this.dataTransOpts.tableS.register_check.id); }, }, },};</script><style lang="scss" scoped>@import "../../assets/css/global.css";
::v-deep .el-table td.el-table__cell,.el-table th.el-table__cell.is-leaf { padding: 0;}
::v-deep .el-textarea__inner { min-height: 23px; height: 23px; line-height: 1.25; padding: 2px 15px 2px 2px; font-size: v-bind("LocalConfig.doctorCheck.pacsDescFontSize"); font-family: "Microsoft YaHei";}
/*正常*/::v-deep .tipsNormal .el-textarea__inner { background-color: v-bind("tipsNormal.backgroundColor") !important; color: v-bind("tipsNormal.color") !important;}
/*错误*/::v-deep .tipsError .el-textarea__inner { background-color: v-bind("tipsError.backgroundColor") !important; color: v-bind("tipsError.color") !important;}
/*阴性 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */::v-deep .tipsNegative .el-textarea__inner { background-color: v-bind("tipsNegative.backgroundColor") !important; color: v-bind("tipsNegative.color") !important;}
/*弱阳性 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */::v-deep .tipsLowPositive .el-textarea__inner { background-color: v-bind("tipsLowPositive.backgroundColor") !important; color: v-bind("tipsLowPositive.color") !important;}
/*阳性 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */::v-deep .tipsPositive .el-textarea__inner { background-color: v-bind("tipsPositive.backgroundColor") !important; color: v-bind("tipsPositive.color") !important;}
/*偏低 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */::v-deep .tipsLow .el-textarea__inner { background-color: v-bind("tipsLow.backgroundColor") !important; color: v-bind("tipsLow.color") !important;}
/*偏高 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */::v-deep .tipsHigh .el-textarea__inner { background-color: v-bind("tipsHigh.backgroundColor") !important; color: v-bind("tipsHigh.color") !important;}
/*超低 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */::v-deep .tipsSuperLow .el-textarea__inner { background-color: v-bind("tipsSuperLow.backgroundColor") !important; color: v-bind("tipsSuperLow.color") !important;}
/*超高 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */::v-deep .tipsSuperHigh .el-textarea__inner { background-color: v-bind("tipsSuperHigh.backgroundColor") !important; color: v-bind("tipsSuperHigh.color") !important;}
/*文字性危及值 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */::v-deep .tipsSuper .el-textarea__inner { background-color: v-bind("tipsSuper.backgroundColor") !important; color: v-bind("tipsSuper.color") !important;}</style>
|