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.

813 lines
29 KiB

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 year ago
2 years ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year 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
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
2 years 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
2 years ago
2 years 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
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
2 years ago
1 year ago
2 years 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
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
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 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
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 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
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
1 year ago
2 years 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
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
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
2 years ago
1 year 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
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
2 years ago
1 year 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
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
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
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
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"
  12. @input="madeTooltips(scope.$index); computeFun(scope.$index)" v-bind:class="scope.row.class">
  13. </el-autocomplete>
  14. <el-button style="min-width:23px;padding: 2px;" icon="el-icon-caret-bottom"
  15. @click="btnMoreResult(scope.row, scope.$index)" :disabled="rowResultDisabled(scope.row)"
  16. size="small"></el-button>
  17. <el-button style="min-width:23px;padding:2px;margin-left: 2px;"
  18. @click="btnPacsResult(scope.row, scope.$index)" :disabled="rowResultDisabled(scope.row)"
  19. size="small">P</el-button>
  20. </div>
  21. </template>
  22. </el-table-column>
  23. <el-table-column prop="unit" label="单位" width="90" align="center" />
  24. <el-table-column prop="referenceRangeValue" label="参考范围" width="120" align="center" />
  25. <el-table-column prop="resultStatusId" label="提示" width="40" align="center">
  26. <template slot-scope="scope">
  27. <div>{{ dddw(resultStatus, 'id', scope.row.resultStatusId, 'dataInputPrompt') }}</div>
  28. </template>
  29. </el-table-column>
  30. <el-table-column prop="criticalFlag" label="危急值" width="50" align="center">
  31. <template slot-scope="scope">
  32. <el-button style="min-width:23px;padding:6px 2px;"
  33. @click="btnCritical(scope.row)"
  34. size="small">W</el-button>
  35. </template>
  36. </el-table-column>
  37. </el-table>
  38. <!--弹窗-->
  39. <div>
  40. <!-- 结果录入模版 -->
  41. <el-dialog title="结果录入模版" :visible.sync="dialogWinMoreResult" width="800px" :close-on-click-modal="false">
  42. <div style="margin-top: -10px;">
  43. <el-checkbox v-model="isSplitChooseResult" size="small" true-label="Y"
  44. false-label="N">选结果模板时自动添加分隔符</el-checkbox>
  45. <div
  46. style="overflow-y:auto; height:300px;width:100%;display: flex;flex-wrap: wrap;align-content: flex-start;">
  47. <div v-for="item in moreResult.data" :key="item.id" style="margin: 5px;cursor:pointer;"
  48. @click="clickResult(item)" @dblclick="dblclickResult(item)">
  49. <el-tag size="samll"
  50. style="padding: 0 3px;height: 24px;line-height: 24px;font-size: 14px; color: #303133;background-color: white;">{{
  51. item.result }}</el-tag>
  52. </div>
  53. </div>
  54. <div>特殊符号</div>
  55. <div style="overflow-y:auto; width:100%;display: flex;flex-wrap: wrap;align-content: flex-start;">
  56. <div v-for="item in symbols" :key="item.id" style="margin: 1px 2px;cursor:pointer;"
  57. @click="insertSymbols(item.displayName)">
  58. <el-tag
  59. style="padding: 0 3px;height: 24px;line-height: 24px;font-size: 15px;color: #303133;background-color: white;">
  60. {{ item.displayName }}
  61. </el-tag>
  62. </div>
  63. </div>
  64. <div style="display: flex;justify-content: space-between;">
  65. <div style="margin-top: 5px;">录入结果</div>
  66. <div style="overflow-y:auto; display: flex;flex-wrap: wrap;">
  67. <div v-for="item in splitSymbols" :key="item" style="margin: 1px 2px;cursor:pointer;"
  68. @click="insertSymbols(item)">
  69. <el-tag
  70. style="padding: 0 3px;height: 24px;line-height: 24px;font-size: 15px;color: #303133;background-color: white;">
  71. {{ item }}
  72. </el-tag>
  73. </div>
  74. </div>
  75. </div>
  76. <el-input id="resultBox" style="width: 100%;" class="commonFont" type="textarea"
  77. :autosize="{ minRows: 4, maxRows: 4 }" v-model="moreResult.result" />
  78. </div>
  79. <span slot="footer" class="dialog-footer">
  80. <el-button @click="btnClear"> </el-button>
  81. <el-button type="primary" @click="btnOkResult('defaultResult')">默认结果</el-button>
  82. <el-button type="primary" @click="btnOkResult('')"> </el-button>
  83. <el-button @click="dialogWinMoreResult = false"> </el-button>
  84. </span>
  85. </el-dialog>
  86. <!--Pacs结果录入模版-->
  87. <el-dialog :title="'Pacs结果录入模版 -- ' + doctorCheck.asbitemName" v-if="dialogWinPacsTemplate" :visible.sync="dialogWinPacsTemplate" width="800px"
  88. :close-on-click-modal="false">
  89. <PacsTemplate :refParams="pacsParams" :refFuncOther="handlePacsResult" />
  90. </el-dialog>
  91. </div>
  92. </div>
  93. </template>
  94. <script>
  95. // 0-无参考范围,1-数字型,2-字符型,3-性激素
  96. import { mapState } from "vuex";
  97. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  98. import { arrayExistObj, dddw, deepCopy } from '../../utlis/proFunc'
  99. import PacsTemplate from "./PacsTemplate.vue";
  100. export default {
  101. components: {
  102. PacsTemplate
  103. },
  104. props: ["isCheckPicture", "registerCheckId", "doctor_check_check_charge"],
  105. data() {
  106. return {
  107. resultStatus: [], //结果状态提示数据
  108. tipsNormal: {
  109. id: '01',
  110. displayName: "正常",
  111. dataInputPrompt: "正常",
  112. reportPrompt: "正常",
  113. reportBackgroundColor: 16777215,
  114. reportFontColor: 0,
  115. dataInputBackgroundColor: 16777215,
  116. dataInputFontColor: 0,
  117. }, //正常提示
  118. tipsError: {}, //错误提示
  119. tipsNegative: {}, //阴性提示
  120. tipsLowPositive: {}, //弱阳性提示
  121. tipsPositive: {}, //阳性提示
  122. tipsLow: {}, //偏低提示
  123. tipsHigh: {}, //偏高提示
  124. tipsSuperLow: {}, //超低提示
  125. tipsSuperHigh: {}, //超高提示
  126. tipsSuper: {}, //文字型危急值
  127. restaurants: [], //结果模版
  128. currentRow: -1, //当前操作的行
  129. dialogWinMoreResult: false,
  130. dialogWinPacsTemplate:false,
  131. moreResult: {
  132. data: [],
  133. result: '',
  134. defaultResult: '',
  135. index: 0, // 明细序列
  136. }, //结果模版
  137. isSplitChooseResult: 'N', // 选结果时,是否自动加上分隔符
  138. selection: { // 光标位置
  139. start: 0, end: 0
  140. },
  141. symbols: [], //特殊符号
  142. splitSymbols: [';', '、'], // 分隔符
  143. userId: '',
  144. // pacs 结果录入
  145. pacsParams: {
  146. from:'doctor',
  147. refresh:-1, // 强制刷新
  148. row: {},
  149. index: 0,
  150. result: '',
  151. summary: ''
  152. },
  153. };
  154. },
  155. created() {
  156. this.dictInit()
  157. },
  158. //挂载完成
  159. mounted() {
  160. this.checkItemList(this.dataTransOpts.tableS.register_check.id);
  161. this.userId = window.sessionStorage.getItem("userId")
  162. },
  163. computed: {
  164. ...mapState(["window", "dataTransOpts", "dict", "dialogWin", "doctorCheck"]),
  165. tableHeight() {
  166. let temp = this.window.pageHeight < 600 ? 600 : this.window.pageHeight
  167. return Math.floor((temp - 260 - (this.isCheckPicture ? 110 : 0)) * 3 / 5);
  168. },
  169. },
  170. methods: {
  171. dddw,
  172. dictInit() {
  173. //获取结果状态提示数据
  174. getapi('/api/app/result-status').then(res => {
  175. if (res.code != -1) {
  176. this.resultStatus = res.data
  177. this.resultStatus.forEach(e => {
  178. switch (e.id) {
  179. case '01': // 正常
  180. e.tooltips = 'tipsNormal'
  181. this.colorTrans(e, e.tooltips)
  182. break;
  183. case '02': // 错误
  184. e.tooltips = 'tipsError'
  185. this.colorTrans(e, e.tooltips)
  186. break;
  187. case '03': // 阴性
  188. e.tooltips = 'tipsNegative'
  189. this.colorTrans(e, e.tooltips)
  190. break;
  191. case '04': // 阳性
  192. e.tooltips = 'tipsPositive'
  193. this.colorTrans(e, e.tooltips)
  194. break;
  195. case '05': // 弱阳性
  196. e.tooltips = 'tipsLowPositive'
  197. this.colorTrans(e, e.tooltips)
  198. break;
  199. case '06': // 偏低
  200. e.tooltips = 'tipsLow'
  201. this.colorTrans(e, e.tooltips)
  202. break;
  203. case '07': // 偏高
  204. e.tooltips = 'tipsHigh'
  205. this.colorTrans(e, e.tooltips)
  206. break;
  207. case '08': // 危急值下限
  208. e.tooltips = 'tipsSuperLow'
  209. this.colorTrans(e, e.tooltips)
  210. break;
  211. case '09': // 危急值上限
  212. e.tooltips = 'tipsSuperHigh'
  213. this.colorTrans(e, e.tooltips)
  214. break;
  215. case '10': // 危急值
  216. e.tooltips = 'tipsSuper'
  217. this.colorTrans(e, e.tooltips)
  218. break;
  219. default:
  220. e.tooltips = 'tipsNormal'
  221. this.colorTrans(e, e.tooltips)
  222. break;
  223. }
  224. });
  225. }
  226. })
  227. //获取结果状态提示数据
  228. postapi('/api/app/CommonChar/GetCommonCharList', {}).then(res => {
  229. if (res.code >= 0) {
  230. this.symbols = res.data
  231. }
  232. })
  233. },
  234. // 颜色转换
  235. // displayName: "错误",
  236. // dataInputPrompt: "×",
  237. // reportPrompt: "×",
  238. // reportBackgroundColor: 2427166,
  239. // reportFontColor: 1070166,
  240. // dataInputBackgroundColor: 321313,
  241. // dataInputFontColor: 12991019,
  242. colorTrans(dataColor, frontColor) {
  243. let tempColor = '000000' + Number(dataColor.dataInputBackgroundColor).toString(16)
  244. let backgroundColor = '#' + tempColor.substring(tempColor.length - 6)
  245. tempColor = '000000' + Number(dataColor.dataInputFontColor).toString(16)
  246. let color = '#' + tempColor.substring(tempColor.length - 6)
  247. this[frontColor] = Object.assign(
  248. {},
  249. dataColor,
  250. { backgroundColor, color }
  251. )
  252. console.log(`this.${frontColor}`, this[frontColor])
  253. },
  254. // "referenceRangeValue": "15-55",
  255. // "referenceRangeTypeFlag": "1",
  256. // "criticalRangeValue": null,
  257. // "result"
  258. madeTooltips(index) {
  259. // let ts = confirm('提示')
  260. let checkItem = this.doctorCheck.checkItemList[index]
  261. let tooltips = 'tipsNormal'
  262. checkItem.class = tooltips
  263. let referenceRangeTypeFlag = checkItem.referenceRangeTypeFlag || '0' //参考范围类别0-无参考范围,1-数字型,2-字符型,3-性激素
  264. // console.log('madeTooltips',index,referenceRangeTypeFlag)
  265. switch (referenceRangeTypeFlag) {
  266. case '3': // 1 是数字型,3 是性激素期
  267. case '1':
  268. // console.log('1、3')
  269. if (checkItem.result) {
  270. let tempResult = checkItem.result
  271. .replaceAll('<', '').replaceAll('≤', '').replaceAll('≦', '')
  272. .replaceAll('>', '').replaceAll('≥', '').replaceAll('≧', '')
  273. .replaceAll('=', '').replaceAll(' ', '')
  274. console.log('tempResult', isNaN(tempResult), tempResult)
  275. if (isNaN(tempResult)) break;
  276. let result = Number(tempResult)
  277. if (checkItem.referenceRangeValue) {
  278. let criticalRangeValue = checkItem.criticalRangeValue
  279. let valueArr = checkItem.referenceRangeValue.replaceAll('--', '-').replaceAll('〜', '-').replaceAll('~', '-').split('-')
  280. if (valueArr.length == 1) valueArr.unshift(0)
  281. // console.log('valueArr',checkItem.referenceRangeValue,valueArr)
  282. if (criticalRangeValue) {
  283. let criticalArr = criticalRangeValue.replaceAll('--', '-').replaceAll('〜', '-').replaceAll('~', '-').split('-')
  284. if (criticalArr.length == 1) criticalArr.unshift(0)
  285. // console.log('criticalArr',checkItem.criticalRangeValue,criticalArr)
  286. if (result < Number(criticalArr[0])) {
  287. tooltips = 'tipsSuperLow'
  288. } else if (result > Number(criticalArr[1])) {
  289. tooltips = 'tipsSuperHigh'
  290. } else if (result < Number(valueArr[0])) {
  291. tooltips = 'tipsLow'
  292. } else if (result > Number(valueArr[1])) {
  293. tooltips = 'tipsHigh'
  294. }
  295. } else {
  296. if (result < Number(valueArr[0])) {
  297. tooltips = 'tipsLow'
  298. } else if (result > Number(valueArr[1])) {
  299. tooltips = 'tipsHigh'
  300. }
  301. }
  302. }
  303. //错误值校验
  304. let errArr = []
  305. if (checkItem.inputCheck) {
  306. errArr = checkItem.inputCheck.replaceAll('--', '-').replaceAll('〜', '-').replaceAll('~', '-').split('-')
  307. if (errArr.length == 1) errArr.unshift(-1)
  308. }
  309. if (errArr && errArr.length > 1) {
  310. if (result < Number(errArr[0]) || result > Number(errArr[1])) {
  311. tooltips = 'tipsError'
  312. console.log('checkItem', checkItem)
  313. }
  314. }
  315. }
  316. break;
  317. case '2':
  318. if (checkItem.result) {
  319. if (checkItem.result.indexOf('阴性') > -1 || checkItem.result.indexOf('-') > -1) {
  320. tooltips = 'tipsNegative'
  321. } else if (checkItem.result.indexOf('弱阳性') > -1 || checkItem.result.indexOf('±') > -1) {
  322. tooltips = 'tipsLowPositive'
  323. } else if (checkItem.result.indexOf('阳性') > -1 || checkItem.result.indexOf('+') > -1) {
  324. tooltips = 'tipsPositive'
  325. }
  326. }
  327. break;
  328. default:
  329. break;
  330. }
  331. // 判断后重新赋值
  332. checkItem.class = tooltips
  333. // 保存过检查时,直接取数据库
  334. checkItem.resultStatusId = this[tooltips].id //名称 dataInputPrompt
  335. // console.log('checkItem',checkItem)
  336. // console.log(`this.${tooltips}`,this[tooltips])
  337. },
  338. // 行结果是否可编辑
  339. rowResultDisabled(row) {
  340. return row.isCalculationItem == 'Y' || this.doctorCheck.RegisterCheckEdit.completeFlag == '1' || this.doctorCheck.RegisterCheckEdit.completeFlag == '2'
  341. },
  342. btnCritical(row){
  343. this.dialogWin.FollowCriticalCheck=true
  344. this.doctorCheck.combinationCriticalValue=false
  345. this.doctorCheck.singleDetailedProject=row
  346. },
  347. //项目列为计算函数
  348. computeFun(index) {
  349. // 有计算项的,才调用计算函数
  350. let haveComputeFun = false
  351. let checkItem = this.doctorCheck.checkItemList[index]
  352. console.log('checkItem', checkItem)
  353. let body = {
  354. registerCheckId: checkItem.registerCheckId,
  355. items: []
  356. }
  357. this.doctorCheck.checkItemList.forEach(e => {
  358. body.items.push({
  359. itemId: e.itemId,
  360. result: e.result
  361. })
  362. if (e.isCalculationItem == 'Y') haveComputeFun = true
  363. });
  364. if (!haveComputeFun) return // 有计算项的,才调用计算函数
  365. let lfind = -1
  366. postapi('/api/app/diagnosisfunction/getcalculationfunctionresult', body).then(res => {
  367. if (res.code != -1) {
  368. // console.log('res.data',res.data)
  369. res.data.items.forEach(e => {
  370. lfind = arrayExistObj(this.doctorCheck.checkItemList, "itemId", e.itemId)
  371. if (lfind > -1) {
  372. if (e.result != this.doctorCheck.checkItemList[lfind].result) {
  373. this.doctorCheck.checkItemList[lfind].result = e.result
  374. console.log('e', lfind, this.doctorCheck.checkItemList[lfind])
  375. this.madeTooltips(lfind)
  376. }
  377. }
  378. });
  379. }
  380. })
  381. },
  382. // 点击结果模版按钮
  383. btnMoreResult(row, index) {
  384. this.moreResult.data = deepCopy(row.itemResultTemplates)
  385. this.moreResult.result = row.result
  386. this.moreResult.defaultResult = row.defaultResult
  387. this.moreResult.index = index
  388. // "itemId": "3a0c517f-cbdb-9fff-e300-1f76b3e47580",
  389. // "result": "00000",
  390. // "diagnosisId": "3a0ed8a2-72d9-ee50-78aa-5b1f474f2921",
  391. // "isNameIntoSummary": "N",
  392. // "isResultIntoSummary": "Y",
  393. // "resultStatusId": "01",
  394. // "simpleCode": "0"
  395. this.dialogWinMoreResult = true
  396. this.watchSelection()
  397. },
  398. // pacs结果模板
  399. btnPacsResult(row, index) {
  400. let result = row.result
  401. let summary = ''
  402. this.doctorCheck.checkSummaryList.forEach((e, i) => {
  403. summary += e.summary
  404. });
  405. this.pacsParams.row = row
  406. this.pacsParams.index = index
  407. this.pacsParams.result = result
  408. this.pacsParams.summary = summary
  409. this.pacsParams.refresh++
  410. this.dialogWinPacsTemplate = true
  411. },
  412. // 双击选择结果模版的结果
  413. dblclickResult(item) {
  414. this.moreResult.result = ''
  415. this.clickResult(item)
  416. this.btnOkResult('')
  417. },
  418. // 单击选择结果模版的结果
  419. clickResult(item) {
  420. let result = []
  421. if (this.moreResult.result) result = this.moreResult.result.split(';')
  422. // 不用分隔符时,不判断包含关系
  423. if (this.isSplitChooseResult == 'Y' && result.indexOf(item.result) > -1) return
  424. if (this.isSplitChooseResult == 'Y' || result.length == 0) {
  425. result.push(item.result)
  426. } else {
  427. result[result.length - 1] = result[result.length - 1] + item.result
  428. }
  429. let ret = ''
  430. result.forEach((e, i) => {
  431. let splitStr = ';'
  432. if (i == 0) splitStr = ''
  433. ret += splitStr + e
  434. });
  435. this.moreResult.result = ret
  436. },
  437. // 清除结果值
  438. btnClear() {
  439. this.moreResult.result = ''
  440. },
  441. btnOkResult(result) {
  442. this.doctorCheck.checkItemList[this.moreResult.index].result = result ? this.moreResult[result] : this.moreResult.result
  443. this.madeTooltips(this.moreResult.index);
  444. this.computeFun(this.moreResult.index)
  445. this.dialogWinMoreResult = false
  446. },
  447. // 处理 pacs 结果录入的情况
  448. handlePacsResult(row, index, pacsResult) {
  449. // console.log('row,index,pacsResult', row, index, pacsResult)
  450. this.doctorCheck.checkItemList[index].result = pacsResult.result
  451. this.doctorCheck.checkSummaryList = [{
  452. id: Math.random(),
  453. registerCheckId: this.doctorCheck.RegisterCheckEdit.id,
  454. summary: pacsResult.summary,
  455. summaryFlag: 'N',
  456. }]
  457. this.dialogWinPacsTemplate = false
  458. },
  459. //选择项目
  460. rowClick(row) {
  461. this.doctorCheck.checkItem = row;
  462. this.restaurants = row.itemResultTemplates;
  463. },
  464. //检查组合项目下所包含的明细项目
  465. checkItemList(RegisterCheckId) {
  466. // this.doctorCheck.checkItem = null
  467. if (!RegisterCheckId) {
  468. this.doctorCheck.checkItemList = []
  469. this.doctorCheck.RegisterCheckEdit = {
  470. id: '',
  471. checkDoctorId: '',
  472. checkDate: '',
  473. LastModifierId: '',
  474. LastModificationTime: '',
  475. completeFlag: ''
  476. }
  477. return
  478. }
  479. console.log(`/api/app/registercheckitem/getlistinregistercheckid?RegisterCheckId=${RegisterCheckId}`);
  480. getapi(`/api/app/registercheck/getregistercheck?id=${RegisterCheckId}`)
  481. .then(res => {
  482. if (res.code > -1) {
  483. this.doctorCheck.RegisterCheckEdit = res.data
  484. if (res.data.isCharge != 'Y' && this.doctor_check_check_charge == 'Y') {
  485. this.$message.warning({ showClose: true, message: `该体检人员未缴清费用!` })
  486. }
  487. if (this.doctorCheck.RegisterCheckEdit.completeFlag == '0') {
  488. this.doctorCheck.RegisterCheckEdit.checkDoctorId = this.userId
  489. this.doctorCheck.RegisterCheckEdit.checkDate = new Date()
  490. }
  491. return getapi(`/api/app/registercheckitem/getlistinregistercheckid?RegisterCheckId=${RegisterCheckId}&PatientRegisterId=${this.dataTransOpts.tableS.patient_register.id}`)
  492. }
  493. })
  494. .then((res) => {
  495. // console.log("checkItemList", res.data);
  496. if (res && res.code > -1) {
  497. res.data.forEach((e, i) => {
  498. // 虚拟显示危急状态
  499. e['criticalFlag'] = 'N'
  500. });
  501. this.doctorCheck.checkItemList = res.data;
  502. this.doctorCheck.checkItemList.forEach((e, i) => {
  503. if (this.doctorCheck.RegisterCheckEdit.completeFlag == '0') {
  504. this.madeTooltips(i)
  505. } else {
  506. let lfind = arrayExistObj(this.resultStatus, 'id', e.resultStatusId)
  507. if (lfind > -1) {
  508. e.class = this.resultStatus[lfind].tooltips
  509. }
  510. }
  511. });
  512. this.enterToTab();
  513. }
  514. })
  515. .catch((err) => {
  516. this.$message.error({ showClose: true, message: `操作失败,原因:${err}` });
  517. });
  518. },
  519. querySearch(queryString, cb) {
  520. var restaurants = []; //不需要字典库显示 deepCopy(this.restaurants) [{ value: '阴性' },{ value: '阳性' }]
  521. restaurants.forEach((item) => {
  522. return (item.value = item.result);
  523. });
  524. // console.log("restaurants", restaurants);
  525. var results = queryString
  526. ? restaurants.filter(this.createFilter(queryString))
  527. : restaurants;
  528. // 调用 callback 返回建议列表的数据
  529. cb(results);
  530. },
  531. createFilter(queryString) {
  532. return (restaurant) => {
  533. return (
  534. restaurant["value"]
  535. .toLowerCase()
  536. .indexOf(queryString.toLowerCase()) > -1
  537. );
  538. };
  539. },
  540. handleSelect(item) {
  541. console.log('item', item);
  542. },
  543. //回车替代tab键
  544. enterToTab() {
  545. // console.log('enterToTab');
  546. this.$nextTick(() => {
  547. let inputs = document.querySelectorAll(["textarea", "input"]); //用数组可以读取多个标签的元素 //.inline-input
  548. // console.log('inputs', typeof inputs, inputs)
  549. // 为每个输入框添加键盘事件监听器
  550. inputs.forEach((input, i) => {
  551. // console.log('input',input);
  552. input.addEventListener('keydown', (event) => {
  553. // 如果按下的是回车键
  554. // console.log('data-lineModeFlag', input, input.getAttribute('data-lineModeFlag'), i);
  555. // console.log('event.keyCode', event.keyCode)
  556. switch (event.keyCode) {
  557. case 13:
  558. if (event.keyCode === 13 && input.getAttribute('data-lineModeFlag') == '0') {
  559. event.preventDefault();
  560. } else {
  561. break;
  562. }
  563. case 9: // tab 键
  564. event.preventDefault();
  565. case 40: // ↓ 键
  566. for (let j = i + 1; j < inputs.length; j++) {
  567. // console.log(inputs[j], inputs[j].getAttribute('type'), inputs[j].getAttribute('placeholder'))
  568. if (inputs[j].getAttribute('placeholder') == "请输入结果值") {
  569. if (inputs[j].getAttribute('disabled') != "disabled") {
  570. // console.log('inputs[j]', inputs[j])
  571. inputs[j].focus();
  572. break;
  573. }
  574. }
  575. }
  576. break;
  577. case 38: // ↑ 键
  578. for (let j = i - 1; j > -1; j--) {
  579. // console.log(inputs[j], inputs[j].getAttribute('type'), inputs[j].getAttribute('placeholder'))
  580. if (inputs[j].getAttribute('placeholder') == "请输入结果值") {
  581. if (inputs[j].getAttribute('disabled') != "disabled") {
  582. // console.log('inputs[j]', inputs[j])
  583. inputs[j].focus();
  584. break;
  585. }
  586. }
  587. }
  588. break;
  589. default:
  590. break;
  591. }
  592. });
  593. // 点击时全选结果
  594. input.addEventListener('click', (event) => {
  595. input.select()
  596. });
  597. });
  598. });
  599. },
  600. // 光标位置插入特殊符号
  601. insertSymbols(symbols) {
  602. let result = this.moreResult.result || ''
  603. if (result) {
  604. result = result.substring(0, this.selection.start) + symbols + result.substring(this.selection.end)
  605. } else {
  606. result = symbols
  607. }
  608. this.moreResult.result = result
  609. this.selection.start++
  610. this.selection.end++
  611. },
  612. // 获取光标位置的函数
  613. getCaretPosition() {
  614. let input = document.getElementById('resultBox');
  615. this.selection.start = input.selectionStart;
  616. this.selection.end = input.selectionEnd;
  617. // console.log('selection',this.selection)
  618. },
  619. watchSelection() {
  620. this.$nextTick(() => {
  621. let that = this
  622. let resultBox = document.getElementById('resultBox'); //用数组可以读取多个标签的元素 //.inline-input
  623. // 绑定键盘事件到文本框
  624. resultBox.addEventListener('click', function (event) {
  625. // 获取光标位置
  626. that.getCaretPosition()
  627. })
  628. resultBox.addEventListener('input', function (event) {
  629. // 获取光标位置
  630. that.getCaretPosition()
  631. })
  632. })
  633. },
  634. },
  635. //监听事件
  636. watch: {
  637. //检查项目切换
  638. // "doctorCheck.RegisterCheckId":{
  639. // immediate:true,
  640. // handler(newVal, oldVal) {
  641. // console.log(
  642. // "watch doctorCheck.RegisterCheckId newVal:",
  643. // newVal,
  644. // " oldVal:",
  645. // oldVal
  646. // );
  647. // this.checkItemList(newVal);
  648. // }
  649. // },
  650. //检查项目未切换换时 也可以强制刷新数据
  651. "dataTransOpts.refresh.register_check_item.M": {
  652. // immediate: true,
  653. handler(newVal, oldVal) {
  654. console.log(`watch 检查明细 newVal:${newVal} oldVal:${oldVal} registerCheckId: ${this.dataTransOpts.tableS.register_check.id}`);
  655. this.checkItemList(this.dataTransOpts.tableS.register_check.id);
  656. }
  657. },
  658. },
  659. };
  660. </script>
  661. <style lang="scss" scoped>
  662. @import "../../assets/css/global.css";
  663. ::v-deep .el-table td.el-table__cell,
  664. .el-table th.el-table__cell.is-leaf {
  665. padding: 0;
  666. }
  667. ::v-deep .el-textarea__inner {
  668. min-height: 23px;
  669. height: 23px;
  670. line-height: 1.25;
  671. padding: 2px 15px 2px 2px;
  672. }
  673. /*正常*/
  674. ::v-deep .tipsNormal .el-textarea__inner {
  675. background-color: v-bind("tipsNormal.backgroundColor") !important;
  676. color: v-bind("tipsNormal.color") !important;
  677. font-family: "Microsoft YaHei";
  678. }
  679. /*错误*/
  680. ::v-deep .tipsError .el-textarea__inner {
  681. background-color: v-bind("tipsError.backgroundColor") !important;
  682. color: v-bind("tipsError.color") !important;
  683. font-family: "Microsoft YaHei";
  684. }
  685. /*阴性 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
  686. ::v-deep .tipsNegative .el-textarea__inner {
  687. background-color: v-bind("tipsNegative.backgroundColor") !important;
  688. color: v-bind("tipsNegative.color") !important;
  689. font-family: "Microsoft YaHei";
  690. }
  691. /*弱阳性 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
  692. ::v-deep .tipsLowPositive .el-textarea__inner {
  693. background-color: v-bind("tipsLowPositive.backgroundColor") !important;
  694. color: v-bind("tipsLowPositive.color") !important;
  695. font-family: "Microsoft YaHei";
  696. }
  697. /*阳性 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
  698. ::v-deep .tipsPositive .el-textarea__inner {
  699. background-color: v-bind("tipsPositive.backgroundColor") !important;
  700. color: v-bind("tipsPositive.color") !important;
  701. font-family: "Microsoft YaHei";
  702. }
  703. /*偏低 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
  704. ::v-deep .tipsLow .el-textarea__inner {
  705. background-color: v-bind("tipsLow.backgroundColor") !important;
  706. color: v-bind("tipsLow.color") !important;
  707. font-family: "Microsoft YaHei";
  708. }
  709. /*偏高 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
  710. ::v-deep .tipsHigh .el-textarea__inner {
  711. background-color: v-bind("tipsHigh.backgroundColor") !important;
  712. color: v-bind("tipsHigh.color") !important;
  713. font-family: "Microsoft YaHei";
  714. }
  715. /*超低 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
  716. ::v-deep .tipsSuperLow .el-textarea__inner {
  717. background-color: v-bind("tipsSuperLow.backgroundColor") !important;
  718. color: v-bind("tipsSuperLow.color") !important;
  719. font-family: "Microsoft YaHei";
  720. }
  721. /*超高 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
  722. ::v-deep .tipsSuperHigh .el-textarea__inner {
  723. background-color: v-bind("tipsSuperHigh.backgroundColor") !important;
  724. color: v-bind("tipsSuperHigh.color") !important;
  725. font-family: "Microsoft YaHei";
  726. }
  727. /*文字性危及值 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
  728. ::v-deep .tipsSuper .el-textarea__inner {
  729. background-color: v-bind("tipsSuper.backgroundColor") !important;
  730. color: v-bind("tipsSuper.color") !important;
  731. font-family: "Microsoft YaHei";
  732. }
  733. ::v-deep .commonFont .el-textarea__inner {
  734. font-family: "Microsoft YaHei";
  735. }
  736. </style>