Browse Source

10701 【pc端】配置康复计划,顶部那三个去掉,住院病历自己填写应该可以修改
10700 【pc端】配置康复计划,添加住院病历,填写出院时间早于入院时间,点击保存,再次点击出院时间,页面一直转

yht2016 5 years ago
parent
commit
a4bab77df7

+ 6 - 0
app/recover/css/new_recover.css

@ -238,6 +238,12 @@ ul {
.bg-f5f5fa{
	background-color: #f5f5fa;
}
.bd-red{
	border-color: red !important;
}
.bd-12b7f5{
	border-color: #12b7f5 !important;
}
.link-control{
	padding-right: 20px;
	position: relative;

+ 37 - 6
app/recover/html/medical-records.html

@ -106,7 +106,7 @@
				})
			}
			
			selectVue = new Vue({
			top.medicalRecordsVue = new Vue({
                el: "#app",
                data: {
					pickerOptions1: {
@ -118,23 +118,46 @@
					dischargeTime: '',
					diseaseData: [], //诊断列表
					diagnosisValue: '',
					diagnosisObj: undefined,
					diagnosisObj: {},
					tags: [],//诊断标签
					tagsObj: {},
					advice: '',
					doctorCode: docInfo.uid,
					patient: httpData.patient,
					patientName: decodeURI(httpData.patientName)
					patientName: decodeURI(httpData.patientName),
					medicalRecordsId: '',
                },
                mounted: function() {
					this.getIcd10Info()
					if(httpData['medicalRecordsId']){
						this.medicalRecordsId = httpData['medicalRecordsId']
						var curMedicalRecords = JSON.parse(window.localStorage.getItem('curMedicalRecords'))
						this.initMedicalRecords(curMedicalRecords)
					}
                },
                methods: {
					initMedicalRecords: function(model){
						var vm = this
						vm.admissionTime = model.admissionTime
						vm.dischargeTime = model.dischargeTime
						vm.tags = model.diagnosisName.split(',')
						var diagnosisCodeArr = model.diagnosis.split(',')
						$.each(vm.tags, function(index, o){
							vm.tagsObj[o] = diagnosisCodeArr[index]
						})
						console.log('vm.tagsObj', vm.tagsObj)
						vm.advice = model.advice
					},
					handleSelect: function(res){
						
					},
					//添加诊断
					saveDiagnosisWrap: function(){
						if(this.diagnosisValue.trim().length>0){
							if(this.tagsObj[this.diagnosisValue]){
								showInfoMessage('该诊断已被添加')
								return false
							}
							this.tags.push(this.diagnosisValue)
							this.diagnosisValue = ''
						}
@ -158,6 +181,7 @@
							layer.close(loadding)
							if(res.status == 200) {
								vm.diseaseData = $.each(res.data, function(i, o){
									vm.diagnosisObj[o.code]=o.name
									o.value = o.name									
									return o
								})
@ -170,8 +194,7 @@
						top.recoverVue.closeMedicalRecords()
					},
					addMedicalRecords: function(){
						var vm = this,
						loading = layer.load(0, {shade: false})
						var vm = this
						if(!this.admissionTime){
							showErrorMessage('请选择入院时间!')
							return false
@ -214,10 +237,18 @@
							patientName: vm.patientName,
							jsonData: JSON.stringify(jsonData)
						}
						if(vm.medicalRecordsId){
							params['id'] = vm.medicalRecordsId
						}
						var loading = layer.load(0, {shade: false})
						rehaAPI.createMedicalRecords(params).then(function(res){
							layer.close(loading)
							if(res.status==200){
								top.recoverVue.completeMedicalRecords(res.data)
								if(vm.medicalRecordsId){
									top.recoverVue.completeMedicalRecords('edit', res.data)
								} else {
									top.recoverVue.completeMedicalRecords('isNew', res.data)
								}
							}else{
								top.recoverVue.closeMedicalRecords()
								showErrorMessage(res.msg);

+ 49 - 17
app/recover/html/new_recover.html

@ -95,12 +95,12 @@
							{{isEdit == true? '编辑':'保存'}}
						</span>
					</h4>
					<textarea v-bind:disabled="isEdit" v-model="adviceContent" class="m0 p10 c-333 mt10" :class="{'bg-f5f5fa':isEdit}" style="width: 100%;height: 200px; width: 100%; border:1px solid #e1e1e1; resize:none;" placeholder="请输入您的康复建议..."></textarea>
					<textarea v-bind:disabled="isEdit" v-model="adviceContent" class="m0 p10 c-333 mt10" :class="{'bg-f5f5fa':isEdit, 'bd-red':showAdviceContentTip}" style="width: 100%;height: 200px; width: 100%; border:1px solid #e1e1e1; resize:none;" placeholder="请输入您的康复建议..."></textarea>
					<h4 class="h30 m0 c-f14 c-border-b f-w500" style="overflow: hidden;">
						住院病历
					</h4>
					<div v-if="medicalRecordsList.length>0" v-for="(o, i) in medicalRecordsList" class="mt10">
						<div class="flex vc c-f14 c-border plr10 ptb5 link-control">
						<div class="flex vc c-f14 c-border plr10 ptb5 link-control" style="cursor: pointer;" @click="editMedicalRecords(o, i)" :class="{'bd-12b7f5': curMedicalRecordsIndex==i}">
							<span class="c-666 mr15">
								{{formatter(o.admissionTime)}}
							</span>
@ -134,7 +134,7 @@
		        			<h4 class="m0 pl15 lh40 c-border-b set-label f-w500 c-position-r">
		        				<em class="c-position-a set-blue-span"></em>
		        				配置康复计划
		        				<span v-for="(label, index) in spanLabel" :key="index" class="fr ml20 pl20 c-f14 c-999 cur-pit" :class="{'active': index == labelIndex}" @click="setLabelIndex(index, label)">{{label.labelName}}</span>
		        				<!-- <span v-for="(label, index) in spanLabel" :key="index" class="fr ml20 pl20 c-f14 c-999 cur-pit" :class="{'active': index == labelIndex}" @click="setLabelIndex(index, label)">{{label.labelName}}</span> -->
		        			</h4>
		        			<div class="c-h100-41" style="overflow: hidden;">
		        				<ul class="c-h100 p0 m0" style="overflow: auto;">
@ -388,9 +388,19 @@
					adviceContent: '', //康复建议
					isEdit: false, 
					medicalRecordsList: [],
					docInfo: JSON.parse(window.localStorage.getItem('docInfo'))
					docInfo: JSON.parse(window.localStorage.getItem('docInfo')),
					showAdviceContentTip: false,
					curMedicalRecordsIndex: -1
				},
				watch: {
					adviceContent: function(){
						var vm = this
						if(vm.adviceContent.trim().length>0){
							vm.showAdviceContentTip = false
						} else {
							vm.showAdviceContentTip = true
						}
					},
					templateDetail: function(){
						if(this.templateDetail.length==0){
							this.havePlan = false
@ -429,12 +439,32 @@
							content: "medical-records.html?patient="+vm.pati.patient+'&patientName='+vm.pati.patientName
						});
					},
					// 编辑住院病历
					editMedicalRecords: function(o, i){
						var vm = this
						vm.curMedicalRecordsIndex = i
						window.localStorage.setItem('curMedicalRecords', JSON.stringify(o))
						this.selectPatientIndex = layer.open({
							type: 2,
							area: ['480px', '520px'],
							shade: 0.5,
							title: '添加住院病历',
							closeBtn: 1,
							shift: 5,
							shadeClose: false, //点击遮罩关闭层
							content: "medical-records.html?patient="+vm.pati.patient+'&patientName='+vm.pati.patientName+'&medicalRecordsId='+o.id
						});
					},
					//关闭添加住院病历弹框
					closeMedicalRecords: function(){
						layer.close(this.selectPatientIndex)
					},
					completeMedicalRecords: function(data){
						this.medicalRecordsList.unshift(data)
					completeMedicalRecords: function(type, data){
						if(type=='edit'){
							this.$set(this.medicalRecordsList, this.curMedicalRecordsIndex, data)
						} else {
							this.medicalRecordsList.unshift(data)
						}
						layer.close(this.selectPatientIndex)
					},
                	//获取诊疗信息
@ -938,7 +968,10 @@
                		this.isPlan = false
                		this.allFee = 0
                		this.templateDetail = []
                		this.pati = pati
						this.pati = pati
						this.isEdit = false
						this.showAdviceContentTip = false
						this.medicalRecordsList = []
                		this.getPatientInfo()
                		this.findTemplateList()
						// this.diagnosisQuery()
@ -947,17 +980,16 @@
                	// 添加模板
                	addMuban: function(oId) {
						var vm = this
                		// vm.selectDiseaseIndex = layer.open({
						// 	type: 2,
						// 	area: ['400px', '500px'],
						// 	shade: 0.5,
						// 	title: '选择疾病',
						// 	closeBtn: 1,
						// 	shift: 5,
						// 	shadeClose: false, //点击遮罩关闭层
						// 	content: "select-disease.html?teamCode=" + vm.pati.teamCode +"&templateId=" + oId || ''
						// });
						var templateId = oId||''
						if(!this.adviceContent){
							vm.showAdviceContentTip = true
							showWarningMessage("请输入康复建议!")
                			return false;
						}
						if(vm.medicalRecordsList.length==0){
							showWarningMessage("请选择住院病历!")
                			return false;
						}
						vm.newPlan(templateId)
                	},
                	// 取消计划

+ 68 - 25
app/rehabilitation/html/addRecoveryDown.html

@ -13,13 +13,13 @@
	<body class="m0">
	<div id="app" class="p15 c-333" v-cloak>
        <div class="ui-row flex">
            <div class="ui-row-item flex">
            <div class="ui-row-item flex mr50">
                <label class="c-999 w-80">专科团队:</label>
				<select v-model="curTeamId" class="form-control w-180 h30">
					<option :value="o.id" v-for="(o, i) in teamList">{{o.name}}</option> 
				</select>
            </div>
            <div class="ui-row-item flex ml50">
            <div class="ui-row-item flex">
                <label class="c-999 w-80">患者身份证:</label>
				<div>
					<input type="text" v-model="searchKey" placeholder="请输入患者身份证查询" class="form-control w-220 h30">
@ -78,7 +78,7 @@
			    </div>
			</div>
			<div class="c-t-center mt50">
			    <button type="button" class="btn btn-12B7F5 btn-size-m" @click="saveBtn">保存</button>
			    <button type="button" class="btn btn-12B7F5 btn-size-m" @click="judgePatientInSpecia">保存</button>
			</div>
		</div>
		<div v-else class="c-t-center mt50"><img src="../images/wushuju_img.png" alt=""> <p class="c-999 mt10">{{emptyText}}</p></div>
@ -150,9 +150,11 @@
				},
				watch: {
					curTeamId: function(){
						this.patientInfo = undefined
						this.getSpecialistPatientLabel(this.curTeamId)
						this.curTeamInfo = this.teamListObj[this.curTeamId]
						if(vm.patientInfo){
							vm.findPatientSignSpecialistInfo()
						}
					}
				},
                methods: {
@ -208,6 +210,8 @@
								if(res.data.length>0){
									vm.patientInfo = res.data[0]
									vm.getPatientLabelInfo()
									// 获取签约专科信息
									vm.findPatientSignSpecialistInfo()
								} else {
									vm.patientInfo = undefined
									vm.emptyText = '患者暂未家签,请先提醒患者完成家庭医生签约'
@ -306,37 +310,75 @@
							}
						})
					},
					//居民未与扫描的二维码团队对应
					createPatientInSpeciaRelation:function(data){
					//判断居民是否签约专科医生
					findPatientSignSpecialistInfo: function() {
						var vm = this,
						params = {
							patient: data.patient_code,
							doctor: docInfo.code,
							patientName: data.patient_name,
							doctorName: docInfo.name,
							teamCode:data.teamCode
							patient: vm.patientInfo.patient,
							doctor: docInfo.code
						}
						rehaAPI.createPatientInSpeciaRelation(params).then(function(res){
							if(res.data&&res.data.status == 200) {
						recoverApi.findPatientSignSpecialistInfo(params).then(function(res){
							if(res.status == 200) {
								if(res.data.teamCode){
									if(res.data.teamCode==vm.curTeamInfo.id){  //签约团队与二维码团队一致
										vm.is_sign_specialist = true
									}else{
										vm.is_sign_specialist = false
									}
								}
							} else {
								showErrorMessage(res.msg);
								showErrorMessage(res.msg)
							}
						})
						
					},
					saveBtn: function(){
					//居民未与扫描的二维码团队对应
					createPatientInSpeciaRelation:function(data){
						return new Promise(function (resolve, reject) {
							var vm = this,
							params = {
								patient: data.patient_code,
								doctor: docInfo.code,
								patientName: data.patient_name,
								doctorName: docInfo.name,
								teamCode:data.teamCode
							}
							rehaAPI.createPatientInSpeciaRelation({jsonData:JSON.stringify(params)}).then(function(res){
								// if(res.data&&res.data.status == 200) {
								// 	resolve(res)
								// } else {
								// 	showErrorMessage(res.msg);
								// 	reject(res)
								// }
								resolve(res)
							})
						})
					},
					judgePatientInSpecia: function(){
						var vm = this
						var vm = this, num1 = 0, num2 = 0,
						health = {}, disease = [], custom = []
						if(!vm.patientInfo){return false}
						if(!is_sign_specialist){
							vm.createPatientInSpeciaRelation({
								patient_code: vm.patientInfo.patient,
								patient_name: vm.patientInfo.patientName,
								teamCode: vm.curTeamInfo.id
						if(!vm.is_sign_specialist){
							var text = "请问您是否确认为"+vm.patientInfo.patientName+"患者进行康复下转?"
							var current=layer.confirm(text, { 
								btn: ['确定', '取消'],
								title: "提示"
							}, function (index) {
								vm.createPatientInSpeciaRelation({
									patient_code: vm.patientInfo.patient,
									patient_name: vm.patientInfo.patientName,
									teamCode: vm.curTeamInfo.id
								}).then(function(res){
									setTimeout(function(){
										vm.saveBtn()
									}, 500)
								})
							})
						} else {
							vm.saveBtn()
						}
					},
					saveBtn: function(){
						var vm = this, num1 = 0, num2 = 0,
						health = {}, disease = [], custom = []
						if(!vm.curHealthStatu){
							showWarningMessage('请选择健康情况!')
							return false
@ -389,7 +431,8 @@
						var params = {
							patient: vm.patientInfo.patient, // "915cdef5-5b1d-11e6-8344-fa163e8aee56"
							patientName: vm.patientInfo.patientName,
							json: JSON.stringify(data)
							json: JSON.stringify(data),
							teamCode: vm.curTeamInfo.id
						}
						var loading = top.layer.load(0, {shade: false}); //0代表加载的风格,支持0-2
						rehaAPI.updatePatientLabelInfo(params).then(function(res){