CriticalLabTest.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <template>
  2. <div>
  3. <crumbs
  4. :title="
  5. type === 'success'
  6. ? '危急值提醒-实验室检查规则测试-成功条数'
  7. : '危急值提醒-实验室检查规则测试-失败条数'
  8. "
  9. class="topBack"
  10. :param="$route.params"
  11. linkTo="KnowledgeMapRuleTest"
  12. >
  13. <el-form :inline="true" class="demo-form-inline">
  14. <el-form-item style="marginbottom: 0px">
  15. <el-button size="mini" @click="exportData">导出</el-button>
  16. </el-form-item>
  17. </el-form>
  18. </crumbs>
  19. <div style="margin: 60px 20px 0">
  20. <el-table :data="list" border>
  21. <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="80"></el-table-column>
  22. <el-table-column :resizable="false" prop="gmtModified" label="测试时间"></el-table-column>
  23. <el-table-column
  24. :resizable="false"
  25. prop="criticalItemName"
  26. label="实验室检查名称(标准术语)"
  27. show-overflow-tooltip
  28. ></el-table-column>
  29. <el-table-column
  30. :resizable="false"
  31. prop="criticalItemHisName"
  32. label="实验室检查套餐名(医院术语)"
  33. show-overflow-tooltip
  34. ></el-table-column>
  35. <el-table-column
  36. :resizable="false"
  37. prop="criticalItemHisDetailName"
  38. label="实验室检查名称(医院术语)"
  39. show-overflow-tooltip
  40. ></el-table-column>
  41. <el-table-column :resizable="false" prop="maxValue" label="高危急值" show-overflow-tooltip></el-table-column>
  42. <el-table-column :resizable="false" prop="minValue" label="低危急值" show-overflow-tooltip></el-table-column>
  43. <el-table-column :resizable="false" prop="inputValue" label="输入值" show-overflow-tooltip></el-table-column>
  44. <el-table-column :resizable="false" prop="output" label="实际结果" show-overflow-tooltip></el-table-column>
  45. <el-table-column
  46. :resizable="false"
  47. prop="expectedOutput"
  48. label="预期结果"
  49. show-overflow-tooltip
  50. ></el-table-column>
  51. <el-table-column label="测试结果">
  52. <template slot-scope="scope">{{ scope.row.success === 1 ? '成功' : '失败' }}</template>
  53. </el-table-column>
  54. <el-table-column
  55. v-if="type !== 'success'"
  56. :resizable="false"
  57. prop="message"
  58. label="失败原因"
  59. show-overflow-tooltip
  60. ></el-table-column>
  61. </el-table>
  62. <div class="pagination pagepage">
  63. <el-pagination
  64. :current-page.sync="currentPage"
  65. @current-change="currentChange"
  66. background
  67. :page-size="pageSize"
  68. :page-sizes="pageSizeArr"
  69. @size-change="handleSizeChange"
  70. :layout="pageLayout"
  71. :total="total"
  72. ></el-pagination>
  73. </div>
  74. </div>
  75. </div>
  76. </template>
  77. <script>
  78. import api from '@api/cdss.js';
  79. import config from '@api/config.js';
  80. import utils from '@api/utils.js';
  81. export default {
  82. data() {
  83. return {
  84. list: [],
  85. currentPage: 1,
  86. pageSize: config.pageSize,
  87. pageSizeArr: config.pageSizeArr,
  88. pageLayout: config.pageLayout,
  89. total: 0,
  90. type: ''
  91. };
  92. },
  93. created() {
  94. const params = this.handleInitData();
  95. this.getDataList();
  96. // 非首页 编辑页返回 设置 this.currentPage
  97. if (Object.keys(this.$route.params).length !== 0) {
  98. this.currentPage = this.$route.params.currentPage;
  99. }
  100. },
  101. beforeRouteEnter(to, from, next) {
  102. next(vm => {
  103. //const pm = to.param;
  104. Object.assign(vm, to.params);
  105. vm.inCurrentPage = to.params.currentPage;
  106. });
  107. },
  108. methods: {
  109. handleInitData() {
  110. const { data, type } = this.$route.params;
  111. this.type = type;
  112. let criticalType;
  113. if (data && data.caseName === '危机值提醒_实验室检查规则') {
  114. criticalType = 1;
  115. } else if (data && data.caseName === '危机值提醒_辅助检查规则') {
  116. criticalType = 2;
  117. }
  118. return {
  119. current: this.inCurrentPage || this.currentPage,
  120. size: this.pageSize,
  121. criticalType,
  122. resultId: data && data.resultId,
  123. success: type === 'success' ? 1 : 0
  124. };
  125. },
  126. indexMethod(index) {
  127. return (this.currentPage - 1) * this.pageSize + index + 1;
  128. },
  129. currentChange(next) {
  130. this.currentPage = next;
  131. this.getDataList(true);
  132. },
  133. handleSizeChange(val) {
  134. this.pageSize = val;
  135. this.currentPage = utils.getCurrentPage(
  136. this.currentPage,
  137. this.total,
  138. this.pageSize
  139. );
  140. this.getDataList();
  141. },
  142. getDataList() {
  143. const params = this.handleInitData();
  144. this.searched = true;
  145. const loading = this.$loading({
  146. lock: true,
  147. text: 'Loading',
  148. spinner: 'el-icon-loading',
  149. background: 'rgba(0, 0, 0, 0.7)'
  150. });
  151. api.getResultCriticalPage(params).then(res => {
  152. loading.close();
  153. if (res.data.code === '0') {
  154. this.list = res.data.data && res.data.data.records;
  155. }
  156. this.total = res.data.data && res.data.data.total;
  157. if (this.inCurrentPage !== undefined) {
  158. this.currentPage = this.inCurrentPage;
  159. this.inCurrentPage = undefined;
  160. }
  161. });
  162. },
  163. // 导出
  164. exportData() {
  165. const { data, hospitalId, hospitalName, type } = this.$route.params;
  166. let params = {
  167. success: type === 'success' ? 1 : 0,
  168. resultId: data.resultId,
  169. criticalType: 1 //1:检验,2:检查
  170. };
  171. this.$alert('确定要导出规则测试结果吗?', '', {
  172. confirmButtonText: '确定',
  173. title: '提示',
  174. type: 'warning'
  175. })
  176. .then(() => {
  177. api.criticalExportExcel(params).then(res => {
  178. if (res.status === 200) {
  179. this.$message({ message: '导出成功', type: 'success' });
  180. utils.downloadExportedData(
  181. res.data,
  182. `${hospitalName}-实验室检查危急值提醒规则测试结果.xls`
  183. );
  184. }
  185. });
  186. })
  187. .catch(() => {});
  188. }
  189. }
  190. };
  191. </script>
  192. <style lang="less" scored>
  193. @import '../../../less/admin.less';
  194. </style>