123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- (function() {
- Vue.component('doctor-list', {
- template: '<div class="ui-col-1 ml15 bgc-fff c-border p20">\
- <div class="c-f16 c-323232 mb20">医生列表</div>\
- <div class="ui-grid c-border p10 pb0 mt10" v-for="(doc, index) in doctorList" v-show="isDoctorList">\
- <div class="ui-col-0 mr10">\
- <img v-bind:src="doc.photoUri" width="70" height="70" class="c-images-cycle">\
- </div>\
- <div class="ui-col-1 div-doctor-info">\
- <p>\
- <span class="c-f16 c-323232 c-bold mr10">{{doc.doctorName}}</span>\
- <span class="c-f14 c-323232 mr10">{{doc.lczcName}}</span>\
- <span class="c-f14 c-909090">{{doc.standardDeptName}}</span>\
- </p>\
- <p class="c-f14 c-909090">{{currentHosName}}</p>\
- <p class="c-f14 text-ellipsis">\
- <span class="c-909090">擅长:</span>\
- <span class="c-909090" v-bind:title="doc.skill">{{doc.skill}}</span>\
- </p>\
- </div>\
- <div class="ui-col-1 div-doctor-section" v-for="(arrange, aindex) in arrangeList" v-if="index==aindex">\
- <div class="div-left-btn" @click="preClick"></div>\
- <ul class="doctor-ul">\
- <li v-for="(arrg, arrIndex) in arrange" @click="goToDoctorPage(doc.doctorSn, arrg.arrangeID)">\
- <div class="div-doctor-item" :class="getColorClass(arrg.numberStatus,arrg.arrangeStatus)">\
- <div class="mt5">{{arrg.date}}</div>\
- <div class="mtb2">{{arrg.timeName}}</div>\
- <div class="div-doctor-type bgc-0ad8c8" v-if="arrg.numberStatus==1">预约</div>\
- <div class="div-doctor-type bgc-d1d1d1" v-if="arrg.numberStatus==2">已满</div>\
- <div class="div-doctor-type bgc-f0a65f" v-if="arrg.arrangeStatus==2">放号提醒</div>\
- <div class="div-doctor-type bgc-ff8787" v-if="arrg.arrangeStatus==4">停诊</div>\
- </div>\
- </li>\
- </ul>\
- <div class="div-right-active-btn" @click="nextClick"></div>\
- </div>\
- </div>\
- <div id="page" class="page_div fr" v-show="isDoctorList"></div>\
- <div class="div-wushuju" v-show="!isDoctorList">\
- <div style="background: url(../../../images/wushuju_icon.png) no-repeat;width: 230px;height: 130px;margin: 30px auto;"></div>\
- <div style="text-align:center">查无数据</div>\
- </div>\
- </div>',
- props: ["info"],
- data: function() {
- return {
- isInit: true,
- currentHospitalId: "",
- currentHosName: "",
- pageIndex: 1,
- pageSize: 5,
- totalPage: 0,
- hosDeptId: "",
- doctorList: [],
- arrangeList:[],
- leftBtn:false,
- rightBtn:false,
- isDoctorList:true
- }
- },
- mounted: function() {
- var vm = this;
- setTimeout(function() {
- vm.currentHospitalId = JSON.parse(vm.info).hospitalId;
- vm.currentHosName = JSON.parse(vm.info).hosName;
- vm.getDoctorList();
- }, 50);
-
- //更新医生列表信息
- EventBus.$on('update-doctor-list', function(arg) {
- vm.isInit = true;
- vm.currentHospitalId = arg.hospitalId;
- vm.hosDeptId = arg.hosDeptId;
- vm.getDoctorList();
- })
- },
- methods: {
- getColorClass:function(numberStatus,arrangeStatus){
- var classZ="";
- if(numberStatus==1){
- classZ = "border-0ad8c8 c-0ad8c8";
- }else if(numberStatus==2){
- classZ = "border-d1d1d1 c-d1d1d1";
- }else if(arrangeStatus==2){
- classZ = "border-ff8787 c-ff8787";
- }else if(arrangeStatus==4){
- classZ = "border-f0a65f c-f0a65f";
- }
- return classZ;
- },
- //获取医生列表
- getDoctorList: function() {
- var vm = this;
- var params = {
- pageIndex: vm.pageIndex,
- pageSize: vm.pageSize,
- hospitalId: vm.currentHospitalId,
- hosDeptId: vm.hosDeptId
- }
- appointmentAPI.querySimpleDoctorList(params).then(function(res) {
- if(res.successFlg && res.obj.Code == "10000") {
- vm.doctorList = res.obj.Result || [];
- vm.isDoctorList = vm.doctorList.length>0?true:false;
- vm.getArrangeWater(vm.doctorList);//获取医生排班数据
- if(vm.isInit) {
- vm.totalPage = Math.ceil(res.obj.Total / vm.pageSize) || 0;
- var totalSize = res.obj.Total || 0;
- //分页初始化
- $("#page").paging({
- pageNo: 1,
- totalPage: vm.totalPage,
- totalSize: totalSize,
- callback: function(num) {
- vm.pageIndex = num; //回调的页数
- getDoctorList(vm);
- }
- })
- vm.isInit = false;
- }
- }
- })
- },
- //获取医生排班数据
- getArrangeWater: function(doctorData) {
- var vm = this,
- reqPromise = [];
- _.map(doctorData, function(data) {
- var params = {
- pageIndex: vm.pageIndex,
- pageSize: vm.pageSize,
- hospitalId: vm.currentHospitalId,
- hosDeptId: vm.hosDeptId,
- doctorSn: data.doctorSn, //医生编号
- registerDate: "" //就诊日期
- }
- reqPromise.push(appointmentAPI.queryGhtArrangeWater(params));
- })
-
- Promise.all(reqPromise).then(function(datas) {
- _.map(datas, function(data) {
- if(data.successFlg && data.obj.Code == "10000") {
- vm.arrangeList.push(data.obj.Result);
- }
- })
-
- vm.arrangeList = _.map(vm.arrangeList, function(data) {
- _.map(data, function(item,index) {
- item.date = item.registerDate.substring(5,10).replace("-","/");
- item.timeName = item.timeId==1?"上午":item.timeId==2?"下午":"晚上";
- })
- return data;
- })
- // $(".doctor-ul li:lt(4)").hide()
- });
- },
- preClick:function(){
-
- },
- nextClick:function(){
- $(event.target).prev().find("li:lt(4)").hide();
- },
- //跳转去医生号源页面
- goToDoctorPage: function(doctorSn, arrangeID){
- window.location.href = "select-time.html?doctorSn="+Base64.encode(doctorSn)+"&arrangeID="+arrangeID;
- }
- }
- });
- })()
|