yht2016 5 gadi atpakaļ
vecāks
revīzija
1bee859779
1 mainītis faili ar 53 papildinājumiem un 43 dzēšanām
  1. 53 43
      app/recover/html/addRecoveryDown.html

+ 53 - 43
app/recover/html/addRecoveryDown.html

@ -82,7 +82,7 @@
			    <button type="button" class="btn btn-12B7F5 btn-size-m" @click="saveBtn">保存</button>
			</div>
		</div>
		<div v-else class="c-t-center mt50"><img src="../images/wushuju_img.png" alt=""> <p class="c-999 mt10">患者暂未家签,请先提醒患者完成家庭医生签约</p></div>
		<div v-else class="c-t-center mt50"><img src="../images/wushuju_img.png" alt=""> <p class="c-999 mt10">{{emptyText}}</p></div>
	</div>
		<script src="../../../js/vue.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../../js/jquery-2.2.4.js"></script>
@ -139,15 +139,22 @@
					healthLabel: [],
					teamList: [], // 专科团队列表
					curTeamId: '',
					curHealthStatu: ''
					curHealthStatu: '',
					emptyText: '暂无数据'
                },
                mounted: function() {
					this.getSpecialistTeamList()
                },
				},
				watch: {
					curTeamId: function(){
						this.getSpecialistPatientLabel(this.curTeamId)
					}
				},
                methods: {
					// 获取下转居民列表
					onSearch: function(){
						if(this.searchKey.trim().length==0){
							showWarningMessage('请输入居民身份证进行查询!')
							return false;
						}
						var vm = this,
@ -161,6 +168,9 @@
								if(res.data.length>0){
									vm.patientInfo = res.data[0]
									vm.getPatientLabelInfo()
								} else {
									vm.patientInfo = undefined
									vm.emptyText = '患者暂未家签,请先提醒患者完成家庭医生签约'
								}
							} else {
								showErrorMessage(res.msg);
@ -178,6 +188,27 @@
							if(res.status == 200) {
								vm.teamList = res.data || []
								vm.curTeamId = vm.teamList[0].id
							} else {
								showErrorMessage(res.msg);
							}
						})
					},
					// 获取居民标签(健康情况、疾病类型、自定义分组)
					getPatientLabelInfo: function(){
						var vm = this,
							loading = layer.load(0, {shade: false})
						var params = {
							patient: vm.patientInfo.patient // "915cdef5-5b1d-11e6-8344-fa163e8aee56"
						}
						rehaAPI.getPatientLabelInfo(params).then(function(res){
							layer.close(loading)
							if(res.status == 200) {
								var healthLabel = res.data['healthLabel']||[], 
									diseaseLabel = res.data['diseaseServer']||[], 
									customLabel = res.data['customLabel']||[];
								vm.patientInfo.healthLabel = healthLabel
								vm.patientInfo.diseaseLabel = diseaseLabel
								vm.patientInfo.customLabel = customLabel
								vm.getSpecialistPatientLabel(vm.curTeamId)
							} else {
								showErrorMessage(res.msg);
@ -194,57 +225,36 @@
						rehaAPI.getSpecialistPatientLabel(params).then(function(res){
							layer.close(loading)
							if(res.status==200){
								var diseaseLabel = [], customLabel = [];
								var dLabel = [], cLabel = [];
								$.each(res.data['diseaseLabel'], function(index, o){
									o.flag = false
									o.disease = o.code
									o.diseaseName = o.name
									diseaseLabel.push(o)
								})
								$.each(res.data['customLabel'], function(index, o){
									o.flag = false
									customLabel.push(o)
								})
								vm.healthLabel = res.data['healthLabel'] || []
								vm.curHealthStatu = vm.healthLabel.length>0?vm.healthLabel[0].labelCode:undefined
								vm.diseaseLabel = diseaseLabel
								vm.customLabel = customLabel
							}else{
								showErrorMessage(res.msg);
							}
						})
					},
					// 获取居民标签(健康情况、疾病类型、自定义分组)
					getPatientLabelInfo: function(){
						var vm = this,
							loading = layer.load(0, {shade: false})
						var params = {
							patient: vm.patientInfo.patient // "915cdef5-5b1d-11e6-8344-fa163e8aee56"
						}
						rehaAPI.getPatientLabelInfo(params).then(function(res){
							layer.close(loading)
							if(res.status == 200) {
								if(res.data['healthLabel'].length>0){
									vm.curHealthStatu = res.data['healthLabel'][0].label
								}
								$.each(res.data['diseaseServer'], function(index, o){
									$.each(vm.diseaseLabel, function(index1, o1){
										if(o.disease == o1.disease){
											o1.flag = true
									$.each(vm.patientInfo.diseaseLabel, function(index1, o1){
										if(o1.disease == o.code){
											o.flag = true
										}
										vm.$set(vm.diseaseLabel, index1, o1)
									})
									dLabel.push(o)
								})
								$.each(res.data['customLabel'], function(index, o){
									$.each(vm.customLabel, function(index1, o1){
										if(o.label == o1.labelCode){
											o1.flag = true
									o.flag = false
									o.labelCode = o.labelCode
									o.labelName = o.labelName
									$.each(vm.patientInfo.customLabel, function(index1, o1){
										if(o1.label == o.labelCode){
											o.flag = true
										}else{
											
										}
										vm.$set(vm.customLabel, index1, o1)
									})
									cLabel.push(o)
								})
							} else {
								vm.healthLabel = res.data['healthLabel'] || []
								vm.curHealthStatu = vm.patientInfo.healthLabel&&vm.patientInfo.healthLabel.length>0?vm.patientInfo.healthLabel[0].label:res.data['healthLabel'][0].labelCode
								vm.diseaseLabel = dLabel
								vm.customLabel = cLabel
							}else{
								showErrorMessage(res.msg);
							}
						})