yaopinzidian.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <title>Document</title>
  8. <link rel="stylesheet" href="../../../css/element.css">
  9. <link rel="stylesheet" href="../css/zidian.css">
  10. </head>
  11. <body>
  12. <div id="app" v-cloak>
  13. <nav class="header">
  14. <span id="text">查看字典</span>
  15. <span id="close" @click="clickClose"><i class="el-icon-close"></i></span>
  16. </nav>
  17. <el-container style="height: 100%;">
  18. <el-aside style="width: 200px; ">
  19. <el-menu active-text-color="#2eaafa" :default-openeds="['1']">
  20. <el-menu-item class="ellipsis" title="检验专业代码" index="1-0" @click="daimaClick">
  21. 药品编码</el-menu-item>
  22. <el-menu-item class="ellipsis" title="检验专业分类" index="1-1" @click="fenleiClick">
  23. 急救药品代码</el-menu-item>
  24. </el-aside>      
  25. <el-main style="height: 100%;overflow: hidden;">
  26. <div class="flex">
  27. <span id="searchtext"> 字典项:</span>
  28. <el-input placeholder="请输入代码或者名称" id="typeSearch" v-model="searchKey">
  29. </el-input>
  30. <i class="el-icon-search" @click='searchClick'></i>
  31. </div>
  32. <el-table :data="tableData" border style="width: 100%" >
  33. <el-table-column type="index" label="序号" width='60'>
  34. </el-table-column>
  35. <el-table-column prop="code" label="值域编码">
  36. </el-table-column>
  37. <el-table-column prop="value" label="值域名称">
  38. </el-table-column>
  39. </el-table>
  40. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
  41. :page-sizes="pageSizeArr" :page-size="pageSize" layout="total,sizes,prev, pager, next, jumper"
  42. :total="total">
  43. </el-pagination>
  44. </el-main>
  45. </el-container>
  46. </div>
  47. <script>
  48. window.noUse = true
  49. </script>
  50. <script src="../../../js/post.js"></script>
  51. <script src="../../../js/api/bigDataOut-api.js"></script>
  52. <script>
  53. new Vue({
  54. el: "#app",
  55. data: function () {
  56. return {
  57. currentPage: 1, //初始页
  58. pageSize: 10, // 每页的数据
  59. pageSizeArr: [2,5,10],
  60. searchKey: '',
  61. total: 0,
  62. tableData: [],
  63. hidden: true,
  64. code: "STD_MEDICINE",
  65. }
  66. },
  67. mounted: function () {
  68. this.getData()
  69. },
  70. methods: {
  71. clickClose:function(){
  72. top.layer.close(top.layer.getFrameIndex(window.name))
  73. },
  74. daimaClick: function () {
  75. this.code = 'STD_MEDICINE',
  76. this.initData()
  77. },
  78. fenleiClick: function () {
  79. this.code = 'CV08.50.301',
  80. this.initData()
  81. },
  82. handleCurrentChange: function (val) {
  83. this.currentPage = val;
  84. this.getData()
  85. },
  86. handleSizeChange: function (val) {
  87. this.pageSize = val;
  88. this.initData()
  89. },
  90. initData: function () { //初始化
  91. this.currentPage = 1;
  92. this.getData()
  93. },
  94. searchClick: function () {
  95. this.initData()
  96. },
  97. getData: function () {
  98. var vm = this;
  99. var params = {
  100. code: this.code,
  101. size: this.pageSize,
  102. page: this.currentPage
  103. }
  104. if (this.searchKey) {
  105. params.filters ="code?"+this.searchKey+" g1;value?"+this.searchKey+" g1"
  106. }
  107. GlobalEventBus.$emit('setLoading', {
  108. loading: true
  109. }); //等待效果
  110. bigDataOutApi.lastDictItem(params).then(function (res) {
  111. console.log(res)
  112. GlobalEventBus.$emit('setLoading');
  113. vm.tableData = res.detailModelList;
  114. vm.total = res.totalCount;
  115. }).catch(function (err) {
  116. console.log(err)
  117. GlobalEventBus.$emit('setLoading');
  118. })
  119. },
  120. }
  121. })
  122. </script>
  123. </body>
  124. </html>