Explorar o código

访视表单存在历史数据(进行过编辑但未完成访视),要代入数据,再代入历史记录

zhangyanfang %!s(int64=5) %!d(string=hai) anos
pai
achega
a5fec5ebb6

+ 72 - 35
app/followup/v1/html/fangshi-detail-10.html

@ -879,7 +879,9 @@
                    followupId: Request['id'],
                    finishedBtn:true,  //是否已经完成随访
                    sfStatus:'',  //当前的随访状态
                    showFinish:true,  //是否显示完成随访按钮
                    showFinish:true,  //是否显示完成随访按钮,
                    followupClass:'',
                    patientCode:'',
                    parient: {
                        "version": Request['version']||'1',
                        "followup_id":  Request['id']||'1', //随访id
@ -894,7 +896,7 @@
                            {
                                "create_user": '',
                                "create_user_name": '',
                                "followup_date": new Date().format("yyyy-MM-dd"),//随访日期,
                                "followup_date": '',
                                "way": '',//随访方式:1-门诊,2-家庭 3-电话   //整数
                                "treate_month": '',//治疗月序
                                "superviser": {
@ -1111,7 +1113,6 @@
                var docInfo = JSON.parse(window.localStorage.getItem("docInfo"));
                console.log(docInfo.code)
                console.log(docInfo.name)
                //获取随访详情
                this.getData()
            },
            computed:{
@ -1131,41 +1132,73 @@
                    var vm = this
                    // var vmP = this.postpartumVisitDetails  Request['id']||'1'  
                    fangshiAPI.getPhthisis({ followupId: Request['id']||'1' }).then(function (res) {
                        if (res.status == 200) {
                            vm.getStatus() //获取随访状态
                        if(res.status==200 && !res.data[0]){
                            vm.getStatus(true)
                        }
                        if (res.status == 200 && res.data[0]) {
                            console.log("获取肺结核信息")
                            console.log(res)
                            vm.parient = res.data[0]
                             //转换用药数据
                            vm.yongyao1 = vm.parient.data[0].drug_use.dosage_form?vm.parient.data[0].drug_use.dosage_form.split(','):[]
                            vm.yongyao2 = vm.parient.data[1].drug_use.dosage_form?vm.parient.data[1].drug_use.dosage_form.split(','):[]
                            vm.yongyao3 = vm.parient.data[2].drug_use.dosage_form?vm.parient.data[2].drug_use.dosage_form.split(','):[]
                            vm.yongyao4 = vm.parient.data[3].drug_use.dosage_form?vm.parient.data[3].drug_use.dosage_form.split(','):[]
                            //转换体征信息
                            vm.tizheng = vm.parient.data[0].symptom?vm.parient.data[0].symptom.split(','):[]
                            
                            console.log(vm.parient)
                            for(var i=0;i<4;i++){
                                vm.parient.data[i].superviser.superviser_type = vm.parient.data[i].superviser.superviser_type.toString()
                                vm.parient.data[i].way = vm.parient.data[i].way?vm.parient.data[i].way.toString():vm.parient.data[i].way
                                vm.parient.data[i].drug_use.method = vm.parient.data[i].drug_use?vm.parient.data[i].drug_use.method.toString():vm.parient.data[i].drug_use
                                vm.parient.data[i].drug_bad_reaction =  vm.parient.data[i].drug_bad_reaction?vm.parient.data[i].drug_bad_reaction.toString():vm.parient.data[i].drug_bad_reaction
                                vm.parient.data[i].complication = vm.parient.data[i].complication?vm.parient.data[i].complication.toString():vm.parient.data[i].complication
                                vm.parient.stop_treate.reason = vm.parient.stop_treate.reason?vm.parient.stop_treate.reason.toString():vm.parient.stop_treate.reason
                                vm.$forceUpdate()
                            }
                            console.log("!!!!!!")
                            console.log(vm.parient)
                            vm.dealData()
                            // vm.parient.data = vm.parient.data.map(function(ele){
                            //     var item = ele
                            //     item.superviser.superviser_type = superviser.superviser_type.toString()
                            //     console.log(item.superviser.superviser_type)
                            //     return item
                            // })
                            vm.getStatus(false)
                        } else {
                            top.toastr.info(res.msg);
                            // top.toastr.info(res.msg);
                        }
                    })
                },
                dealData: function () {
                    //转换用药数据
                    var vm=this
                    vm.yongyao1 = vm.parient.data[0].drug_use.dosage_form ? vm.parient.data[0].drug_use.dosage_form.split(',') : []
                    vm.yongyao2 = vm.parient.data[1].drug_use.dosage_form ? vm.parient.data[1].drug_use.dosage_form.split(',') : []
                    vm.yongyao3 = vm.parient.data[2].drug_use.dosage_form ? vm.parient.data[2].drug_use.dosage_form.split(',') : []
                    vm.yongyao4 = vm.parient.data[3].drug_use.dosage_form ? vm.parient.data[3].drug_use.dosage_form.split(',') : []
                    //转换体征信息
                    vm.tizheng = vm.parient.data[0].symptom ? vm.parient.data[0].symptom.split(',') : []
                    console.log(vm.parient)
                    for (var i = 0; i < 4; i++) {
                        vm.parient.data[i].superviser.superviser_type = vm.parient.data[i].superviser.superviser_type.toString()
                        vm.parient.data[i].way = vm.parient.data[i].way ? vm.parient.data[i].way.toString() : vm.parient.data[i].way
                        vm.parient.data[i].drug_use.method = vm.parient.data[i].drug_use ? vm.parient.data[i].drug_use.method.toString() : vm.parient.data[i].drug_use
                        vm.parient.data[i].drug_bad_reaction = vm.parient.data[i].drug_bad_reaction ? vm.parient.data[i].drug_bad_reaction.toString() : vm.parient.data[i].drug_bad_reaction
                        vm.parient.data[i].complication = vm.parient.data[i].complication ? vm.parient.data[i].complication.toString() : vm.parient.data[i].complication
                        vm.parient.stop_treate.reason = vm.parient.stop_treate.reason ? vm.parient.stop_treate.reason.toString() : vm.parient.stop_treate.reason
                        vm.$forceUpdate()
                    }
                    console.log("!!!!!!")
                    console.log(vm.parient)
                },
                getLastData: function (obj) {
                    var vm = this
                    fangshiAPI.getLastVisitRecord({ followupClass: vm.followupClass, patientCode: vm.patientCode }).then(function (res) {
                        if (res.status == 200) {
                                // 默认信息
                                vm.parient.patient.name = obj.name
                                vm.parient.management.signature_doctor_name = obj.doctorName
                                for (var i = 0; i < 4; i++) {
                                    vm.parient.data[i].followup_doctor_name = obj.doctorName
                                }
                                // 居民存在上次历史记录,则代入默认信息
                                if (res.data.detail[0]) {
                                    vm.parient = res.data.detail[0]
                                    vm.dealData()
                                }
                                //默认日期(不被历史记录覆盖)
                                for (var i=0; i<4 ;i++){
                                    vm.parient.data[i].followup_date=new Date().format("yyyy-MM-dd")
                                }
                                for (var i=0; i<4 ;i++){
                                    vm.parient.data[0].next_followup_date=""
                                }
                               
                            
                        }
                    })
                },
@ -1174,7 +1207,8 @@
                    var vm = this
                    fangshiAPI.updateFollowStatus({ followupId: this.followupId,isFlag:1 }).then(function (res) {
                        if (res.status == 200) {
                            vm.getStatus()
                            vm.finishedStatus=true
                            vm.setEditBtn()
                            top.toastr.info("完成随访成功")
                        } else {
                            top.toastr.error(res.msg);
@ -1207,6 +1241,7 @@
                    //     top.toastr.info("请输入编号")
                    //     return false
                    // }
                    vm.parient.followup_id=Request['id']
                    fangshiAPI.savePhthisis({ jsonData: JSON.stringify(vm.parient) }).then(function (res) {
                        if (res.status == 200) {
                            vm.finishedStatus ? '' : vm.finish()
@ -1240,19 +1275,21 @@
					this.isEditBtn || !this.finishedStatus?this.editData():''//保存数据
                },                
                //获取当前随访状态信息  Request['id']||'1'
                getStatus:function(){
                getStatus:function(getLast){
                    var vm = this
                    fangshiAPI.getFollowupInfo({ followupId: Request['id']||'1'}).then(function (res) {
                            if (res.status == 200) {
                                res.data.status != 1 ? vm.finishedStatus = false : vm.finishedStatus = true
                                if(!vm.finishedStatus){
                                    vm.parient.patient.name=res.data.patient.name
                                    for(var i=0;i<4;i++){
                                        vm.parient.data[i].followup_doctor_name=res.data.doctorName
                                    }
                                    vm.parient.management.signature_doctor_name=res.data.doctorName
                                vm.patientCode = res.data.patientCode
                                vm.followupClass = res.data.followupClass
                                var obj = {}
                                obj.name = res.data.patient.name
                                obj.doctorName = res.data.doctorName
                                // finishedStatus:true 随访完成,false 随访未完成
                                if(getLast){
                                    vm.getLastData(obj)
                                }
								vm.setEditBtn()
                                vm.setEditBtn()
                            } else {
                                top.toastr.error(res.msg);
                            }

+ 13 - 9
app/followup/v1/html/fangshi-detail-5.html

@ -252,7 +252,8 @@
						breast_feeding: '0',
						newborn_care_and_feeding: '0',
						other_guide: '0',
						followup_date:''
						followup_date:'',
						next_visiting_date:''
					},
					followupId: Request['id'],
					version: Request['version'],
@ -261,7 +262,7 @@
				}
			},
			mounted: function () {
				this.getStatus() //获取随访状态
				this.getData() //获取随访状态
			},
			watch: {
				check: function (i) {
@ -283,6 +284,9 @@
							if (data != null) {											
								vm.postpartumVisitDetails = data
								vm.dealData(data)
								vm.getStatus(false)
							}else{
								vm.getStatus(true)
							}
						} else {
							top.toastr.error(res.msg);
@ -325,9 +329,6 @@
						if (res.status == 200) {
							var data = res.data.detail
							// finishedStatus:true 随访完成,false 随访未完成
							if (vm.finishedStatus) {
								vm.getData()
							} else {
								//默认随访医生签名
								vm.postpartumVisitDetails.visiting_doctor_name=doctorName
								vm.postpartumVisitDetails.name=name
@ -338,7 +339,7 @@
								}
								//默认随访时间为当前时间
								vm.postpartumVisitDetails.followup_date = new Date().format("yyyy-MM-dd")
							}
								vm.postpartumVisitDetails.next_visiting_date=""
						}
                    })
                },
@ -347,7 +348,8 @@
					var vm=this
					fangshiAPI.updateFollowStatus({ followupId: this.followupId }).then(function (res) {
						if (res.status == 200) {
                            vm.getStatus()
                            vm.finishedStatus=true
                            vm.setEditBtn()
                            top.toastr.info("完成随访成功")
						} else {
							top.toastr.error(res.msg);
@ -383,7 +385,7 @@
					})
				},
				//获取当前随访状态信息  Request['id']||'1'
				getStatus: function (isShow) {
				getStatus: function (getLast) {
					var vm = this
					fangshiAPI.getFollowupInfo({ followupId: this.followupId || '1888107' }).then(function (res) {
						if (res.status == 200) {
@ -392,7 +394,9 @@
							vm.followupClass=res.data.followupClass
							var doctorName=res.data.doctorName
							var name=res.data.patient.name
							vm.getLastData(doctorName,name)//获取patientCode,followupClass 获取上一次数据
                            if(getLast){
                                vm.getLastData(doctorName,name)//获取patientCode,followupClass 获取上一次数据
                            }
							vm.setEditBtn()
						} else {
							top.toastr.error(res.msg);

+ 11 - 8
app/followup/v1/html/fangshi-detail-7.html

@ -747,7 +747,7 @@
                },
            },
            mounted: function () {
				this.getStatus() //获取随访状态
				this.getData() //获取随访状态
            },
            methods: {
                getData: function () {
@ -759,6 +759,9 @@
                            if (data != null) {
                                vm.severeMentalDisorderData = res.data
                                vm.dealData(data)
                                vm.getStatus(false)
                            }else{
                                vm.getStatus(true)
                            }
                        } else {
                            top.toastr.error(res.msg);
@ -837,9 +840,6 @@
                        if (res.status == 200) {
                            var data = res.data.detail
                            // finishedStatus:true 随访完成,false 随访未完成
                            if (vm.finishedStatus) {
                                vm.getData()
                            } else {
                                // 默认医生签名
                                vm.severeMentalDisorderData.doctor_name=doctorName
                                vm.severeMentalDisorderData.name=name
@ -850,7 +850,7 @@
                                }
                                //默认登记时间为当前时间
                                vm.severeMentalDisorderData.followup_date=new Date().format("yyyy-MM-dd")
                            }
                                vm.severeMentalDisorderData.followup_next_date=""
                        }
                    })
                },
@ -859,7 +859,8 @@
                    var vm=this
                    fangshiAPI.updateFollowStatus({ followupId: this.followupId }).then(function (res) {
                        if (res.status == 200) {
                            vm.getStatus()
                            vm.finishedStatus=true
                            vm.setEditBtn()
                            top.toastr.info("完成随访成功")
                        } else {
                            top.toastr.error(res.msg);
@ -942,7 +943,7 @@
					}
				},
                //获取当前随访状态信息  Request['id']||'1'
                getStatus: function () {
                getStatus: function (getLast) {
                    var vm = this
                    fangshiAPI.getFollowupInfo({ followupId: this.followupId || '1888107' }).then(function (res) {
                        if (res.status == 200) {
@ -951,7 +952,9 @@
                            vm.followupClass=res.data.followupClass
                            var doctorName=res.data.doctorName
                            var name=res.data.patient.name
							vm.getLastData(doctorName,name)//获取patientCode,followupClass 获取上一次数据
                            if(getLast){
                                vm.getLastData(doctorName,name)//获取patientCode,followupClass 获取上一次数据
                            }
                            vm.setEditBtn()
                        } else {
                            top.toastr.error(res.msg);

+ 10 - 8
app/followup/v1/html/fangshi-detail-8.html

@ -2107,7 +2107,7 @@
					}
				},
				mounted: function () {
					this.getStatus() //获取随访状态
					this.getData() //获取随访状态
				},
				computed: {
					rale: function () {
@ -2555,6 +2555,9 @@
								if (data != null) {
									vm.oldmanData = data
									vm.dealData(data)
									vm.getStatus(false)
								}else{
									vm.getStatus(true)
								}
							} else {
								top.toastr.error(res.msg);
@ -2590,9 +2593,6 @@
								vm.oldmanData.name=obj.name
								vm.oldmanData.idcard=obj.idcard
								// finishedStatus:true 随访完成,false 随访未完成
								if (vm.finishedStatus) {
									vm.getData()
								} else {
									// 居民存在上次历史记录,则代入默认信息
									if (res.data.detail) {
										vm.oldmanData = res.data.detail
@ -2600,7 +2600,6 @@
									}
									//默认随访时间为当前时间(不被历史记录覆盖)
									vm.oldmanData.duty = new Date().format("yyyy-MM-dd")
								}
							}
						})
					},
@ -2609,7 +2608,8 @@
						var vm = this
						fangshiAPI.updateFollowStatus({ followupId: this.followupId }).then(function (res) {
							if (res.status == 200) {
								vm.getStatus()
								vm.finishedStatus = true
								vm.setEditBtn()
								top.toastr.info("完成随访成功")
							} else {
								top.toastr.error(res.msg);
@ -2672,7 +2672,7 @@
						this.isEditBtn || !this.finishedStatus ? this.editData() : ''//保存数据
					},
					//获取当前随访状态信息  Request['id']||'1'
					getStatus: function () {
					getStatus: function (getLast) {
						var vm = this
						fangshiAPI.getFollowupInfo({ followupId: this.followupId || '1888107' }).then(function (res) {
							if (res.status == 200) {
@ -2682,7 +2682,9 @@
								var obj={}
								obj.name=res.data.patient.name
								obj.idcard=res.data.patient.idcard
								vm.getLastData(obj)//获取patientCode,followupClass 获取上一次数据
								if (getLast) {
									vm.getLastData(obj)//获取patientCode,followupClass 获取上一次数据
								}
								vm.setEditBtn()
							} else {
								top.toastr.error(res.msg);

+ 37 - 32
app/followup/v1/html/fangshi-detail-9.html

@ -351,7 +351,7 @@
                            life_style: {},
                            health_edu: {},
                            followup_date:'',
                            way:2,   //默认家庭,
                            way:"",   //默认家庭,
                            signature_doctor_name:''
                        },
                        radio: "",
@ -364,7 +364,7 @@
                    }
                },
                mounted: function () {
                    this.getStatus() //获取随访状态
                    this.getData() //获取随访状态
                },
                methods: {
                    getData: function () {
@ -382,6 +382,9 @@
                                if (!isEmpty) {
                                    vm.data2 = data
                                    vm.dealData(data)
                                    vm.getStatus(false)
                                }else{
                                    vm.getStatus(true)
                                }
                            } else {
                                top.toastr.error(res.msg);
@ -414,29 +417,27 @@
                        }
                    },
                    getLastData: function (obj) {
                        var vm = this
                        fangshiAPI.getLastVisitRecord({ followupClass: vm.followupClass, patientCode: vm.patientCode }).then(function (res) {
                            if (res.status == 200) {
                                var data = res.data.detail
                                // finishedStatus:true 随访完成,false 随访未完成
                                if (vm.finishedStatus) {
                                    vm.getData()
                                } else {
                                    // 默认信息
                                    vm.data2.patient.name = obj.name
                                    vm.data2.signature_doctor_name = obj.doctorName
                                    // 居民存在上次历史记录,则代入默认信息
									if (res.data.detail) {
                                        vm.data2 = res.data.detail
                                        vm.dealData(data)
                                    }
                                    //默认随访时间为当前时间
                                    vm.data2.followup_date = new Date().format("yyyy-MM-dd")
                                }
                            }
                        })
                    },
                    // getLastData: function (obj) {
                    //     var vm = this
                    //     fangshiAPI.getLastVisitRecord({ followupClass: vm.followupClass, patientCode: vm.patientCode }).then(function (res) {
                    //         if (res.status == 200) {
                    //             var data = res.data.detail
                    //             // finishedStatus:true 随访完成,false 随访未完成
                    //             if (vm.finishedStatus) {
                    //                 vm.getData()
                    //             } else {
                    //                 // 默认信息
                    //                 vm.data2.patient.name = obj.name
                    //                 vm.data2.signature_doctor_name = obj.doctorName
                    //                 // 居民存在上次历史记录,则代入默认信息
					// 				if (res.data.detail) {
                    //                     vm.data2 = res.data.detail
                    //                     vm.dealData(data)
                    //                 }
                    //             }
                    //         }
                    //     })
                    // },
                    // 完成随访状态修改
                    finish: function () {
                        var vm = this
@ -493,17 +494,21 @@
                    this.isEditBtn || !this.finishedStatus?this.editData():''//保存数据
                    },
                    //获取当前随访状态信息  Request['id']||'1'
                    getStatus: function () {
                    getStatus: function (getLast) {
                        var vm = this
                        fangshiAPI.getFollowupInfo({ followupId: this.followupId || '1888107' }).then(function (res) {
                            if (res.status == 200) {
                                res.data.status != 1 ? vm.finishedStatus = false : vm.finishedStatus = true
                                vm.patientCode = res.data.patientCode
                                vm.followupClass = res.data.followupClass
                                var obj={}
                                obj.name=res.data.patient.name
                                obj.doctorName=res.data.doctorName
                                vm.getLastData(obj)//获取patientCode,followupClass 获取上一次数据
                                // vm.patientCode = res.data.patientCode
                                // vm.followupClass = res.data.followupClass
                                if (getLast) {
                                    //默认信息
                                    vm.data2.patient.name = res.data.patient.name
                                    vm.data2.signature_doctor_name = res.data.doctorName
                                    vm.data2.way = 2
                                    vm.data2.followup_date = new Date().format("yyyy-MM-dd")
                                }
                                // vm.getLastData()//获取patientCode,followupClass 获取上一次数据
								vm.setEditBtn()
                            } else {
                                top.toastr.error(res.msg);

+ 13 - 9
component/followup/fangshi-detail-6.js

@ -690,7 +690,8 @@ Vue.component('fangshi-detail-6', {
            newbornData: {
                this_INTERVIEW_DATE:'',
                birthday:'',
                sick_SEX:''
                sick_SEX:'',
                next_VISITING_DATE:"",
            },
            patientCode:'',
            followupClass:''
@ -934,7 +935,7 @@ Vue.component('fangshi-detail-6', {
    },
    mounted: function () {
        this.getStatus() //获取随访状态
        this.getData() //获取随访状态
    },
    methods: {
        getData: function () {
@ -945,6 +946,9 @@ Vue.component('fangshi-detail-6', {
                    if (data != null) {
                        vm.newbornData = data
                        vm.dealData(data)
                        vm.getStatus(false)
                    }else{
                        vm.getStatus(true)
                    }
                } else {
                    top.toastr.error(res.msg);
@ -1019,9 +1023,6 @@ Vue.component('fangshi-detail-6', {
                if (res.status == 200) {
                    var data = res.data.detail
                    // finishedStatus:true 随访完成,false 随访未完成
                    if (vm.finishedStatus) {
                        vm.getData()
                    } else {
                        //默认信息
                        vm.newbornData.sick_NAME=obj.name
                        vm.newbornData.sick_SEX=obj.sex.toString()
@ -1034,7 +1035,7 @@ Vue.component('fangshi-detail-6', {
                        }
                        //默认随访时间为当前时间
                        vm.newbornData.this_INTERVIEW_DATE = new Date().format("yyyy-MM-dd")
                    }
                        vm.newbornData.next_VISITING_DATE=""
                }
            })
        },
@ -1043,7 +1044,8 @@ Vue.component('fangshi-detail-6', {
            var vm = this
            fangshiAPI.updateFollowStatus({ followupId: this.followupid }).then(function (res) {
                if (res.status == 200) {
                    vm.getStatus()
                    vm.finishedStatus=true
                    vm.setEditBtn()
                    top.toastr.info("完成随访成功")
                } else {
                    top.toastr.error(res.msg);
@ -1118,7 +1120,7 @@ Vue.component('fangshi-detail-6', {
            this.isEditBtn || !this.finishedStatus?this.editData():''//保存数据
        },
        //获取当前随访状态信息  Request['id']||'1'
        getStatus: function () {
        getStatus: function (getLast) {
            var vm = this
            fangshiAPI.getFollowupInfo({ followupId: this.followupid || '1888107' }).then(function (res) {
                if (res.status == 200) {
@ -1130,7 +1132,9 @@ Vue.component('fangshi-detail-6', {
                     obj.name=res.data.patient.name
                     obj.sex=res.data.patient.sex
                     obj.birthday=res.data.patient.birthday
                    vm.getLastData(obj)//获取patientCode,followupClass 获取上一次数据
                    if (getLast) {
                        vm.getLastData(obj)//获取patientCode,followupClass 获取上一次数据
                    }
                    vm.setEditBtn()
                } else {
                    top.toastr.error(res.msg);