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.

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