BillCommonTest.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  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. const { data, type } = this.$route.params;
  149. this.type = type;
  150. let billType; // 开单合理性规则类型 1 通用 2 输血
  151. if (data && data.caseName === '开单合理性提醒_通用规则') {
  152. billType = 1;
  153. } else if (data && data.caseName === '开单类型提醒_输血规则') {
  154. billType = 2;
  155. }
  156. return {
  157. billType,
  158. resultId: data && data.resultId,
  159. success: type === 'success' ? 1 : 0,
  160. };
  161. },
  162. indexMethod(index) {
  163. return (this.currentPage - 1) * this.pageSize + index + 1;
  164. },
  165. currentChange(next) {
  166. this.currentPage = next;
  167. this.getDataList(true);
  168. },
  169. handleSizeChange(val) {
  170. this.pageSize = val;
  171. this.currentPage = utils.getCurrentPage(
  172. this.currentPage,
  173. this.total,
  174. this.pageSize
  175. );
  176. this.getDataList();
  177. },
  178. getDataList() {
  179. const params = this.handleInitData();
  180. this.searched = true;
  181. const loading = this.$loading({
  182. lock: true,
  183. text: 'Loading',
  184. spinner: 'el-icon-loading',
  185. background: 'rgba(0, 0, 0, 0.7)',
  186. });
  187. api.getResultBillPage(params).then((res) => {
  188. loading.close();
  189. if (res.data.code === '0') {
  190. this.list = res.data.data && res.data.data.records;
  191. }
  192. this.total = res.data.data && res.data.data.total;
  193. if (this.inCurrentPage !== undefined) {
  194. this.currentPage = this.inCurrentPage;
  195. this.inCurrentPage = undefined;
  196. }
  197. });
  198. },
  199. // 导出
  200. exportData() {
  201. const { data, hospitalId, hospitalName, type } = this.$route.params;
  202. let params = {
  203. success: type === 'success' ? 1 : 0,
  204. resultId: data.resultId,
  205. billType: 1, //1:通用,2:输血
  206. };
  207. this.$alert('确定要导出规则测试结果吗?', '', {
  208. confirmButtonText: '确定',
  209. title: '提示',
  210. type: 'warning',
  211. })
  212. .then(() => {
  213. api.billExportExcel(params).then((res) => {
  214. if (res.status === 200) {
  215. this.$message({ message: '导出成功', type: 'success' });
  216. utils.downloadExportedData(
  217. res.data,
  218. `${hospitalName}-开单合理性提醒规则测试结果.xls`
  219. );
  220. }
  221. });
  222. })
  223. .catch(() => {});
  224. },
  225. },
  226. };
  227. </script>
  228. <style lang="less" scored>
  229. @import '../../../less/admin.less';
  230. </style>