LessStaticOrNoMap.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <template>
  2. <div>
  3. <crumbs
  4. :title="title"
  5. class="topBack"
  6. :param="$route.params"
  7. linkTo="StaticKnowledgeMapTest"
  8. >
  9. <el-form :inline="true" class="demo-form-inline">
  10. <el-form-item style="marginbottom: 0px">
  11. <el-button size="mini" @click="exportData">导出</el-button>
  12. </el-form-item>
  13. </el-form>
  14. </crumbs>
  15. <div style="margin: 60px 20px 0">
  16. <el-table :data="list" border>
  17. <el-table-column
  18. :resizable="false"
  19. type="index"
  20. :index="indexMethod"
  21. label="编号"
  22. width="80"
  23. ></el-table-column>
  24. <el-table-column
  25. :resizable="false"
  26. prop="gmtModified"
  27. label="测试时间"
  28. ></el-table-column>
  29. <el-table-column
  30. :resizable="false"
  31. prop="hisName"
  32. :label="caseName === '检验' ? '医院术语(检验套餐)' : '医院术语'"
  33. show-overflow-tooltip
  34. ></el-table-column>
  35. <el-table-column
  36. :resizable="false"
  37. prop="hisDetailName"
  38. label="医院术语(检验细项)"
  39. show-overflow-tooltip
  40. v-if="caseName === '检验'"
  41. ></el-table-column>
  42. <el-table-column
  43. :resizable="false"
  44. prop="name"
  45. label="标准术语"
  46. show-overflow-tooltip
  47. ></el-table-column>
  48. <el-table-column
  49. v-if="type === 'lessStatic'"
  50. :resizable="false"
  51. prop="hasStaticKnowledge"
  52. label="静态知识标识"
  53. show-overflow-tooltip
  54. >
  55. <template slot-scope="scope">
  56. {{ scope.row.hasStaticKnowledge === 0 ? '无' : '有' }}
  57. </template>
  58. </el-table-column>
  59. </el-table>
  60. <div class="pagination pagepage">
  61. <el-pagination
  62. :current-page.sync="currentPage"
  63. @current-change="currentChange"
  64. background
  65. :page-size="pageSize"
  66. :page-sizes="pageSizeArr"
  67. @size-change="handleSizeChange"
  68. :layout="pageLayout"
  69. :total="total"
  70. ></el-pagination>
  71. </div>
  72. </div>
  73. </div>
  74. </template>
  75. <script>
  76. import api from '@api/cdss.js';
  77. import config from '@api/config.js';
  78. import utils from '@api/utils.js';
  79. export default {
  80. data() {
  81. return {
  82. list: [],
  83. currentPage: 1,
  84. pageSize: config.pageSize,
  85. pageSizeArr: config.pageSizeArr,
  86. pageLayout: config.pageLayout,
  87. total: 0,
  88. caseName: '',
  89. type: '', // 来自什么页面 noMap/lessStatic
  90. };
  91. },
  92. created() {
  93. this._initData();
  94. this.getDataList();
  95. // 非首页 编辑页返回 设置 this.currentPage
  96. if (Object.keys(this.$route.params).length !== 0) {
  97. this.currentPage = this.$route.params.currentPage;
  98. }
  99. },
  100. computed: {
  101. title() {
  102. let text = '';
  103. if (this.type === 'noMap') {
  104. text = '未映射到标准术语的医院术语-';
  105. } else if (this.type === 'lessStatic') {
  106. text = '缺少静态知识的医院术语-';
  107. }
  108. return text + this.caseName;
  109. },
  110. },
  111. beforeRouteEnter(to, from, next) {
  112. next((vm) => {
  113. Object.assign(vm, to.params);
  114. vm.inCurrentPage = to.params.currentPage;
  115. });
  116. },
  117. methods: {
  118. _initData() {
  119. const { data, type } = this.$route.params;
  120. this.caseName = (data && data.caseName) || '';
  121. this.type = type;
  122. },
  123. indexMethod(index) {
  124. return (this.currentPage - 1) * this.pageSize + index + 1;
  125. },
  126. currentChange(next) {
  127. this.currentPage = next;
  128. this.getDataList(true);
  129. },
  130. handleSizeChange(val) {
  131. this.pageSize = val;
  132. this.currentPage = utils.getCurrentPage(
  133. this.currentPage,
  134. this.total,
  135. this.pageSize
  136. );
  137. this.getDataList();
  138. },
  139. handleParams() {
  140. const { data, type } = this.$route.params;
  141. let params = {
  142. resultId: data.resultId, //结果id
  143. };
  144. if (type === 'noMap') {
  145. //是否映射到标准术语(0:否,1:是)
  146. params = { ...params, hasStandName: 0 };
  147. } else if (type === 'lessStatic') {
  148. //是否有静态知识(0:无,1:有)
  149. params = { ...params, hasStaticKnowledge: 0 };
  150. }
  151. return params;
  152. },
  153. getDataList() {
  154. const params = this.handleParams();
  155. this.searched = true;
  156. const loading = this.$loading({
  157. lock: true,
  158. text: 'Loading',
  159. spinner: 'el-icon-loading',
  160. background: 'rgba(0, 0, 0, 0.7)',
  161. });
  162. api.getStaticPage(params).then((res) => {
  163. loading.close();
  164. if (res.data.code === '0') {
  165. this.list = res.data.data && res.data.data.records;
  166. }
  167. this.total = res.data.data && res.data.data.total;
  168. if (this.inCurrentPage !== undefined) {
  169. this.currentPage = this.inCurrentPage;
  170. this.inCurrentPage = undefined;
  171. }
  172. });
  173. },
  174. // excel文件名处理
  175. handleExcelName() {
  176. const { data, hospitalId, hospitalName, type } = this.$route.params;
  177. let exportText = ''; // excel文件名
  178. return exportText;
  179. },
  180. // 导出
  181. exportData() {
  182. const { data, hospitalId, hospitalName, type } = this.$route.params;
  183. let requestAjax;
  184. let exportText; // excel文件名
  185. let params = {
  186. resultId: data.resultId,
  187. };
  188. if (data.caseName === '检验' && type === 'noMap') {
  189. requestAjax = 'exportStaticLisExcel';
  190. exportText = `${hospitalName}-未映射到标准术语的${data.caseName}医院术语.xls`;
  191. params = { ...params, hasStandName: 0 };
  192. } else if (data.caseName !== '检验' && type === 'noMap') {
  193. requestAjax = 'exportStaticCommonExcel';
  194. exportText = `${hospitalName}-未映射到标准术语的${data.caseName}医院术语.xls`;
  195. params = { ...params, hasStandName: 0 };
  196. } else if (data.caseName === '检验' && type === 'lessStatic') {
  197. requestAjax = 'exportStaticLisStaticExcel';
  198. exportText = `${hospitalName}-缺少静态知识的${data.caseName}医院术语.xls`;
  199. params = { ...params, hasStaticKnowledge: 0 };
  200. } else if (data.caseName !== '检验' && type === 'lessStatic') {
  201. requestAjax = 'exportStaticCommonStaticExcel';
  202. exportText = `${hospitalName}-缺少静态知识的${data.caseName}医院术语.xls`;
  203. params = { ...params, hasStaticKnowledge: 0 };
  204. }
  205. this.$alert('确定要导出静态知识映射测试结果吗?', '', {
  206. confirmButtonText: '确定',
  207. title: '提示',
  208. type: 'warning',
  209. })
  210. .then(() => {
  211. api[requestAjax](params).then((res) => {
  212. if (res.status === 200) {
  213. this.$message({ message: '导出成功', type: 'success' });
  214. utils.downloadExportedData(res.data, exportText);
  215. }
  216. });
  217. })
  218. .catch(() => {});
  219. },
  220. },
  221. };
  222. </script>
  223. <style lang="less" scored>
  224. @import '../../../less/admin.less';
  225. </style>