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.

186 lines
6.3 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
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
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 style="display: flex;width:100%;">
  3. <div style="width:180;">
  4. <!-- :row-class-name="tableRowClassName" -->
  5. <el-table :data="RegisterCheckList" width="180"
  6. :height="window.pageHeight < 600 ? 330:window.pageHeight-270"
  7. border highlight-current-row
  8. @row-click="rowClick">
  9. <el-table-column prop="asbitemName" label="组合项目" width="180">
  10. <template slot-scope="scope">
  11. <div>
  12. <el-tooltip class="item" effect="dark" content="未检" placement="top">
  13. <i v-show="scope.row.completeFlag == '0'" class="el-icon-circle-plus" style="font-size: 18px;color: red;"></i>
  14. </el-tooltip>
  15. <el-tooltip class="item" effect="dark" content="已检" placement="top">
  16. <i v-show="scope.row.completeFlag == '1'" class="el-icon-success" style="font-size: 18px;color: green;"></i>
  17. </el-tooltip>
  18. <el-tooltip class="item" effect="dark" content="弃检" placement="top">
  19. <i v-show="scope.row.completeFlag == '2'" class="el-icon-remove" style="font-size: 18px;"></i>
  20. </el-tooltip>
  21. {{scope.row.asbitemName}}
  22. </div>
  23. </template>
  24. </el-table-column>
  25. </el-table>
  26. </div>
  27. <div :style="'width:' + (window.pageWidth - 180 - 110 - 45) + 'px;'">
  28. <el-table :data="tableData" :width="(window.pageWidth - 330 - 80)"
  29. :height="window.pageHeight < 600 ? 330:window.pageHeight-270"
  30. border highlight-current-row>
  31. <el-table-column prop="itemName" label="项目" width="150" />
  32. <el-table-column prop="unitName" label="单位" width="80" align="center"/>
  33. <el-table-column prop="referenceRangeValue" label="参考范围" width="80" align="center"/>
  34. <el-table-column v-for="(item, index) of tableCols" :label="item" :prop="item" :key="index" min-width="150" align="center">
  35. </el-table-column>
  36. </el-table>
  37. </div>
  38. </div>
  39. </template>
  40. <script lang="ts">
  41. import { mapState } from 'vuex';
  42. import Sortable from "sortablejs";
  43. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  44. import { arrayExistObj } from '@/utlis/proFunc';
  45. export default {
  46. components: {},
  47. props:["patientId"],
  48. data() {
  49. return {
  50. RegisterCheckList: [],
  51. tableData: [], //显示数据
  52. tableRows: [], //动态行
  53. tableCols: [], //动态列
  54. };
  55. },
  56. created() { },
  57. //挂载完成
  58. mounted() {
  59. // if(this.sumDoctorCheck.sumPREdit.patientId){
  60. // this.registerCheckList(this.sumDoctorCheck.sumPREdit.patientId);
  61. // }
  62. },
  63. computed: {
  64. ...mapState(['window','dict', 'doctorCheck', 'sumDoctorCheck']),
  65. },
  66. methods: {
  67. //组合项目颜色标识
  68. tableRowClassName({ row, rowIndex }) {
  69. //console.log('tableRowClassName',rowIndex,row)
  70. if (row.completeFlag === '0') {
  71. return 'warning'; //未检
  72. } else if (row.completeFlag === '2') {
  73. return 'info'; //弃检
  74. }
  75. return '';
  76. },
  77. //获取检查组合项目
  78. registerCheckList(patientId) {
  79. this.RegisterCheckList = []
  80. if(!patientId) return
  81. console.log(`/api/app/sumsummaryreport/gethorizontalcomparisonasbitemlist?PatientId=${patientId}`)
  82. getapi(`/api/app/sumsummaryreport/gethorizontalcomparisonasbitemlist?PatientId=${patientId}`)
  83. .then((res) => {
  84. console.log("获取项目对比 SumItems", res.data);
  85. if (res.code != -1) {
  86. this.RegisterCheckList = res.data;
  87. if (res.data.length > 0) this.rowClick(res.data[0])
  88. }
  89. })
  90. .catch((err) => {
  91. this.$message({ type: "error", message: `操作失败,原因:${err}` });
  92. });
  93. },
  94. rowClick(row) {
  95. //console.log('row',row) //asbitemId
  96. this.SumItems(this.patientId, row.asbitemId)
  97. },
  98. //获取结果明细 3a0c6589-9989-4d7f-ba54-61e5b0138220
  99. // "itemName": "乙肝表面抗原(HBsAg)",
  100. // "unitName": "次/分",
  101. // "referenceRangeValue": "",
  102. // "checkDate": "2023-07-14",
  103. // "resultValue": "阴性"
  104. SumItems(patientId, asbitemId) {
  105. console.log(`/api/app/sumsummaryreport/gethorizontalcomparisonlist?PatientId=${patientId}&AsbitemId=${asbitemId}`)
  106. getapi(`/api/app/sumsummaryreport/gethorizontalcomparisonlist?PatientId=${patientId}&AsbitemId=${asbitemId}`)
  107. .then((res) => {
  108. console.log("获取项目对比 SumItems", res.data);
  109. if (res.code != -1) {
  110. this.crossTable(res.data);
  111. }
  112. })
  113. .catch((err) => {
  114. this.$message({ type: "error", message: `操作失败,原因:${err}` });
  115. });
  116. },
  117. //交叉报表
  118. crossTable(tableData) {
  119. this.tableData = [] //显示数据
  120. this.tableRows = [] //动态行
  121. this.tableCols = [] //动态列
  122. // console.log('tableData', tableData)
  123. tableData.forEach(e => {
  124. if (this.tableRows.indexOf(e.itemName) == - 1) this.tableRows.push(e.itemName)
  125. if (this.tableCols.indexOf(e.checkDate) == - 1) this.tableCols.push(e.checkDate)
  126. });
  127. this.tableCols.sort();
  128. this.tableRows.forEach(r => {
  129. let item = {}
  130. let resultValue = ''
  131. item['itemName'] = r
  132. this.tableCols.forEach(c => {
  133. for (let i = 0; i < tableData.length; i++) {
  134. if (tableData[i].itemName == r) {
  135. item['unitName'] = tableData[i].unitName
  136. item['referenceRangeValue'] = tableData[i].referenceRangeValue
  137. }
  138. if (tableData[i].itemName == r && tableData[i].checkDate == c) {
  139. resultValue = tableData[i].resultValue
  140. break;
  141. }
  142. }
  143. item[c] = resultValue
  144. });
  145. this.tableData.push(item)
  146. });
  147. // console.log('this.tableRows', this.tableRows)
  148. // console.log('this.tableCols', this.tableCols)
  149. // console.log('this.tableData', this.tableData)
  150. },
  151. },
  152. //监听事件
  153. watch: {
  154. //检查项目切换
  155. "patientId":{
  156. immediate:true,
  157. handler(newVal, oldVal) {
  158. console.log("watch patientId newVal:", newVal, " oldVal:", oldVal);
  159. this.registerCheckList(newVal)
  160. }
  161. },
  162. },
  163. };
  164. </script>
  165. <style scoped>
  166. @import '../../assets/css/global_table.css';
  167. </style>