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.

257 lines
8.6 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
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
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
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
4 weeks 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 style="display: flex;width:100%;">
  3. <div style="width:180;">
  4. <!-- :row-class-name="tableRowClassName" -->
  5. <el-table :data="RegisterCheckList" width="180" :height="divHeight" border highlight-current-row
  6. @row-click="rowClick" ref="registerCheckList" >
  7. <el-table-column prop="asbitemName" label="组合项目" width="180">
  8. <template slot="header">
  9. <div style="width: 180px;background-color: #f4f8ff;">组合项目</div>
  10. </template>
  11. </el-table-column>
  12. </el-table>
  13. </div>
  14. <div :style="`padding-left:10px;width:${(window.pageWidth - 180 - 110 - 25)}px;`">
  15. <!--
  16. <el-table :data="tableData" :height="divHeight" border highlight-current-row>
  17. <el-table-column prop="itemName" label="项目" width="150" />
  18. <el-table-column prop="unitName" label="单位" width="80" align="center" />
  19. <el-table-column prop="referenceRangeValue" label="参考范围" width="80" align="center" />
  20. <el-table-column v-for="(item, index) of tableCols" :label="item.substring(0,10)" :prop="item" :key="index" min-width="150"
  21. align="center">
  22. <template slot-scope="scope">
  23. <div>{{ scope.row[item] }}</div>
  24. </template>
  25. </el-table-column>
  26. </el-table>
  27. -->
  28. <table width="100%" style="font-size:14px;border-collapse:collapse;" border="1" cellspacing="0"
  29. bordercolor="#909399">
  30. <colgroup>
  31. <col width="150">
  32. <col width="50">
  33. <col width="80">
  34. <col width="120" v-for="(item, index) of tableCols" :key="index">
  35. </colgroup>
  36. <thead>
  37. <tr height="30">
  38. <td class="tdCellClass">项目</td>
  39. <td class="tdCellClass">单位</td>
  40. <td class="tdCellClass">参考范围</td>
  41. <td class="tdCellClass" v-for="(item, index) of tableCols" :key="index">{{ item.substring(0, 10) }}</td>
  42. </tr>
  43. </thead>
  44. <tbody v-for="(item, index) of tableData" :key="index">
  45. <tr height="30">
  46. <td class="tdCellClass" style="text-align: left;">{{ item.itemName }}</td>
  47. <td class="tdCellClass">{{ item.unitName }}</td>
  48. <td class="tdCellClass">{{ item.referenceRangeValue }}</td>
  49. <td v-for="(item2, index2) of tableCols" :key="index2"
  50. :style="`padding: 0 5px;text-align:left;color: ${item.itemName == '小结' ? '#000000': getColorStr(item[item2 + '_color'])};`" v-html="item[item2]"></td>
  51. </tr>
  52. </tbody>
  53. </table>
  54. </div>
  55. </div>
  56. </template>
  57. <script>
  58. import { mapState } from 'vuex';
  59. import Sortable from "sortablejs";
  60. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  61. import { arrayExistObj, getColorStr } from '@/utlis/proFunc';
  62. export default {
  63. components: {},
  64. props: ["patientId", "tabChoosed","refParams"],
  65. data() {
  66. return {
  67. RegisterCheckList: [],
  68. tableData: [], //显示数据
  69. tableRows: [], //动态行
  70. tableCols: [], //动态列
  71. };
  72. },
  73. created() { },
  74. //挂载完成
  75. mounted() {
  76. this.registerCheckList(this.patientId)
  77. },
  78. computed: {
  79. ...mapState(['window', 'dict', 'dataTransOpts', 'doctorCheck', 'sumDoctorCheck']),
  80. divHeight() {
  81. let tableHeight = 465
  82. switch (this.refParams.place) {
  83. case 'summary': //总检处
  84. tableHeight = (this.window.pageHeight < 600 ? 600 : this.window.pageHeight) - 195
  85. break;
  86. default:
  87. break;
  88. }
  89. return tableHeight
  90. },
  91. },
  92. methods: {
  93. getColorStr,
  94. //组合项目颜色标识
  95. tableRowClassName({ row, rowIndex }) {
  96. //console.log('tableRowClassName',rowIndex,row)
  97. if (row.completeFlag === '0') {
  98. return 'warning'; //未检
  99. } else if (row.completeFlag === '2') {
  100. return 'info'; //弃检
  101. }
  102. return '';
  103. },
  104. //获取检查组合项目
  105. registerCheckList(patientId) {
  106. this.RegisterCheckList = []
  107. if (!patientId) return
  108. // console.log(`/api/app/sumsummaryreport/gethorizontalcomparisonasbitemlist?PatientId=${patientId}`)
  109. postapi('/api/app/SumSummaryReport/GetHorizontalComparisonAsbitems', { patientId })
  110. .then((res) => {
  111. console.log("获取横向对比 SumItems", res.data);
  112. if (res.code != -1) {
  113. this.RegisterCheckList = res.data;
  114. // if (this.RegisterCheckList && this.RegisterCheckList.length > 0){
  115. // this.rowClick(this.RegisterCheckList[0])
  116. // this.$refs['registerCheckList'].setCurrentRow(this.RegisterCheckList[0])
  117. // }
  118. }
  119. })
  120. .catch((err) => {
  121. this.$message({ type: "error", message: `操作失败,原因:${err}` });
  122. });
  123. },
  124. rowClick(row) {
  125. //console.log('row',row) //asbitemId
  126. this.SumItems(this.patientId, row.asbitemId)
  127. },
  128. //获取结果明细 3a0c6589-9989-4d7f-ba54-61e5b0138220
  129. // "itemName": "乙肝表面抗原(HBsAg)",
  130. // "unitName": "次/分",
  131. // "referenceRangeValue": "",
  132. // "checkDate": "2023-07-14",
  133. // "resultValue": "阴性"
  134. SumItems(patientId, asbitemId) {
  135. // console.log(`/api/app/sumsummaryreport/gethorizontalcomparisonlist?PatientId=${patientId}&AsbitemId=${asbitemId}`)
  136. postapi('/api/app/SumSummaryReport/GetHorizontalComparisons', { patientId, asbitemId })
  137. .then((res) => {
  138. console.log("获取横向对比 SumItems", res.data);
  139. if (res.code != -1) {
  140. this.crossTable(res.data);
  141. }
  142. })
  143. .catch((err) => {
  144. this.$message({ type: "error", message: `操作失败,原因:${err}` });
  145. });
  146. },
  147. //交叉报表
  148. crossTable(tableData) {
  149. // [
  150. // {
  151. // "regsterCheckId": "00000000-0000-0000-0000-000000000000",
  152. // "checkDate": "2018-06-08T00:00:00",
  153. // "summarys": [
  154. // {
  155. // "summary": "体重指数:23.89 诊断为:正常"
  156. // }
  157. // ],
  158. // "registerCheckItems": [
  159. // {
  160. // "itemName": "身高",
  161. // "unitName": "",
  162. // "referenceRangeValue": "",
  163. // "resultValue": "176",
  164. // "reportFontColor": 0
  165. // }
  166. this.tableData = [] //显示数据
  167. this.tableCols = [] //动态列
  168. // console.log('tableData', tableData)
  169. // this.tableCols.push('itemName')
  170. // this.tableCols.push('unitName')
  171. // this.tableCols.push('referenceRangeValue')
  172. let summary = { itemName: '小结', unitName: '', referenceRangeValue: '' }
  173. tableData.forEach((e, i) => {
  174. let lsummary = ''
  175. e.summarys.forEach((s, i) => {
  176. let splitStr = '<br>'
  177. if (i == 0) splitStr = ''
  178. lsummary += splitStr + (s.summary || '')
  179. });
  180. summary[e.checkDate] = lsummary
  181. // 获取列数
  182. if (this.tableCols.indexOf(e.checkDate) == - 1) this.tableCols.push(e.checkDate)
  183. // 获取行及数据
  184. let row = {}
  185. e.registerCheckItems.forEach(r => {
  186. let lfind = arrayExistObj(this.tableData, 'itemName', r.itemName)
  187. if (lfind > -1) {
  188. this.tableData[lfind][e.checkDate] = r.resultValue
  189. this.tableData[lfind][e.checkDate + '_color'] = r.reportFontColor
  190. } else {
  191. row = {
  192. itemName: r.itemName,
  193. unitName: r.unitName,
  194. referenceRangeValue: r.referenceRangeValue
  195. }
  196. row[e.checkDate] = r.resultValue
  197. row[e.checkDate + '_color'] = r.reportFontColor
  198. this.tableData.push(row)
  199. }
  200. })
  201. });
  202. this.tableData.push(summary)
  203. },
  204. },
  205. //监听事件
  206. watch: {
  207. // 虚拟表 触发强制刷新 (sumDoctor.M 合并包含:综述、建议、对比、历史等,不包含总检诊断)
  208. "dataTransOpts.refresh.sumDoctor.M": {
  209. // immediate:true,
  210. handler(newVal, oldVal) {
  211. console.log(`watch 总检--横向对比 newVal: ${newVal}, oldVal: ${oldVal} patientId: ${this.patientId} tabChoosed: ${this.tabChoosed}`);
  212. if (newVal != oldVal){
  213. if(this.refParams.place == 'doctor'){
  214. this.registerCheckList(this.patientId)
  215. }else{
  216. if(this.tabChoosed == '5') this.registerCheckList(this.patientId)
  217. }
  218. }
  219. }
  220. },
  221. },
  222. };
  223. </script>
  224. <style scoped>
  225. @import '../../assets/css/global_table.css';
  226. .tdCellClass {
  227. padding: 0 5px;
  228. text-align: center;
  229. }
  230. ::v-deep .el-table tr {
  231. background-color: #f4f8ff;
  232. }
  233. </style>