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.

1095 lines
37 KiB

2 years ago
2 years ago
12 months ago
2 years ago
2 years ago
2 years ago
1 year ago
12 months ago
1 year ago
12 months ago
2 years ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year 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
2 years ago
2 years ago
12 months ago
2 years ago
1 year ago
2 years ago
12 months ago
1 year ago
12 months ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
12 months ago
1 year ago
12 months ago
1 year ago
12 months ago
1 year ago
12 months ago
2 years ago
2 years ago
12 months ago
1 year ago
12 months ago
1 year ago
12 months ago
2 years ago
1 year ago
12 months ago
1 year ago
12 months ago
1 year ago
12 months ago
2 years ago
1 year ago
12 months ago
1 year ago
1 year ago
2 years ago
1 year ago
11 months ago
12 months ago
1 year ago
1 year ago
12 months ago
12 months ago
12 months ago
12 months ago
2 years ago
2 years ago
2 years ago
2 years 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
12 months 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
1 year ago
2 years ago
2 years ago
1 year ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
12 months ago
12 months ago
2 years ago
2 years ago
1 year ago
12 months ago
2 years ago
2 years ago
2 years ago
2 years ago
12 months ago
12 months ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
11 months ago
1 year ago
2 years 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
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
1 year ago
12 months ago
1 year ago
12 months ago
1 year ago
12 months ago
1 year ago
2 years ago
1 year ago
12 months ago
1 year ago
12 months ago
1 year ago
12 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
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
1 year 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
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
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
2 years ago
1 year ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
1 year 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
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
12 months ago
12 months ago
12 months ago
12 months 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
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
2 years 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
2 years ago
2 years ago
2 years 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
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
2 years ago
1 year ago
1 year ago
11 months ago
12 months ago
11 months ago
1 year ago
2 years 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
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
2 years 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
2 years ago
1 year ago
2 years ago
1 year 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
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
  1. <template>
  2. <div>
  3. <el-table :data="doctorCheck.checkItemList" style="width: 100%" :height="tableHeight" border highlight-current-row
  4. @row-click="rowClick" size="small">
  5. <el-table-column prop="itemName" label="项目" width="220" />
  6. <el-table-column prop="result" label="结果" min-width="200">
  7. <template slot-scope="scope">
  8. <div style="display: flex">
  9. <el-autocomplete style="width: 100%" type="textarea" v-model="scope.row.result" placeholder="请输入结果值"
  10. :disabled="rowResultDisabled(scope.row)" :autosize="{ minRows: 1, maxRows: 10 }" :trigger-on-focus="false"
  11. :fetch-suggestions="querySearch" :data-lineModeFlag="scope.row.lineModeFlag" @input="
  12. madeTooltips(scope.$index);
  13. computeFun(scope.$index);
  14. " v-bind:class="scope.row.class">
  15. </el-autocomplete>
  16. <el-button style="min-width: 23px; padding: 2px" icon="el-icon-caret-bottom"
  17. @click="btnMoreResult(scope.row, scope.$index)" :disabled="rowResultDisabled(scope.row)"
  18. size="small"></el-button>
  19. <el-button style="min-width: 23px; padding: 2px; margin-left: 2px"
  20. @click="btnPacsResult(scope.row, scope.$index)" :disabled="rowResultDisabled(scope.row)"
  21. size="small">P</el-button>
  22. <el-button style="min-width: 23px; padding: 5.8px; margin-left: 2px"
  23. :disabled="rowResultDisabled(scope.row)" @click="btnPacsRessulst(scope.row)" size="small">S</el-button>
  24. <!-- <el-popover
  25. placement="top-end"
  26. width="500"
  27. trigger="click"
  28. :title="scope.row.itemName"
  29. >
  30. <el-tabs v-model="activeName">
  31. <el-tab-pane label="文字结果" name="first">
  32. <el-table :data="gridData">
  33. <el-table-column
  34. property="checkDate"
  35. label="检查日期"
  36. align="center"
  37. ></el-table-column>
  38. <el-table-column
  39. property="itemResult"
  40. label="项目结果"
  41. align="center"
  42. ></el-table-column>
  43. </el-table>
  44. </el-tab-pane>
  45. <el-tab-pane label="折线图" name="second">
  46. <div
  47. style="height: 200px; width: 200px"
  48. ref="chart"
  49. ></div>
  50. </el-tab-pane>
  51. </el-tabs>
  52. <el-button
  53. slot="reference"
  54. style="min-width: 23px; padding: 5.8px; margin-left: 2px"
  55. :disabled="rowResultDisabled(scope.row)"
  56. @click="btnPacsRessulst(scope.row)"
  57. size="small"
  58. >S</el-button
  59. >
  60. </el-popover> -->
  61. </div>
  62. </template>
  63. </el-table-column>
  64. <el-table-column prop="unit" label="单位" width="90" align="center" />
  65. <el-table-column prop="referenceRangeValue" label="参考范围" width="120" align="center" />
  66. <el-table-column prop="resultStatusId" label="提示" width="40" align="center">
  67. <template slot-scope="scope">
  68. <div>
  69. {{
  70. dddw(
  71. resultStatus,
  72. "id",
  73. scope.row.resultStatusId,
  74. "dataInputPrompt"
  75. )
  76. }}
  77. </div>
  78. </template>
  79. </el-table-column>
  80. <el-table-column prop="criticalFlag" label="危急值" width="50" align="center">
  81. <template slot-scope="scope">
  82. <el-button :style="[
  83. { minWidth: '23px' },
  84. { padding: '6px 2px' },
  85. {
  86. backgroundColor: scope.row.isCriticalValue == 'Y' ? 'red' : '',
  87. },
  88. ]" @click="btnCritical(scope.row)" size="small">W</el-button>
  89. </template>
  90. </el-table-column>
  91. </el-table>
  92. <!--弹窗-->
  93. <div>
  94. <!-- 结果录入模版 -->
  95. <el-dialog title="结果录入模版" :visible.sync="dialogWinMoreResult" width="800px" :close-on-click-modal="false">
  96. <div style="margin-top: -10px">
  97. <el-checkbox v-model="isSplitChooseResult" size="small" true-label="Y"
  98. false-label="N">选结果模板时自动添加分隔符</el-checkbox>
  99. <div style="
  100. overflow-y: auto;
  101. height: 300px;
  102. width: 100%;
  103. display: flex;
  104. flex-wrap: wrap;
  105. align-content: flex-start;
  106. ">
  107. <div v-for="item in moreResult.data" :key="item.id" style="margin: 5px; cursor: pointer"
  108. @click="clickResult(item)" @dblclick="dblclickResult(item)">
  109. <el-tag size="samll" style="
  110. padding: 0 3px;
  111. height: 24px;
  112. line-height: 24px;
  113. font-size: 14px;
  114. color: #303133;
  115. background-color: white;
  116. ">{{ item.result }}</el-tag>
  117. </div>
  118. </div>
  119. <div>特殊符号</div>
  120. <div style="
  121. overflow-y: auto;
  122. width: 100%;
  123. display: flex;
  124. flex-wrap: wrap;
  125. align-content: flex-start;
  126. ">
  127. <div v-for="item in symbols" :key="item.id" style="margin: 1px 2px; cursor: pointer"
  128. @click="insertSymbols(item.displayName)">
  129. <el-tag style="
  130. padding: 0 3px;
  131. height: 24px;
  132. line-height: 24px;
  133. font-size: 15px;
  134. color: #303133;
  135. background-color: white;
  136. ">
  137. {{ item.displayName }}
  138. </el-tag>
  139. </div>
  140. </div>
  141. <div style="display: flex; justify-content: space-between">
  142. <div style="margin-top: 5px">录入结果</div>
  143. <div style="overflow-y: auto; display: flex; flex-wrap: wrap">
  144. <div v-for="item in splitSymbols" :key="item" style="margin: 1px 2px; cursor: pointer"
  145. @click="insertSymbols(item)">
  146. <el-tag style="
  147. padding: 0 3px;
  148. height: 24px;
  149. line-height: 24px;
  150. font-size: 15px;
  151. color: #303133;
  152. background-color: white;
  153. ">
  154. {{ item }}
  155. </el-tag>
  156. </div>
  157. </div>
  158. </div>
  159. <el-input id="resultBox" style="width: 100%" class="commonFont" type="textarea"
  160. :autosize="{ minRows: 4, maxRows: 4 }" v-model="moreResult.result" />
  161. </div>
  162. <span slot="footer" class="dialog-footer">
  163. <el-button @click="btnClear"> </el-button>
  164. <el-button type="primary" @click="btnOkResult('defaultResult')">默认结果</el-button>
  165. <el-button type="primary" @click="btnOkResult('')"> </el-button>
  166. <el-button @click="dialogWinMoreResult = false"> </el-button>
  167. </span>
  168. </el-dialog>
  169. <!--Pacs结果录入模版-->
  170. <el-dialog :title="'Pacs结果录入模版 -- ' + doctorCheck.checkItemList[pacsParams.index].itemName"
  171. v-if="dialogWinPacsTemplate" :visible.sync="dialogWinPacsTemplate" width="880px" :close-on-click-modal="false">
  172. <PacsTemplate :refParams="pacsParams" :refFuncOther="handlePacsResult" />
  173. </el-dialog>
  174. <el-dialog :title="curRow.itemName" :visible.sync="previousResults" width="500px" :close-on-click-modal="true"
  175. :show-close="false" @close="resultsclose">
  176. <el-tabs v-model="activeName">
  177. <el-tab-pane label="文字结果" name="first">
  178. <el-table :data="gridData">
  179. <el-table-column property="checkDate" label="检查日期" align="center"></el-table-column>
  180. <el-table-column property="itemResult" label="项目结果" align="center"></el-table-column>
  181. </el-table>
  182. </el-tab-pane>
  183. <el-tab-pane label="折线图" name="second">
  184. <div style="height: 400px; width: 500px" ref="chart1"></div>
  185. </el-tab-pane>
  186. </el-tabs>
  187. </el-dialog>
  188. </div>
  189. </div>
  190. </template>
  191. <script>
  192. // 0-无参考范围,1-数字型,2-字符型,3-性激素
  193. import { mapState } from "vuex";
  194. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  195. import { arrayExistObj, dddw, deepCopy } from "../../utlis/proFunc";
  196. import PacsTemplate from "./PacsTemplate.vue";
  197. import * as echarts from "echarts";
  198. export default {
  199. components: {
  200. PacsTemplate,
  201. },
  202. props: ["isCheckPicture", "registerCheckId", "doctor_check_check_charge"],
  203. data() {
  204. return {
  205. activeName: "first",
  206. previousResults: false,
  207. gridData: [],
  208. resultStatus: [], //结果状态提示数据
  209. tipsNormal: {
  210. id: "01",
  211. displayName: "正常",
  212. dataInputPrompt: "正常",
  213. reportPrompt: "正常",
  214. reportBackgroundColor: 16777215,
  215. reportFontColor: 0,
  216. dataInputBackgroundColor: 16777215,
  217. dataInputFontColor: 0,
  218. }, //正常提示
  219. tipsError: {}, //错误提示
  220. tipsNegative: {}, //阴性提示
  221. tipsLowPositive: {}, //弱阳性提示
  222. tipsPositive: {}, //阳性提示
  223. tipsLow: {}, //偏低提示
  224. tipsHigh: {}, //偏高提示
  225. tipsSuperLow: {}, //超低提示
  226. tipsSuperHigh: {}, //超高提示
  227. tipsSuper: {}, //文字型危急值
  228. restaurants: [], //结果模版
  229. currentRow: -1, //当前操作的行
  230. dialogWinMoreResult: false,
  231. dialogWinPacsTemplate: false,
  232. moreResult: {
  233. data: [],
  234. result: "",
  235. defaultResult: "",
  236. index: 0, // 明细序列
  237. }, //结果模版
  238. isSplitChooseResult: "N", // 选结果时,是否自动加上分隔符
  239. selection: {
  240. // 光标位置
  241. start: 0,
  242. end: 0,
  243. },
  244. symbols: [], //特殊符号
  245. splitSymbols: [";", "、"], // 分隔符
  246. userInfo: {
  247. operatorType: "0",
  248. userId: "",
  249. user: "",
  250. },
  251. // pacs 结果录入
  252. pacsParams: {
  253. from: "doctor",
  254. refresh: -1, // 强制刷新
  255. row: {},
  256. index: 0,
  257. result: "",
  258. summary: "",
  259. },
  260. curRow: {},
  261. isSelectAll: 'N', // 录入结果时,是否全选
  262. };
  263. },
  264. created() {
  265. this.dictInit();
  266. let LocalConfig = JSON.parse(window.localStorage.getItem("LocalConfig") || null)
  267. if (LocalConfig && LocalConfig.doctorCheck && LocalConfig.doctorCheck.isSelectAll) this.isSelectAll = LocalConfig.doctorCheck.isSelectAll
  268. },
  269. //挂载完成
  270. mounted() {
  271. this.checkItemList(this.dataTransOpts.tableS.register_check.id);
  272. this.userInfo.operatorType = window.sessionStorage.getItem("operatorType") || '0';
  273. this.userInfo.userId = window.sessionStorage.getItem("userId") || null;
  274. this.userInfo.user = window.sessionStorage.getItem("user") || null;
  275. },
  276. computed: {
  277. ...mapState([
  278. "window",
  279. "dataTransOpts",
  280. "dict",
  281. "dialogWin",
  282. "doctorCheck",
  283. ]),
  284. tableHeight() {
  285. let temp = this.window.pageHeight < 600 ? 600 : this.window.pageHeight;
  286. return Math.floor(
  287. ((temp - 315 - (this.isCheckPicture ? 110 : 0)) * 3) / 5
  288. );
  289. },
  290. },
  291. methods: {
  292. dddw,
  293. dictInit() {
  294. //获取结果状态提示数据
  295. getapi("/api/app/result-status").then((res) => {
  296. if (res.code != -1) {
  297. this.resultStatus = res.data;
  298. this.resultStatus.forEach((e) => {
  299. switch (e.id) {
  300. case "01": // 正常
  301. e.tooltips = "tipsNormal";
  302. this.colorTrans(e, e.tooltips);
  303. break;
  304. case "02": // 错误
  305. e.tooltips = "tipsError";
  306. this.colorTrans(e, e.tooltips);
  307. break;
  308. case "03": // 阴性
  309. e.tooltips = "tipsNegative";
  310. this.colorTrans(e, e.tooltips);
  311. break;
  312. case "04": // 阳性
  313. e.tooltips = "tipsPositive";
  314. this.colorTrans(e, e.tooltips);
  315. break;
  316. case "05": // 弱阳性
  317. e.tooltips = "tipsLowPositive";
  318. this.colorTrans(e, e.tooltips);
  319. break;
  320. case "06": // 偏低
  321. e.tooltips = "tipsLow";
  322. this.colorTrans(e, e.tooltips);
  323. break;
  324. case "07": // 偏高
  325. e.tooltips = "tipsHigh";
  326. this.colorTrans(e, e.tooltips);
  327. break;
  328. case "08": // 危急值下限
  329. e.tooltips = "tipsSuperLow";
  330. this.colorTrans(e, e.tooltips);
  331. break;
  332. case "09": // 危急值上限
  333. e.tooltips = "tipsSuperHigh";
  334. this.colorTrans(e, e.tooltips);
  335. break;
  336. case "10": // 危急值
  337. e.tooltips = "tipsSuper";
  338. this.colorTrans(e, e.tooltips);
  339. break;
  340. default:
  341. e.tooltips = "tipsNormal";
  342. this.colorTrans(e, e.tooltips);
  343. break;
  344. }
  345. });
  346. }
  347. });
  348. //获取结果状态提示数据
  349. postapi("/api/app/CommonChar/GetCommonCharList", {}).then((res) => {
  350. if (res.code >= 0) {
  351. this.symbols = res.data;
  352. }
  353. });
  354. },
  355. btnPacsRessulst(row) {
  356. this.curRow = row;
  357. postapi("/api/app/RegisterCheckItem/GetItemTwoHistoricalResults", {
  358. registerCheckId: row.registerCheckId,
  359. itemId: row.itemId,
  360. }).then((res) => {
  361. if (res.code != -1) {
  362. this.previousResults = true;
  363. this.gridData = res.data;
  364. this.$nextTick(() => {
  365. this.initEcharts();
  366. });
  367. }
  368. });
  369. },
  370. initEcharts() {
  371. let yAxisData = [];
  372. let xAxisData = [];
  373. for (let i = 0; i < this.gridData.length; i++) {
  374. if (this.gridData[i].checkDate) {
  375. xAxisData.push(this.gridData[i].checkDate);
  376. yAxisData.push(this.gridData[i].itemResult);
  377. }
  378. }
  379. let myChart = echarts.init(this.$refs.chart1);
  380. let option1 = {
  381. tooltip: {
  382. trigger: "axis",
  383. confine: true,
  384. },
  385. legend: {
  386. type: "scroll",
  387. orient: "horizontal", // 垂直
  388. right: "3%", // 左对齐
  389. top: "0%", // 位于顶部
  390. },
  391. grid: {
  392. show: false,
  393. left: "2%",
  394. right: "2%",
  395. top: "6%",
  396. bottom: "0%",
  397. containLabel: true,
  398. },
  399. xAxis: {
  400. type: "category",
  401. data: xAxisData,
  402. axisLabel: {
  403. textStyle: {
  404. fontSize: "14",
  405. },
  406. },
  407. axisLine: {
  408. show: true,
  409. },
  410. },
  411. yAxis: {
  412. type: "value",
  413. axisLabel: {
  414. textStyle: {
  415. fontSize: "14",
  416. },
  417. },
  418. },
  419. series: [
  420. {
  421. name: "项目结果",
  422. type: "line",
  423. data: yAxisData,
  424. },
  425. ],
  426. };
  427. myChart.setOption(option1);
  428. },
  429. resultsclose() {
  430. this.activeName = "first";
  431. },
  432. // chartTabs(tab) {
  433. // if (tab.name == "second") {
  434. // this.$nextTick(() => {
  435. // this.initEcharts();
  436. // });
  437. // }
  438. // },
  439. // 颜色转换
  440. // displayName: "错误",
  441. // dataInputPrompt: "×",
  442. // reportPrompt: "×",
  443. // reportBackgroundColor: 2427166,
  444. // reportFontColor: 1070166,
  445. // dataInputBackgroundColor: 321313,
  446. // dataInputFontColor: 12991019,
  447. colorTrans(dataColor, frontColor) {
  448. let tempColor =
  449. "000000" + Number(dataColor.dataInputBackgroundColor).toString(16);
  450. let backgroundColor = "#" + tempColor.substring(tempColor.length - 6);
  451. tempColor = "000000" + Number(dataColor.dataInputFontColor).toString(16);
  452. let color = "#" + tempColor.substring(tempColor.length - 6);
  453. this[frontColor] = Object.assign({}, dataColor, {
  454. backgroundColor,
  455. color,
  456. });
  457. console.log(`this.${frontColor}`, this[frontColor]);
  458. },
  459. // "referenceRangeValue": "15-55",
  460. // "referenceRangeTypeFlag": "1",
  461. // "criticalRangeValue": null,
  462. // "result"
  463. madeTooltips(index) {
  464. // let ts = confirm('提示')
  465. let checkItem = this.doctorCheck.checkItemList[index];
  466. let tooltips = "tipsNormal";
  467. checkItem.class = tooltips;
  468. let referenceRangeTypeFlag = checkItem.referenceRangeTypeFlag || "0"; //参考范围类别0-无参考范围,1-数字型,2-字符型,3-性激素
  469. // console.log('madeTooltips',index,referenceRangeTypeFlag)
  470. switch (referenceRangeTypeFlag) {
  471. case "3": // 1 是数字型,3 是性激素期
  472. case "1":
  473. // console.log('1、3')
  474. if (checkItem.result) {
  475. let tempResult = checkItem.result
  476. .replaceAll("<", "")
  477. .replaceAll("≤", "")
  478. .replaceAll("≦", "")
  479. .replaceAll(">", "")
  480. .replaceAll("≥", "")
  481. .replaceAll("≧", "")
  482. .replaceAll("=", "")
  483. .replaceAll(" ", "");
  484. console.log("tempResult", isNaN(tempResult), tempResult);
  485. if (isNaN(tempResult)) break;
  486. let result = Number(tempResult);
  487. if (checkItem.referenceRangeValue) {
  488. let criticalRangeValue = checkItem.criticalRangeValue;
  489. let valueArr = checkItem.referenceRangeValue
  490. .replaceAll("--", "-")
  491. .replaceAll("〜", "-")
  492. .replaceAll("~", "-")
  493. .split("-");
  494. if (valueArr.length == 1) valueArr.unshift(0);
  495. // console.log('valueArr',checkItem.referenceRangeValue,valueArr)
  496. if (criticalRangeValue) {
  497. let criticalArr = criticalRangeValue
  498. .replaceAll("--", "-")
  499. .replaceAll("〜", "-")
  500. .replaceAll("~", "-")
  501. .split("-");
  502. if (criticalArr.length == 1) criticalArr.unshift(0);
  503. // console.log('criticalArr',checkItem.criticalRangeValue,criticalArr)
  504. if (result < Number(criticalArr[0])) {
  505. tooltips = "tipsSuperLow";
  506. } else if (result > Number(criticalArr[1])) {
  507. tooltips = "tipsSuperHigh";
  508. } else if (result < Number(valueArr[0])) {
  509. tooltips = "tipsLow";
  510. } else if (result > Number(valueArr[1])) {
  511. tooltips = "tipsHigh";
  512. }
  513. } else {
  514. if (result < Number(valueArr[0])) {
  515. tooltips = "tipsLow";
  516. } else if (result > Number(valueArr[1])) {
  517. tooltips = "tipsHigh";
  518. }
  519. }
  520. }
  521. //错误值校验
  522. let errArr = [];
  523. if (checkItem.inputCheck) {
  524. errArr = checkItem.inputCheck
  525. .replaceAll("--", "-")
  526. .replaceAll("〜", "-")
  527. .replaceAll("~", "-")
  528. .split("-");
  529. if (errArr.length == 1) errArr.unshift(-1);
  530. }
  531. if (errArr && errArr.length > 1) {
  532. if (result < Number(errArr[0]) || result > Number(errArr[1])) {
  533. tooltips = "tipsError";
  534. console.log("checkItem", checkItem);
  535. }
  536. }
  537. }
  538. break;
  539. case "2":
  540. if (checkItem.result) {
  541. if (
  542. checkItem.result.indexOf("阴性") > -1 ||
  543. checkItem.result.indexOf("-") > -1
  544. ) {
  545. tooltips = "tipsNegative";
  546. } else if (
  547. checkItem.result.indexOf("弱阳性") > -1 ||
  548. checkItem.result.indexOf("±") > -1
  549. ) {
  550. tooltips = "tipsLowPositive";
  551. } else if (
  552. checkItem.result.indexOf("阳性") > -1 ||
  553. checkItem.result.indexOf("+") > -1
  554. ) {
  555. tooltips = "tipsPositive";
  556. }
  557. }
  558. break;
  559. default:
  560. break;
  561. }
  562. // 判断后重新赋值
  563. checkItem.class = tooltips;
  564. // 保存过检查时,直接取数据库
  565. checkItem.resultStatusId = this[tooltips].id; //名称 dataInputPrompt
  566. // console.log('checkItem',checkItem)
  567. // console.log(`this.${tooltips}`,this[tooltips])
  568. },
  569. // 行结果是否可编辑
  570. rowResultDisabled(row) {
  571. return (
  572. row.isCalculationItem == "Y" ||
  573. this.doctorCheck.RegisterCheckEdit.completeFlag == "1" ||
  574. this.doctorCheck.RegisterCheckEdit.completeFlag == "2"
  575. );
  576. },
  577. btnCritical(row) {
  578. this.dialogWin.FollowCriticalCheck = true;
  579. this.doctorCheck.combinationCriticalValue = false;
  580. this.doctorCheck.singleDetailedProject = row;
  581. },
  582. //项目列为计算函数
  583. computeFun(index) {
  584. // 有计算项的,才调用计算函数
  585. let haveComputeFun = false;
  586. let checkItem = this.doctorCheck.checkItemList[index];
  587. console.log("checkItem", checkItem);
  588. let body = {
  589. registerCheckId: checkItem.registerCheckId,
  590. items: [],
  591. };
  592. this.doctorCheck.checkItemList.forEach((e) => {
  593. body.items.push({
  594. itemId: e.itemId,
  595. result: e.result,
  596. });
  597. if (e.isCalculationItem == "Y") haveComputeFun = true;
  598. });
  599. if (!haveComputeFun) return; // 有计算项的,才调用计算函数
  600. let lfind = -1;
  601. postapi(
  602. "/api/app/diagnosisfunction/getcalculationfunctionresult",
  603. body
  604. ).then((res) => {
  605. if (res.code != -1) {
  606. // console.log('res.data',res.data)
  607. res.data.items.forEach((e) => {
  608. lfind = arrayExistObj(
  609. this.doctorCheck.checkItemList,
  610. "itemId",
  611. e.itemId
  612. );
  613. if (lfind > -1) {
  614. if (e.result != this.doctorCheck.checkItemList[lfind].result) {
  615. this.doctorCheck.checkItemList[lfind].result = e.result;
  616. console.log("e", lfind, this.doctorCheck.checkItemList[lfind]);
  617. this.madeTooltips(lfind);
  618. }
  619. }
  620. });
  621. }
  622. });
  623. },
  624. // 点击结果模版按钮
  625. btnMoreResult(row, index) {
  626. this.moreResult.data = deepCopy(row.itemResultTemplates);
  627. this.moreResult.result = row.result;
  628. this.moreResult.defaultResult = row.defaultResult;
  629. this.moreResult.index = index;
  630. // "itemId": "3a0c517f-cbdb-9fff-e300-1f76b3e47580",
  631. // "result": "00000",
  632. // "diagnosisId": "3a0ed8a2-72d9-ee50-78aa-5b1f474f2921",
  633. // "isNameIntoSummary": "N",
  634. // "isResultIntoSummary": "Y",
  635. // "resultStatusId": "01",
  636. // "simpleCode": "0"
  637. this.dialogWinMoreResult = true;
  638. this.watchSelection();
  639. },
  640. // pacs结果模板
  641. btnPacsResult(row, index) {
  642. let result = row.result;
  643. let summary = "";
  644. this.doctorCheck.checkSummaryList.forEach((e, i) => {
  645. summary += e.summary;
  646. });
  647. this.pacsParams.row = row;
  648. this.pacsParams.index = index;
  649. this.pacsParams.result = result;
  650. this.pacsParams.summary = summary;
  651. this.pacsParams.refresh++;
  652. this.dialogWinPacsTemplate = true;
  653. },
  654. // pacs结果模板(备份)
  655. btnPacsResultBak(row, index) {
  656. let result = row.result;
  657. let summary = "";
  658. this.doctorCheck.checkSummaryList.forEach((e, i) => {
  659. summary += e.summary;
  660. });
  661. this.pacsParams.row = row;
  662. this.pacsParams.index = index;
  663. this.pacsParams.result = result;
  664. this.pacsParams.summary = summary;
  665. this.pacsParams.refresh++;
  666. this.dialogWinPacsTemplate = true;
  667. },
  668. // 双击选择结果模版的结果
  669. dblclickResult(item) {
  670. this.moreResult.result = "";
  671. this.clickResult(item);
  672. this.btnOkResult("");
  673. },
  674. // 单击选择结果模版的结果
  675. clickResult(item) {
  676. let result = [];
  677. if (this.moreResult.result) result = this.moreResult.result.split(";");
  678. // 不用分隔符时,不判断包含关系
  679. if (this.isSplitChooseResult == "Y" && result.indexOf(item.result) > -1)
  680. return;
  681. if (this.isSplitChooseResult == "Y" || result.length == 0) {
  682. result.push(item.result);
  683. } else {
  684. result[result.length - 1] = result[result.length - 1] + item.result;
  685. }
  686. let ret = "";
  687. result.forEach((e, i) => {
  688. let splitStr = ";";
  689. if (i == 0) splitStr = "";
  690. ret += splitStr + e;
  691. });
  692. this.moreResult.result = ret;
  693. },
  694. // 清除结果值
  695. btnClear() {
  696. this.moreResult.result = "";
  697. },
  698. btnOkResult(result) {
  699. this.doctorCheck.checkItemList[this.moreResult.index].result = result
  700. ? this.moreResult[result]
  701. : this.moreResult.result;
  702. this.madeTooltips(this.moreResult.index);
  703. this.computeFun(this.moreResult.index);
  704. this.dialogWinMoreResult = false;
  705. },
  706. // 处理 pacs 结果录入的情况
  707. handlePacsResult(row, index, pacsResult) {
  708. // console.log('row,index,pacsResult', row, index, pacsResult)
  709. // this.doctorCheck.checkItemList[index].result = pacsResult.result;
  710. /*
  711. this.doctorCheck.checkSummaryList = [
  712. {
  713. id: Math.random(),
  714. registerCheckId: this.doctorCheck.RegisterCheckEdit.id,
  715. summary: pacsResult.summary,
  716. summaryFlag: "N",
  717. },
  718. ];
  719. */
  720. this.dialogWinPacsTemplate = false;
  721. },
  722. //选择项目
  723. rowClick(row) {
  724. this.doctorCheck.checkItem = row;
  725. this.restaurants = row.itemResultTemplates;
  726. },
  727. //检查组合项目下所包含的明细项目
  728. checkItemList(RegisterCheckId) {
  729. // this.doctorCheck.checkItem = null
  730. if (!RegisterCheckId) {
  731. this.doctorCheck.checkItemList = [];
  732. this.doctorCheck.RegisterCheckEdit = {
  733. id: "",
  734. checkDoctorId: "",
  735. checkDate: "",
  736. LastModifierId: "",
  737. LastModificationTime: "",
  738. completeFlag: "",
  739. };
  740. return;
  741. }
  742. console.log(
  743. `/api/app/registercheckitem/getlistinregistercheckid?RegisterCheckId=${RegisterCheckId}`
  744. );
  745. getapi(`/api/app/registercheck/getregistercheck?id=${RegisterCheckId}`)
  746. .then((res) => {
  747. if (res.code > -1) {
  748. this.doctorCheck.RegisterCheckEdit = res.data;
  749. if (
  750. res.data.isCharge != "Y" &&
  751. this.doctor_check_check_charge == "Y"
  752. ) {
  753. this.$message.warning({
  754. showClose: true,
  755. message: `该体检人员未缴清费用!`,
  756. });
  757. }
  758. if (this.doctorCheck.RegisterCheckEdit.completeFlag == "0") {
  759. // 当前用户是检查医生时,默认当前用户
  760. if (this.userInfo.operatorType == '1' || this.userInfo.operatorType == '3') {
  761. this.doctorCheck.RegisterCheckEdit.checkDoctorId = this.userInfo.userId;
  762. }
  763. this.doctorCheck.RegisterCheckEdit.checkDate = new Date();
  764. }
  765. return getapi(
  766. `/api/app/registercheckitem/getlistinregistercheckid?RegisterCheckId=${RegisterCheckId}&PatientRegisterId=${this.dataTransOpts.tableS.patient_register.id}`
  767. );
  768. }
  769. })
  770. .then((res) => {
  771. // console.log("checkItemList", res.data);
  772. if (res && res.code > -1) {
  773. res.data.forEach((e, i) => {
  774. // 虚拟显示危急状态
  775. e["criticalFlag"] = "N";
  776. });
  777. this.doctorCheck.checkItemList = res.data;
  778. this.doctorCheck.checkItemList.forEach((e, i) => {
  779. if (this.doctorCheck.RegisterCheckEdit.completeFlag == "0") {
  780. this.madeTooltips(i);
  781. } else {
  782. let lfind = arrayExistObj(
  783. this.resultStatus,
  784. "id",
  785. e.resultStatusId
  786. );
  787. if (lfind > -1) {
  788. e.class = this.resultStatus[lfind].tooltips;
  789. }
  790. }
  791. });
  792. this.enterToTab();
  793. }
  794. })
  795. .catch((err) => {
  796. this.$message.error({
  797. showClose: true,
  798. message: `操作失败,原因:${err}`,
  799. });
  800. });
  801. },
  802. querySearch(queryString, cb) {
  803. var restaurants = []; //不需要字典库显示 deepCopy(this.restaurants) [{ value: '阴性' },{ value: '阳性' }]
  804. restaurants.forEach((item) => {
  805. return (item.value = item.result);
  806. });
  807. // console.log("restaurants", restaurants);
  808. var results = queryString
  809. ? restaurants.filter(this.createFilter(queryString))
  810. : restaurants;
  811. // 调用 callback 返回建议列表的数据
  812. cb(results);
  813. },
  814. createFilter(queryString) {
  815. return (restaurant) => {
  816. return (
  817. restaurant["value"].toLowerCase().indexOf(queryString.toLowerCase()) >
  818. -1
  819. );
  820. };
  821. },
  822. handleSelect(item) {
  823. console.log("item", item);
  824. },
  825. //回车替代tab键
  826. enterToTab() {
  827. // console.log('enterToTab');
  828. this.$nextTick(() => {
  829. let inputs = document.querySelectorAll(["textarea", "input"]); //用数组可以读取多个标签的元素 //.inline-input
  830. // console.log('inputs', typeof inputs, inputs)
  831. // 为每个输入框添加键盘事件监听器
  832. inputs.forEach((input, i) => {
  833. // console.log('input',input);
  834. input.addEventListener("keydown", (event) => {
  835. // 如果按下的是回车键
  836. // console.log('data-lineModeFlag', input, input.getAttribute('data-lineModeFlag'), i);
  837. // console.log('event.keyCode', event.keyCode)
  838. switch (event.keyCode) {
  839. case 13:
  840. if (
  841. event.keyCode === 13 &&
  842. input.getAttribute("data-lineModeFlag") == "0"
  843. ) {
  844. event.preventDefault();
  845. } else {
  846. break;
  847. }
  848. case 9: // tab 键
  849. event.preventDefault();
  850. case 40: // ↓ 键
  851. for (let j = i + 1; j < inputs.length; j++) {
  852. // console.log(inputs[j], inputs[j].getAttribute('type'), inputs[j].getAttribute('placeholder'))
  853. if (inputs[j].getAttribute("placeholder") == "请输入结果值") {
  854. if (inputs[j].getAttribute("disabled") != "disabled") {
  855. // console.log('inputs[j]', inputs[j])
  856. inputs[j].focus();
  857. break;
  858. }
  859. }
  860. }
  861. break;
  862. case 38: // ↑ 键
  863. for (let j = i - 1; j > -1; j--) {
  864. // console.log(inputs[j], inputs[j].getAttribute('type'), inputs[j].getAttribute('placeholder'))
  865. if (inputs[j].getAttribute("placeholder") == "请输入结果值") {
  866. if (inputs[j].getAttribute("disabled") != "disabled") {
  867. // console.log('inputs[j]', inputs[j])
  868. inputs[j].focus();
  869. break;
  870. }
  871. }
  872. }
  873. break;
  874. default:
  875. break;
  876. }
  877. });
  878. // 点击时全选结果
  879. input.addEventListener("click", (event) => {
  880. if (this.isSelectAll == 'Y') {
  881. input.select();
  882. }
  883. });
  884. });
  885. });
  886. },
  887. // 光标位置插入特殊符号
  888. insertSymbols(symbols) {
  889. let result = this.moreResult.result || "";
  890. if (result) {
  891. result =
  892. result.substring(0, this.selection.start) +
  893. symbols +
  894. result.substring(this.selection.end);
  895. } else {
  896. result = symbols;
  897. }
  898. this.moreResult.result = result;
  899. this.selection.start++;
  900. this.selection.end++;
  901. },
  902. // 获取光标位置的函数
  903. getCaretPosition() {
  904. let input = document.getElementById("resultBox");
  905. this.selection.start = input.selectionStart;
  906. this.selection.end = input.selectionEnd;
  907. // console.log('selection',this.selection)
  908. },
  909. watchSelection() {
  910. this.$nextTick(() => {
  911. let that = this;
  912. let resultBox = document.getElementById("resultBox"); //用数组可以读取多个标签的元素 //.inline-input
  913. // 绑定键盘事件到文本框
  914. resultBox.addEventListener("click", function (event) {
  915. // 获取光标位置
  916. that.getCaretPosition();
  917. });
  918. resultBox.addEventListener("input", function (event) {
  919. // 获取光标位置
  920. that.getCaretPosition();
  921. });
  922. });
  923. },
  924. },
  925. //监听事件
  926. watch: {
  927. //检查项目切换
  928. // "doctorCheck.RegisterCheckId":{
  929. // immediate:true,
  930. // handler(newVal, oldVal) {
  931. // console.log(
  932. // "watch doctorCheck.RegisterCheckId newVal:",
  933. // newVal,
  934. // " oldVal:",
  935. // oldVal
  936. // );
  937. // this.checkItemList(newVal);
  938. // }
  939. // },
  940. //检查项目未切换换时 也可以强制刷新数据
  941. "dataTransOpts.refresh.register_check_item.M": {
  942. // immediate: true,
  943. handler(newVal, oldVal) {
  944. console.log(
  945. `watch 检查明细 newVal:${newVal} oldVal:${oldVal} registerCheckId: ${this.dataTransOpts.tableS.register_check.id}`
  946. );
  947. this.checkItemList(this.dataTransOpts.tableS.register_check.id);
  948. },
  949. },
  950. },
  951. };
  952. </script>
  953. <style lang="scss" scoped>
  954. @import "../../assets/css/global.css";
  955. ::v-deep .el-table td.el-table__cell,
  956. .el-table th.el-table__cell.is-leaf {
  957. padding: 0;
  958. }
  959. ::v-deep .el-textarea__inner {
  960. min-height: 23px;
  961. height: 23px;
  962. line-height: 1.25;
  963. padding: 2px 15px 2px 2px;
  964. }
  965. /*正常*/
  966. ::v-deep .tipsNormal .el-textarea__inner {
  967. background-color: v-bind("tipsNormal.backgroundColor") !important;
  968. color: v-bind("tipsNormal.color") !important;
  969. font-family: "Microsoft YaHei";
  970. }
  971. /*错误*/
  972. ::v-deep .tipsError .el-textarea__inner {
  973. background-color: v-bind("tipsError.backgroundColor") !important;
  974. color: v-bind("tipsError.color") !important;
  975. font-family: "Microsoft YaHei";
  976. }
  977. /*阴性 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
  978. ::v-deep .tipsNegative .el-textarea__inner {
  979. background-color: v-bind("tipsNegative.backgroundColor") !important;
  980. color: v-bind("tipsNegative.color") !important;
  981. font-family: "Microsoft YaHei";
  982. }
  983. /*弱阳性 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
  984. ::v-deep .tipsLowPositive .el-textarea__inner {
  985. background-color: v-bind("tipsLowPositive.backgroundColor") !important;
  986. color: v-bind("tipsLowPositive.color") !important;
  987. font-family: "Microsoft YaHei";
  988. }
  989. /*阳性 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
  990. ::v-deep .tipsPositive .el-textarea__inner {
  991. background-color: v-bind("tipsPositive.backgroundColor") !important;
  992. color: v-bind("tipsPositive.color") !important;
  993. font-family: "Microsoft YaHei";
  994. }
  995. /*偏低 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
  996. ::v-deep .tipsLow .el-textarea__inner {
  997. background-color: v-bind("tipsLow.backgroundColor") !important;
  998. color: v-bind("tipsLow.color") !important;
  999. font-family: "Microsoft YaHei";
  1000. }
  1001. /*偏高 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
  1002. ::v-deep .tipsHigh .el-textarea__inner {
  1003. background-color: v-bind("tipsHigh.backgroundColor") !important;
  1004. color: v-bind("tipsHigh.color") !important;
  1005. font-family: "Microsoft YaHei";
  1006. }
  1007. /*超低 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
  1008. ::v-deep .tipsSuperLow .el-textarea__inner {
  1009. background-color: v-bind("tipsSuperLow.backgroundColor") !important;
  1010. color: v-bind("tipsSuperLow.color") !important;
  1011. font-family: "Microsoft YaHei";
  1012. }
  1013. /*超高 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
  1014. ::v-deep .tipsSuperHigh .el-textarea__inner {
  1015. background-color: v-bind("tipsSuperHigh.backgroundColor") !important;
  1016. color: v-bind("tipsSuperHigh.color") !important;
  1017. font-family: "Microsoft YaHei";
  1018. }
  1019. /*文字性危及值 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
  1020. ::v-deep .tipsSuper .el-textarea__inner {
  1021. background-color: v-bind("tipsSuper.backgroundColor") !important;
  1022. color: v-bind("tipsSuper.color") !important;
  1023. font-family: "Microsoft YaHei";
  1024. }
  1025. ::v-deep .commonFont .el-textarea__inner {
  1026. font-family: "Microsoft YaHei";
  1027. }
  1028. </style>