BillCommonTest.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  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
  22. :resizable="false"
  23. type="index"
  24. :index="indexMethod"
  25. label="编号"
  26. width="80"
  27. ></el-table-column>
  28. <el-table-column
  29. :resizable="false"
  30. prop="gmtModified"
  31. label="测试时间"
  32. ></el-table-column>
  33. <el-table-column
  34. :resizable="false"
  35. prop="billItemType"
  36. label="开单项类型"
  37. show-overflow-tooltip
  38. ></el-table-column>
  39. <el-table-column
  40. :resizable="false"
  41. prop="billItemName"
  42. label="开单项(标准术语)"
  43. show-overflow-tooltip
  44. ></el-table-column>
  45. <el-table-column
  46. :resizable="false"
  47. prop="billItemHisName"
  48. label="开单项(医院术语)"
  49. show-overflow-tooltip
  50. ></el-table-column>
  51. <el-table-column
  52. :resizable="false"
  53. prop="conflictItemType"
  54. label="禁忌项类型"
  55. show-overflow-tooltip
  56. ></el-table-column>
  57. <el-table-column
  58. :resizable="false"
  59. prop="conflictItemName"
  60. label="禁忌项(标准术语)"
  61. show-overflow-tooltip
  62. ></el-table-column>
  63. <el-table-column
  64. :resizable="false"
  65. prop="conflictItemHisName"
  66. label="禁忌项(医院术语)"
  67. show-overflow-tooltip
  68. ></el-table-column>
  69. <el-table-column
  70. :resizable="false"
  71. prop="inputValue"
  72. label="禁忌项输入值/结果"
  73. show-overflow-tooltip
  74. ></el-table-column>
  75. <el-table-column
  76. :resizable="false"
  77. prop="output"
  78. label="实际结果"
  79. show-overflow-tooltip
  80. ></el-table-column>
  81. <el-table-column
  82. :resizable="false"
  83. prop="expectedOutput"
  84. label="预期结果"
  85. show-overflow-tooltip
  86. ></el-table-column>
  87. <el-table-column label="测试结果">
  88. <template slot-scope="scope">
  89. {{ scope.row.success === 1 ? '成功' : '失败' }}
  90. </template>
  91. </el-table-column>
  92. <el-table-column
  93. v-if="type !== 'success'"
  94. :resizable="false"
  95. prop="message"
  96. label="失败原因"
  97. show-overflow-tooltip
  98. ></el-table-column>
  99. </el-table>
  100. <div class="pagination pagepage">
  101. <el-pagination
  102. :current-page.sync="currentPage"
  103. @current-change="currentChange"
  104. background
  105. :page-size="pageSize"
  106. :page-sizes="pageSizeArr"
  107. @size-change="handleSizeChange"
  108. :layout="pageLayout"
  109. :total="total"
  110. ></el-pagination>
  111. </div>
  112. </div>
  113. </div>
  114. </template>
  115. <script>
  116. import api from '@api/cdss.js';
  117. import config from '@api/config.js';
  118. import utils from '@api/utils.js';
  119. export default {
  120. data() {
  121. return {
  122. list: [],
  123. currentPage: 1,
  124. pageSize: config.pageSize,
  125. pageSizeArr: config.pageSizeArr,
  126. pageLayout: config.pageLayout,
  127. total: 0,
  128. type: '',
  129. };
  130. },
  131. created() {
  132. const params = this.handleInitData();
  133. this.getDataList();
  134. // 非首页 编辑页返回 设置 this.currentPage
  135. if (Object.keys(this.$route.params).length !== 0) {
  136. this.currentPage = this.$route.params.currentPage;
  137. }
  138. },
  139. beforeRouteEnter(to, from, next) {
  140. next((vm) => {
  141. //const pm = to.param;
  142. Object.assign(vm, to.params);
  143. vm.inCurrentPage = to.params.currentPage;
  144. });
  145. },
  146. methods: {
  147. handleInitData() {
  148. console.log(this.$route.params);
  149. const { data, type } = this.$route.params;
  150. this.type = type;
  151. console.log(this.type, '111');
  152. let billType; // 开单合理性规则类型 1 通用 2 输血
  153. if (data && data.caseName === '开单合理性提醒_通用规则') {
  154. billType = 1;
  155. } else if (data && data.caseName === '开单类型提醒_输血规则') {
  156. billType = 2;
  157. }
  158. return {
  159. billType,
  160. resultId: data && data.resultId,
  161. success: type === 'success' ? 1 : 0,
  162. };
  163. },
  164. indexMethod(index) {
  165. return (this.currentPage - 1) * this.pageSize + index + 1;
  166. },
  167. currentChange(next) {
  168. this.currentPage = next;
  169. this.getDataList(true);
  170. },
  171. handleSizeChange(val) {
  172. this.pageSize = val;
  173. this.currentPage = utils.getCurrentPage(
  174. this.currentPage,
  175. this.total,
  176. this.pageSize
  177. );
  178. this.getDataList();
  179. },
  180. getDataList() {
  181. const params = this.handleInitData();
  182. this.searched = true;
  183. const loading = this.$loading({
  184. lock: true,
  185. text: 'Loading',
  186. spinner: 'el-icon-loading',
  187. background: 'rgba(0, 0, 0, 0.7)',
  188. });
  189. api.getResultBillPage(params).then((res) => {
  190. loading.close();
  191. if (res.data.code === '0') {
  192. this.list = res.data.data && res.data.data.records;
  193. }
  194. this.total = res.data.data && res.data.data.total;
  195. if (this.inCurrentPage !== undefined) {
  196. this.currentPage = this.inCurrentPage;
  197. this.inCurrentPage = undefined;
  198. }
  199. });
  200. },
  201. // 导出
  202. exportData() {
  203. },
  204. },
  205. };
  206. </script>
  207. <style lang="less" scored>
  208. @import '../../../less/admin.less';
  209. </style>