HighRiskDrugTest.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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="highriskItemName"
  26. label="药品通用名称(标准术语)"
  27. show-overflow-tooltip
  28. ></el-table-column>
  29. <el-table-column
  30. :resizable="false"
  31. prop="highriskItemHisName"
  32. label="药品通用名称(医院术语)"
  33. show-overflow-tooltip
  34. ></el-table-column>
  35. <el-table-column
  36. :resizable="false"
  37. prop="highriskItemRegName"
  38. label="药品注册名称"
  39. show-overflow-tooltip
  40. ></el-table-column>
  41. <el-table-column
  42. :resizable="false"
  43. prop="highriskItemForm"
  44. label="剂型"
  45. show-overflow-tooltip
  46. ></el-table-column>
  47. <el-table-column
  48. :resizable="false"
  49. prop="highriskLevel"
  50. label="药品高危级别"
  51. show-overflow-tooltip
  52. ></el-table-column>
  53. <el-table-column :resizable="false" prop="output" label="实际结果" show-overflow-tooltip></el-table-column>
  54. <el-table-column
  55. :resizable="false"
  56. prop="expectedOutput"
  57. label="预期结果"
  58. show-overflow-tooltip
  59. ></el-table-column>
  60. <el-table-column label="测试结果">
  61. <template slot-scope="scope">{{ scope.row.success === 1 ? '成功' : '失败' }}</template>
  62. </el-table-column>
  63. <el-table-column
  64. v-if="type !== 'success'"
  65. :resizable="false"
  66. prop="message"
  67. label="失败原因"
  68. show-overflow-tooltip
  69. ></el-table-column>
  70. </el-table>
  71. <div class="pagination pagepage">
  72. <el-pagination
  73. :current-page.sync="currentPage"
  74. @current-change="currentChange"
  75. background
  76. :page-size="pageSize"
  77. :page-sizes="pageSizeArr"
  78. @size-change="handleSizeChange"
  79. :layout="pageLayout"
  80. :total="total"
  81. ></el-pagination>
  82. </div>
  83. </div>
  84. </div>
  85. </template>
  86. <script>
  87. import api from '@api/cdss.js';
  88. import config from '@api/config.js';
  89. import utils from '@api/utils.js';
  90. export default {
  91. data() {
  92. return {
  93. list: [],
  94. currentPage: 1,
  95. pageSize: config.pageSize,
  96. pageSizeArr: config.pageSizeArr,
  97. pageLayout: config.pageLayout,
  98. total: 0,
  99. type: ''
  100. };
  101. },
  102. created() {
  103. const params = this.handleInitData();
  104. this.getDataList();
  105. // 非首页 编辑页返回 设置 this.currentPage
  106. if (Object.keys(this.$route.params).length !== 0) {
  107. this.currentPage = this.$route.params.currentPage;
  108. }
  109. },
  110. beforeRouteEnter(to, from, next) {
  111. next(vm => {
  112. Object.assign(vm, to.params);
  113. vm.inCurrentPage = to.params.currentPage;
  114. });
  115. },
  116. methods: {
  117. handleInitData() {
  118. const { data, type } = this.$route.params;
  119. this.type = type;
  120. return {
  121. resultId: data && data.resultId,
  122. success: type === 'success' ? 1 : 0
  123. };
  124. },
  125. indexMethod(index) {
  126. return (this.currentPage - 1) * this.pageSize + index + 1;
  127. },
  128. currentChange(next) {
  129. this.currentPage = next;
  130. this.getDataList(true);
  131. },
  132. handleSizeChange(val) {
  133. this.pageSize = val;
  134. this.currentPage = utils.getCurrentPage(
  135. this.currentPage,
  136. this.total,
  137. this.pageSize
  138. );
  139. this.getDataList();
  140. },
  141. getDataList() {
  142. const params = this.handleInitData();
  143. this.searched = true;
  144. const loading = this.$loading({
  145. lock: true,
  146. text: 'Loading',
  147. spinner: 'el-icon-loading',
  148. background: 'rgba(0, 0, 0, 0.7)'
  149. });
  150. api.getResultHighriskDrugPage(params).then(res => {
  151. loading.close();
  152. if (res.data.code === '0') {
  153. this.list = res.data.data && res.data.data.records;
  154. }
  155. this.total = res.data.data && res.data.data.total;
  156. if (this.inCurrentPage !== undefined) {
  157. this.currentPage = this.inCurrentPage;
  158. this.inCurrentPage = undefined;
  159. }
  160. });
  161. },
  162. // 导出
  163. exportData() {}
  164. }
  165. };
  166. </script>
  167. <style lang="less" scored>
  168. @import '../../../less/admin.less';
  169. </style>