You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1430 lines
48 KiB

3 years ago
3 years ago
5 months ago
3 months ago
4 months ago
5 months ago
5 months ago
5 months ago
3 months ago
5 months ago
3 months ago
5 months ago
2 years ago
5 months ago
3 months ago
5 months ago
2 years ago
2 years ago
1 year ago
4 months ago
5 months ago
1 year ago
4 weeks ago
1 year ago
4 weeks ago
1 year ago
4 weeks ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
2 years ago
1 year ago
5 months ago
1 year ago
3 months ago
1 year ago
1 year ago
1 year ago
2 years ago
3 years ago
2 years ago
3 years ago
5 months ago
2 years ago
1 year ago
3 years ago
2 years ago
1 year ago
2 years ago
3 months ago
3 years ago
5 months ago
3 months ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
5 months ago
1 year ago
2 years ago
2 years ago
1 year ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
6 months ago
5 months ago
6 months ago
5 months ago
3 months ago
4 weeks ago
6 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
3 years ago
2 years ago
5 months ago
1 year ago
1 year ago
6 months ago
5 months ago
5 months ago
3 months ago
4 weeks ago
2 years ago
3 years ago
2 years ago
5 months ago
5 months ago
5 months ago
2 months ago
5 months ago
5 months ago
3 months ago
1 year ago
1 year ago
2 years ago
3 years ago
2 months ago
3 years ago
1 year ago
3 months ago
1 year ago
1 year ago
1 year ago
2 years ago
3 years ago
2 years ago
2 years ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
5 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
3 months ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
5 months ago
2 years ago
1 year ago
4 months ago
4 months ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
4 months ago
5 months ago
4 months ago
4 months ago
5 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
4 months ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
3 years ago
3 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
3 months ago
5 months ago
5 months ago
5 months ago
3 years ago
3 years ago
3 months ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
1 month ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
3 months ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
5 months ago
1 month ago
5 months ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 month ago
2 years ago
5 months ago
2 years ago
1 year ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
1 year ago
3 years ago
1 year ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
6 months ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
4 months ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
4 months ago
4 months ago
4 months ago
2 years ago
1 year ago
2 years ago
4 months ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
4 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
3 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
3 years ago
3 years ago
3 years ago
2 years ago
3 months ago
3 months ago
2 years ago
2 years ago
1 year ago
3 months ago
1 year ago
3 months ago
1 year ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
6 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
  1. <template>
  2. <div>
  3. <div @contextmenu.prevent="onContextmenu">
  4. <el-table :data="doctorCheck.checkItemList" style="width: 100%" :height="itemTableHeight" border highlight-current-row
  5. @row-click="itemRowClick" @row-dblclick="itemDblClick" size="small">
  6. <el-table-column prop="itemName" label="项目" min-width="160" />
  7. <el-table-column prop="result" label="结果" min-width="420">
  8. <template slot-scope="scope">
  9. <div style="display: flex;">
  10. <el-autocomplete style="width: 100%" type="textarea" v-model="scope.row.result" placeholder="请输入结果值"
  11. :disabled="rowResultDisabled(scope.row)" :autosize="{ minRows: 1, maxRows: 10 }" :ref="scope.row.itemId"
  12. :trigger-on-focus="false" :fetch-suggestions="querySearch" :data-lineModeFlag="scope.row.lineModeFlag"
  13. @input="
  14. madeTooltips(scope.$index);
  15. computeFun(scope.$index);
  16. " v-bind:class="scope.row.class">
  17. </el-autocomplete>
  18. <el-button style="min-width: 23px; padding: 2px" icon="el-icon-caret-bottom"
  19. @click="btnMoreResult(scope.row, scope.$index)" :disabled="rowResultDisabled(scope.row)"
  20. size="small"></el-button>
  21. <el-button style="min-width: 23px; padding: 2px; margin-left: 2px"
  22. @click="btnPacsResult(scope.row, scope.$index)" :disabled="rowResultDisabled(scope.row)"
  23. size="small">P</el-button>
  24. <el-button style="min-width: 23px; padding: 5.8px; margin-left: 2px"
  25. :disabled="rowResultDisabled(scope.row)" @click="btnPacsRessulst(scope.row)" size="small">S</el-button>
  26. </div>
  27. </template>
  28. </el-table-column>
  29. <el-table-column prop="unit" label="单位" width="90" align="center" />
  30. <el-table-column prop="referenceRangeValue" label="参考范围" width="120" align="center" />
  31. <el-table-column prop="resultStatusId" label="提示" width="40" align="center">
  32. <template slot-scope="scope">
  33. <div>
  34. {{
  35. dddw(
  36. resultStatus,
  37. "id",
  38. scope.row.resultStatusId,
  39. "dataInputPrompt"
  40. )
  41. }}
  42. </div>
  43. </template>
  44. </el-table-column>
  45. <el-table-column prop="criticalFlag" label="危急值" width="50" align="center">
  46. <template slot-scope="scope">
  47. <el-button :style="[
  48. { minWidth: '23px' },
  49. { padding: '6px 2px' },
  50. {
  51. backgroundColor: scope.row.isCriticalValue == 'Y' ? 'red' : '',
  52. },
  53. ]" @click="btnCritical(scope.row)" size="small">W</el-button>
  54. </template>
  55. </el-table-column>
  56. </el-table>
  57. </div>
  58. <!--模拟弹窗-->
  59. <div v-show="hisResultDetailDialogVisible"
  60. :style="`z-index:2;border-radius: 10px;border: 1px solid #ddd;background-color:#FFF; position: absolute;top:0px;right:${LocalConfig.doctorCheck.hisItemRight}px;width:200px;height: 450px;opacity:1;`">
  61. <div style="display: flex;justify-content:space-between;">
  62. <div style="margin-left: 5px;">历次明细结果</div>
  63. <div>
  64. <el-tooltip content="关闭历次明细窗口" placement="bottom" effect="light">
  65. <i class="el-icon-close" @click="hisResultDetailDialogVisible = false"
  66. style="font-size: 24px;color: red;cursor:pointer;"></i>
  67. </el-tooltip>
  68. </div>
  69. </div>
  70. <!-- 明细历次结果 -->
  71. <el-table :data="gridData" border width="100%" height="425" size="small" highlight-current-row
  72. style="border-radius:10px;">
  73. <el-table-column prop="checkDate" label="检查日期" min-width="90" align="center" />
  74. <el-table-column prop="itemResult" label="项目结果" min-width="100">
  75. <template slot-scope="scope">
  76. <div style="margin-left: 2px;">{{ scope.row.itemResult }}</div>
  77. </template>
  78. </el-table-column>
  79. </el-table>
  80. </div>
  81. <!--弹窗-->
  82. <div>
  83. <!-- 结果录入模版 -->
  84. <el-dialog title="结果录入模版" :visible.sync="dialogWinMoreResult" width="800px" :close-on-click-modal="false">
  85. <div style="margin-top: -10px" @contextmenu.prevent="onContextmenuTemplate">
  86. <el-checkbox v-model="LocalConfig.doctorCheck.isSplitChooseResult" size="small" true-label="Y"
  87. false-label="N">选结果模板时自动添加分隔符</el-checkbox>
  88. <div :style="`
  89. overflow-y: auto;
  90. height: 300px;
  91. width: 100%;
  92. display: ${LocalConfig.doctorCheck.resultModeDisp||'flex'};
  93. flex-wrap: wrap;
  94. align-content: flex-start;`
  95. ">
  96. <div v-for="item in moreResult.data" :key="item.id" style="margin: 5px; cursor: pointer"
  97. @click="clickResult(item)" @dblclick="dblclickResult(item)">
  98. <el-tag size="samll" style="
  99. padding: 0 3px;
  100. height: 24px;
  101. line-height: 24px;
  102. font-size: 14px;
  103. color: #303133;
  104. background-color: white;
  105. ">{{ item.result }}</el-tag>
  106. </div>
  107. </div>
  108. <div>特殊符号</div>
  109. <div style="
  110. overflow-y: auto;
  111. width: 100%;
  112. display: flex;
  113. flex-wrap: wrap;
  114. align-content: flex-start;
  115. ">
  116. <div v-for="item in symbols" :key="item.id" style="margin: 1px 2px; cursor: pointer"
  117. @click="insertSymbols(item.displayName)">
  118. <el-tag style="
  119. padding: 0 3px;
  120. height: 24px;
  121. line-height: 24px;
  122. font-size: 15px;
  123. color: #303133;
  124. background-color: white;
  125. ">
  126. {{ item.displayName }}
  127. </el-tag>
  128. </div>
  129. </div>
  130. <div style="display: flex; justify-content: space-between">
  131. <div style="margin-top: 5px">录入结果</div>
  132. <div style="overflow-y: auto; display: flex; flex-wrap: wrap">
  133. <div v-for="item in splitSymbols" :key="item" style="margin: 1px 2px; cursor: pointer"
  134. @click="insertSymbols(item)">
  135. <el-tag style="
  136. padding: 0 3px;
  137. height: 24px;
  138. line-height: 24px;
  139. font-size: 15px;
  140. color: #303133;
  141. background-color: white;
  142. ">
  143. {{ item }}
  144. </el-tag>
  145. </div>
  146. </div>
  147. </div>
  148. <el-input id="resultBox" style="width: 100%" class="commonFont" type="textarea"
  149. :autosize="{ minRows: 4, maxRows: 4 }" v-model="moreResult.result" />
  150. </div>
  151. <span slot="footer" class="dialog-footer">
  152. <el-button @click="btnClear"> </el-button>
  153. <el-button type="primary" @click="btnOkResult('defaultResult')">默认结果</el-button>
  154. <el-button type="primary" @click="btnOkResult('')"> </el-button>
  155. <el-button @click="dialogWinMoreResult = false"> </el-button>
  156. </span>
  157. </el-dialog>
  158. <!--Pacs结果录入模版-->
  159. <el-dialog :title="'Pacs结果录入模版 -- ' + doctorCheck.checkItemList[pacsParams.index].itemName"
  160. v-if="dialogWinPacsTemplate" :visible.sync="dialogWinPacsTemplate" width="880px" :close-on-click-modal="false">
  161. <PacsTemplate :refParams="pacsParams" :refFuncOther="handlePacsResult" />
  162. </el-dialog>
  163. <!--历史结果与折线图-->
  164. <el-dialog :title="curRow.itemName" :visible.sync="previousResults" width="500px" :close-on-click-modal="true"
  165. :show-close="false" @close="resultsclose">
  166. <el-tabs v-model="itemActiveName">
  167. <el-tab-pane label="文字结果" name="first">
  168. <el-table :data="gridData">
  169. <el-table-column property="checkDate" label="检查日期" align="center"></el-table-column>
  170. <el-table-column property="itemResult" label="项目结果" align="center"></el-table-column>
  171. </el-table>
  172. </el-tab-pane>
  173. <el-tab-pane label="折线图" name="second">
  174. <div style="height: 400px; width: 500px" ref="chart1"></div>
  175. </el-tab-pane>
  176. </el-tabs>
  177. </el-dialog>
  178. </div>
  179. </div>
  180. </template>
  181. <script>
  182. // 0-无参考范围,1-数字型,2-字符型,3-性激素
  183. import { mapState } from "vuex";
  184. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  185. import { arrayExistObj, dddw, deepCopy, getPagePriv, checkPagePriv } from "../../utlis/proFunc";
  186. import PacsTemplate from "./PacsTemplate.vue";
  187. import * as echarts from "echarts";
  188. export default {
  189. components: {
  190. PacsTemplate,
  191. },
  192. props: ["isCheckPicture", "registerCheckId", "doctor_check_check_charge","refParams"],
  193. data() {
  194. return {
  195. pagePriv: {
  196. routeUrlorPageName: "doctorCheck", //当前页面归属路由或归属页面权限名称
  197. privs: [], // 页面权限
  198. },
  199. itemActiveName: "first",
  200. previousResults: false,
  201. gridData: [],
  202. resultStatus: [], //结果状态提示数据
  203. tipsNormal: {
  204. id: "01",
  205. displayName: "正常",
  206. dataInputPrompt: "正常",
  207. reportPrompt: "正常",
  208. reportBackgroundColor: 16777215,
  209. reportFontColor: 0,
  210. dataInputBackgroundColor: 16777215,
  211. dataInputFontColor: 0,
  212. }, //正常提示
  213. tipsError: {}, //错误提示
  214. tipsNegative: {}, //阴性提示
  215. tipsLowPositive: {}, //弱阳性提示
  216. tipsPositive: {}, //阳性提示
  217. tipsLow: {}, //偏低提示
  218. tipsHigh: {}, //偏高提示
  219. tipsSuperLow: {}, //超低提示
  220. tipsSuperHigh: {}, //超高提示
  221. tipsSuper: {}, //文字型危急值
  222. restaurants: [], //结果模版
  223. currentRow: -1, //当前操作的行
  224. dialogWinMoreResult: false,
  225. dialogWinPacsTemplate: false,
  226. moreResult: {
  227. data: [],
  228. result: "",
  229. defaultResult: "",
  230. index: 0, // 明细序列
  231. }, //结果模版
  232. selection: {
  233. // 光标位置
  234. start: 0,
  235. end: 0,
  236. },
  237. symbols: [], //特殊符号
  238. splitSymbols: [";", "、"], // 分隔符
  239. userInfo: {
  240. operatorType: "0",
  241. userId: "",
  242. user: "",
  243. },
  244. // pacs 结果录入
  245. pacsParams: {
  246. from: "doctor",
  247. refresh: -1, // 强制刷新
  248. row: {},
  249. index: 0,
  250. result: "",
  251. summary: "",
  252. },
  253. curRow: {},
  254. // 医生诊台相关的本地设置
  255. LocalConfig: {
  256. doctorCheck: {
  257. isSelectAll: 'N', // 录入结果时,是否全选
  258. pacsDescFontSize: "14px", //描述内容的字体大小
  259. isSplitChooseResult: "Y", // 选结果时,是否自动加上分隔符
  260. hisItemRight:0, // 历史检查明细右边边距
  261. resultModeDisp:'flex', // flex 紧凑排列;block 一行一个
  262. }
  263. },
  264. hisResultDetailDialogVisible: false, // 历史结果显示页面
  265. // 避免双击与单击冲突
  266. clickTime1: 0, //第一次点时间
  267. clickTime2: 0, //第二次点时间
  268. //身高体重血压仪项目
  269. comData: {
  270. height_item_id: '', //身高明细项目编号
  271. weight_item_id: '', //体重明细项目编号
  272. hb_item_id: '', //收缩压(高压)明细项目编号
  273. lb_item_id: '', //舒张压(低压)明细项目编号
  274. },
  275. };
  276. },
  277. created() {
  278. //获取用户当前页面的权限
  279. let userPriv = window.sessionStorage.getItem("userPriv");
  280. if (userPriv)
  281. this.pagePriv.privs = deepCopy(
  282. getPagePriv(this.pagePriv.routeUrlorPageName)
  283. );
  284. this.dictInit();
  285. let LocalConfig = JSON.parse(window.localStorage.getItem("LocalConfig") || null)
  286. if (LocalConfig?.doctorCheck?.isSelectAll) this.LocalConfig.doctorCheck.isSelectAll = LocalConfig.doctorCheck.isSelectAll
  287. if (LocalConfig?.doctorCheck?.pacsDescFontSize) this.LocalConfig.doctorCheck.pacsDescFontSize = LocalConfig.doctorCheck.pacsDescFontSize + 'px'
  288. if (LocalConfig?.doctorCheck?.isSplitChooseResult) this.LocalConfig.doctorCheck.isSplitChooseResult = LocalConfig.doctorCheck.isSplitChooseResult
  289. if (LocalConfig?.doctorCheck?.hisItemRight) this.LocalConfig.doctorCheck.hisItemRight = Number(LocalConfig.doctorCheck.hisItemRight)
  290. if (LocalConfig?.doctorCheck?.resultModeDisp) this.LocalConfig.doctorCheck.resultModeDisp = LocalConfig.doctorCheck.resultModeDisp
  291. },
  292. //挂载完成
  293. mounted() {
  294. // 监听来自 Electron 的调用
  295. if (this.$peisAPI) {
  296. try {
  297. // 右击
  298. this.$peisAPI.onContextMenuAction((data) => {
  299. this.onContextMenuDIY(data)
  300. });
  301. // 身高体重仪、血压仪 开启监听
  302. this.$peisAPI.onSerialData((data) => {
  303. this.onSerialData(data)
  304. });
  305. } catch (error) {
  306. console.error(error)
  307. }
  308. }
  309. this.getCheckItemList(this.refParams.registerCheckId);
  310. this.userInfo.operatorType = window.sessionStorage.getItem("operatorType") || '0';
  311. this.userInfo.userId = window.sessionStorage.getItem("userId") || null;
  312. this.userInfo.user = window.sessionStorage.getItem("user") || null;
  313. },
  314. // 销毁前
  315. beforeDestroy(){
  316. if (this.$peisAPI) {
  317. try {
  318. // 取消 身高体重仪、血压仪 监听
  319. this.$peisAPI.removeAllListeners("serial:data")
  320. } catch (error) {
  321. console.error(error)
  322. }
  323. }
  324. },
  325. computed: {
  326. ...mapState([
  327. "window",
  328. "dict",
  329. "dialogWin",
  330. "doctorCheck",
  331. ]),
  332. itemTableHeight() {
  333. let temp = this.window.pageHeight < 600 ? 600 : this.window.pageHeight;
  334. return Math.floor(
  335. ((temp - 315 - (this.isCheckPicture ? 110 : 0)) * 3) / 5
  336. );
  337. },
  338. },
  339. methods: {
  340. dddw,
  341. dictInit() {
  342. // 获取系统参数(是否显示历次明细结果)
  343. postapi('/api/app/SysParmValue/GetSysParmValueBySysParmId', { sysParmId: 'doctor_check_disp_hisdetail' })
  344. .then(res => {
  345. if (res.code > -1) {
  346. let hisResultDetailDialogVisible = res.data || "N"
  347. if (hisResultDetailDialogVisible == 'Y') {
  348. this.hisResultDetailDialogVisible = true
  349. }
  350. }
  351. })
  352. // 获取系统参数(身高明细项目ID)
  353. postapi('/api/app/SysParmValue/GetSysParmValueBySysParmId', { sysParmId: 'height_item_id' })
  354. .then(res => {
  355. if (res.code > -1) {
  356. this.comData.height_item_id = res.data || ""
  357. }
  358. })
  359. // 获取系统参数(体重明细项目ID)
  360. postapi('/api/app/SysParmValue/GetSysParmValueBySysParmId', { sysParmId: 'weight_item_id' })
  361. .then(res => {
  362. if (res.code > -1) {
  363. this.comData.weight_item_id = res.data || ""
  364. }
  365. })
  366. // 获取系统参数(收缩压(高压)明细项目ID)
  367. postapi('/api/app/SysParmValue/GetSysParmValueBySysParmId', { sysParmId: 'hb_item_id' })
  368. .then(res => {
  369. if (res.code > -1) {
  370. this.comData.hb_item_id = res.data || ""
  371. }
  372. })
  373. // 获取系统参数(舒张压(低压)明细项目ID)
  374. postapi('/api/app/SysParmValue/GetSysParmValueBySysParmId', { sysParmId: 'lb_item_id' })
  375. .then(res => {
  376. if (res.code > -1) {
  377. this.comData.lb_item_id = res.data || ""
  378. }
  379. })
  380. //获取结果状态提示数据
  381. getapi("/api/app/result-status").then((res) => {
  382. if (res.code != -1) {
  383. this.resultStatus = res.data;
  384. this.resultStatus.forEach((e) => {
  385. switch (e.id) {
  386. case "01": // 正常
  387. e.tooltips = "tipsNormal";
  388. this.colorTrans(e, e.tooltips);
  389. break;
  390. case "02": // 错误
  391. e.tooltips = "tipsError";
  392. this.colorTrans(e, e.tooltips);
  393. break;
  394. case "03": // 阴性
  395. e.tooltips = "tipsNegative";
  396. this.colorTrans(e, e.tooltips);
  397. break;
  398. case "04": // 阳性
  399. e.tooltips = "tipsPositive";
  400. this.colorTrans(e, e.tooltips);
  401. break;
  402. case "05": // 弱阳性
  403. e.tooltips = "tipsLowPositive";
  404. this.colorTrans(e, e.tooltips);
  405. break;
  406. case "06": // 偏低
  407. e.tooltips = "tipsLow";
  408. this.colorTrans(e, e.tooltips);
  409. break;
  410. case "07": // 偏高
  411. e.tooltips = "tipsHigh";
  412. this.colorTrans(e, e.tooltips);
  413. break;
  414. case "08": // 危急值下限
  415. e.tooltips = "tipsSuperLow";
  416. this.colorTrans(e, e.tooltips);
  417. break;
  418. case "09": // 危急值上限
  419. e.tooltips = "tipsSuperHigh";
  420. this.colorTrans(e, e.tooltips);
  421. break;
  422. case "10": // 危急值
  423. e.tooltips = "tipsSuper";
  424. this.colorTrans(e, e.tooltips);
  425. break;
  426. default:
  427. e.tooltips = "tipsNormal";
  428. this.colorTrans(e, e.tooltips);
  429. break;
  430. }
  431. });
  432. }
  433. });
  434. //获取结果状态提示数据
  435. postapi("/api/app/CommonChar/GetCommonCharList", {}).then((res) => {
  436. if (res.code >= 0) {
  437. this.symbols = res.data;
  438. }
  439. });
  440. },
  441. btnPacsRessulst(row) {
  442. this.curRow = row;
  443. postapi("/api/app/RegisterCheckItem/GetItemTwoHistoricalResults", {
  444. registerCheckId: row.registerCheckId,
  445. itemId: row.itemId,
  446. }).then((res) => {
  447. if (res.code != -1) {
  448. this.previousResults = true;
  449. this.gridData = res.data;
  450. this.$nextTick(() => {
  451. this.initEcharts();
  452. });
  453. }
  454. });
  455. },
  456. initEcharts() {
  457. let yAxisData = [];
  458. let xAxisData = [];
  459. for (let i = 0; i < this.gridData.length; i++) {
  460. if (this.gridData[i].checkDate) {
  461. xAxisData.push(this.gridData[i].checkDate);
  462. yAxisData.push(this.gridData[i].itemResult);
  463. }
  464. }
  465. let myChart = echarts.init(this.$refs.chart1);
  466. let option1 = {
  467. tooltip: {
  468. trigger: "axis",
  469. confine: true,
  470. },
  471. legend: {
  472. type: "scroll",
  473. orient: "horizontal", // 垂直
  474. right: "3%", // 左对齐
  475. top: "0%", // 位于顶部
  476. },
  477. grid: {
  478. show: false,
  479. left: "2%",
  480. right: "2%",
  481. top: "6%",
  482. bottom: "0%",
  483. containLabel: true,
  484. },
  485. xAxis: {
  486. type: "category",
  487. data: xAxisData,
  488. axisLabel: {
  489. textStyle: {
  490. fontSize: "14",
  491. },
  492. },
  493. axisLine: {
  494. show: true,
  495. },
  496. },
  497. yAxis: {
  498. type: "value",
  499. axisLabel: {
  500. textStyle: {
  501. fontSize: "14",
  502. },
  503. },
  504. },
  505. series: [
  506. {
  507. name: "项目结果",
  508. type: "line",
  509. data: yAxisData,
  510. },
  511. ],
  512. };
  513. myChart.setOption(option1);
  514. },
  515. resultsclose() {
  516. this.itemActiveName = "first";
  517. },
  518. // chartTabs(tab) {
  519. // if (tab.name == "second") {
  520. // this.$nextTick(() => {
  521. // this.initEcharts();
  522. // });
  523. // }
  524. // },
  525. // 颜色转换
  526. // displayName: "错误",
  527. // dataInputPrompt: "×",
  528. // reportPrompt: "×",
  529. // reportBackgroundColor: 2427166,
  530. // reportFontColor: 1070166,
  531. // dataInputBackgroundColor: 321313,
  532. // dataInputFontColor: 12991019,
  533. colorTrans(dataColor, frontColor) {
  534. let tempColor =
  535. "000000" + Number(dataColor.dataInputBackgroundColor).toString(16);
  536. let backgroundColor = "#" + tempColor.substring(tempColor.length - 6);
  537. tempColor = "000000" + Number(dataColor.dataInputFontColor).toString(16);
  538. let color = "#" + tempColor.substring(tempColor.length - 6);
  539. this[frontColor] = Object.assign({}, dataColor, {
  540. backgroundColor,
  541. color,
  542. });
  543. console.log(`this.${frontColor}`, this[frontColor]);
  544. },
  545. // "referenceRangeValue": "15-55",
  546. // "referenceRangeTypeFlag": "1",
  547. // "criticalRangeValue": null,
  548. // "result"
  549. madeTooltips(index) {
  550. // let ts = confirm('提示')
  551. let checkItem = this.doctorCheck.checkItemList[index];
  552. let tooltips = "tipsNormal";
  553. checkItem.class = tooltips;
  554. let referenceRangeTypeFlag = checkItem.referenceRangeTypeFlag || "0"; //参考范围类别0-无参考范围,1-数字型,2-字符型,3-性激素
  555. // console.log('madeTooltips',index,referenceRangeTypeFlag)
  556. switch (referenceRangeTypeFlag) {
  557. case "3": // 1 是数字型,3 是性激素期
  558. case "1":
  559. // console.log('1、3')
  560. if (checkItem.result) {
  561. let tempResult = checkItem.result
  562. .replaceAll("<", "")
  563. .replaceAll("≤", "")
  564. .replaceAll("≦", "")
  565. .replaceAll(">", "")
  566. .replaceAll("≥", "")
  567. .replaceAll("≧", "")
  568. .replaceAll("=", "")
  569. .replaceAll(" ", "");
  570. console.log("tempResult", isNaN(tempResult), tempResult);
  571. if (isNaN(tempResult)) break;
  572. let result = Number(tempResult);
  573. if (checkItem.referenceRangeValue) {
  574. let criticalRangeValue = checkItem.criticalRangeValue;
  575. let valueArr = checkItem.referenceRangeValue
  576. .replaceAll("--", "-")
  577. .replaceAll("〜", "-")
  578. .replaceAll("~", "-")
  579. .split("-");
  580. if (valueArr.length == 1) valueArr.unshift(0);
  581. // console.log('valueArr',checkItem.referenceRangeValue,valueArr)
  582. if (criticalRangeValue) {
  583. let criticalArr = criticalRangeValue
  584. .replaceAll("--", "-")
  585. .replaceAll("〜", "-")
  586. .replaceAll("~", "-")
  587. .split("-");
  588. if (criticalArr.length == 1) criticalArr.unshift(0);
  589. // console.log('criticalArr',checkItem.criticalRangeValue,criticalArr)
  590. if (result < Number(criticalArr[0])) {
  591. tooltips = "tipsSuperLow";
  592. } else if (result > Number(criticalArr[1])) {
  593. tooltips = "tipsSuperHigh";
  594. } else if (result < Number(valueArr[0])) {
  595. tooltips = "tipsLow";
  596. } else if (result > Number(valueArr[1])) {
  597. tooltips = "tipsHigh";
  598. }
  599. } else {
  600. if (result < Number(valueArr[0])) {
  601. tooltips = "tipsLow";
  602. } else if (result > Number(valueArr[1])) {
  603. tooltips = "tipsHigh";
  604. }
  605. }
  606. }
  607. //错误值校验
  608. let errArr = [];
  609. if (checkItem.inputCheck) {
  610. errArr = checkItem.inputCheck
  611. .replaceAll("--", "-")
  612. .replaceAll("〜", "-")
  613. .replaceAll("~", "-")
  614. .split("-");
  615. if (errArr.length == 1) errArr.unshift(-1);
  616. }
  617. if (errArr && errArr.length > 1) {
  618. if (result < Number(errArr[0]) || result > Number(errArr[1])) {
  619. tooltips = "tipsError";
  620. console.log("checkItem", checkItem);
  621. }
  622. }
  623. }
  624. break;
  625. case "2":
  626. if (checkItem.result) {
  627. if (
  628. checkItem.result.indexOf("阴性") > -1 ||
  629. checkItem.result.indexOf("-") > -1
  630. ) {
  631. tooltips = "tipsNegative";
  632. } else if (
  633. checkItem.result.indexOf("弱阳性") > -1 ||
  634. checkItem.result.indexOf("±") > -1
  635. ) {
  636. tooltips = "tipsLowPositive";
  637. } else if (
  638. checkItem.result.indexOf("阳性") > -1 ||
  639. checkItem.result.indexOf("+") > -1
  640. ) {
  641. tooltips = "tipsPositive";
  642. }
  643. }
  644. break;
  645. default:
  646. break;
  647. }
  648. // 判断后重新赋值
  649. checkItem.class = tooltips;
  650. // 保存过检查时,直接取数据库
  651. checkItem.resultStatusId = this[tooltips].id; //名称 dataInputPrompt
  652. // console.log('checkItem',checkItem)
  653. // console.log(`this.${tooltips}`,this[tooltips])
  654. },
  655. // 行结果是否可编辑
  656. rowResultDisabled(row) {
  657. return (
  658. row.isCalculationItem == "Y" ||
  659. this.doctorCheck.RegisterCheckEdit.completeFlag == "1" ||
  660. this.doctorCheck.RegisterCheckEdit.completeFlag == "2"
  661. );
  662. },
  663. btnCritical(row) {
  664. this.dialogWin.FollowCriticalCheck = true;
  665. this.doctorCheck.combinationCriticalValue = false;
  666. this.doctorCheck.singleDetailedProject = row;
  667. },
  668. //项目列为计算函数
  669. computeFun(index) {
  670. // 有计算项的,才调用计算函数
  671. let haveComputeFun = false;
  672. let checkItem = this.doctorCheck.checkItemList[index];
  673. console.log("checkItem", checkItem);
  674. let body = {
  675. registerCheckId: checkItem.registerCheckId,
  676. items: [],
  677. };
  678. this.doctorCheck.checkItemList.forEach((e) => {
  679. body.items.push({
  680. itemId: e.itemId,
  681. result: e.result,
  682. });
  683. if (e.isCalculationItem == "Y") haveComputeFun = true;
  684. });
  685. if (!haveComputeFun) return; // 有计算项的,才调用计算函数
  686. let lfind = -1;
  687. postapi(
  688. "/api/app/diagnosisfunction/getcalculationfunctionresult",
  689. body
  690. ).then((res) => {
  691. if (res.code != -1) {
  692. // console.log('res.data',res.data)
  693. res.data.items.forEach((e) => {
  694. lfind = arrayExistObj(
  695. this.doctorCheck.checkItemList,
  696. "itemId",
  697. e.itemId
  698. );
  699. if (lfind > -1) {
  700. if (e.result != this.doctorCheck.checkItemList[lfind].result) {
  701. this.doctorCheck.checkItemList[lfind].result = e.result;
  702. console.log("e", lfind, this.doctorCheck.checkItemList[lfind]);
  703. this.madeTooltips(lfind);
  704. }
  705. }
  706. });
  707. }
  708. });
  709. },
  710. // 点击结果模版按钮
  711. btnMoreResult(row, index) {
  712. this.moreResult.data = deepCopy(row.itemResultTemplates);
  713. this.moreResult.result = row.result;
  714. this.moreResult.defaultResult = row.defaultResult;
  715. this.moreResult.index = index;
  716. if(!row.result){
  717. this.selection.start = 0
  718. this.selection.end = 0
  719. }else{
  720. this.selection.start = row.result.length
  721. this.selection.end = row.result.length
  722. }
  723. console.log('显示模板初始光标',this.selection)
  724. // "itemId": "3a0c517f-cbdb-9fff-e300-1f76b3e47580",
  725. // "result": "00000",
  726. // "diagnosisId": "3a0ed8a2-72d9-ee50-78aa-5b1f474f2921",
  727. // "isNameIntoSummary": "N",
  728. // "isResultIntoSummary": "Y",
  729. // "resultStatusId": "01",
  730. // "simpleCode": "0"
  731. this.dialogWinMoreResult = true;
  732. this.watchSelection();
  733. },
  734. // pacs结果模板
  735. btnPacsResult(row, index) {
  736. let result = row.result;
  737. let summary = "";
  738. this.doctorCheck.checkSummaryList.forEach((e, i) => {
  739. summary += e.summary;
  740. });
  741. this.pacsParams.row = row;
  742. this.pacsParams.index = index;
  743. this.pacsParams.result = result;
  744. this.pacsParams.summary = summary;
  745. this.pacsParams.refresh++;
  746. this.dialogWinPacsTemplate = true;
  747. },
  748. // pacs结果模板(备份)
  749. btnPacsResultBak(row, index) {
  750. let result = row.result;
  751. let summary = "";
  752. this.doctorCheck.checkSummaryList.forEach((e, i) => {
  753. summary += e.summary;
  754. });
  755. this.pacsParams.row = row;
  756. this.pacsParams.index = index;
  757. this.pacsParams.result = result;
  758. this.pacsParams.summary = summary;
  759. this.pacsParams.refresh++;
  760. this.dialogWinPacsTemplate = true;
  761. },
  762. // 双击选择结果模版的结果
  763. dblclickResult(item) {
  764. this.moreResult.result = "";
  765. this.clickResult(item);
  766. this.btnOkResult("");
  767. },
  768. // 单击选择结果模版的结果
  769. clickResult(item) {
  770. let moreResult = this.moreResult.result || ''
  771. let resultIsNum = /^[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?$/.test(item.result);
  772. // console.log('this.moreResult',JSON.stringify(this.moreResult))
  773. // console.log('item',item)
  774. //点击结果前 == 默认结果
  775. if (!moreResult || moreResult == this.moreResult.defaultResult ) {
  776. this.moreResult.result = item.result
  777. this.selection.start = item?.result.length||0
  778. this.selection.end = this.selection.start
  779. console.log('=默认结果光标',this.selection)
  780. }else if(moreResult.includes(item.result) && !resultIsNum){
  781. // 结果包含已选(且不是数字)时,不作处理
  782. }else {
  783. let choosedResult = item.result
  784. if(this.LocalConfig.doctorCheck.isSplitChooseResult == 'Y') choosedResult = ';' + choosedResult
  785. this.insertSymbols(choosedResult)
  786. }
  787. },
  788. // 清除结果值
  789. btnClear() {
  790. this.moreResult.result = "";
  791. },
  792. btnOkResult(result) {
  793. this.doctorCheck.checkItemList[this.moreResult.index].result = result
  794. ? this.moreResult[result]
  795. : this.moreResult.result;
  796. this.madeTooltips(this.moreResult.index);
  797. this.computeFun(this.moreResult.index);
  798. this.dialogWinMoreResult = false;
  799. },
  800. // 处理 pacs 结果录入的情况
  801. handlePacsResult(row, index, pacsResult) {
  802. // console.log('row,index,pacsResult', row, index, pacsResult)
  803. // this.doctorCheck.checkItemList[index].result = pacsResult.result;
  804. /*
  805. this.doctorCheck.checkSummaryList = [
  806. {
  807. id: Math.random(),
  808. registerCheckId: this.doctorCheck.RegisterCheckEdit.id,
  809. summary: pacsResult.summary,
  810. summaryFlag: "N",
  811. },
  812. ];
  813. */
  814. this.dialogWinPacsTemplate = false;
  815. },
  816. //选择项目
  817. itemRowClick(row) {
  818. this.clickTime1 = new Date().getTime()
  819. console.log('this.clickTime1', this.clickTime1)
  820. this.doctorCheck.checkItem = row;
  821. this.restaurants = row.itemResultTemplates;
  822. // 防止与双击冲突
  823. setTimeout(() => {
  824. // 首次点击才执行
  825. if (this.clickTime1 > this.clickTime2) {
  826. //显示历史明细结果
  827. if (this.hisResultDetailDialogVisible) {
  828. this.gridData = []
  829. postapi("/api/app/RegisterCheckItem/GetItemTwoHistoricalResults", {
  830. registerCheckId: row.registerCheckId,
  831. itemId: row.itemId,
  832. }).then((res) => {
  833. if (res.code != -1) {
  834. this.gridData = res.data;
  835. }
  836. });
  837. }
  838. }
  839. }, 400);
  840. },
  841. // 双击调出模版
  842. itemDblClick(row) {
  843. this.clickTime2 = new Date().getTime()
  844. console.log('this.clickTime2', this.clickTime2)
  845. //@click="btnMoreResult(scope.row, scope.$index)" :disabled="rowResultDisabled(scope.row)"
  846. if (this.rowResultDisabled(row)) {
  847. return
  848. }
  849. let lfind = arrayExistObj(this.doctorCheck.checkItemList, 'itemId', row.itemId)
  850. this.btnMoreResult(row, lfind)
  851. },
  852. //检查组合项目下所包含的明细项目
  853. getCheckItemList(RegisterCheckId) {
  854. // this.doctorCheck.checkItem = null
  855. if (!RegisterCheckId) {
  856. this.doctorCheck.checkItemList = [];
  857. this.doctorCheck.RegisterCheckEdit = {
  858. id: "",
  859. checkDoctorId: "",
  860. checkDate: "",
  861. LastModifierId: "",
  862. LastModificationTime: "",
  863. completeFlag: "",
  864. };
  865. this.gridData = [] // 清空历次明细
  866. return;
  867. }
  868. console.log(
  869. `/api/app/registercheckitem/getlistinregistercheckid?RegisterCheckId=${RegisterCheckId}`
  870. );
  871. getapi(`/api/app/registercheck/getregistercheck?id=${RegisterCheckId}`)
  872. .then((res) => {
  873. if (res.code > -1) {
  874. this.doctorCheck.RegisterCheckEdit = res.data;
  875. if (
  876. res.data.isCharge != "Y" &&
  877. this.doctor_check_check_charge == "Y"
  878. ) {
  879. this.$message.warning({
  880. showClose: true,
  881. message: `该体检人员未缴清费用!`,
  882. });
  883. }
  884. if (this.doctorCheck.RegisterCheckEdit.completeFlag == "0") {
  885. // 当前用户是检查医生时,默认当前用户
  886. if (this.userInfo.operatorType == '1' || this.userInfo.operatorType == '3') {
  887. this.doctorCheck.RegisterCheckEdit.checkDoctorId = this.userInfo.userId;
  888. }
  889. this.doctorCheck.RegisterCheckEdit.checkDate = new Date();
  890. }
  891. return getapi(
  892. `/api/app/registercheckitem/getlistinregistercheckid?RegisterCheckId=${RegisterCheckId}&PatientRegisterId=${this.refParams.id}`
  893. );
  894. }
  895. })
  896. .then((res) => {
  897. // console.log("checkItemList", res.data);
  898. if (res && res.code > -1) {
  899. res.data.forEach((e, i) => {
  900. // 虚拟显示危急状态
  901. e["criticalFlag"] = "N";
  902. });
  903. //console.log('this.doctorCheck.checkItemList',res.data)
  904. this.doctorCheck.checkItemList = res.data;
  905. this.doctorCheck.checkItemList.forEach((e, i) => {
  906. if (this.doctorCheck.RegisterCheckEdit.completeFlag == "0") {
  907. this.madeTooltips(i);
  908. } else {
  909. let lfind = arrayExistObj(
  910. this.resultStatus,
  911. "id",
  912. e.resultStatusId
  913. );
  914. if (lfind > -1) {
  915. e.class = this.resultStatus[lfind].tooltips;
  916. }
  917. }
  918. // 刷新历次明细显示
  919. if(i == 0){
  920. this.itemRowClick(e)
  921. }
  922. });
  923. // 光标定位第一个输入框
  924. this.$nextTick(() => {
  925. this.$refs[res.data[0].itemId].focus(); //打开光标定位到条码栏里
  926. });
  927. // 监听回车代替tab键
  928. this.enterToTab();
  929. }
  930. })
  931. .catch((err) => {
  932. this.$message.error({
  933. showClose: true,
  934. message: `操作失败,原因:${err}`,
  935. });
  936. });
  937. },
  938. querySearch(queryString, cb) {
  939. var restaurants = []; //不需要字典库显示 deepCopy(this.restaurants) [{ value: '阴性' },{ value: '阳性' }]
  940. restaurants.forEach((item) => {
  941. return (item.value = item.result);
  942. });
  943. // console.log("restaurants", restaurants);
  944. var results = queryString
  945. ? restaurants.filter(this.createFilter(queryString))
  946. : restaurants;
  947. // 调用 callback 返回建议列表的数据
  948. cb(results);
  949. },
  950. createFilter(queryString) {
  951. return (restaurant) => {
  952. return (
  953. restaurant["value"].toLowerCase().indexOf(queryString.toLowerCase()) >
  954. -1
  955. );
  956. };
  957. },
  958. handleSelect(item) {
  959. console.log("item", item);
  960. },
  961. //回车替代tab键
  962. enterToTab() {
  963. // console.log('enterToTab');
  964. this.$nextTick(() => {
  965. let inputs = document.querySelectorAll(["textarea", "input"]); //用数组可以读取多个标签的元素 //.inline-input
  966. // console.log('inputs', typeof inputs, inputs)
  967. // 为每个输入框添加键盘事件监听器
  968. inputs.forEach((input, i) => {
  969. // console.log('input',input);
  970. input.addEventListener("keydown", (event) => {
  971. // 如果按下的是回车键
  972. // console.log('data-lineModeFlag', input, input.getAttribute('data-lineModeFlag'), i);
  973. // console.log('event.keyCode', event.keyCode)
  974. switch (event.keyCode) {
  975. case 13:
  976. if (
  977. event.keyCode === 13 &&
  978. input.getAttribute("data-lineModeFlag") == "0"
  979. ) {
  980. event.preventDefault();
  981. } else {
  982. break;
  983. }
  984. case 9: // tab 键
  985. event.preventDefault();
  986. case 40: // ↓ 键
  987. for (let j = i + 1; j < inputs.length; j++) {
  988. // console.log(inputs[j], inputs[j].getAttribute('type'), inputs[j].getAttribute('placeholder'))
  989. if (inputs[j].getAttribute("placeholder") == "请输入结果值") {
  990. if (inputs[j].getAttribute("disabled") != "disabled") {
  991. // console.log('inputs[j]', inputs[j])
  992. inputs[j].focus();
  993. break;
  994. }
  995. }
  996. }
  997. break;
  998. case 38: // ↑ 键
  999. for (let j = i - 1; j > -1; j--) {
  1000. // console.log(inputs[j], inputs[j].getAttribute('type'), inputs[j].getAttribute('placeholder'))
  1001. if (inputs[j].getAttribute("placeholder") == "请输入结果值") {
  1002. if (inputs[j].getAttribute("disabled") != "disabled") {
  1003. // console.log('inputs[j]', inputs[j])
  1004. inputs[j].focus();
  1005. break;
  1006. }
  1007. }
  1008. }
  1009. break;
  1010. default:
  1011. break;
  1012. }
  1013. });
  1014. // 点击时全选结果
  1015. input.addEventListener("click", (event) => {
  1016. if (this.LocalConfig.doctorCheck.isSelectAll == 'Y') {
  1017. input.select();
  1018. }
  1019. });
  1020. });
  1021. });
  1022. },
  1023. // 光标位置插入特殊符号(插入结果)
  1024. insertSymbols(symbols) {
  1025. let result = this.moreResult.result || "";
  1026. if (result) {
  1027. result =
  1028. result.substring(0, this.selection.start) +
  1029. symbols +
  1030. result.substring(this.selection.end);
  1031. } else {
  1032. result = symbols;
  1033. }
  1034. this.moreResult.result = result;
  1035. this.selection.start = this.selection.start + symbols.length;
  1036. this.selection.end = this.selection.start;
  1037. //console.log('插入结果后光标',this.selection)
  1038. },
  1039. // 获取光标位置的函数
  1040. getCaretPosition() {
  1041. let input = document.getElementById("resultBox");
  1042. this.selection.start = input.selectionStart;
  1043. this.selection.end = input.selectionEnd;
  1044. //console.log('点击后光标',this.selection)
  1045. },
  1046. watchSelection() {
  1047. this.$nextTick(() => {
  1048. let that = this;
  1049. let resultBox = document.getElementById("resultBox"); //用数组可以读取多个标签的元素 //.inline-input
  1050. // 绑定键盘事件到文本框
  1051. resultBox.addEventListener("click", function (event) {
  1052. // 获取光标位置
  1053. that.getCaretPosition();
  1054. });
  1055. resultBox.addEventListener("input", function (event) {
  1056. // 获取光标位置
  1057. that.getCaretPosition();
  1058. });
  1059. });
  1060. },
  1061. // 录入结果区域 右击事件(无壳)
  1062. onContextmenuNoShell(event) {
  1063. //菜单项
  1064. let items = [];
  1065. // items.push({
  1066. // label: "一级菜单",
  1067. // children: [
  1068. // { label: "修改姓名", onClick: () => { this.fnUpBaseInfo(row, 'patientName'); } }
  1069. // ],
  1070. // onClick: () => { //菜单事件 }
  1071. // })
  1072. // 显示明细历次结果
  1073. items.push({
  1074. label: "显示明细历次结果",
  1075. onClick: () => {
  1076. this.hisResultDetailDialogVisible = true
  1077. },
  1078. })
  1079. // 预览影像报告
  1080. //if(checkPagePriv(this.pagePriv.privs, "预览影像报告"))
  1081. items.push({
  1082. label: "预览影像报告",
  1083. onClick: () => {
  1084. this.pacsReportView();
  1085. },
  1086. })
  1087. this.$contextmenu({
  1088. items,
  1089. event,
  1090. x: event.clientX,
  1091. y: event.clientY,
  1092. customClass: "custom-class",
  1093. zIndex: 3,
  1094. minWidth: 80,
  1095. });
  1096. return false;
  1097. },
  1098. // 右击菜单
  1099. onContextmenu(event) {
  1100. if (!this.$peisAPI) {
  1101. this.onContextmenuNoShell(event)
  1102. } else {
  1103. let menus = [
  1104. { type: 'separator' },
  1105. { label: '显示明细历次结果', itemId: '显示明细历次结果', enabled: true },
  1106. { label: '预览影像报告', itemId: '预览影像报告', enabled: true }
  1107. // { label: '测试菜单', itemId: '测试菜单', enabled: true },
  1108. // {
  1109. // label: '更多操作',
  1110. // submenu: [
  1111. // { label: '子菜单', itemId: '子菜单', enabled: true }
  1112. // ]
  1113. // }
  1114. ]
  1115. this.$peisAPI.showContextMenu(menus)
  1116. .then(res => {
  1117. console.log('res', res)
  1118. })
  1119. .catch(err => {
  1120. console.log('err', err)
  1121. })
  1122. .finally(() => {
  1123. console.log('finally')
  1124. })
  1125. }
  1126. },
  1127. // 模板右击
  1128. onContextmenuTemplate(event) {
  1129. if (!this.$peisAPI) return
  1130. let menus = [
  1131. // { label: '测试菜单', itemId: '测试菜单', enabled: true },
  1132. // {
  1133. // label: '更多操作',
  1134. // submenu: [
  1135. // { label: '子菜单', itemId: '子菜单', enabled: true }
  1136. // ]
  1137. // }
  1138. ]
  1139. this.$peisAPI.showContextMenu(menus)
  1140. .then(res => {
  1141. console.log('res', res)
  1142. })
  1143. .catch(err => {
  1144. console.log('err', err)
  1145. })
  1146. .finally(() => {
  1147. console.log('finally')
  1148. })
  1149. },
  1150. // 自定义右击事件
  1151. onContextMenuDIY(data) {
  1152. //this.$message({showClose:true,message:data})
  1153. switch (data) {
  1154. case '显示明细历次结果':
  1155. this.hisResultDetailDialogVisible = true
  1156. break;
  1157. case '预览影像报告':
  1158. this.pacsReportView();
  1159. break;
  1160. default:
  1161. break;
  1162. }
  1163. },
  1164. // 预览影像报告
  1165. pacsReportView() {
  1166. if (!this.$peisAPI) {
  1167. this.$message.info("此功能,需要在壳客户端才可运行!")
  1168. return
  1169. }
  1170. ///3a0c990e-5756-2dc0-19d5-69a617fe4048
  1171. let ReportCode = '0011';
  1172. let BusinessCode = this.doctorCheck.RegisterCheckId
  1173. let token = window.sessionStorage.getItem('token');
  1174. let user = window.sessionStorage.getItem('user');
  1175. let toOutShell = {
  1176. ReportCode, token, BusinessCode,
  1177. isBuildImage: 'N',
  1178. IsUploadPdf: 'N',
  1179. preViewCanPrint: 'Y',
  1180. Parameters: [
  1181. { Name: 'printer', Value: user },
  1182. { Name: 'LTS', Value: 'Y' }, //Y、N N只看不能打印
  1183. { Name: "firstPage", Value: "pic/peisReportFirstPage.jpg" },
  1184. { Name: "pageHeader", Value: "pic/peisReportPageHeader.jpg" },
  1185. { Name: "pageFooter", Value: "pic/peisReportPageFooter.jpg" },
  1186. //{ Name: "orgSign", Value: this.dataTransOpts.tableS.patient_register.isPatientOccupationalDisease == 'Y' ? "pic/orgSignOcc.png" : "pic/orgSign.png" },
  1187. { Name: 'picExtOne', Value: 'pic/hisLog.jpg' },
  1188. { Name: 'resultSign', Value: 'pic/resultSign.png' },
  1189. ],
  1190. };
  1191. let JSONtoOutShell = JSON.stringify(toOutShell)
  1192. console.log('$peisAPI.printPre', JSONtoOutShell)
  1193. this.$peisAPI.printPre(JSONtoOutShell)
  1194. .then(res => {
  1195. if (res) {
  1196. let lres = JSON.parse(res)
  1197. if (lres.code < 0) this.$message.error({ showClose: true, message: lres.message })
  1198. }
  1199. })
  1200. .catch(err => {
  1201. this.$message.warning(err);
  1202. });
  1203. },
  1204. // 身高体重、血压仪
  1205. onSerialData(data) {
  1206. console.log('onSerialData.data', data)
  1207. let array = data.data
  1208. for (let index = 0; index < array.length; index++) {
  1209. this.setSerialData(array[index]['deviceType'], array[index]['value'])
  1210. }
  1211. },
  1212. // 接收仪器的数据设置到体检
  1213. setSerialData(deviceType, value) {
  1214. try {
  1215. let itemIds = this.comData[deviceType].split(',')
  1216. let lfind = -1
  1217. for (let index = 0; index < itemIds.length; index++) {
  1218. lfind = arrayExistObj(this.doctorCheck.checkItemList, 'itemId', itemIds[index])
  1219. if (lfind > -1) break
  1220. }
  1221. if (lfind > -1) {
  1222. this.doctorCheck.checkItemList[lfind]['result'] = String(value)
  1223. this.madeTooltips(lfind);
  1224. this.computeFun(lfind);
  1225. }
  1226. } catch (err) {
  1227. console.error('身高体重仪数据设置体检出错:', err)
  1228. this.$message.error({ showClose: true, message: err.message })
  1229. }
  1230. },
  1231. },
  1232. //监听事件
  1233. watch: {
  1234. //检查项目未切换换时 也可以强制刷新数据
  1235. // "dataTransOpts.refresh.register_check_item.M": {
  1236. "refParams.brushItemList": {
  1237. // immediate: true,
  1238. handler(newVal, oldVal) {
  1239. console.log(
  1240. `watch 检查明细 newVal:${newVal} oldVal:${oldVal} registerCheckId: ${this.refParams.registerCheckId}`
  1241. );
  1242. this.getCheckItemList(this.refParams.registerCheckId);
  1243. },
  1244. },
  1245. },
  1246. };
  1247. </script>
  1248. <style lang="scss" scoped>
  1249. @import "../../assets/css/global.css";
  1250. ::v-deep .el-table td.el-table__cell,
  1251. .el-table th.el-table__cell.is-leaf {
  1252. padding: 0;
  1253. }
  1254. ::v-deep .el-textarea__inner {
  1255. min-height: 23px;
  1256. height: 23px;
  1257. line-height: 1.25;
  1258. padding: 2px 15px 2px 2px;
  1259. font-size: v-bind("LocalConfig.doctorCheck.pacsDescFontSize");
  1260. font-family: "Microsoft YaHei";
  1261. }
  1262. /*正常*/
  1263. ::v-deep .tipsNormal .el-textarea__inner {
  1264. background-color: v-bind("tipsNormal.backgroundColor") !important;
  1265. color: v-bind("tipsNormal.color") !important;
  1266. }
  1267. /*错误*/
  1268. ::v-deep .tipsError .el-textarea__inner {
  1269. background-color: v-bind("tipsError.backgroundColor") !important;
  1270. color: v-bind("tipsError.color") !important;
  1271. }
  1272. /*阴性 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
  1273. ::v-deep .tipsNegative .el-textarea__inner {
  1274. background-color: v-bind("tipsNegative.backgroundColor") !important;
  1275. color: v-bind("tipsNegative.color") !important;
  1276. }
  1277. /*弱阳性 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
  1278. ::v-deep .tipsLowPositive .el-textarea__inner {
  1279. background-color: v-bind("tipsLowPositive.backgroundColor") !important;
  1280. color: v-bind("tipsLowPositive.color") !important;
  1281. }
  1282. /*阳性 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
  1283. ::v-deep .tipsPositive .el-textarea__inner {
  1284. background-color: v-bind("tipsPositive.backgroundColor") !important;
  1285. color: v-bind("tipsPositive.color") !important;
  1286. }
  1287. /*偏低 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
  1288. ::v-deep .tipsLow .el-textarea__inner {
  1289. background-color: v-bind("tipsLow.backgroundColor") !important;
  1290. color: v-bind("tipsLow.color") !important;
  1291. }
  1292. /*偏高 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
  1293. ::v-deep .tipsHigh .el-textarea__inner {
  1294. background-color: v-bind("tipsHigh.backgroundColor") !important;
  1295. color: v-bind("tipsHigh.color") !important;
  1296. }
  1297. /*超低 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
  1298. ::v-deep .tipsSuperLow .el-textarea__inner {
  1299. background-color: v-bind("tipsSuperLow.backgroundColor") !important;
  1300. color: v-bind("tipsSuperLow.color") !important;
  1301. }
  1302. /*超高 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
  1303. ::v-deep .tipsSuperHigh .el-textarea__inner {
  1304. background-color: v-bind("tipsSuperHigh.backgroundColor") !important;
  1305. color: v-bind("tipsSuperHigh.color") !important;
  1306. }
  1307. /*文字性危及值 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
  1308. ::v-deep .tipsSuper .el-textarea__inner {
  1309. background-color: v-bind("tipsSuper.backgroundColor") !important;
  1310. color: v-bind("tipsSuper.color") !important;
  1311. }
  1312. </style>