|  |  | @ -18,14 +18,49 @@ | 
			
		
	
		
			
				
					|  |  |  |       /> | 
			
		
	
		
			
				
					|  |  |  |       <div class="content-right"> | 
			
		
	
		
			
				
					|  |  |  |         <div v-if="name === '门急诊电子病历'" style="height: 100%"> | 
			
		
	
		
			
				
					|  |  |  |           <ourPatientRecord v-if="name === '门急诊电子病历'" :patient-id="patientId" :only-read="onlyRead" :is-search="isSearch" :case-id="caseId" /> | 
			
		
	
		
			
				
					|  |  |  |           <ourPatientRecord | 
			
		
	
		
			
				
					|  |  |  |             v-if="name === '门急诊电子病历'" | 
			
		
	
		
			
				
					|  |  |  |             ref="ourPatient" | 
			
		
	
		
			
				
					|  |  |  |             :patient-id="patientId" | 
			
		
	
		
			
				
					|  |  |  |             :only-read="onlyRead" | 
			
		
	
		
			
				
					|  |  |  |             :is-search="isSearch" | 
			
		
	
		
			
				
					|  |  |  |             :case-id="caseId" | 
			
		
	
		
			
				
					|  |  |  |           /> | 
			
		
	
		
			
				
					|  |  |  |         </div> | 
			
		
	
		
			
				
					|  |  |  |         <template v-else> | 
			
		
	
		
			
				
					|  |  |  |           <div v-if="formList.length && isSearch === '2'" style="height: 100%"> | 
			
		
	
		
			
				
					|  |  |  |             <InformedConsent v-if="name==='眼科激光手术患者知情同意书'" :patient-detail="patientData" :json-text="jsonText" @handleSaveTable="updateForm" @formDelete="formDelete" /> | 
			
		
	
		
			
				
					|  |  |  |             <mra-form v-if="name==='眼底血管造影知情同意书'" :patient-detail="patientData" :json-text="jsonText" @handleSaveTable="updateForm" @formDelete="formDelete" /> | 
			
		
	
		
			
				
					|  |  |  |             <laser-surgery v-if="name==='眼科激光手术治疗'" :patient-detail="patientData" :json-text="jsonText" @handleSaveTable="updateForm" @formDelete="formDelete" /> | 
			
		
	
		
			
				
					|  |  |  |             <report-form v-if="name==='报告'" :patient-detail="patientData" :json-text="jsonText" @handleSaveTable="updateForm" @formDelete="formDelete" /> | 
			
		
	
		
			
				
					|  |  |  |             <InformedConsent | 
			
		
	
		
			
				
					|  |  |  |               v-if="name==='眼科激光手术患者知情同意书'" | 
			
		
	
		
			
				
					|  |  |  |               ref="informedConsent" | 
			
		
	
		
			
				
					|  |  |  |               :patient-detail="patientData" | 
			
		
	
		
			
				
					|  |  |  |               :json-text="jsonText" | 
			
		
	
		
			
				
					|  |  |  |               @handleSaveTable="updateForm" | 
			
		
	
		
			
				
					|  |  |  |               @formDelete="formDelete" | 
			
		
	
		
			
				
					|  |  |  |             /> | 
			
		
	
		
			
				
					|  |  |  |             <mra-form | 
			
		
	
		
			
				
					|  |  |  |               v-if="name==='眼底血管造影知情同意书'" | 
			
		
	
		
			
				
					|  |  |  |               ref="mraForm" | 
			
		
	
		
			
				
					|  |  |  |               :patient-detail="patientData" | 
			
		
	
		
			
				
					|  |  |  |               :json-text="jsonText" | 
			
		
	
		
			
				
					|  |  |  |               @handleSaveTable="updateForm" | 
			
		
	
		
			
				
					|  |  |  |               @formDelete="formDelete" | 
			
		
	
		
			
				
					|  |  |  |             /> | 
			
		
	
		
			
				
					|  |  |  |             <laser-surgery | 
			
		
	
		
			
				
					|  |  |  |               v-if="name==='眼科激光手术治疗'" | 
			
		
	
		
			
				
					|  |  |  |               ref="laserSurgery" | 
			
		
	
		
			
				
					|  |  |  |               :patient-detail="patientData" | 
			
		
	
		
			
				
					|  |  |  |               :json-text="jsonText" | 
			
		
	
		
			
				
					|  |  |  |               @handleSaveTable="updateForm" | 
			
		
	
		
			
				
					|  |  |  |               @formDelete="formDelete" | 
			
		
	
		
			
				
					|  |  |  |             /> | 
			
		
	
		
			
				
					|  |  |  |             <report-form | 
			
		
	
		
			
				
					|  |  |  |               v-if="name==='报告'" | 
			
		
	
		
			
				
					|  |  |  |               ref="reportForm" | 
			
		
	
		
			
				
					|  |  |  |               :patient-detail="patientData" | 
			
		
	
		
			
				
					|  |  |  |               :json-text="jsonText" | 
			
		
	
		
			
				
					|  |  |  |               @handleSaveTable="updateForm" | 
			
		
	
		
			
				
					|  |  |  |               @formDelete="formDelete" | 
			
		
	
		
			
				
					|  |  |  |             /> | 
			
		
	
		
			
				
					|  |  |  |           </div> | 
			
		
	
		
			
				
					|  |  |  |         </template> | 
			
		
	
		
			
				
					|  |  |  |       </div> | 
			
		
	
	
		
			
				
					|  |  | @ -86,14 +121,38 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |   created() { | 
			
		
	
		
			
				
					|  |  |  |     if (this.isSearch === '2') { | 
			
		
	
		
			
				
					|  |  |  |       this.getFormList() | 
			
		
	
		
			
				
					|  |  |  |       this.getPatientData() | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |   }, | 
			
		
	
		
			
				
					|  |  |  |   methods: { | 
			
		
	
		
			
				
					|  |  |  |     handleForm({ index, item }) { | 
			
		
	
		
			
				
					|  |  |  |       this.$confirmFun('是否保存数据,否则当前数据会丢弃!', '保存', '', '已取消保存数据!') | 
			
		
	
		
			
				
					|  |  |  |         .then(() => { | 
			
		
	
		
			
				
					|  |  |  |           this.$nextTick(() => { | 
			
		
	
		
			
				
					|  |  |  |             switch (this.name) { | 
			
		
	
		
			
				
					|  |  |  |               case '报告': | 
			
		
	
		
			
				
					|  |  |  |                 this.$refs.reportForm && this.$refs.reportForm.handleSaveTable() | 
			
		
	
		
			
				
					|  |  |  |                 break | 
			
		
	
		
			
				
					|  |  |  |               case '眼科激光手术患者知情同意书': | 
			
		
	
		
			
				
					|  |  |  |                 this.$refs.informedConsent && this.$refs.informedConsent.handleSaveTable() | 
			
		
	
		
			
				
					|  |  |  |                 break | 
			
		
	
		
			
				
					|  |  |  |               case '眼底血管造影知情同意书': | 
			
		
	
		
			
				
					|  |  |  |                 this.$refs.mraForm && this.$refs.mraForm.handleSaveTable() | 
			
		
	
		
			
				
					|  |  |  |                 break | 
			
		
	
		
			
				
					|  |  |  |               case '眼科激光手术治疗': | 
			
		
	
		
			
				
					|  |  |  |                 this.$refs.laserSurgery && this.$refs.laserSurgery.handleSaveTable() | 
			
		
	
		
			
				
					|  |  |  |                 break | 
			
		
	
		
			
				
					|  |  |  |               default: | 
			
		
	
		
			
				
					|  |  |  |                 this.$refs.ourPatient && this.$refs.ourPatient.handleSaveTable() | 
			
		
	
		
			
				
					|  |  |  |                 return | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |           }) | 
			
		
	
		
			
				
					|  |  |  |         }).finally(() => { | 
			
		
	
		
			
				
					|  |  |  |           this.curIndex = index | 
			
		
	
		
			
				
					|  |  |  |           this.id = item.id | 
			
		
	
		
			
				
					|  |  |  |           this.name = item.name | 
			
		
	
		
			
				
					|  |  |  |           this.jsonText = item.jsonText | 
			
		
	
		
			
				
					|  |  |  |         }) | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |     getPatientData() { | 
			
		
	
		
			
				
					|  |  |  |       const params = { | 
			
		
	
	
		
			
				
					|  |  | @ -103,11 +162,17 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |         this.patientData = data.data.data | 
			
		
	
		
			
				
					|  |  |  |       }) | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |     async updateForm(data) { | 
			
		
	
		
			
				
					|  |  |  |     updateForm(data) { | 
			
		
	
		
			
				
					|  |  |  |       if (data) { | 
			
		
	
		
			
				
					|  |  |  |         this.jsonText = JSON.stringify(data) | 
			
		
	
		
			
				
					|  |  |  |       } | 
			
		
	
		
			
				
					|  |  |  |       this.saveFormData(this.jsonText) | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |     async saveFormData(jsonText) { | 
			
		
	
		
			
				
					|  |  |  |       const params = { | 
			
		
	
		
			
				
					|  |  |  |         flag: 8, | 
			
		
	
		
			
				
					|  |  |  |         name: this.name, | 
			
		
	
		
			
				
					|  |  |  |         jsonText: JSON.stringify(data), | 
			
		
	
		
			
				
					|  |  |  |         jsonText, | 
			
		
	
		
			
				
					|  |  |  |         patientId: this.patientId, | 
			
		
	
		
			
				
					|  |  |  |         id: this.id, | 
			
		
	
		
			
				
					|  |  |  |         platform: this.isSearch | 
			
		
	
	
		
			
				
					|  |  | @ -132,10 +197,12 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |         }) | 
			
		
	
		
			
				
					|  |  |  |         return | 
			
		
	
		
			
				
					|  |  |  |       } | 
			
		
	
		
			
				
					|  |  |  |       const isMedical = name === '门急诊电子病历' | 
			
		
	
		
			
				
					|  |  |  |       const params = { | 
			
		
	
		
			
				
					|  |  |  |         flag: 8, | 
			
		
	
		
			
				
					|  |  |  |         name: name, | 
			
		
	
		
			
				
					|  |  |  |         createTime: date, | 
			
		
	
		
			
				
					|  |  |  |         isMedical, | 
			
		
	
		
			
				
					|  |  |  |         patientId: this.patientId, | 
			
		
	
		
			
				
					|  |  |  |         platform: this.isSearch | 
			
		
	
		
			
				
					|  |  |  |       } | 
			
		
	
	
		
			
				
					|  |  | @ -167,23 +234,20 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |       }) | 
			
		
	
		
			
				
					|  |  |  |       if (res.code === 0) { | 
			
		
	
		
			
				
					|  |  |  |         this.formList = res.data || [] | 
			
		
	
		
			
				
					|  |  |  |         const date = this.$moment().format('YYYY-MM-DD') | 
			
		
	
		
			
				
					|  |  |  |         if (this.formList.length) { | 
			
		
	
		
			
				
					|  |  |  |           if (mode) { | 
			
		
	
		
			
				
					|  |  |  |             this.curIndex = this.formList.findIndex(item => item.id === this.id) | 
			
		
	
		
			
				
					|  |  |  |             this.jsonText = this.formList[this.curIndex].jsonText | 
			
		
	
		
			
				
					|  |  |  |           } else { | 
			
		
	
		
			
				
					|  |  |  |           if (!mode) { | 
			
		
	
		
			
				
					|  |  |  |             this.name = this.formList[0].name | 
			
		
	
		
			
				
					|  |  |  |             this.id = this.formList[0].id | 
			
		
	
		
			
				
					|  |  |  |           } | 
			
		
	
		
			
				
					|  |  |  |           this.curIndex = this.formList.findIndex(item => item.id === this.id) | 
			
		
	
		
			
				
					|  |  |  |           this.jsonText = this.formList[this.curIndex].jsonText | 
			
		
	
		
			
				
					|  |  |  |           } | 
			
		
	
		
			
				
					|  |  |  |         } else { | 
			
		
	
		
			
				
					|  |  |  |           this.addRecord('门急诊电子病历') | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |       } else { | 
			
		
	
		
			
				
					|  |  |  |         this.$message.error(res.msg) | 
			
		
	
		
			
				
					|  |  |  |       } | 
			
		
	
		
			
				
					|  |  |  |       this.getPatientData() | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |   } | 
			
		
	
		
			
				
					|  |  |  | } | 
			
		
	
	
		
			
				
					|  |  | 
 |