handleChangeViewA.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. Vue.component('comA', {
  2. template: '<div class="tab1">\
  3. <template>\
  4. <el-date-picker v-model="value4" type="month" placeholder="选择时间">\
  5. </el-date-picker>\
  6. <div class="search" @click="searchClick">搜 索</div>\
  7. <span class="span">一周就医次数>=3次的患者记录</span>\
  8. <el-table :data="tableData" border style="width: 100%" :data.native="tableData.slice((currentPage-1)*pageSize,currentPage*pageSize)">\
  9. <el-table-column prop="patient_name" label="姓名">\
  10. </el-table-column>\
  11. <el-table-column prop="result" label="就医次数">\
  12. </el-table-column>\
  13. <el-table-column prop="demographic_id" label="身份证号" >\
  14. </el-table-column>\
  15. <el-table-column label="性别" >\
  16. <template slot-scope="scope">\
  17. <span v-if="scope.row.patient_sex == 1">男</span>\
  18. <span v-else>女</span>\
  19. </template>\
  20. </el-table-column>\
  21. <el-table-column prop="patient_age" label="年龄">\
  22. </el-table-column>\
  23. <el-table-column prop="address" label="家庭地址" >\
  24. </el-table-column>\
  25. <el-table-column fixed="right" label="操作" >\
  26. <template slot-scope="scope">\
  27. <el-button @click="handleClick(scope.row)" type="text" size="small">查看详情</el-button>\
  28. </template>\
  29. </el-table-column>\
  30. </el-table>\
  31. <el-pagination \
  32. @size-change="handleSizeChange"\
  33. @current-change="handleCurrentChange" \
  34. :current-page="currentPage"\
  35. :page-sizes="pageSizeArr"\
  36. :page-size="pageSize" \
  37. layout="total,sizes,prev, pager, next, jumper"\
  38. :total="total">\
  39. </el-pagination>\
  40. </template>\
  41. </div> ',
  42. data: function () {
  43. return {
  44. currentPage: 1, //初始页
  45. pageSize: 10, // 每页的数据
  46. tableData: [],
  47. pageSizeArr: [10, 20, 30, 50],
  48. total: 0,
  49. value4: new Date(),
  50. }
  51. },
  52. mounted: function () {
  53. this.getData()
  54. },
  55. methods: {
  56. handleCurrentChange: function (val) {
  57. this.currentPage = val;
  58. this.getData()
  59. },
  60. handleSizeChange: function (val) {
  61. this.pageSize = val;
  62. this.initData()
  63. },
  64. initData: function () { //初始化
  65. this.currentPage = 1;
  66. this.getData()
  67. },
  68. searchClick: function () {
  69. this.initData()
  70. },
  71. getData: function () {
  72. var vm = this;
  73. var params = {
  74. time: this.value4.format('yyyy-MM-dd'),
  75. size: 15,
  76. page: 1,
  77. }
  78. GlobalEventBus.$emit('setLoading', {
  79. loading: true
  80. }); //等待效果
  81. bigDataOutApi.getOftenIllList(params).then(function (res) {
  82. console.log(res)
  83. GlobalEventBus.$emit('setLoading');
  84. vm.tableData = res.detailModelList;
  85. debugger
  86. vm.total = res.detailModelList.length;
  87. }).catch(function (err) {
  88. console.log(err)
  89. GlobalEventBus.$emit('setLoading');
  90. })
  91. },
  92. handleClick: function (row) {
  93. demographic_id = row.demographic_id,
  94. blurry_type = '',
  95. searchParam = ''
  96. var url = httpRequest.server + '/profile/app/medication/html/jiuzhen-item.html?' +
  97. 'healthProblemName=' + '&demographic_id=' + demographic_id + '&blurry_type=' + blurry_type + '&searchParam=' + searchParam
  98. console.log(url)
  99. // window.open(url)
  100. var width = (0.5212 * window.screen.width) + 'px';
  101. var height = (0.7878 * window.screen.height) + 'px';
  102. top.layer.open({
  103. id: 'Lay_xiangqingA',
  104. type: 2,
  105. title: false,
  106. closeBtn: 0,
  107. shade: 0.5,
  108. shadeClose: true,
  109. area: [width, height],
  110. content: url
  111. })
  112. }
  113. }
  114. })