handleChangeViewA.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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%" >\
  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. <div class="flex f_y_c f_x_e">\
  32. <el-pagination @size-change="handleSizeChange" background @current-change="handleCurrentChange" :current-page="currentPage"\
  33. :page-sizes=" pageSizeArr" :page-size="pageSize" layout="total,sizes,prev, pager, next, jumper"\
  34. :total="total">\
  35. </el-pagination>\
  36. </div>\
  37. </template>\
  38. </div> ',
  39. data: function () {
  40. return {
  41. currentPage: 1, //初始页
  42. pageSize: 10, // 每页的数据
  43. tableData: [],
  44. pageSizeArr: [10, 20, 30, 50],
  45. total: 0,
  46. value4: new Date(),
  47. }
  48. },
  49. mounted: function () {
  50. this.getData()
  51. },
  52. methods: {
  53. handleCurrentChange: function (val) {
  54. this.currentPage = val;
  55. this.getData()
  56. },
  57. handleSizeChange: function (val) {
  58. this.pageSize = val;
  59. this.initData()
  60. },
  61. initData: function () { //初始化
  62. this.currentPage = 1;
  63. this.getData()
  64. },
  65. searchClick: function () {
  66. this.initData()
  67. },
  68. getData: function () {
  69. var vm = this;
  70. var params = {
  71. time: this.value4.format('yyyy-MM-dd'),
  72. size: this.pageSize,
  73. page: this.currentPage
  74. }
  75. GlobalEventBus.$emit('setLoading', {
  76. loading: true
  77. }); //等待效果
  78. bigDataOutApi.getOftenIllList(params).then(function (res) {
  79. console.log(res)
  80. GlobalEventBus.$emit('setLoading');
  81. vm.tableData = res.detailModelList;
  82. vm.total = res.totalCount;
  83. debugger
  84. }).catch(function (err) {
  85. console.log(err)
  86. GlobalEventBus.$emit('setLoading');
  87. })
  88. },
  89. handleClick: function (row) {
  90. demographic_id = row.demographic_id,
  91. blurry_type = '',
  92. searchParam = ''
  93. var url = httpRequest.server + '/profile/app/medication/html/jiuzhen-item.html?' +
  94. 'healthProblemName=' + '&demographic_id=' + demographic_id + '&blurry_type=' + blurry_type + '&searchParam=' + searchParam
  95. console.log(url)
  96. // window.open(url)
  97. var width = 1000 + 'px';
  98. var height = 600+ 'px';
  99. top.layer.open({
  100. id: 'Lay_xiangqingA',
  101. type: 2,
  102. title: false,
  103. closeBtn: 0,
  104. shade: 0.5,
  105. shadeClose: true,
  106. area: [width, height],
  107. content: url
  108. })
  109. }
  110. }
  111. })