doctor-list.js 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. (function() {
  2. Vue.component('doctor-list', {
  3. template: '<div class="ui-col-1 ml15 bgc-fff c-border p20">\
  4. <div class="c-f16 c-323232 mb20">医生列表</div>\
  5. <div class="ui-grid c-border p10 pb0 mt10" v-for="(doc, index) in doctorList" v-show="isDoctorList">\
  6. <div class="ui-col-0 mr10">\
  7. <img v-bind:src="doc.photoUri" width="70" height="70" class="c-images-cycle">\
  8. </div>\
  9. <div class="ui-col-1 div-doctor-info">\
  10. <p>\
  11. <span class="c-f16 c-323232 c-bold mr10">{{doc.doctorName}}</span>\
  12. <span class="c-f14 c-323232 mr10">{{doc.lczcName}}</span>\
  13. <span class="c-f14 c-909090">{{doc.standardDeptName}}</span>\
  14. </p>\
  15. <p class="c-f14 c-909090">{{currentHosName}}</p>\
  16. <p class="c-f14 text-ellipsis">\
  17. <span class="c-909090">擅长:</span>\
  18. <span class="c-909090" v-bind:title="doc.skill">{{doc.skill}}</span>\
  19. </p>\
  20. </div>\
  21. <div class="ui-col-1 div-doctor-section" v-for="(arrange, aindex) in arrangeList" v-if="index==aindex">\
  22. <div class="div-left-btn" @click="preClick"></div>\
  23. <ul class="doctor-ul">\
  24. <li v-for="(arrg, arrIndex) in arrange" @click="goToDoctorPage(doc.doctorSn, arrg.arrangeID)">\
  25. <div class="div-doctor-item" :class="getColorClass(arrg.numberStatus,arrg.arrangeStatus)">\
  26. <div class="mt5">{{arrg.date}}</div>\
  27. <div class="mtb2">{{arrg.timeName}}</div>\
  28. <div class="div-doctor-type bgc-0ad8c8" v-if="arrg.numberStatus==1">预约</div>\
  29. <div class="div-doctor-type bgc-d1d1d1" v-if="arrg.numberStatus==2">已满</div>\
  30. <div class="div-doctor-type bgc-f0a65f" v-if="arrg.arrangeStatus==2">放号提醒</div>\
  31. <div class="div-doctor-type bgc-ff8787" v-if="arrg.arrangeStatus==4">停诊</div>\
  32. </div>\
  33. </li>\
  34. </ul>\
  35. <div class="div-right-active-btn" @click="nextClick"></div>\
  36. </div>\
  37. </div>\
  38. <div id="page" class="page_div fr" v-show="isDoctorList"></div>\
  39. <div class="div-wushuju" v-show="!isDoctorList">\
  40. <div style="background: url(../../../images/wushuju_icon.png) no-repeat;width: 230px;height: 130px;margin: 30px auto;"></div>\
  41. <div style="text-align:center">查无数据</div>\
  42. </div>\
  43. </div>',
  44. props: ["info"],
  45. data: function() {
  46. return {
  47. isInit: true,
  48. currentHospitalId: "",
  49. currentHosName: "",
  50. pageIndex: 1,
  51. pageSize: 5,
  52. totalPage: 0,
  53. hosDeptId: "",
  54. doctorList: [],
  55. arrangeList:[],
  56. leftBtn:false,
  57. rightBtn:false,
  58. isDoctorList:true
  59. }
  60. },
  61. mounted: function() {
  62. var vm = this;
  63. setTimeout(function() {
  64. vm.currentHospitalId = JSON.parse(vm.info).hospitalId;
  65. vm.currentHosName = JSON.parse(vm.info).hosName;
  66. vm.getDoctorList();
  67. }, 50);
  68. //更新医生列表信息
  69. EventBus.$on('update-doctor-list', function(arg) {
  70. vm.isInit = true;
  71. vm.currentHospitalId = arg.hospitalId;
  72. vm.hosDeptId = arg.hosDeptId;
  73. vm.getDoctorList();
  74. })
  75. },
  76. methods: {
  77. getColorClass:function(numberStatus,arrangeStatus){
  78. var classZ="";
  79. if(numberStatus==1){
  80. classZ = "border-0ad8c8 c-0ad8c8";
  81. }else if(numberStatus==2){
  82. classZ = "border-d1d1d1 c-d1d1d1";
  83. }else if(arrangeStatus==2){
  84. classZ = "border-ff8787 c-ff8787";
  85. }else if(arrangeStatus==4){
  86. classZ = "border-f0a65f c-f0a65f";
  87. }
  88. return classZ;
  89. },
  90. //获取医生列表
  91. getDoctorList: function() {
  92. var vm = this;
  93. var params = {
  94. pageIndex: vm.pageIndex,
  95. pageSize: vm.pageSize,
  96. hospitalId: vm.currentHospitalId,
  97. hosDeptId: vm.hosDeptId
  98. }
  99. appointmentAPI.querySimpleDoctorList(params).then(function(res) {
  100. if(res.successFlg && res.obj.Code == "10000") {
  101. vm.doctorList = res.obj.Result || [];
  102. vm.isDoctorList = vm.doctorList.length>0?true:false;
  103. vm.getArrangeWater(vm.doctorList);//获取医生排班数据
  104. if(vm.isInit) {
  105. vm.totalPage = Math.ceil(res.obj.Total / vm.pageSize) || 0;
  106. var totalSize = res.obj.Total || 0;
  107. //分页初始化
  108. $("#page").paging({
  109. pageNo: 1,
  110. totalPage: vm.totalPage,
  111. totalSize: totalSize,
  112. callback: function(num) {
  113. vm.pageIndex = num; //回调的页数
  114. getDoctorList(vm);
  115. }
  116. })
  117. vm.isInit = false;
  118. }
  119. }
  120. })
  121. },
  122. //获取医生排班数据
  123. getArrangeWater: function(doctorData) {
  124. var vm = this,
  125. reqPromise = [];
  126. _.map(doctorData, function(data) {
  127. var params = {
  128. pageIndex: vm.pageIndex,
  129. pageSize: vm.pageSize,
  130. hospitalId: vm.currentHospitalId,
  131. hosDeptId: vm.hosDeptId,
  132. doctorSn: data.doctorSn, //医生编号
  133. registerDate: "" //就诊日期
  134. }
  135. reqPromise.push(appointmentAPI.queryGhtArrangeWater(params));
  136. })
  137. Promise.all(reqPromise).then(function(datas) {
  138. _.map(datas, function(data) {
  139. if(data.successFlg && data.obj.Code == "10000") {
  140. vm.arrangeList.push(data.obj.Result);
  141. }
  142. })
  143. vm.arrangeList = _.map(vm.arrangeList, function(data) {
  144. _.map(data, function(item,index) {
  145. item.date = item.registerDate.substring(5,10).replace("-","/");
  146. item.timeName = item.timeId==1?"上午":item.timeId==2?"下午":"晚上";
  147. })
  148. return data;
  149. })
  150. // $(".doctor-ul li:lt(4)").hide()
  151. });
  152. },
  153. preClick:function(){
  154. },
  155. nextClick:function(){
  156. $(event.target).prev().find("li:lt(4)").hide();
  157. },
  158. //跳转去医生号源页面
  159. goToDoctorPage: function(doctorSn, arrangeID){
  160. window.location.href = "select-time.html?doctorSn="+Base64.encode(doctorSn)+"&arrangeID="+arrangeID;
  161. }
  162. }
  163. });
  164. })()