|  | @ -1,178 +1,190 @@
 | 
	
		
			
				|  |  |    
 | 
	
		
			
				|  |  |         layui.use('element', function () {
 | 
	
		
			
				|  |  |             element = layui.element//Tab的切换功能,切换事件监听等,需要依赖element模块
 | 
	
		
			
				|  |  |             function Progress(dom, num) {
 | 
	
		
			
				|  |  |                 window.setTimeout(function () {
 | 
	
		
			
				|  |  |                     element.progress(dom, num)
 | 
	
		
			
				|  |  |                 }, 360)
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             function showInfoMessage(msg) {
 | 
	
		
			
				|  |  |                 layer.msg(msg, {
 | 
	
		
			
				|  |  |                     icon: 6
 | 
	
		
			
				|  |  |                 })
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             function ConFirm(msg, num, isStop,planid,getDat) {
 | 
	
		
			
				|  |  |                 layer.confirm('您确定要执行该操作吗?', { btn: ['确定', '取消'], title: "提示" }, function (index) {
 | 
	
		
			
				|  |  |                     if (num == 2) {
 | 
	
		
			
				|  |  |                         showInfoMessage("计划已完成")
 | 
	
		
			
				|  |  |                         $("#button_id").attr('disabled', true).addClass("falsebutton")
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                     } else {
 | 
	
		
			
				|  |  |                         isStop = num == 0 ? 1 : 0
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     var params = {
 | 
	
		
			
				|  |  |                             status: isStop,
 | 
	
		
			
				|  |  |                             planId: planid
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                         healthAPI.updatePlanStatusById(params).then(function (res) {
 | 
	
		
			
				|  |  |                             if (res.status == 200) {
 | 
	
		
			
				|  |  |                                 getDat()
 | 
	
		
			
				|  |  |                             }
 | 
	
		
			
				|  |  |                         })
 | 
	
		
			
				|  |  |                         layer.close(index);
 | 
	
		
			
				|  |  |                 });
 | 
	
		
			
				|  |  | layui.use('element', function () {
 | 
	
		
			
				|  |  |     element = layui.element//Tab的切换功能,切换事件监听等,需要依赖element模块
 | 
	
		
			
				|  |  |     function Progress(dom, num) {
 | 
	
		
			
				|  |  |         window.setTimeout(function () {
 | 
	
		
			
				|  |  |             element.progress(dom, num)
 | 
	
		
			
				|  |  |         }, 360)
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  |     function showInfoMessage(msg) {
 | 
	
		
			
				|  |  |         layer.msg(msg, {
 | 
	
		
			
				|  |  |             icon: 6
 | 
	
		
			
				|  |  |         })
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  |     function conFirm(msg, num, isStop, planid, getDat) {
 | 
	
		
			
				|  |  |         layer.confirm('您确定要执行该操作吗?', { btn: ['确定', '取消'], title: "提示" }, function (index) {
 | 
	
		
			
				|  |  |             if (num == 2) {
 | 
	
		
			
				|  |  |                 showInfoMessage("计划已完成")
 | 
	
		
			
				|  |  |                 $("#stopBtn_"+planid).attr('disabled', true).addClass("falsebutton")
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             } else {
 | 
	
		
			
				|  |  |                 isStop = num == 0 ? 1 : 0
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             var reqList = []; //记录请求的参数和url,用于后退时使用
 | 
	
		
			
				|  |  |             Vue.use(Vuedals.default);
 | 
	
		
			
				|  |  |             new Vue({
 | 
	
		
			
				|  |  |                 el: "#app",
 | 
	
		
			
				|  |  |                 data: {
 | 
	
		
			
				|  |  |                     appname: "更多计划",
 | 
	
		
			
				|  |  |                     isback: true,
 | 
	
		
			
				|  |  |                     isrefresh: true,
 | 
	
		
			
				|  |  |                     paticentcode: "",
 | 
	
		
			
				|  |  |                     tablelistone: [],
 | 
	
		
			
				|  |  |                     tablelist: [],
 | 
	
		
			
				|  |  |                     name: "",
 | 
	
		
			
				|  |  |                     sex: "",
 | 
	
		
			
				|  |  |                     age: "",
 | 
	
		
			
				|  |  |                     hospital: "",
 | 
	
		
			
				|  |  |                     diseaseList: [],
 | 
	
		
			
				|  |  |                     signFamilyFinishItemCount: "",
 | 
	
		
			
				|  |  |                     signFamilyServiceRecordCount: "",
 | 
	
		
			
				|  |  |                     signFamilyAdminTeamName: "",
 | 
	
		
			
				|  |  |                     specialistAdminTeamName: "",
 | 
	
		
			
				|  |  |                     specialistFinishItemCount: "",
 | 
	
		
			
				|  |  |                     specialistServiceRecordCount: "",
 | 
	
		
			
				|  |  |                     progress: "",
 | 
	
		
			
				|  |  |                     specialistHospitalName: "",
 | 
	
		
			
				|  |  |                     familyHospitalName: "",
 | 
	
		
			
				|  |  |                     planid: "",
 | 
	
		
			
				|  |  |                     isStop: 1 //
 | 
	
		
			
				|  |  |             if (isStop == 0) {
 | 
	
		
			
				|  |  |                 $("#progress_"+planid).css({
 | 
	
		
			
				|  |  |                      "background-color": "gray"
 | 
	
		
			
				|  |  |                  })
 | 
	
		
			
				|  |  |                 $("#stopBtn_"+planid).html("激活计划")
 | 
	
		
			
				|  |  |              } else {
 | 
	
		
			
				|  |  |                  $("#progress_"+planid).css({
 | 
	
		
			
				|  |  |                      "background-color": "#ff9526"
 | 
	
		
			
				|  |  |                  })
 | 
	
		
			
				|  |  |                  $("#stopBtn_"+planid).html("终止计划")
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                 },
 | 
	
		
			
				|  |  |                 watch: {
 | 
	
		
			
				|  |  |                     tablelist: function (val) {
 | 
	
		
			
				|  |  |                             this.$nextTick(function () {
 | 
	
		
			
				|  |  |                                 element.init()
 | 
	
		
			
				|  |  |                                 for (var i = 0; i < val.length; i++) {
 | 
	
		
			
				|  |  |                                     var allFinishCount = val[i].allFinishCount
 | 
	
		
			
				|  |  |                                     var allCount = val[i].allCount
 | 
	
		
			
				|  |  |                                     var isStop = val[i].status
 | 
	
		
			
				|  |  |                                     var bname=val[i].patientName
 | 
	
		
			
				|  |  |                                     // if()
 | 
	
		
			
				|  |  |                                     if(isStop==2){
 | 
	
		
			
				|  |  |                                         $("#span_font").html("已完成")
 | 
	
		
			
				|  |  |                                         $("#span_font").addClass("corg")
 | 
	
		
			
				|  |  |                                     }
 | 
	
		
			
				|  |  |                                     if(isStop==1){
 | 
	
		
			
				|  |  |                                         $("#span_font").html("进行中")
 | 
	
		
			
				|  |  |                                         $("#span_font").addClass("cblue")
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |           
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                                     }
 | 
	
		
			
				|  |  |                                     if (isStop == 0) {
 | 
	
		
			
				|  |  |                                         $(".layui-progress-bar").css({
 | 
	
		
			
				|  |  |                                             "background-color": "gray"
 | 
	
		
			
				|  |  |                                         })
 | 
	
		
			
				|  |  |                                         $("#button_id").html("激活计划")
 | 
	
		
			
				|  |  |                                         $("#span_font").html("已中止")
 | 
	
		
			
				|  |  |                                         $("#span_font").addClass("cgre")
 | 
	
		
			
				|  |  |                                     } else {
 | 
	
		
			
				|  |  |                                         $(".layui-progress-bar").css({
 | 
	
		
			
				|  |  |                                             "background-color": "#ff9526"
 | 
	
		
			
				|  |  |                                         })
 | 
	
		
			
				|  |  |                                         $("#button_id").html("终止计划")
 | 
	
		
			
				|  |  |             var params = {
 | 
	
		
			
				|  |  |                 status: isStop,
 | 
	
		
			
				|  |  |                 planId: planid
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                                     }
 | 
	
		
			
				|  |  |                                     var progressNum = Math.ceil((allFinishCount / allCount) * 100)
 | 
	
		
			
				|  |  |                                     Progress(val[i].planId, progressNum + "%")
 | 
	
		
			
				|  |  |                                 }
 | 
	
		
			
				|  |  |                             })
 | 
	
		
			
				|  |  |                        
 | 
	
		
			
				|  |  |                     },
 | 
	
		
			
				|  |  |                 },
 | 
	
		
			
				|  |  |                 mounted() {
 | 
	
		
			
				|  |  |                     var vm = this
 | 
	
		
			
				|  |  |                     vm.getDatas()
 | 
	
		
			
				|  |  |                     EventBus.$on("back-click", function (arg) {
 | 
	
		
			
				|  |  |                         history.go(-1);
 | 
	
		
			
				|  |  |             healthAPI.updatePlanStatusById(params).then(function (res) {
 | 
	
		
			
				|  |  |                 if (res.status == 200) {
 | 
	
		
			
				|  |  |                     getDat()
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |             })
 | 
	
		
			
				|  |  |             layer.close(index);
 | 
	
		
			
				|  |  |         });
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  |     var reqList = []; //记录请求的参数和url,用于后退时使用
 | 
	
		
			
				|  |  |     Vue.use(Vuedals.default);
 | 
	
		
			
				|  |  |     new Vue({
 | 
	
		
			
				|  |  |         el: "#app",
 | 
	
		
			
				|  |  |         data: {
 | 
	
		
			
				|  |  |             appname: "更多计划",
 | 
	
		
			
				|  |  |             isback: true,
 | 
	
		
			
				|  |  |             isrefresh: true,
 | 
	
		
			
				|  |  |             paticentcode: "",
 | 
	
		
			
				|  |  |             tablelistone: [],
 | 
	
		
			
				|  |  |             tablelist: [],
 | 
	
		
			
				|  |  |             name: "",
 | 
	
		
			
				|  |  |             sex: "",
 | 
	
		
			
				|  |  |             age: "",
 | 
	
		
			
				|  |  |             hospital: "",
 | 
	
		
			
				|  |  |             diseaseList: [],
 | 
	
		
			
				|  |  |             signFamilyFinishItemCount: "",
 | 
	
		
			
				|  |  |             signFamilyServiceRecordCount: "",
 | 
	
		
			
				|  |  |             signFamilyAdminTeamName: "",
 | 
	
		
			
				|  |  |             specialistAdminTeamName: "",
 | 
	
		
			
				|  |  |             specialistFinishItemCount: "",
 | 
	
		
			
				|  |  |             specialistServiceRecordCount: "",
 | 
	
		
			
				|  |  |             progress: "",
 | 
	
		
			
				|  |  |             specialistHospitalName: "",
 | 
	
		
			
				|  |  |             familyHospitalName: "",
 | 
	
		
			
				|  |  |             planid: "",
 | 
	
		
			
				|  |  |             isStop: 1 ,//
 | 
	
		
			
				|  |  |             patientPhoto:"",
 | 
	
		
			
				|  |  |             
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                     });
 | 
	
		
			
				|  |  |                     //监听页面刷新
 | 
	
		
			
				|  |  |                     EventBus.$on("refresh-click", function (arg) {
 | 
	
		
			
				|  |  |                         location.reload();
 | 
	
		
			
				|  |  |                     });
 | 
	
		
			
				|  |  |                 },
 | 
	
		
			
				|  |  |                 components: {
 | 
	
		
			
				|  |  |                     vuedals: Vuedals.Component
 | 
	
		
			
				|  |  |                 },
 | 
	
		
			
				|  |  |                 methods: {
 | 
	
		
			
				|  |  |                     setImgSrc: function(src) {
 | 
	
		
			
				|  |  |                         var str = httpRequest.getImgUrl(src)
 | 
	
		
			
				|  |  |                         return str
 | 
	
		
			
				|  |  |                     },
 | 
	
		
			
				|  |  |                     getDatas: function () {
 | 
	
		
			
				|  |  |                         var vm = this
 | 
	
		
			
				|  |  |                         var httpData = GetRequest()
 | 
	
		
			
				|  |  |                         vm.paticentcode = httpData.patientCode
 | 
	
		
			
				|  |  |                         var params = {
 | 
	
		
			
				|  |  |                             patientCode: vm.paticentcode
 | 
	
		
			
				|  |  |         },
 | 
	
		
			
				|  |  |         watch: {
 | 
	
		
			
				|  |  |             tablelist: function (val) {
 | 
	
		
			
				|  |  |                 this.$nextTick(function () {
 | 
	
		
			
				|  |  |                     element.init()
 | 
	
		
			
				|  |  |                     for (var i = 0; i < val.length; i++) {
 | 
	
		
			
				|  |  |                         var allFinishCount = val[i].allFinishCount
 | 
	
		
			
				|  |  |                         var allCount = val[i].allCount
 | 
	
		
			
				|  |  |                         var isStop = val[i].status
 | 
	
		
			
				|  |  |                         var ishospitalName = val[i].hospitalName
 | 
	
		
			
				|  |  |                         if(ishospitalName==null){
 | 
	
		
			
				|  |  |                             $("#hospitalName_"+val[i].id).html("暂无社区信息")
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                         healthAPI.PlanDetailList(params).then(function (res) {
 | 
	
		
			
				|  |  |                             if (res.status == 200) {
 | 
	
		
			
				|  |  |                                 console.log(res)
 | 
	
		
			
				|  |  |                                 vm.wujilu = false
 | 
	
		
			
				|  |  |                                 vm.name = res.data.patientName
 | 
	
		
			
				|  |  |                                 vm.sex = res.data.sex
 | 
	
		
			
				|  |  |                                 vm.age = res.data.age
 | 
	
		
			
				|  |  |                                 vm.hospital = res.data.hospitalName
 | 
	
		
			
				|  |  |                                 vm.diseaseList = res.data.diseaseList
 | 
	
		
			
				|  |  |                                 vm.tablelist=_.sortBy(res.data.rehabilitationPlanList,"patientName")
 | 
	
		
			
				|  |  |                                 vm.signFamilyServiceRecordCount = res.data.signFamilyServiceRecordCount
 | 
	
		
			
				|  |  |                                 vm.signFamilyFinishItemCount = res.data.signFamilyFinishItemCount
 | 
	
		
			
				|  |  |                                 vm.signFamilyAdminTeamName = res.data.signFamilyAdminTeamName
 | 
	
		
			
				|  |  |                                 vm.specialistAdminTeamName = res.data.specialistAdminTeamName
 | 
	
		
			
				|  |  |                                 vm.specialistFinishItemCount = res.data.specialistFinishItemCount
 | 
	
		
			
				|  |  |                                 vm.specialistServiceRecordCount = res.data.specialistServiceRecordCount
 | 
	
		
			
				|  |  |                                 vm.specialistHospitalName = res.data.specialistHospitalName
 | 
	
		
			
				|  |  |                                 vm.familyHospitalName = res.data.familyHospitalName
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                                 if (vm.tablelist.length == 0) {
 | 
	
		
			
				|  |  |                                     vm.wujilu = true
 | 
	
		
			
				|  |  |                                 }
 | 
	
		
			
				|  |  |                             } else {
 | 
	
		
			
				|  |  |                                 // showErrorMessage(res.msg);
 | 
	
		
			
				|  |  |                             }
 | 
	
		
			
				|  |  |                         })
 | 
	
		
			
				|  |  |                         if (isStop == 2) {
 | 
	
		
			
				|  |  |                             $("#span_font"+val[i].planId).html("已完成")
 | 
	
		
			
				|  |  |                             $("#span_font"+val[i].planId).addClass("corg")
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                         if (isStop == 1) {
 | 
	
		
			
				|  |  |                             $("#span_font"+val[i].planId).html("进行中")
 | 
	
		
			
				|  |  |                             $("#span_font"+val[i].planId).addClass("cblue")
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                     },
 | 
	
		
			
				|  |  |                     stop: function (data) {
 | 
	
		
			
				|  |  |                         var vm = this
 | 
	
		
			
				|  |  |                         vm.planid = data.planId
 | 
	
		
			
				|  |  |                         console.log(data.planId)
 | 
	
		
			
				|  |  |                         ConFirm("确定终止该计划吗", data.status, vm.isStop,vm.planid,vm.getDatas)
 | 
	
		
			
				|  |  |                         var params = {
 | 
	
		
			
				|  |  |                             status: vm.isStop,
 | 
	
		
			
				|  |  |                             planId: vm.planid
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                    
 | 
	
		
			
				|  |  |                         console.log(vm.isStop)
 | 
	
		
			
				|  |  |                         if (isStop == 0) {
 | 
	
		
			
				|  |  |                             $("#span_font"+val[i].planId).html("已中止")
 | 
	
		
			
				|  |  |                             $("#span_font"+val[i].planId).addClass("cgre")
 | 
	
		
			
				|  |  |                         } 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                     },
 | 
	
		
			
				|  |  |                     noOpen:function(){
 | 
	
		
			
				|  |  |                         showInfoMessage("暂未开放")
 | 
	
		
			
				|  |  |                         var progressNum = Math.ceil((allFinishCount / allCount) * 100)
 | 
	
		
			
				|  |  |                         Progress(val[i].planId, progressNum + "%")
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                 })
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             },
 | 
	
		
			
				|  |  |         },
 | 
	
		
			
				|  |  |         mounted() {
 | 
	
		
			
				|  |  |             var vm = this
 | 
	
		
			
				|  |  |             vm.getDatas()
 | 
	
		
			
				|  |  |             EventBus.$on("back-click", function (arg) {
 | 
	
		
			
				|  |  |                 history.go(-1);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             });
 | 
	
		
			
				|  |  |             //监听页面刷新
 | 
	
		
			
				|  |  |             EventBus.$on("refresh-click", function (arg) {
 | 
	
		
			
				|  |  |                 location.reload();
 | 
	
		
			
				|  |  |             });
 | 
	
		
			
				|  |  |         },
 | 
	
		
			
				|  |  |         components: {
 | 
	
		
			
				|  |  |             vuedals: Vuedals.Component
 | 
	
		
			
				|  |  |         },
 | 
	
		
			
				|  |  |         methods: {
 | 
	
		
			
				|  |  |             setImgSrc: function (src) {
 | 
	
		
			
				|  |  |                 if(!src){
 | 
	
		
			
				|  |  |                     return "../../../images/p-female.png"
 | 
	
		
			
				|  |  |                 }else{
 | 
	
		
			
				|  |  |                     var str = httpRequest.getImgUrl(src)
 | 
	
		
			
				|  |  |                     return str
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |             })
 | 
	
		
			
				|  |  |                
 | 
	
		
			
				|  |  |             },
 | 
	
		
			
				|  |  |             getDatas: function () {
 | 
	
		
			
				|  |  |                 var vm = this
 | 
	
		
			
				|  |  |                 var httpData = GetRequest()
 | 
	
		
			
				|  |  |                 vm.paticentcode = httpData.patientCode
 | 
	
		
			
				|  |  |                 var params = {
 | 
	
		
			
				|  |  |                     patientCode: vm.paticentcode
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 healthAPI.PlanDetailList(params).then(function (res) {
 | 
	
		
			
				|  |  |                     if (res.status == 200) {
 | 
	
		
			
				|  |  |                         console.log(res)
 | 
	
		
			
				|  |  |                         vm.wujilu = false
 | 
	
		
			
				|  |  |                         vm.name = res.data.patientName
 | 
	
		
			
				|  |  |                         vm.sex = res.data.sex
 | 
	
		
			
				|  |  |                         vm.age = res.data.age
 | 
	
		
			
				|  |  |                         vm.patientPhoto=res.data.patientPhoto
 | 
	
		
			
				|  |  |                         vm.hospital = res.data.hospitalName
 | 
	
		
			
				|  |  |                         vm.diseaseList = res.data.diseaseList
 | 
	
		
			
				|  |  |                         vm.tablelist = _.sortBy(res.data.rehabilitationPlanList, "patientName")
 | 
	
		
			
				|  |  |                         vm.signFamilyServiceRecordCount = res.data.signFamilyServiceRecordCount
 | 
	
		
			
				|  |  |                         vm.signFamilyFinishItemCount = res.data.signFamilyFinishItemCount
 | 
	
		
			
				|  |  |                         vm.signFamilyAdminTeamName = res.data.signFamilyAdminTeamName
 | 
	
		
			
				|  |  |                         vm.specialistAdminTeamName = res.data.specialistAdminTeamName
 | 
	
		
			
				|  |  |                         vm.specialistFinishItemCount = res.data.specialistFinishItemCount
 | 
	
		
			
				|  |  |                         vm.specialistServiceRecordCount = res.data.specialistServiceRecordCount
 | 
	
		
			
				|  |  |                         vm.specialistHospitalName = res.data.specialistHospitalName
 | 
	
		
			
				|  |  |                         vm.familyHospitalName = res.data.familyHospitalName
 | 
	
		
			
				|  |  |                         if (vm.tablelist.length == 0) {
 | 
	
		
			
				|  |  |                             vm.wujilu = true
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                     } else {
 | 
	
		
			
				|  |  |                         // showErrorMessage(res.msg);
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 })
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             },
 | 
	
		
			
				|  |  |             stop: function (data) {
 | 
	
		
			
				|  |  |                 var vm = this
 | 
	
		
			
				|  |  |                 vm.planid = data.planId
 | 
	
		
			
				|  |  |                 console.log(data.planId)
 | 
	
		
			
				|  |  |                 conFirm("确定终止该计划吗", data.status, vm.isStop, vm.planid, vm.getDatas)
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                 console.log(vm.isStop)
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             },
 | 
	
		
			
				|  |  |             noOpen: function () {
 | 
	
		
			
				|  |  |                 showInfoMessage("暂未开放")
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     })
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         });
 | 
	
		
			
				|  |  | });
 |