team-info-dyy.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. (function(){
  2. Vue.component('team-info-dyy',{
  3. template: '<div class="team-info-dyy" style="height:500px;overflow:auto;">\
  4. <div class="dyy-title" style="font-size: 14px;">团队信息</div>\
  5. <div class="ui-grid mt20 c-f16 c-333 plr20" style="font-size: 14px;">\
  6. <div class="ui-col-0 pr10" style="width:50%"><span class="c-999">团队名称:</span>{{team.name}}</div>\
  7. <div class="ui-col-0 pl10" style="width:50%"><span class="c-999">所在社区:</span>{{team.hospitalName}}</div>\
  8. </div>\
  9. <div class="mt20 c-f16 c-333 plr20" style="word-break: break-all;font-size: 14px;"><span class="c-999">团队长:</span>{{team.leaderName}}</div>\
  10. <div class="mt20 c-f16 c-333 plr20 pb40 c-border-b mb20" style="word-break: break-all;font-size: 14px;"><span class="c-999">团队成员:</span><span v-for="(member, index) in members">{{index==0? "": " 、"}}{{member.name}}</span>\</div>\
  11. <div class="dyy-title" style="font-size: 14px;">代预约记录</div>\
  12. <div id="sc_table" class="p20">\
  13. <table class="table-bordered table-striped width-100 c-t-center">\
  14. <thead>\
  15. <tr>\
  16. <th>居民姓名</th>\
  17. <th>挂号时间</th>\
  18. <th>预约医生</th>\
  19. <th>预约医院</th>\
  20. <th>就诊时间</th>\
  21. </tr>\
  22. </thead>\
  23. <tbody v-loading="isloading">\
  24. <tr v-if="!wujilu" v-for="(data, index) in tablelist">\
  25. <td style="width:80px">{{data.name}}</td>\
  26. <td >{{data.czrq}}</td>\
  27. <td >{{data.doctorName}}</td>\
  28. <td>{{data.orgName}}</td>\
  29. <td >{{data.startTime}}</td>\
  30. </tr>\
  31. <tr v-if="wujilu">\
  32. <td colspan="6">无记录</td>\
  33. </tr>\
  34. </tbody>\
  35. </table>\
  36. <navigation :pages="pagetotal" :current="currentPage" @navpage="search" :total="total" :size="pagesize"></navigation>\
  37. </div>\
  38. </div>',
  39. props:['teamId','year'],
  40. data: function(){
  41. return {
  42. team: {},
  43. members: [],
  44. memberLength: 0,
  45. pagesize: 5,
  46. total: 0,
  47. pagetotal: 1, //总页数
  48. currentPage: 1, //当前页数
  49. tablelist: [],
  50. wujilu: false,
  51. isloading:false,
  52. date:'',
  53. }
  54. },
  55. mounted: function(){
  56. var vm = this;
  57. vm.date = getEndDate29(vm.year);
  58. getTeamInfo(vm);
  59. vm.getDatas()
  60. },
  61. methods:{
  62. getDatas:function(){
  63. var vm = this
  64. var params = {
  65. teamId: vm.teamId,
  66. year:vm.year,
  67. date:vm.date,
  68. pageIndex: vm.currentPage,
  69. pageSize: vm.pagesize
  70. }
  71. vm.isloading=true
  72. statisticAPI.GetReservationByTeamId(params).then(function(res) {
  73. vm.isloading=false
  74. if(res.status == 200) {
  75. vm.wujilu = false
  76. vm.total = res.data.total
  77. vm.pagetotal = Math.ceil(res.data.total / vm.pagesize)
  78. vm.tablelist = res.data.list;
  79. if(vm.tablelist.length == 0) {
  80. vm.wujilu = true
  81. }
  82. } else {
  83. showErrorMessage(res.msg);
  84. }
  85. })
  86. },
  87. //页面跳转
  88. search: function(page) {
  89. var vm = this
  90. vm.currentPage = page
  91. vm.getDatas()
  92. },
  93. }
  94. });
  95. function getTeamInfo(vm){
  96. var params = {
  97. teamId: vm.teamId
  98. };
  99. statisticAPI.getTeamInfo(params).then(function(res){
  100. if(res.status == 200){
  101. vm.team = res.data.team;
  102. vm.members = res.data.members;
  103. vm.memberLength = res.data.members.length;
  104. }else{
  105. console.log(res.msg);
  106. }
  107. })
  108. }
  109. function showErrorMessage(msg) {
  110. layer.msg(msg, {
  111. icon: 5
  112. })
  113. }
  114. })()