健康评估报告

This commit is contained in:
xiezhijun
2021-02-27 16:55:31 +08:00
parent 488a149ec3
commit 5de80fd57f
11 changed files with 263 additions and 45 deletions

View File

@ -3,7 +3,8 @@
<div v-if="showFlag">
<div style="float:right;margin-top:-10px;margin-bottom: 10px;" v-show="dataList.length > 0">
<!-- 只有新版健康评估信息才可修改旧的体征数据不支持修改 -->
<el-button type="info" v-show="dataType == 0" @click="generateReport()" plain>生成报告</el-button>
<el-button type="info" v-show="dataType == 0" @click="generateReport()" plain>下载报告</el-button>
<el-button type="info" v-show="dataType == 0" @click="handleEditGuidanceClick()" plain>减脂指导</el-button>
<el-button v-hasPermi="['custom:healthy:edit']" type="info" v-show="dataType == 0" @click="handleEditRemarkClick()" plain>修改备注</el-button>
<el-button v-hasPermi="['custom:healthy:edit']" type="warning" v-show="dataType == 0" @click="handleEditHealthyClick()" plain>修改信息</el-button>
<el-button type="danger" v-hasPermi="['custom:healthy:remove']" @click="handleDelete()" plain>删除信息</el-button>
@ -25,6 +26,15 @@
<auto-hide-message :data="scope.row.remarkValue" :maxLength="100"/></template>
</el-table-column>
</el-table>
<!-- 指导 -->
<el-table :data="guidanceList" :show-header="false" border :cell-style="remarkColumnStyle" style="width: 100%;">
<el-table-column width="140" prop="guidanceTitle">
</el-table-column>
<el-table-column prop="guidanceValue">
<template slot-scope="scope">
<auto-hide-message :data="scope.row.guidanceValue" :maxLength="100"/></template>
</el-table-column>
</el-table>
</div>
<!-- 其他信息 -->
<div style="height:400px;overflow: auto">
@ -72,6 +82,8 @@
<physicalSigns-edit ref="physicalSignsEditDialog" @refreshHealthyData="getCustomerHealthyByCusId()"></physicalSigns-edit>
<!-- 编辑备注 -->
<physicalSigns-remark ref="physicalSignsRemarkDialog" @refreshHealthyData="getCustomerHealthyByCusId()"></physicalSigns-remark>
<!-- 编辑减脂指导 -->
<physicalSigns-guidance ref="physicalSignsGuidanceDialog" @refreshHealthyData="getCustomerHealthyByCusId()"></physicalSigns-guidance>
</el-dialog>
</template>
<script>
@ -83,13 +95,15 @@ import * as healthyData from "@/utils/healthyData";
import Clipboard from 'clipboard';
import PhysicalSignsEdit from "@/components/PhysicalSignsEdit";
import PhysicalSignsRemark from "@/components/PhysicalSignsRemark";
import PhysicalSignsGuidance from "@/components/PhysicalSignsGuidance";
export default {
name: "PhysicalSignsDialog",
components: {
"auto-hide-message": AutoHideMessage,
"table-detail-message": TableDetailMessage,
"physicalSigns-edit":PhysicalSignsEdit,
"physicalSigns-remark":PhysicalSignsRemark
"physicalSigns-remark":PhysicalSignsRemark,
"physicalSigns-guidance":PhysicalSignsGuidance
},
data() {
return {
@ -101,6 +115,7 @@ export default {
dataType: 0,
healthyData: null,
remarkList:[{"remarkTitle": "备注信息", "remarkValue": ""}],
guidanceList:[{"guidanceTitle": "减脂指导", "guidanceValue": ""}],
// 体征标题
signTitleData: [
["创建时间", "姓名", "年龄"],
@ -242,6 +257,7 @@ export default {
if(this.dataType == 0){
this.healthyData = Object.assign({}, res.data.customerHealthy);
this.remarkList[0].remarkValue = this.healthyData.remark;
this.guidanceList[0].guidanceValue = this.healthyData.guidance;
this.getDataListByHealthyMessage(res.data.customerHealthy);
}else{
this.getDataListBySignMessage(res.data.customerHealthy)
@ -362,7 +378,7 @@ export default {
});
}
detailHealthy.motion = this.trimComma(motionStr + (detailHealthy.otherMotionClassify ? ( ""+ detailHealthy.otherMotionClassify) : ""));
detailHealthy.motionField += this.trimComma(detailHealthy.otherMotionField ? (""+detailHealthy.otherMotionField) : "");
detailHealthy.motionField = this.trimComma(detailHealthy.motionField + (detailHealthy.otherMotionField ? (""+detailHealthy.otherMotionField) : ""));
detailHealthy.sleepDrugFlag = detailHealthy.sleepDrugFlag == 1 ? "有" : "无";
detailHealthy.stayupLateFlag = detailHealthy.stayupLateFlag == 1 ? "有" : "无";
detailHealthy.stayupLateWeekNum += "次/周";
@ -374,14 +390,13 @@ export default {
}*/
physicalSigns += "" + (detailHealthy.otherPhysicalSigns ? detailHealthy.otherPhysicalSigns : "");
detailHealthy.physicalSigns = this.trimComma(physicalSigns);
detailHealthy.familyIllnessHistory += this.trimComma(detailHealthy.otherFamilyIllnessHistory ? ("" + detailHealthy.otherFamilyIllnessHistory) : "");
detailHealthy.operationHistory += this.trimComma(detailHealthy.otherOperationHistory ? ("" + detailHealthy.otherOperationHistory) : "");
detailHealthy.familyIllnessHistory = this.trimComma(detailHealthy.familyIllnessHistory + ""+ (detailHealthy.otherFamilyIllnessHistory ? detailHealthy.otherFamilyIllnessHistory : ""));
detailHealthy.operationHistory = this.trimComma(detailHealthy.operationHistory + ""+ (detailHealthy.otherOperationHistory ? detailHealthy.otherOperationHistory : ""));
detailHealthy.nearOperationFlag = detailHealthy.nearOperationFlag == 1 ? "有" : "无";
detailHealthy.longEatDrugFlag = detailHealthy.longEatDrugFlag == 1 ? "有" : "无";
detailHealthy.longEatDrugClassify += detailHealthy.otherLongEatDrugClassify ? ("" + detailHealthy.otherLongEatDrugClassify) : "";
detailHealthy.longEatDrugClassify = this.trimComma(detailHealthy.longEatDrugClassify + "" + (detailHealthy.otherLongEatDrugClassify ? detailHealthy.otherLongEatDrugClassify : ""));
detailHealthy.allergyFlag = detailHealthy.allergyFlag == 1 ? "有" : "无";
detailHealthy.allergen += detailHealthy.otherAllergen ? ("" +detailHealthy.otherAllergen) : "";
detailHealthy.allergen = this.trimComma(detailHealthy.allergen);
detailHealthy.allergen = this.trimComma(detailHealthy.allergen + "" + (detailHealthy.otherAllergen ? detailHealthy.otherAllergen : ""));
let medicalReportPathArray = detailHealthy.medicalReport ? detailHealthy.medicalReport.split(",") : [];
let medicalReportNameArray = detailHealthy.medicalReportName ? detailHealthy.medicalReportName.split(",") : [];
this.medicalReportPathArray = medicalReportPathArray;
@ -432,12 +447,26 @@ export default {
this.downloadResource(fileName);
},
generateReport(){
//this.detailHealthy.customerId = this.data.id;
generateHealthyReport(this.detailHealthy).then((res) => {
if(res.code == 200 && res.path != null){
this.download(res.path);
}
});
let data = this.detailHealthy;
if(!this.guidanceList[0].guidanceValue || this.guidanceList[0].guidanceValue.length == 0){
this.$confirm("该客户还未添加减脂指导,是否确认下载报告?", "警告", {
confirmButtonText: "确定", cancelButtonText: "取消", type: "warning"
})
.then(function(){
return generateHealthyReport(data);
})
.then((response) => {
if(response.code == 200 && response.path != null){
this.download(response.path);
}
}).catch(function () {});
}else{
generateHealthyReport(data).then((res) => {
if(res.code == 200 && res.path != null){
this.download(res.path);
}
});
}
},
trimComma(str){
if(str.startsWith("") || str.startsWith(",")){
@ -480,7 +509,11 @@ export default {
},
handleEditRemarkClick(){
this.$refs["physicalSignsRemarkDialog"].showDialog(this.data, this.healthyData);
},
handleEditGuidanceClick(){
this.$refs["physicalSignsGuidanceDialog"].showDialog(this.data, this.healthyData);
}
}
};
</script>

View File

@ -0,0 +1,88 @@
<template>
<el-dialog :visible.sync="visible" :title="title" width="500px" append-to-body @closed="onClosed">
<el-form ref="form" :model="form" :rules="rules" label-position="top" label-width="100px">
<el-form-item label="" prop="guidance" >
<el-input
type="textarea"
:rows="8"
maxlength="300"
show-word-limit
placeholder="请输入减脂指导"
v-model="form.guidance">
</el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submit()"> </el-button>
<el-button @click="onClosed()"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { getCustomerPhysicalSignsByCusId } from "@/api/custom/customer";
import { updateHealthy } from "@/api/custom/healthy";
export default {
name: "PhysicalSignsGuidance",
components: {
},
data() {
return {
visible: false,
title: "",
data: undefined,
form: {
id: null,
guidance: null
},
rules: {
}
};
},
methods: {
showDialog(data, healthy) {
this.data = data;
this.title = "修改"+`${data.name}`+"减脂指导";
this.form.id = healthy.id;
this.form.guidance = healthy.guidance;
this.visible = true;
},
onClosed() {
this.visible = false;
this.data = null;
},
submit(){
this.$refs.form.validate((valid) => {
if (valid) {
this.editCustomerHealthy();
} else {
this.$message({message: "数据未填写完整", type: "warning"});
}
});
},
editCustomerHealthy(){
updateHealthy(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.onClosed();
this.$emit('refreshHealthyData');
}
}).catch(function() {
console.log("error");
});
}
}
};
</script>
<style scoped>
.margin-top-20{
margin-top:20px;
}
.p_title_1{
font-size: 18px;
font-weight: bold;
margin-top: 20px;
}
</style>