简易问卷优化

Merge pull request  from 德仔/xzj
This commit is contained in:
德仔 2021-07-23 01:17:12 +00:00 committed by Gitee
commit a8ae365ff7
4 changed files with 120 additions and 23 deletions
stdiet-custom/src/main/resources/mapper/custom
stdiet-ui/src
components/SimpleSurveyReport
views/custom/preSaleSurvey
index.vue
simpleSurvey

@ -39,6 +39,10 @@
and question_type = #{questionType}
</if>
<if test="name != null and name != ''"> and (name like concat('%', #{name}, '%') or phone like concat('%',#{name},'%'))</if>
<if test="beginTime != null and endTime != null">
and date_format(create_time,'%Y-%m-%d') >= #{beginTime} and #{endTime} >= date_format(create_time,'%Y-%m-%d')
</if>
order by create_time desc
</select>
<select id="selectSysPreSaleSurveyById" parameterType="Long" resultMap="SysPreSaleSurveyResult">

@ -4,7 +4,7 @@
<div class="report_title">{{reportData.name ? reportData.name : '您的'}}身体评估报告</div>
<div class="report_weight">
<div style="text-align:center">
<span><span class="weight_name">{{reportData.overWeight > 0 ? '超重' : '增重'}}</span>{{Math.abs(reportData.overWeight).toFixed(2)}} </span> <span style="margin-left:30px"><span class="weight_name">标准体重</span>{{reportData.standardWeight.toFixed(2)}} </span>
<span><span class="weight_name">{{reportData.overWeight > 0 ? '超重' : '增重'}}</span>{{Math.abs(reportData.overWeight).toFixed(2)}} </span> <span style="margin-left:8px"><span class="weight_name">标准体重</span>{{reportData.standardWeight.toFixed(2)}} </span>
</div>
</div>
<div>
@ -23,10 +23,16 @@
</div>
<div class="blood_moisture">
<div style="float: left;">
<div class="blood_moisture_title">湿气指数</div><div :class="getBloodMoistureIndexClass(reportData.moistureIndex)"></div>
<div class="blood_moisture_title">湿气指数</div>
<div :class="getBloodMoistureIndexClass(reportData.moistureIndex)">
<span class="blood_moisture_index_span" :style="'margin-left:'+getBloodMoistureIndexClass(reportData.moistureIndex, 2)+'%;'">{{getBloodMoistureIndexClass(reportData.moistureIndex, 1)}}</span>
</div>
</div>
<div style="float: left;margin-top:20px">
<div class="blood_moisture_title">气血指数</div><div :class="getBloodMoistureIndexClass(reportData.bloodIndex)"></div>
<div class="blood_moisture_title">气血指数</div>
<div :class="getBloodMoistureIndexClass(reportData.bloodIndex)">
<span class="blood_moisture_index_span" :style="'margin-left:'+getBloodMoistureIndexClass(reportData.bloodIndex, 2)+'%;'">{{getBloodMoistureIndexClass(reportData.bloodIndex, 1)}}</span>
</div>
</div>
<div class="clear"></div>
@ -63,7 +69,10 @@ export default {
signTypeArray: [],
moistureIndex: 0,
bloodIndex: 0
}
},
//
//1-3
indexRange: [1,4,7]
};
},
components: {
@ -99,16 +108,26 @@ export default {
let signObj = this.physicalSignsList.find((obj) => obj.dictValue === value);
return signObj != null ? signObj.dictLabel : null;
},
getBloodMoistureIndexClass(num){
getBloodMoistureIndexClass(num, type){
let className = "blood_moisture_value";
if(num <= 3){
let spanValue = "";
let marginLeft = 0;
if(num < this.indexRange[0]){
className += " none";
}else if(num < this.indexRange[1]){
spanValue = "低";
marginLeft = 21;
className += " light";
}else if(num <= 6){
}else if(num < this.indexRange[2]){
spanValue = "中";
marginLeft = 55;
className += " moderate";
}else{
spanValue = "高";
marginLeft = 86;
className += " severe";
}
return className;
return (type != undefined && type > 0) ? (type == 1 ? spanValue : marginLeft) : className;
}
},
created() {
@ -149,7 +168,7 @@ export default {
margin-top: 25px;
border-top:2px solid #F1F1F1;
border-bottom:2px solid #F1F1F1;
padding: 0px 10px;
padding: 0px 0px;
}
.weight_name{
@ -158,7 +177,7 @@ export default {
font-weight: 500;
color: #4B8AFF;
line-height: 50px;
margin-right:5px;
margin-right:2px;
}
.weight_value{
@ -194,7 +213,7 @@ export default {
.sign_type_div{
height: 30px;
background: #F1F1F1;
background: #e16664;
border-radius: 24px;
text-align: center;
margin:10px 5px;
@ -208,7 +227,7 @@ export default {
font-size: 15px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #333333;
color: #ffffff;
line-height: 30px;
}
@ -228,23 +247,27 @@ export default {
.blood_moisture_value{
margin-left:10px;
float: left;
width: 220px;
width: 180px;
height:30px;
border-radius: 20px;
}
.clear{ clear:both}
.none{
background: #CCCCCC
}
.light{
background: #20d866;
background: linear-gradient(to right,#37bc02,#e6b46a 33%,#CCCCCC 35%);
}
.moderate{
background: #f0a70b;
background: linear-gradient(to right,#37bc02,#f5b95e 33%, #fa9500 67%,#CCCCCC 67%);
}
.severe{
background: #e94545;
background: linear-gradient(to right,#37bc02,#fa9500,#da302a);
}
.bottom_content{
@ -256,6 +279,12 @@ export default {
text-align:center;
margin-top:20px;
}
.blood_moisture_index_span{
font-size: 16px;
font-family: Source Han Sans CN;
font-weight: 500;
color: #FEFEFF;
line-height: 30px;
}
</style>

@ -9,6 +9,20 @@
size="small"
/>
</el-form-item>
<el-form-item label="日期范围" prop="time">
<el-date-picker
v-model="timeScope"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
:picker-options="timePickerOptions"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@ -237,6 +251,7 @@ import Clipboard from "clipboard";
import AutoHideInfo from "@/components/AutoHideInfo";
import AutoHideMessage from "@/components/AutoHideMessage"
import VueQr from "vue-qr";
import dayjs from "dayjs";
const logo = require("@/assets/logo/logo_b.png");
export default {
name: "PreSaleSurvey",
@ -276,7 +291,13 @@ export default {
simpleSignTypeOption: [],
moistureDataExtendedOption:[],
bloodDataExtendedOption:[],
copyValue: ""
copyValue: "",
timeScope: null,
timePickerOptions: {
disabledDate(time) {
return time.getTime() > dayjs()
},
}
};
},
created() {
@ -300,6 +321,8 @@ export default {
/** 查询简易问卷调查列表 */
getList() {
this.loading = true;
this.queryParams.beginTime = this.timeScope && this.timeScope.length > 0 ? this.timeScope[0] : null;
this.queryParams.endTime = this.timeScope && this.timeScope.length > 0 ? this.timeScope[1] : null;
listPreSaleSurvey(this.queryParams).then(response => {
response.rows.forEach(item => {
item.physicalSignsIdArray = item.physicalSignsId.split(",");
@ -406,6 +429,7 @@ export default {
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.timeScope = null;
this.handleQuery();
},
//
@ -457,7 +481,13 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$confirm('是否确认删除简易问卷调查编号为"' + ids + '"的数据项?', "警告", {
let confirmTitle = "";
if(row != undefined && row.id != undefined){
confirmTitle = '是否确认删除名字为 '+row.name+' 的简易问卷信息?';
}else{
confirmTitle = '是否确认删除所勾选的 '+ids.length+' 条的简易问卷信息?';
}
this.$confirm(confirmTitle, "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"

@ -40,14 +40,25 @@
></el-input>
</el-form-item>
<el-form-item label="8、病史体征(可多选)" prop="physicalSignsIdArray" >
<el-select v-model="form.physicalSignsIdArray" multiple placeholder="请选择">
<el-option
<el-select v-model="form.physicalSignsIdArray" multiple filterable clearable placeholder="请选择病史体征">
<!--<el-option
v-for="physicalSign in physicalSignsList"
:key="physicalSign.dictValue"
:label="physicalSign.dictLabel"
:value="physicalSign.dictValue"
>
</el-option>
</el-option>-->
<el-option-group
v-for="(group,index) in physicalSignsGroupList"
:key="index"
:label="group.label">
<el-option
v-for="(item, j) in group.options"
:key="index+'_'+j"
:label="item.label"
:value="item.value">
</el-option>
</el-option-group>
</el-select>
<div><span class="text-span">其他病史体征</span>
<el-input type="textarea"
@ -122,6 +133,7 @@ export default {
moistureDataList:[],
bloodDataList:[],
physicalSignsList:[],
physicalSignsGroupList:[],
form:{
customerKey: null,
name: "",
@ -244,7 +256,29 @@ export default {
getPhysicalSignsList() {
getDictData("simple_sign_type").then((response) => {
this.physicalSignsList = response.data;
this.physicalSignsGroupList = this.dealSignList(response.data);
});
},
dealSignList(signList){
let result = [];
if(signList == null || signList.length == 0){
return result;
}
let groupObj = {};
let groupLabelArray = [];
signList.forEach(item => {
if(item.remark != null && item.remark != ""){
if(groupLabelArray.indexOf(item.remark) == -1){
groupLabelArray.push(item.remark);
}
groupObj[item.remark] = groupObj[item.remark] == undefined ? [] : groupObj[item.remark];
groupObj[item.remark].push({'value': item.dictValue, 'label': item.dictLabel});
}
});
groupLabelArray.forEach(item => {
result.push({'label': item, 'options': groupObj[item]});
})
return result;
}
},
created() {