CaseQualityBox.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <template>
  2. <div class="caseQualityBox">
  3. <div class="score-box">
  4. {{ data.score }}分
  5. <span class="level">{{ scoreLevel }}</span>
  6. </div>
  7. <el-table
  8. :data="tableData"
  9. default-expand-all
  10. style="width: 100%">
  11. <el-table-column type="expand">
  12. <template slot-scope="props">
  13. <el-card v-for="(item, index) of props.row.children" :key="index" class="box-card" shadow="hover">
  14. <el-row>
  15. <el-col :span="24">
  16. <el-descriptions title="" :column="1" direction="vertical">
  17. <el-descriptions-item label="质控项目">
  18. <el-tag>{{ item.error_field }}</el-tag>
  19. <span class="koufen">-{{ item.score }}分</span>
  20. </el-descriptions-item>
  21. <el-descriptions-item label="错误描述">{{ item.notice }}</el-descriptions-item>
  22. <el-descriptions-item label="质控依据">
  23. <div v-for="(yItem, yIndex) of item.basis" :key="yIndex" style="margin-bottom: 10px;">
  24. <div v-if="item.rule_id !== 6">
  25. <div v-for="(cItem, cIndex) of yItem" :key="cIndex">{{ cItem }}</div>
  26. </div>
  27. <a v-else href="javascript:;" class="link" @click="toPage(yItem[1])">{{ yItem[0] }}</a>
  28. </div>
  29. </el-descriptions-item>
  30. </el-descriptions>
  31. </el-col>
  32. </el-row>
  33. </el-card>
  34. </template>
  35. </el-table-column>
  36. <el-table-column
  37. label=""
  38. prop="category">
  39. </el-table-column>
  40. </el-table>
  41. </div>
  42. </template>
  43. <script>
  44. export default {
  45. props: {
  46. data: {
  47. type: Object,
  48. default() {
  49. return {
  50. score: 0,
  51. data: {}
  52. }
  53. }
  54. }
  55. },
  56. computed: {
  57. tableData() {
  58. let arr = []
  59. const keys = Object.keys(this.data.data)
  60. for(let i=0; i<keys.length; i++) {
  61. let obj = {
  62. category: keys[i],
  63. children: this.data.data[keys[i]]
  64. }
  65. arr.push(obj)
  66. }
  67. return arr
  68. },
  69. scoreLevel() {
  70. /**
  71. * 甲>90分
  72. * 乙75-90分
  73. * 丙<75分
  74. * */
  75. let str
  76. const { score } = this.data
  77. if (score > 90) {
  78. str = '甲'
  79. } else if (score < 75) {
  80. str = '丙'
  81. } else {
  82. str = '乙'
  83. }
  84. return str
  85. }
  86. },
  87. methods: {
  88. toPage(blbh) {
  89. const { path } = this.$route
  90. let routeData = this.$router.resolve({ path, query: { blbh } })
  91. window.open(routeData.href, '_blank');
  92. }
  93. }
  94. }
  95. </script>
  96. <style lang="scss" scoped>
  97. .caseQualityBox {
  98. width: 340px;
  99. height: 820px;
  100. overflow-x: hidden;
  101. overflow-y: scroll;
  102. background: #ffffff;
  103. border: 1px solid #e2e2e2;
  104. box-sizing: border-box;
  105. padding: 20px;
  106. ::v-deep .el-descriptions-item__container .el-descriptions-item__content {
  107. display: block;
  108. }
  109. ::v-deep .el-descriptions-item__label:not(.is-bordered-label) {
  110. font-weight: 600;
  111. display: inline-table;
  112. }
  113. ::v-deep .el-descriptions-item__content {
  114. padding-top: 12px;
  115. }
  116. .box-card {
  117. margin-bottom: 10px;
  118. }
  119. .score-box {
  120. width: 100%;
  121. height: 120px;
  122. line-height: 120px;
  123. font-size: 32px;
  124. font-weight: bold;
  125. text-align: center;
  126. border-radius: 5px;
  127. border: 1px solid #dddddd;
  128. position: relative;
  129. overflow: hidden;
  130. &::before {
  131. content: "";
  132. position: absolute;
  133. width: 200px;
  134. height: 200px;
  135. top: -120px;
  136. right: -160px;
  137. z-index: 1;
  138. background-color: red;
  139. transform: rotate(45deg);
  140. }
  141. .level {
  142. position: absolute;
  143. top: 5px;
  144. right: 10px;
  145. z-index: 2;
  146. line-height: 30px;
  147. color: #ffffff;
  148. font-size: 16px;
  149. }
  150. }
  151. }
  152. .koufen {
  153. color: red;
  154. float: right;
  155. line-height: 32px;
  156. font-size: 16px;
  157. font-weight: bold;
  158. }
  159. .link {
  160. text-decoration: underline;
  161. &:hover {
  162. color: #409EFF;
  163. }
  164. }
  165. </style>