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.

244 lines
8.3 KiB

3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years 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
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years 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
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 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"],
  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 tempHeight = this.window.pageHeight < 600 ? 600 : this.window.pageHeight
  82. return tempHeight - 195
  83. },
  84. },
  85. methods: {
  86. getColorStr,
  87. //组合项目颜色标识
  88. tableRowClassName({ row, rowIndex }) {
  89. //console.log('tableRowClassName',rowIndex,row)
  90. if (row.completeFlag === '0') {
  91. return 'warning'; //未检
  92. } else if (row.completeFlag === '2') {
  93. return 'info'; //弃检
  94. }
  95. return '';
  96. },
  97. //获取检查组合项目
  98. registerCheckList(patientId) {
  99. this.RegisterCheckList = []
  100. if (!patientId) return
  101. // console.log(`/api/app/sumsummaryreport/gethorizontalcomparisonasbitemlist?PatientId=${patientId}`)
  102. postapi('/api/app/SumSummaryReport/GetHorizontalComparisonAsbitems', { patientId })
  103. .then((res) => {
  104. console.log("获取横向对比 SumItems", res.data);
  105. if (res.code != -1) {
  106. this.RegisterCheckList = res.data;
  107. // if (this.RegisterCheckList && this.RegisterCheckList.length > 0){
  108. // this.rowClick(this.RegisterCheckList[0])
  109. // this.$refs['registerCheckList'].setCurrentRow(this.RegisterCheckList[0])
  110. // }
  111. }
  112. })
  113. .catch((err) => {
  114. this.$message({ type: "error", message: `操作失败,原因:${err}` });
  115. });
  116. },
  117. rowClick(row) {
  118. //console.log('row',row) //asbitemId
  119. this.SumItems(this.patientId, row.asbitemId)
  120. },
  121. //获取结果明细 3a0c6589-9989-4d7f-ba54-61e5b0138220
  122. // "itemName": "乙肝表面抗原(HBsAg)",
  123. // "unitName": "次/分",
  124. // "referenceRangeValue": "",
  125. // "checkDate": "2023-07-14",
  126. // "resultValue": "阴性"
  127. SumItems(patientId, asbitemId) {
  128. // console.log(`/api/app/sumsummaryreport/gethorizontalcomparisonlist?PatientId=${patientId}&AsbitemId=${asbitemId}`)
  129. postapi('/api/app/SumSummaryReport/GetHorizontalComparisons', { patientId, asbitemId })
  130. .then((res) => {
  131. console.log("获取横向对比 SumItems", res.data);
  132. if (res.code != -1) {
  133. this.crossTable(res.data);
  134. }
  135. })
  136. .catch((err) => {
  137. this.$message({ type: "error", message: `操作失败,原因:${err}` });
  138. });
  139. },
  140. //交叉报表
  141. crossTable(tableData) {
  142. // [
  143. // {
  144. // "regsterCheckId": "00000000-0000-0000-0000-000000000000",
  145. // "checkDate": "2018-06-08T00:00:00",
  146. // "summarys": [
  147. // {
  148. // "summary": "体重指数:23.89 诊断为:正常"
  149. // }
  150. // ],
  151. // "registerCheckItems": [
  152. // {
  153. // "itemName": "身高",
  154. // "unitName": "",
  155. // "referenceRangeValue": "",
  156. // "resultValue": "176",
  157. // "reportFontColor": 0
  158. // }
  159. this.tableData = [] //显示数据
  160. this.tableCols = [] //动态列
  161. // console.log('tableData', tableData)
  162. // this.tableCols.push('itemName')
  163. // this.tableCols.push('unitName')
  164. // this.tableCols.push('referenceRangeValue')
  165. let summary = { itemName: '小结', unitName: '', referenceRangeValue: '' }
  166. tableData.forEach((e, i) => {
  167. let lsummary = ''
  168. e.summarys.forEach((s, i) => {
  169. let splitStr = '<br>'
  170. if (i == 0) splitStr = ''
  171. lsummary += splitStr + (s.summary || '')
  172. });
  173. summary[e.checkDate] = lsummary
  174. // 获取列数
  175. if (this.tableCols.indexOf(e.checkDate) == - 1) this.tableCols.push(e.checkDate)
  176. // 获取行及数据
  177. let row = {}
  178. e.registerCheckItems.forEach(r => {
  179. let lfind = arrayExistObj(this.tableData, 'itemName', r.itemName)
  180. if (lfind > -1) {
  181. this.tableData[lfind][e.checkDate] = r.resultValue
  182. this.tableData[lfind][e.checkDate + '_color'] = r.reportFontColor
  183. } else {
  184. row = {
  185. itemName: r.itemName,
  186. unitName: r.unitName,
  187. referenceRangeValue: r.referenceRangeValue
  188. }
  189. row[e.checkDate] = r.resultValue
  190. row[e.checkDate + '_color'] = r.reportFontColor
  191. this.tableData.push(row)
  192. }
  193. })
  194. });
  195. this.tableData.push(summary)
  196. },
  197. },
  198. //监听事件
  199. watch: {
  200. // 虚拟表 触发强制刷新 (sumDoctor.M 合并包含:综述、建议、对比、历史等,不包含总检诊断)
  201. "dataTransOpts.refresh.sumDoctor.M": {
  202. // immediate:true,
  203. handler(newVal, oldVal) {
  204. console.log(`watch 总检--横向对比 newVal: ${newVal}, oldVal: ${oldVal} patientId: ${this.patientId} tabChoosed: ${this.tabChoosed}`);
  205. if (newVal != oldVal && this.tabChoosed == '5') this.registerCheckList(this.patientId)
  206. }
  207. },
  208. },
  209. };
  210. </script>
  211. <style scoped>
  212. @import '../../assets/css/global_table.css';
  213. .tdCellClass {
  214. padding: 0 5px;
  215. text-align: center;
  216. }
  217. ::v-deep .el-table tr {
  218. background-color: #f4f8ff;
  219. }
  220. </style>