handleChangeViewC.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. Vue.component('comC',{
  2. template:' <div class="tab3">\
  3. <template>\
  4. <span>检查/检验:</span> <el-select v-model="value" placeholder="请选择">\
  5. <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">\
  6. </el-option>\
  7. </el-select> <a href="#" @click="open5">查看字典</a>\
  8. <div class="search">搜索</div>\
  9. </template>\
  10. <span class="span">一周内同种检查/检验项目的次数>=3</span>\
  11. <el-table :data="tableData" border style="width: 100%" :data.native="tableData.slice((currentPage-1)*pagesize,currentPage*pagesize)">\
  12. <el-table-column prop="name" label="姓名" width="140">\
  13. </el-table-column>\
  14. <el-table-column prop="province" label="就医次数" width="140">\
  15. </el-table-column>\
  16. <el-table-column prop="address" label="身份证号" width="380">\
  17. </el-table-column>\
  18. <el-table-column prop="province" label="性别" width="140">\
  19. </el-table-column>\
  20. <el-table-column prop="province" label="年龄" width="140">\
  21. </el-table-column>\
  22. <el-table-column prop="address" label="地址" width="380">\
  23. </el-table-column>\
  24. <el-table-column fixed="right" label="操作" width="140">\
  25. <template slot-scope="scope">\
  26. <el-button @click="handleClick(scope.row)" type="text" size="small">查看详情</el-button>\
  27. </template>\
  28. </el-table-column>\
  29. </el-table>\
  30. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"\
  31. :page-sizes="[2,10, 20, 40]" :page-size="pagesize" layout="total,sizes,prev, pager, next, jumper"\
  32. :total="tableData.length">\
  33. </el-pagination>\
  34. </template>\
  35. </div>',
  36. data:function(){
  37. return{
  38. currentPage: 1, //初始页
  39. pagesize:2, // 每页的数据
  40. tableData: [{
  41. date: '2016-05-03',
  42. name: '王小虎',
  43. province: '上海',
  44. city: '普陀区',
  45. address: '上海市普陀区金沙江路 1518 弄',
  46. zip: 200333
  47. }, {
  48. date: '2016-05-02',
  49. name: '王小虎',
  50. province: '上海',
  51. city: '普陀区',
  52. address: '上海市普陀区金沙江路 1518 弄',
  53. zip: 200333
  54. }, {
  55. date: '2016-05-04',
  56. name: '王小虎',
  57. province: '上海',
  58. city: '普陀区',
  59. address: '上海市普陀区金沙江路 1518 弄',
  60. zip: 200333
  61. }, {
  62. date: '2016-05-01',
  63. name: '王小虎',
  64. province: '上海',
  65. city: '普陀区',
  66. address: '上海市普陀区金沙江路 1518 弄',
  67. zip: 200333
  68. }],
  69. options: [{
  70. value: '选项1',
  71. label: '外科'
  72. }, {
  73. value: '选项2',
  74. label: '住院'
  75. }],
  76. option: [{
  77. value: '选项1',
  78. label: '全部'
  79. }, {
  80. value: '选项2',
  81. label: '选线一'
  82. }],
  83. value: '全部'
  84. }
  85. },
  86. methods: {
  87. handleSizeChange: function (size) {
  88. this.pagesize = size;
  89. console.log(this.pagesize) //每页下拉显示数据
  90. },
  91. handleCurrentChange: function (currentPage) {
  92. this.currentPage = currentPage;
  93. console.log(this.currentPage) //点击第几页
  94. },
  95. handleClick(row) {
  96. console.log(row);
  97. },
  98. }
  99. }
  100. })