BasicPartOfSpeech.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <template>
  2. <div>
  3. <crumbs title="基础词性类型维护" style="min-width: 980px">
  4. <el-form :inline="true" class="demo-form-inline">
  5. <el-form-item label="关系名称:">
  6. <el-input size="mini" v-model="filter.uniqueName" placeholder="请输入" clearable></el-input>
  7. </el-form-item>
  8. <el-form-item label="数字编码:">
  9. <el-input size="mini" v-model="filter.uniqueName" placeholder="请输入" clearable></el-input>
  10. </el-form-item>
  11. <el-form-item label="状态:" class="selectMedicine">
  12. <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
  13. <el-option v-for="item in stateList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  14. </el-select>
  15. </el-form-item>
  16. <el-form-item class="dododo">
  17. <el-button size="mini" @click="filterDatas">搜索</el-button>
  18. </el-form-item>
  19. </el-form>
  20. </crumbs>
  21. <div class="contents">
  22. <el-table :data="list" border style="width: 100%">
  23. <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="60"></el-table-column>
  24. <el-table-column :resizable="false" prop="gmtModified" label="词性名称" width="180"></el-table-column>
  25. <el-table-column :resizable="false" prop="hisName" label="数字编码" show-overflow-tooltip></el-table-column>
  26. <el-table-column
  27. :resizable="false"
  28. prop="uniqueName"
  29. label="是否支持通用扩展"
  30. show-overflow-tooltip
  31. ></el-table-column>
  32. <el-table-column :resizable="false" prop="uniqueName" label="是否允许修改" show-overflow-tooltip></el-table-column>
  33. <el-table-column :resizable="false" prop="uniqueName" label="是否只有单个词" show-overflow-tooltip></el-table-column>
  34. <el-table-column :resizable="false" prop="uniqueName" label="状态" show-overflow-tooltip></el-table-column>
  35. <el-table-column :resizable="false" prop="uniqueName" label="操作人" show-overflow-tooltip></el-table-column>
  36. <el-table-column :resizable="false" prop="uniqueName" label="操作时间" show-overflow-tooltip></el-table-column>
  37. <el-table-column :resizable="false" prop="operate" label="操作">
  38. <template slot-scope="scope">
  39. <el-button @click="modifyRelation(scope.row)" type="text" size="small">修改</el-button>
  40. </template>
  41. </el-table-column>
  42. </el-table>
  43. <div class="pagination pagepage">
  44. <el-pagination
  45. :current-page.sync="currentPage"
  46. @current-change="currentChange"
  47. background
  48. :page-size="pageSize"
  49. :page-sizes="pageSizeArr"
  50. @size-change="handleSizeChange"
  51. :layout="pageLayout"
  52. :total="total"
  53. ></el-pagination>
  54. </div>
  55. </div>
  56. </div>
  57. </template>
  58. <script>
  59. import api from '@api/icss.js';
  60. import config from '@api/config.js';
  61. import utils from '@api/utils.js';
  62. export default {
  63. name: 'Fusion', //化验大小项和公表维护
  64. data: function() {
  65. return {
  66. list: [],
  67. searched: false,
  68. filter: {
  69. hisName: '', // 医院诊断名称
  70. uniqueName: '', //标准诊断名称
  71. status: ''
  72. },
  73. stateList: [
  74. { id: 1, name: '启用' },
  75. { id: 0, name: '禁用' }
  76. ],
  77. currentPage: 1,
  78. pageSize: config.pageSize,
  79. pageSizeArr: config.pageSizeArr,
  80. pageLayout: config.pageLayout,
  81. total: 0,
  82. uploadInfo: '导入'
  83. };
  84. },
  85. created() {
  86. const that = this;
  87. //返回时避免参数未赋值就获取列表
  88. setTimeout(function() {
  89. that.clearFilter();
  90. // that.getDataList();
  91. });
  92. // 非首页 编辑页返回 设置 this.currentPage
  93. if (Object.keys(this.$route.params).length !== 0) {
  94. this.currentPage = this.$route.params.currentPage;
  95. }
  96. },
  97. watch: {
  98. filter: {
  99. handler: function() {
  100. this.searched = false;
  101. },
  102. deep: true
  103. }
  104. },
  105. beforeRouteEnter(to, from, next) {
  106. next(vm => {
  107. //const pm = to.param;
  108. Object.assign(vm, to.params);
  109. vm.inCurrentPage = to.params.currentPage;
  110. });
  111. },
  112. methods: {
  113. handleSizeChange(val) {
  114. this.pageSize = val;
  115. this.currentPage = utils.getCurrentPage(
  116. this.currentPage,
  117. this.total,
  118. this.pageSize
  119. );
  120. this.getDataList();
  121. },
  122. // 获取列表数据
  123. getDataList(isTurnPage) {
  124. const params = this.getFilterItems(isTurnPage);
  125. this.searched = true;
  126. const loading = this.$loading({
  127. lock: true,
  128. text: 'Loading',
  129. spinner: 'el-icon-loading',
  130. background: 'rgba(0, 0, 0, 0.7)'
  131. });
  132. api.getFusionPage(params).then(res => {
  133. loading.close();
  134. if (res.data.code === '0') {
  135. this.list = res.data.data && res.data.data.records;
  136. }
  137. this.total = res.data.data && res.data.data.total;
  138. if (this.inCurrentPage !== undefined) {
  139. this.currentPage = this.inCurrentPage;
  140. this.inCurrentPage = undefined;
  141. }
  142. });
  143. },
  144. // 处理列表请求数据参数
  145. getFilterItems(isTurnPage) {
  146. //翻页时筛选条件没点确定则清空
  147. if (isTurnPage && !this.searched) {
  148. this.clearFilter();
  149. }
  150. const param = {
  151. current: this.inCurrentPage || this.currentPage,
  152. size: this.pageSize,
  153. hisName: this.filter.hisName.trim(),
  154. uniqueName: this.filter.uniqueName.trim(),
  155. uniqueCode: ''
  156. };
  157. return param;
  158. },
  159. filterDatas() {
  160. this.currentPage = 1;
  161. this.getDataList();
  162. },
  163. // 跳转至编辑页面
  164. modifyRelation(row) {
  165. // const item = Object.assign({}, row);
  166. // const pam = this.searched
  167. // ? {
  168. // currentPage: this.currentPage,
  169. // pageSize: this.pageSize,
  170. // filter: this.filter
  171. // }
  172. // : { currentPage: this.currentPage, pageSize: this.pageSize };
  173. // this.$router.push({
  174. // name: 'AddFusion',
  175. // params: Object.assign(pam, { isEdit: true, data: item })
  176. // });
  177. },
  178. currentChange(next) {
  179. this.currentPage = next;
  180. this.getDataList(true);
  181. // if (this.cacheData[next]) { //如果已请求过该页数据,则使用缓存不重复请求
  182. // this.list = this.cacheData[next];
  183. // } else {
  184. // this.getDataList();
  185. // }
  186. },
  187. // 清空搜索参数
  188. clearFilter() {
  189. this.filter = {
  190. hisName: '',
  191. uniqueName: ''
  192. };
  193. },
  194. indexMethod(index) {
  195. return (this.currentPage - 1) * this.pageSize + index + 1;
  196. },
  197. getTagType(val) {
  198. return val;
  199. },
  200. warning(msg, type) {
  201. this.$message({
  202. showClose: true,
  203. message: msg,
  204. type: type || 'warning'
  205. });
  206. }
  207. }
  208. };
  209. </script>
  210. <style lang="less">
  211. @import '../../less/admin.less';
  212. .delete {
  213. color: red;
  214. }
  215. .delete:hover {
  216. color: red;
  217. }
  218. .pagination {
  219. min-width: 1010px;
  220. }
  221. .downTemplate {
  222. margin-right: 8px;
  223. span {
  224. color: #02a7f0;
  225. }
  226. }
  227. #upFile {
  228. display: none !important;
  229. }
  230. .el-message-box {
  231. /deep/.cancelBtn {
  232. background-color: #d7d7d7;
  233. border-color: transparent;
  234. }
  235. /deep/.confirmC {
  236. background-color: #ff545b !important;
  237. border-color: transparent !important;
  238. }
  239. }
  240. .exportBox6 {
  241. /deep/ .el-message-box__btns {
  242. margin-top: 20px;
  243. }
  244. /deep/ .el-message-box__message {
  245. // text-align: center;
  246. }
  247. /deep/.leftbtn {
  248. background-color: #d7d7d7;
  249. border-color: transparent !important;
  250. }
  251. /deep/ .el-message-box__header {
  252. border-bottom: 1px solid #dcdfe6;
  253. }
  254. }
  255. </style>