|  | @ -11,6 +11,7 @@ var baseInfo = null,
 | 
	
		
			
				|  |  |     team_msg = "",
 | 
	
		
			
				|  |  |     docList = null; //记录改患者可选的随访医生列表
 | 
	
		
			
				|  |  |     
 | 
	
		
			
				|  |  | var currentNum=1;//当前选择下的记录
 | 
	
		
			
				|  |  | //下拉弹框的数据
 | 
	
		
			
				|  |  | var type_keys = [],
 | 
	
		
			
				|  |  |     type_vals = [],
 | 
	
	
		
			
				|  | @ -120,7 +121,7 @@ getDoctorList = function(){
 | 
	
		
			
				|  |  | //},
 | 
	
		
			
				|  |  | setDefaultSelect = function() {
 | 
	
		
			
				|  |  |     // 获取健康管理师下拉框mibiscroll实例
 | 
	
		
			
				|  |  |     var doctorMobiscroll = $('[data-val=doctor]').mobiscroll('getInst');
 | 
	
		
			
				|  |  | //  var doctorMobiscroll = $('[data-val=doctor]').mobiscroll('getInst');
 | 
	
		
			
				|  |  |     var valueText = "{keys:'"+defaultDoc.keys+"',values:'"+defaultDoc.values+"'}";
 | 
	
		
			
				|  |  |     doctorMobiscroll.setVal([valueText]);
 | 
	
		
			
				|  |  | },
 | 
	
	
		
			
				|  | @ -156,41 +157,53 @@ initialize_select = function(){
 | 
	
		
			
				|  |  | //  });
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     //随访医生选择
 | 
	
		
			
				|  |  |     $('[data-val=doctor]').mobiscroll({
 | 
	
		
			
				|  |  |         theme: 'ios',
 | 
	
		
			
				|  |  |         lang: 'zh',
 | 
	
		
			
				|  |  |         customWheels: true,
 | 
	
		
			
				|  |  |         wheels: [
 | 
	
		
			
				|  |  |             [{
 | 
	
		
			
				|  |  |                 keys: doc_keys,
 | 
	
		
			
				|  |  |                 values: doc_vals
 | 
	
		
			
				|  |  |             }]
 | 
	
		
			
				|  |  |         ],
 | 
	
		
			
				|  |  |         onSelect: function(valueText, inst) {
 | 
	
		
			
				|  |  |             var dd = eval("[" + valueText + "]");
 | 
	
		
			
				|  |  |             var $this = $(this)
 | 
	
		
			
				|  |  |             $this.text(dd[0].values);
 | 
	
		
			
				|  |  |             $this.attr('data-id',dd[0].keys);
 | 
	
		
			
				|  |  |             //随访方式写死team_msg
 | 
	
		
			
				|  |  | 	    	$.map(team_msg,function(o,i){
 | 
	
		
			
				|  |  | 	    		if(dd[0].keys == o.code){
 | 
	
		
			
				|  |  | 	    			if(o.typename == "全科医生"){
 | 
	
		
			
				|  |  | 	    				$this.closest('ul.c-list').find(".plan_type").html('家庭(全科)')
 | 
	
		
			
				|  |  |   						$this.closest('ul.c-list').find(".plan_type").attr('data-id',22)
 | 
	
		
			
				|  |  | 	    			}
 | 
	
		
			
				|  |  | 	    			if(o.typename == "健康管理师"){
 | 
	
		
			
				|  |  | 	    				$this.closest('ul.c-list').find(".plan_type").html('健管师随访')
 | 
	
		
			
				|  |  |   						$this.closest('ul.c-list').find(".plan_type").attr('data-id',10)
 | 
	
		
			
				|  |  | 	    			}
 | 
	
		
			
				|  |  | 	    			if(o.typename == "专科医生"){
 | 
	
		
			
				|  |  | 	    				$this.closest('ul.c-list').find(".plan_type").html('专科医生随访')
 | 
	
		
			
				|  |  |   						$this.closest('ul.c-list').find(".plan_type").attr('data-id',13)
 | 
	
		
			
				|  |  | 	    			}
 | 
	
		
			
				|  |  | 	    		}
 | 
	
		
			
				|  |  | 	    	})
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     });
 | 
	
		
			
				|  |  |     setDefaultSelect(); //设置默认医生选中
 | 
	
		
			
				|  |  | //  $('[data-val=doctor]').mobiscroll({
 | 
	
		
			
				|  |  | //      theme: 'ios',
 | 
	
		
			
				|  |  | //      lang: 'zh',
 | 
	
		
			
				|  |  | //      customWheels: true,
 | 
	
		
			
				|  |  | //      wheels: [
 | 
	
		
			
				|  |  | //          [{
 | 
	
		
			
				|  |  | //              keys: doc_keys,
 | 
	
		
			
				|  |  | //              values: doc_vals
 | 
	
		
			
				|  |  | //          }]
 | 
	
		
			
				|  |  | //      ],
 | 
	
		
			
				|  |  | //      onSelect: function(valueText, inst) {
 | 
	
		
			
				|  |  | //          var dd = eval("[" + valueText + "]");
 | 
	
		
			
				|  |  | //          var $this = $(this)
 | 
	
		
			
				|  |  | //          $this.text(dd[0].values);
 | 
	
		
			
				|  |  | //          $this.attr('data-id',dd[0].keys);
 | 
	
		
			
				|  |  | //          //随访方式写死team_msg
 | 
	
		
			
				|  |  | //	    	$.map(team_msg,function(o,i){
 | 
	
		
			
				|  |  | //	    		if(dd[0].keys == o.code){
 | 
	
		
			
				|  |  | //	    			if(o.typename == "全科医生"){
 | 
	
		
			
				|  |  | //	    				$this.closest('ul.c-list').find(".plan_type").html('家庭(全科)')
 | 
	
		
			
				|  |  | //						$this.closest('ul.c-list').find(".plan_type").attr('data-id',22)
 | 
	
		
			
				|  |  | //	    			}
 | 
	
		
			
				|  |  | //	    			if(o.typename == "健康管理师"){
 | 
	
		
			
				|  |  | //	    				$this.closest('ul.c-list').find(".plan_type").html('健管师随访')
 | 
	
		
			
				|  |  | //						$this.closest('ul.c-list').find(".plan_type").attr('data-id',10)
 | 
	
		
			
				|  |  | //	    			}
 | 
	
		
			
				|  |  | //	    			if(o.typename == "专科医生"){
 | 
	
		
			
				|  |  | //	    				$this.closest('ul.c-list').find(".plan_type").html('专科医生随访')
 | 
	
		
			
				|  |  | //						$this.closest('ul.c-list').find(".plan_type").attr('data-id',13)
 | 
	
		
			
				|  |  | //	    			}
 | 
	
		
			
				|  |  | //	    		}
 | 
	
		
			
				|  |  | //	    	})
 | 
	
		
			
				|  |  | //      }
 | 
	
		
			
				|  |  | //  });
 | 
	
		
			
				|  |  | //  setDefaultSelect(); //设置默认医生选中
 | 
	
		
			
				|  |  | },
 | 
	
		
			
				|  |  | reflashBindEvent=function(){
 | 
	
		
			
				|  |  | 	$(".plan_type").unbind("click")
 | 
	
		
			
				|  |  | 	$(".mui-table-view-cell1").unbind("click")
 | 
	
		
			
				|  |  | 	$(".plan_type").bind('click',function(){
 | 
	
		
			
				|  |  |     	currentNum=$(this).parents(".scsf-item").data("num") || $(this).parents(".append_plan").data("num");
 | 
	
		
			
				|  |  |     	mui('#sheet1').popover('toggle');
 | 
	
		
			
				|  |  |     })
 | 
	
		
			
				|  |  |     $(".mui-table-view-cell1").bind('click',function(){
 | 
	
		
			
				|  |  |     	mui('#sheet1').popover('hide');
 | 
	
		
			
				|  |  |     	$("[data-num="+currentNum+"]").find(".plan_type").text($(this).find('a').text()).data('id',($(this).data("value")))
 | 
	
		
			
				|  |  |     })
 | 
	
		
			
				|  |  | },
 | 
	
		
			
				|  |  | //绑定事件
 | 
	
		
			
				|  |  | bindEvents = function(){
 | 
	
	
		
			
				|  | @ -205,8 +218,9 @@ bindEvents = function(){
 | 
	
		
			
				|  |  |         $('.plan_list').children('ul').last().find('.plan_type').attr('id','way'+num);
 | 
	
		
			
				|  |  |         $('.plan_list').children('ul').last().find('.plan_doctor').attr('id','doctor'+num);
 | 
	
		
			
				|  |  |         initialize_select(num);
 | 
	
		
			
				|  |  |         reflashBindEvent();
 | 
	
		
			
				|  |  |     });
 | 
	
		
			
				|  |  |     
 | 
	
		
			
				|  |  |     reflashBindEvent();
 | 
	
		
			
				|  |  |     //删除随访
 | 
	
		
			
				|  |  |     $('.main').on('click','.title-btn',function (){
 | 
	
		
			
				|  |  |         $(this).parents('.append_plan').remove();
 | 
	
	
		
			
				|  | @ -218,8 +232,8 @@ bindEvents = function(){
 | 
	
		
			
				|  |  |         var plan_datas = [];
 | 
	
		
			
				|  |  |         $('.plan_list').children('ul').each(function (e){
 | 
	
		
			
				|  |  |             var plan_date = $(this).find('.plan_date').val();
 | 
	
		
			
				|  |  |             var plan_type = $(this).find('.plan_type').attr('data-id');
 | 
	
		
			
				|  |  |             var plan_doctor = $(this).find('.plan_doctor').attr('data-id');
 | 
	
		
			
				|  |  |             var plan_type = $(this).find('.plan_type').data('id');
 | 
	
		
			
				|  |  |             var plan_doctor = $(this).find('.plan_doctor').data('id');
 | 
	
		
			
				|  |  |             if(plan_date == '' || plan_date == '请选择'){
 | 
	
		
			
				|  |  |                status = 1;
 | 
	
		
			
				|  |  |             }
 | 
	
	
		
			
				|  | @ -325,16 +339,17 @@ function backToPage(wv,id){
 | 
	
		
			
				|  |  | }
 | 
	
		
			
				|  |  | //随访方式写死 第一次初始化
 | 
	
		
			
				|  |  | function doctorLevel(){
 | 
	
		
			
				|  |  |     if(docInfo.level ==2){
 | 
	
		
			
				|  |  |       	$(".plan_type").html('家庭(全科)')
 | 
	
		
			
				|  |  |       	$(".plan_type").attr('data-id',22)
 | 
	
		
			
				|  |  |     }else if(docInfo.level ==3){
 | 
	
		
			
				|  |  |     	$(".plan_type").html('健管师随访')
 | 
	
		
			
				|  |  |     	$(".plan_type").attr('data-id',10)
 | 
	
		
			
				|  |  |     }else if(docInfo.level ==1){
 | 
	
		
			
				|  |  |     	$(".plan_type").html('专科医生随访')
 | 
	
		
			
				|  |  |     	$(".plan_type").attr('data-id',13)
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 	
 | 
	
		
			
				|  |  | //  if(docInfo.level ==2){
 | 
	
		
			
				|  |  | //    	$(".plan_type").html('家庭(全科)')
 | 
	
		
			
				|  |  | //    	$(".plan_type").attr('data-id',22)
 | 
	
		
			
				|  |  | //  }else if(docInfo.level ==3){
 | 
	
		
			
				|  |  | //  	$(".plan_type").html('健管师随访')
 | 
	
		
			
				|  |  | //  	$(".plan_type").attr('data-id',10)
 | 
	
		
			
				|  |  | //  }else if(docInfo.level ==1){
 | 
	
		
			
				|  |  | //  	$(".plan_type").html('专科医生随访')
 | 
	
		
			
				|  |  | //  	$(".plan_type").attr('data-id',13)
 | 
	
		
			
				|  |  | //  }
 | 
	
		
			
				|  |  | }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | // 页面业务处理流程开始
 |