Browse Source

诊疗信息 修改生成计划 在保存

huhongkun 6 years ago
parent
commit
1efffdcee0
1 changed files with 83 additions and 82 deletions
  1. 83 82
      app/recover/html/new_recover.html

+ 83 - 82
app/recover/html/new_recover.html

@ -68,19 +68,19 @@
								</ul>
							</div>
						</div>
		        		<li class="pt10"style="display: flex;">
		        		<li class="pt10"style="display: flex;" id="department">
		        			<label class="c-999" style="font-weight: normal;">入院科室:</label>
		        			<input class="form-control" v-bind:disabled="edit" v-bind:placeholder="nodata == true? '请输入': subsidiaryInfo.data.department" style=" text-align: center; height: 22px; border-radius: 3px; width: 80%;">
		        		</li>
		        		<li class="pt10"style="display: flex;">
		        		<li class="pt10"style="display: flex;" id="attendingDoctor">
		        			<label class="c-999" style="font-weight: normal;">主治医师:</label>
		        			<input class="form-control" v-bind:disabled="edit" v-bind:placeholder="nodata == true? '请输入': subsidiaryInfo.data.attendingDoctor" style="text-align: center; height: 22px; border-radius: 3px; width: 80%;">
		        		</li>
		        		<li class="pt10"style="display: flex;">
		        		<li class="pt10"style="display: flex;" id="admissionDiagnosis">
		        			<label class="c-999" style="font-weight: normal;">入院诊断:</label>
		        			<input class="form-control" v-bind:disabled="edit" v-bind:placeholder="nodata == true? '请输入': subsidiaryInfo.data.admissionDiagnosis" style="text-align: center; height: 22px; border-radius: 3px; width: 80%;">
		        		</li>
		        		<li class="pt10"style="display: flex;">
		        		<li class="pt10"style="display: flex;" id="dischargeDiagnosis">
		        			<label class="c-999" style="font-weight: normal;">出院诊断:</label>
		        			<input class="form-control" v-bind:disabled="edit" v-bind:placeholder="nodata == true? '请输入': subsidiaryInfo.data.dischargeDiagnosis" style="text-align: center; height: 22px; border-radius: 3px; width: 80%;">
		        		</li>
@ -337,7 +337,8 @@
                		var vm = this;
                		loadding = layer.load(0, {shade: false});
                		params = {
                			patient: this.pati.patient,
//              			patient: this.pati.patient,
                			patient:"3b26a7905e034c36a5ba8e65bdc0dc7f",
							type: '2',
							page: 1,
							pageSize: 50,
@ -349,7 +350,6 @@
                				if(res.data.length == 0){
                					vm.diagnosisInfo = [{orgName:'无'}]
                					console.log(vm.diagnosisInfo)
                					debugger
                					vm.nodata = true
                				}else{
                					vm.diagnosisInfo = res.data;
@ -368,10 +368,10 @@
                		vm.indexOrder = index
                		loadding = layer.load(0, {shade: false});
                		var sec_params = {
                			patient: vm.pati.patient,
							event:vm.diagnosisInfo[index].id || "",
//							patient:"3b26a7905e034c36a5ba8e65bdc0dc7f",
//							event:"26eec2df-caa9-4b7e-9993-0ad7ae8d0a15",
//              			patient: vm.pati.patient,
//							event:vm.diagnosisInfo[index].id || "",
							patient:"3b26a7905e034c36a5ba8e65bdc0dc7f",
							event:"26eec2df-caa9-4b7e-9993-0ad7ae8d0a15",
							catalog:'0213',
							serial:"1"
		                	}
@ -441,34 +441,7 @@
					//编辑诊疗
					editdiagnosis:function(){
						var  vm = this;
						if(vm.isPlanId){
							vm.edit = !vm.edit;
							if(vm.edit == true){
								var thr_parems ={
									patient:vm.pati.patient,
									patientName:vm.pati.patientName,
									planId:vm.isPlanId,
									hospitalName:$('.input-group-btn button').text().trim(),
									department:vm.subsidiaryInfo.data.department|| "",
									attendingDoctorName:vm.subsidiaryInfo.data.attendingDoctor ||"",
									admittingDiagnosis:vm.subsidiaryInfo.data.admissionDiagnosis || "",
									dischargeDiagnosis:vm.subsidiaryInfo.data.dischargeDiagnosis|| "",
									advice:vm.subsidiaryInfo.data.dischargeOrder ||"",
									dischargeTime:vm.subsidiaryInfo.data.dischargeTime || ""
								}
								loadding = layer.load(0, {shade: false});
								recoverAPI.preservationInfo(thr_parems).then(function(res){
		        					layer.close(loadding)
		        					if (res.status == 200) {
		                				showSuccessMessage('保存成功')
	            					}else{
	                					showErrorMessage(res.msg);
	                				}
	                			})
							}
						}else{
                			showWarningMessage("请先生成计划")
						}
						vm.edit = !vm.edit;
					},
                	// 获取频次列表
                	selectFrequencys: function() {
@ -989,8 +962,10 @@
//		    					}
//		    				}
//              		}
                		var vm = this,
			    			loadding = layer.load(0, {shade: false}),
                		
						var vm = this;
			    		if(vm.edit == true){
			    			var loadding = layer.load(0, {shade: false}),
			    			data = {
			    				patient: this.pati.patient,
			    				name: this.pati.patientName,
@ -1003,49 +978,75 @@
			    				detail: []
			    			},
			    			params = {};
			    		$.each(vm.templateDetail, function(index, o) {
			    			if(o.specialistServiceItemDO.executeTime.length) {
			    				var executeTime = []
			    				$.each(o.specialistServiceItemDO.executeTime, function(ind, v) {
			    					v += ' 00:00'
			    					executeTime.push(v)
			    				});
			    				var obj = {
			    					hospitalServiceItemId: o.id,
			    					type: o.flag == 2 ? 2 : 1,
			    					doctor: o.executeDoctor,
			    					doctorName: o.executeDoctorName,
			    					executeTimes: executeTime.join(","),
			    					frequencyCode: o.frequencyCode,
			    					timeType: o.timeType,
			    					remark: o.remark || ''
			    				}
			    				data.detail.push(obj)
			    			}
			    		});
			    		params = {
			    			json: JSON.stringify(data)
			    		}
						recoverAPI.createRehabilitationPlan(params).then(function(res) {
							layer.close(loadding)
							if(res.status == 200) {
								vm.isPlanId = res.data
								showSuccessMessage("康复计划配置成功!")
//								setTimeout(function() {
//									window.location.href = "../../rehabilitation/html/health_control.html"
//								}, 1000)
							} else {
								showErrorMessage(res.msg || "同康复计划项目创建时间重复!");
								vm.templateDetail = $.map(vm.templateDetail, function(o, index) {
									$.each(res.data, function(ind, v) {
										if(v == o.id) {
											o.isTimeSame = true
				    		$.each(vm.templateDetail, function(index, o) {
				    			if(o.specialistServiceItemDO.executeTime.length) {
				    				var executeTime = []
				    				$.each(o.specialistServiceItemDO.executeTime, function(ind, v) {
				    					v += ' 00:00'
				    					executeTime.push(v)
				    				});
				    				var obj = {
				    					hospitalServiceItemId: o.id,
				    					type: o.flag == 2 ? 2 : 1,
				    					doctor: o.executeDoctor,
				    					doctorName: o.executeDoctorName,
				    					executeTimes: executeTime.join(","),
				    					frequencyCode: o.frequencyCode,
				    					timeType: o.timeType,
				    					remark: o.remark || ''
				    				}
				    				data.detail.push(obj)
				    			}
				    		});
				    		params = {
				    			json: JSON.stringify(data)
				    		}
							recoverAPI.createRehabilitationPlan(params).then(function(res) {
								layer.close(loadding)
								if(res.status == 200) {
									vm.isPlanId = res.data
									if(vm.isPlanId){
										var thr_parems ={
											patient:vm.pati.patient,
											patientName:vm.pati.patientName,
											planId:vm.isPlanId,
											hospitalName:$('.input-group-btn button').text().trim(),
											department:$('#department').find('input').val(),//vm.subsidiaryInfo.data.department|| ""
											attendingDoctorName:$('#attendingDoctor').find('input').val(),//vm.subsidiaryInfo.data.attendingDoctor ||""
											admittingDiagnosis:$('#admissionDiagnosis').find('input').val(),//vm.subsidiaryInfo.data.admissionDiagnosis || ""
											dischargeDiagnosis:$('#dischargeDiagnosis').find('input').val(),//vm.subsidiaryInfo.data.dischargeDiagnosis|| ""
											advice:$('.tipText').val().trim(),//vm.subsidiaryInfo.data.dischargeOrder ||""
											dischargeTime:vm.subsidiaryInfo.data.dischargeTime || ""
										}
									});
									return o
								})
							}
						})
										loadding = layer.load(0, {shade: false});
										recoverAPI.preservationInfo(thr_parems).then(function(res){
				        					layer.close(loadding)
				        					if (res.status == 200) {
				        						setTimeout(function() {
													window.location.href = "../../rehabilitation/html/health_control.html"
												}, 1000)
				                				showSuccessMessage('保存成功')
			            					}else{
			                					showErrorMessage(res.msg);
			                				}
			                			})
									}
									showSuccessMessage("康复计划配置成功!")
								} else {
									showErrorMessage(res.msg || "同康复计划项目创建时间重复!");
									vm.templateDetail = $.map(vm.templateDetail, function(o, index) {
										$.each(res.data, function(ind, v) {
											if(v == o.id) {
												o.isTimeSame = true
											}
										});
										return o
									})
								}
							})
			    		}else{
			    			showSuccessMessage("请先保存诊疗信息!")
			    		}
    				},
    				// 字符串方法计算加减乘除(精确度百分位)
               		add: function(num1,num2){