客户健康修改
This commit is contained in:
parent
bc63f7bbf4
commit
e53ac00fbd
@ -31,9 +31,13 @@ public class SysCustomerHealthy extends BaseEntity
|
||||
private String phone;
|
||||
|
||||
/** 调理项目id */
|
||||
@Excel(name = "调理项目id")
|
||||
//@Excel(name = "调理项目id")
|
||||
private Long conditioningProjectId;
|
||||
|
||||
/** 调理项目名称 ,非持久化字段*/
|
||||
@Excel(name = "调理项目")
|
||||
private String conditioningProject;
|
||||
|
||||
/** 0男 1女 2未知,默认2 */
|
||||
@Excel(name = "0男 1女 2未知,默认2")
|
||||
private Long sex;
|
||||
@ -1169,6 +1173,14 @@ public class SysCustomerHealthy extends BaseEntity
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getConditioningProject() {
|
||||
return conditioningProject;
|
||||
}
|
||||
|
||||
public void setConditioningProject(String conditioningProject) {
|
||||
this.conditioningProject = conditioningProject;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
@ -7,11 +7,13 @@
|
||||
<resultMap type="SysCustomerHealthy" id="SysCustomerHealthyResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="customerId" column="customer_id" />
|
||||
<!-- 非持久化字段 -->
|
||||
<!-- 非持久化字段,客户姓名 -->
|
||||
<result property="name" column="name"></result>
|
||||
<!-- 非持久化字段 -->
|
||||
<!-- 非持久化字段,客户手机号 -->
|
||||
<result property="phone" column="phone"></result>
|
||||
<result property="conditioningProjectId" column="conditioning_project_id" />
|
||||
<!-- 非持久化字段,调理项目名称 -->
|
||||
<result property="conditioningProject" column="conditioning_project" />
|
||||
<result property="sex" column="sex" />
|
||||
<result property="age" column="age" />
|
||||
<result property="condiment" column="condiment" />
|
||||
@ -107,17 +109,19 @@
|
||||
</sql>
|
||||
|
||||
<select id="selectSysCustomerHealthyList" parameterType="SysCustomerHealthy" resultMap="SysCustomerHealthyResult">
|
||||
<include refid="selectSysCustomerHealthyVo"/>,sc.name,sc.phone
|
||||
<include refid="selectSysCustomerHealthyVo"/>,sc.name,sc.phone,cp.dict_label as conditioning_project
|
||||
from sys_customer_healthy as sch
|
||||
left join sys_customer sc on sc.id = sch.customer_id
|
||||
LEFT JOIN sys_customer sc on sc.id = sch.customer_id
|
||||
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'conditioning_project') AS cp ON cp.dict_value = sch.conditioning_project_id
|
||||
where sch.del_flag = 0 and sc.del_flag = 0
|
||||
<if test="conditioningProjectId != null "> and sch.conditioning_project_id = #{conditioningProjectId}</if>
|
||||
</select>
|
||||
|
||||
<select id="selectSysCustomerHealthyById" parameterType="Long" resultMap="SysCustomerHealthyResult">
|
||||
<include refid="selectSysCustomerHealthyVo"/>,sc.name,sc.phone
|
||||
<include refid="selectSysCustomerHealthyVo"/>,sc.name,sc.phone,cp.dict_label as conditioning_project
|
||||
from sys_customer_healthy as sch
|
||||
left join sys_customer sc on sc.id = sch.customer_id
|
||||
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'conditioning_project') AS cp ON cp.dict_value = sch.conditioning_project_id
|
||||
where sch.del_flag = 0 and sc.del_flag = 0 and sch.id = #{id}
|
||||
</select>
|
||||
|
||||
|
177
stdiet-ui/src/utils/healthyData.js
Normal file
177
stdiet-ui/src/utils/healthyData.js
Normal file
@ -0,0 +1,177 @@
|
||||
export const condimentArray = [
|
||||
{"name":"鸡精", "value":"1"},
|
||||
{"name":"耗油", "value":"2"},
|
||||
{"name":"生抽", "value":"3"},
|
||||
{"name":"老抽", "value":"4"},
|
||||
{"name":"香油", "value":"5"},
|
||||
{"name":"浓汤宝", "value":"6"},
|
||||
{"name":"鸡粉", "value":"7"},
|
||||
{"name":"花椒", "value":"8"},
|
||||
{"name":"辣椒油", "value":"9"}
|
||||
]
|
||||
|
||||
export const cookingStyleArray = [
|
||||
{"name":"煎","value":"1"},{"name":"烤","value":"2"},{"name":"炸","value":"3"},{"name":"卤","value":"4"},
|
||||
{"name":"腌","value":"5"},{"name":"腊","value":"6"},{"name":"煲","value":"7"},{"name":"炒","value":"8"},
|
||||
{"name":"蒸","value":"9"},{"name":"刺身","value":"10"},{"name":"水煮","value":"11"}
|
||||
]
|
||||
|
||||
export const cookingStyleRateArray = ["煎","炸","卤","腌","腊","煲"]
|
||||
|
||||
export const washVegetablesStyleArray = [
|
||||
{"name":"先切后洗","value": "1"},{"name":"先洗后切","value": "2"},{"name":"切后浸泡","value": "3"}
|
||||
]
|
||||
|
||||
export const breakfastTypeArray = [
|
||||
{"name":"不吃","value": "1"},{"name":"偶尔吃","value": "2"},{"name":"每天吃","value": "3"}
|
||||
]
|
||||
|
||||
export const lunchTypeArray = [
|
||||
{"name":"外卖","value":"1"},{"name":"自带餐","value":"2"},{"name":"快餐","value":"3"},{"name":"餐厅","value":"4"}
|
||||
]
|
||||
|
||||
export const dinnerArray = [
|
||||
{"name":"餐馆吃","value":"1"},{"name":"在家吃","value":"2"},{"name":"丰盛","value":"3"},{"name":"清淡","value":"4"}
|
||||
]
|
||||
|
||||
export const dietHotAndColdArray = [
|
||||
{"name":"偏冷食","value":"1"},{"name":"偏冷食","value":"2"},{"name":"正常","value":"3"}
|
||||
]
|
||||
|
||||
export const dietFlavorArray = [
|
||||
{"name":"偏油","value":"1"},{"name":"偏咸","value":"2"},{"name":"偏辣","value":"3"},
|
||||
{"name":"偏甜","value":"4"},{"name":"偏酸","value":"5"},{"name":"清淡","value":"6"}
|
||||
]
|
||||
|
||||
export const vegetablesRateTypeArray = [
|
||||
{"name":"每天吃","value":"1"},{"name":"经常吃","value":"2"},{"name":"偶尔吃","value":"3"},{"name":"从不吃","value":"4"}
|
||||
]
|
||||
|
||||
export const fruitsTimeArray = [
|
||||
{"name":"餐前","value":"1"},{"name":"餐后","value":"2"},{"name":"餐间","value":"3"}
|
||||
]
|
||||
|
||||
|
||||
export const fruitsRateArray = [
|
||||
{"name":"每天吃","value":"1"},{"name":"经常吃","value":"2"},{"name":"偶尔吃","value":"3"},{"name":"从不吃","value":"4"}
|
||||
]
|
||||
|
||||
export const eatingSpeedArray = [
|
||||
{"name":"很快","value":"1"},{"name":"偏快","value":"2"},{"name":"正常","value":"3"},{"name":"偏慢","value":"4"}
|
||||
,{"name":"很慢","value":"5"}
|
||||
]
|
||||
|
||||
export const snacksArray = [
|
||||
{"name":"面包","value":"1"},{"name":"蛋糕","value":"2"},{"name":"饼干","value":"3"},{"name":"冰淇淋","value":"4"}
|
||||
,{"name":"糖果","value":"5"},{"name":"巧克力","value":"6"},{"name":"方便面","value":"7"},{"name":"薯条","value":"8"},{"name":"肉干","value":"9"},
|
||||
{"name":"坚果","value":"10"},{"name":"饮料","value":"11"},{"name":"果脯","value":"12"},{"name":"牛奶","value":"13"}
|
||||
]
|
||||
|
||||
|
||||
export const waterTypeArray = [
|
||||
{"name":"冰水","value":"1"},{"name":"温水","value":"2"},{"name":"常温水","value":"3"}
|
||||
]
|
||||
|
||||
|
||||
export const waterHabitArray = [
|
||||
{"name":"均匀地喝","value":"1"},{"name":"餐前多喝","value":"2"},{"name":"餐后多喝","value":"3"},{"name":"餐间多喝","value":"4"},
|
||||
{"name":"随时喝","value":"5"}
|
||||
]
|
||||
|
||||
export const drinksNumArray = ["老火汤","咖啡","浓茶","奶茶","冷饮","碳酸饮料","甜饮料","鲜榨果汁"]
|
||||
|
||||
|
||||
export const drinkWineFlagArray = [
|
||||
{"name":"经常饮酒","value": "1"},{"name":"不饮酒","value": "2"},{"name":"偶尔","value": "3"}
|
||||
]
|
||||
|
||||
|
||||
export const drinkWineClassifyArray = [
|
||||
{"name":"白酒","value": "1"},{"name":"红酒","value": "2"},{"name":"啤酒","value": "3"}
|
||||
]
|
||||
|
||||
export const drinkWineAmountArray = ["白酒","啤酒","红酒"]
|
||||
|
||||
export const drinkWineAmountUnitArray = ["两","瓶","毫升"]
|
||||
|
||||
export const smokeRateArray = ["每天抽烟","烟龄","已戒烟"]
|
||||
export const smokeRateUnitArray = ["次","年","年"]
|
||||
|
||||
export const workTypeArray = [
|
||||
{"name":"工作时间长","value": "1"},{"name":"久坐","value": "2"},{"name":"久站","value": "3"},
|
||||
{"name":"走动多","value": "4"},{"name":"强度大","value": "5"},{"name":"用电脑多","value": "6"},{"name":"体力工作多","value": "7"}
|
||||
]
|
||||
|
||||
export const defecationTimeArray = [
|
||||
{"name":"上午","value": "1"},{"name":"中午","value": "2"},{"name":"晚上","value": "3"}
|
||||
]
|
||||
|
||||
export const aerobicMotionClassifyArray = [
|
||||
{"name":"跳绳","value": "1"},{"name":"跑步","value": "2"},{"name":"游泳","value": "3"}
|
||||
]
|
||||
export const anaerobicMotionClassifyArray = [
|
||||
{"name":"撸铁","value": "1"},{"name":"俯卧撑","value": "2"}
|
||||
]
|
||||
|
||||
export const anaerobicAerobicMotionClassifyArray = [
|
||||
{"name":"拳击","value": "1"},{"name":"瑜伽","value": "2"}
|
||||
]
|
||||
|
||||
export const motionFieldArray = [
|
||||
{"name":"居家","value": "1"},{"name":"健身房","value": "2"},{"name":"户外","value": "3"}, {"name":"健身房","value": "4"}
|
||||
]
|
||||
|
||||
export const sleepQualityArray = [
|
||||
{"name":"好","value": "1"},{"name":"一般","value": "2"},{"name":"入睡难","value": "3"},
|
||||
{"name":"失眠","value": "4"},{"name":"易醒","value": "5"},{"name":"多梦","value": "6"}
|
||||
]
|
||||
|
||||
export const familyIllnessHistoryArray = [
|
||||
{"name":"高血压病","value": "1"},{"name":"脑卒中","value": "2"},{"name":"冠心病","value": "3"},
|
||||
{"name":"外周血管病","value": "4"},{"name":"心力衰竭","value": "5"},{"name":"冠心病","value": "6"},
|
||||
{"name":"肥胖症","value": "7"},{"name":"慢性肾脏疾病","value": "8"},{"name":"骨质疏松","value": "9"},
|
||||
{"name":"痛风","value": "10"},{"name":"精神疾病","value": "11"},{"name":"恶性肿瘤","value": "12"},
|
||||
{"name":"慢性阻塞性肺病","value": "13"},{"name":"风湿性免疫性疾病","value": "14"},
|
||||
]
|
||||
|
||||
export const operationHistoryArray = [
|
||||
{"name":"头颅(含脑)","value": "1"},{"name":"眼","value": "2"},{"name":"耳鼻咽喉","value": "3"},
|
||||
{"name":"颌面部及口腔","value": "4"},{"name":"颈部或甲状腺","value": "5"},{"name":"胸部(含肺部)","value": "6"},
|
||||
{"name":"心脏(含心脏介入)","value": "7"},{"name":"外周血管","value": "8"},{"name":"胃肠","value": "9"},
|
||||
{"name":"肝胆","value": "10"},{"name":"肾脏","value": "11"},{"name":"脊柱","value": "12"},
|
||||
{"name":"四肢及关节","value": "13"},{"name":"前列腺","value": "14"},{"name":"妇科","value": "15"},{"name":"乳腺","value": "16"}
|
||||
,{"name":"膀胱","value": "17"}
|
||||
]
|
||||
|
||||
export const longEatDrugClassifyArray = [
|
||||
{"name":"降压药","value": "1"},{"name":"降糖药","value": "2"},{"name":"降尿酸药","value": "3"},
|
||||
{"name":"抗心律失常药","value": "4"},{"name":"缓解哮喘药物","value": "5"},{"name":"抗压郁药物","value": "6"},
|
||||
{"name":"雌激素类药物","value": "7"},{"name":"利尿剂","value": "8"},{"name":"中草药","value": "9"},
|
||||
{"name":"避孕药","value": "10"},{"name":"强的松类药物","value": "11"},{"name":"镇静剂或安眠药","value": "12"},
|
||||
{"name":"调值药(降脂药)","value": "13"},{"name":"解热镇痛药(如布洛芬等)","value": "14"}
|
||||
]
|
||||
|
||||
export const allergenArray = [
|
||||
{"name":"青霉素","value": "1"},{"name":"磺胺类","value": "2"},{"name":"链霉素","value": "3"},
|
||||
{"name":"头孢类","value": "4"},{"name":"鸡蛋","value": "5"},{"name":"牛奶","value": "6"},
|
||||
{"name":"海鲜","value": "7"},{"name":"花粉或尘螨","value": "8"},{"name":"粉尘","value": "9"},
|
||||
{"name":"洗洁剂","value": "10"},{"name":"化妆品","value": "11"}
|
||||
]
|
||||
|
||||
//需要将数组转成字符串的属性名称,包含对象数组、字符串数组
|
||||
export const arrayName = [
|
||||
"condiment","cookingStyle","cookingStyleRate", "washVegetablesStyle","lunchType","dinner","dietFlavor",
|
||||
"snacks","waterType","waterHabit","drinksNum","drinkWineClassify","drinkWineAmount","smokeRate",
|
||||
"workType","defecationTime","aerobicMotionClassify","anaerobicMotionClassify","anaerobicAerobicMotionClassify",
|
||||
"motionField","sleepQuality", "familyIllnessHistory", "operationHistory", "longEatDrugClassify", "allergen", "medicalReport"
|
||||
]
|
||||
|
||||
//需要将数字下标转成中文含义的属性名
|
||||
export const needAttrName = [
|
||||
"condiment","cookingStyle", "washVegetablesStyle","breakfastType","lunchType","dinner","dietFlavor","vegetablesRateType","dietHotAndCold",
|
||||
"fruitsTime","fruitsRate","eatingSpeed",
|
||||
"snacks","waterType","waterHabit","drinkWineFlag","drinkWineClassify",
|
||||
"workType","defecationTime","aerobicMotionClassify","anaerobicMotionClassify","anaerobicAerobicMotionClassify",
|
||||
"motionField","sleepQuality", "familyIllnessHistory", "operationHistory", "longEatDrugClassify", "allergen"
|
||||
]
|
||||
|
@ -69,7 +69,7 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini"
|
||||
><a href="http://sign.shengtangdiet.com/question" target='_blank'>营养体征调查</a></a></el-button>
|
||||
><a href="http://sign.shengtangdiet.com/question" target='_blank'>营养体征调查</a></el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="调理项目id" prop="conditioningProjectId">
|
||||
<!--<el-form-item label="调理项目" prop="conditioningProjectId">
|
||||
<el-input
|
||||
v-model="queryParams.conditioningProjectId"
|
||||
placeholder="请输入调理项目id"
|
||||
placeholder="请输入调理项目"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
@ -13,11 +13,11 @@
|
||||
<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>
|
||||
</el-form-item>
|
||||
</el-form-item>-->
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<!--<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@ -25,8 +25,8 @@
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['custom:healthy:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
</el-col>-->
|
||||
<!--<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
icon="el-icon-edit"
|
||||
@ -35,8 +35,8 @@
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['custom:healthy:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
</el-col>-->
|
||||
<!--<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@ -54,18 +54,34 @@
|
||||
@click="handleExport"
|
||||
v-hasPermi="['custom:healthy:export']"
|
||||
>导出</el-button>
|
||||
</el-col>-->
|
||||
<el-col :span="1.5" title="客户健康评估表链接">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini"
|
||||
><a href="http://sign.shengtangdiet.com/subhealthyInvestigation" target='_blank'>客户健康评估表</a></el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="healthyList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="调理项目id" align="center" prop="id" />
|
||||
<el-table-column label="客户ID" align="center" prop="customerId" />
|
||||
<el-table-column label="调理项目id" align="center" prop="conditioningProjectId" />
|
||||
<el-table-column label="0男 1女 2未知,默认2" align="center" prop="sex" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime"fixed="left">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="调理项目" align="center" prop="conditioningProject" fixed="left"/>
|
||||
<el-table-column label="姓名" align="center" prop="name" fixed="left"/>
|
||||
<el-table-column label="手机号" align="center" prop="phone" fixed="left"/>
|
||||
<el-table-column label="性别" align="center" prop="sex" >
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.sex == 0 ? `男` : '女'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="年龄" align="center" prop="age" />
|
||||
<el-table-column label="调味品种类,使用 , 隔开" align="center" prop="condiment" />
|
||||
<!--<el-table-column label="调味品种类,使用 , 隔开" align="center" prop="condiment" />
|
||||
<el-table-column label="其他调味品种类" align="center" prop="otherCondiment" />
|
||||
<el-table-column label="喜好的烹调方式,使用 , 隔开" align="center" prop="cookingStyle" />
|
||||
<el-table-column label="烹调方式对应频次,每周几次,使用 , 隔开" align="center" prop="cookingStyleRate" />
|
||||
@ -145,23 +161,30 @@
|
||||
<el-table-column label="过敏症状" align="center" prop="allergySituation" />
|
||||
<el-table-column label="过敏源,使用,隔开" align="center" prop="allergen" />
|
||||
<el-table-column label="其他过敏源" align="center" prop="otherAllergen" />
|
||||
<el-table-column label="体检报告" align="center" prop="medicalReport" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column label="体检报告" align="center" prop="medicalReport" />-->
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120" fixed="right" >
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
<!--<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['custom:healthy:edit']"
|
||||
>修改</el-button>
|
||||
>修改</el-button>-->
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-c-scale-to-original"
|
||||
@click="handleLookDetail(scope.row)"
|
||||
v-hasPermi="['custom:healthy:query']"
|
||||
>查看详情</el-button>
|
||||
<!--<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['custom:healthy:remove']"
|
||||
>删除</el-button>
|
||||
>删除</el-button>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -173,7 +196,6 @@
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改客户健康对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
@ -225,7 +247,7 @@
|
||||
<el-form-item label="晚餐习惯,使用 , 隔开" prop="dinner">
|
||||
<el-input v-model="form.dinner" placeholder="请输入晚餐习惯,使用 , 隔开" />
|
||||
</el-form-item>
|
||||
<el-form-item label="早餐当中素菜占比" prop="vegetableRate">
|
||||
<el-form-item label="正餐中素菜占比" prop="vegetableRate">
|
||||
<el-input v-model="form.vegetableRate" placeholder="请输入早餐当中素菜占比" />
|
||||
</el-form-item>
|
||||
<el-form-item label="最常吃的肉类" prop="commonMeat">
|
||||
@ -450,11 +472,38 @@
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 查看详情 -->
|
||||
<el-dialog title="客户健康评估表" v-if="healthyDetailOpen" :visible.sync="healthyDetailOpen" width="1000px" style="overflow: auto;" append-to-body>
|
||||
<el-table :show-header="false" v-for="(item,index) in healthyDetailList" :data="item" border :cell-style="columnStyle" style="width: 100%;margin-top:20px;">
|
||||
<el-table-column width="140" prop="attr_name_one">
|
||||
</el-table-column>
|
||||
<el-table-column prop="value_one">
|
||||
<template slot-scope="scope">
|
||||
<AutoHideMessage :data="scope.row.value_one == null ? '' : (scope.row.value_one+'')" :maxLength="20"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="140" prop="attr_name_two"></el-table-column>
|
||||
<el-table-column prop="value_two">
|
||||
<template slot-scope="scope">
|
||||
<AutoHideMessage :data="scope.row.value_two == null ? '' : (scope.row.value_two+'')" :maxLength="20"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="140" prop="attr_name_three"></el-table-column>
|
||||
<el-table-column prop="value_three">
|
||||
<template slot-scope="scope">
|
||||
<AutoHideMessage :data="scope.row.value_three == null ? '' : (scope.row.value_three+'')" :maxLength="20"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listHealthy, getHealthy, delHealthy, addHealthy, updateHealthy, exportHealthy } from "@/api/custom/healthy";
|
||||
import AutoHideMessage from "@/components/AutoHideMessage";
|
||||
import * as healthyData from "@/utils/healthyData";
|
||||
|
||||
export default {
|
||||
name: "Healthy",
|
||||
@ -491,22 +540,186 @@
|
||||
vegetableRate: [
|
||||
{ required: true, message: "早餐当中素菜占比不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
},
|
||||
healthyDetailOpen:false,
|
||||
healthyDetailList:[[]],
|
||||
healthyTitleData:[
|
||||
[["创建时间","客户姓名","手机号"],["调理项目","性别","年龄"]],
|
||||
[["调味品种","烹调方式","烹调频次"],["洗菜方式","",""]],
|
||||
[
|
||||
["早餐习惯","早餐吃的食物","午餐习惯"],["晚餐习惯","正餐中素菜占比","最常吃的肉类"],
|
||||
["晚餐时间","每周吃夜宵次数","夜宵通常吃的食物"],["食物的冷热偏好","食物的口味偏好","平均每周吃生菜几次"],
|
||||
["每周吃生菜的频次类型","平均每天吃水果次数","吃水果的时间段"],["平时吃水果的频次","一餐吃几碗饭","吃几成饱"],
|
||||
["吃饭速度","常吃的零食","有无服用营养保健品"],["营养保健品品牌名","营养保健品产品名","服用营养保健品频次"]
|
||||
],
|
||||
[
|
||||
["每天的饮水量","喜欢喝什么水","喝水习惯"],["常喝的饮品的每周频次","是否喝酒","喝酒种类"],["对应酒的量","是否抽烟","抽烟频次和烟龄"],
|
||||
["是否经常抽二手烟","工作行业","工作性质"],["排便次数","排便时间段","排便的形状"],["排便的气味","排便的速度","排便的颜色"]
|
||||
],
|
||||
[
|
||||
["每周运动次数","每次运动的时长","每天运动的时间"],["运动","运动场地","睡觉时间"],["睡眠质量","是否有辅助入睡药物","辅助睡眠类药物名称"],
|
||||
["是否经常熬夜","熬夜频次","家族疾病史"],["手术史","近期是否做过手术","手术恢复情况"],
|
||||
["是否长期服用药物","长期服用的药物","是否出现过过敏症状"],["过敏症状","过敏源",""]
|
||||
]
|
||||
],
|
||||
//健康详情的属性名称,与标题对应,按竖显示
|
||||
healthyValueData:[
|
||||
[["createTime","name","phone"],["conditioningProject","sex","age"]],
|
||||
[["condiment","cookingStyle","cookingStyleRate"],["washVegetablesStyle","",""]],
|
||||
[
|
||||
["breakfastType","breakfastFood","lunchType"],["dinner","vegetableRate","commonMeat"],
|
||||
["dinnerTime","supperNum","supperFood"],["dietHotAndCold","dietFlavor","vegetablesNum"],
|
||||
["vegetablesRateType","fruitsNum","fruitsTime"],["fruitsRate","riceNum","riceNum"],["eatingSpeed","snacks","healthProductsFlag"],
|
||||
["healthProductsBrand","healthProductsName","healthProductsWeekRate"]
|
||||
],
|
||||
[
|
||||
["waterNum","waterType","waterHabit"],["drinksNum","drinkWineFlag","drinkWineClassify"],["drinkWineAmount","smokeFlag","smokeRate"],
|
||||
["secondSmoke","workIndustry","workType"],["defecationNum","defecationTime","defecationShape"],["defecationSmell","defecationSpeed","defecationColor"]
|
||||
],
|
||||
[
|
||||
["motionNum","motionDuration","motionTime"],["motion","motionField","sleepTime"],["sleepQuality","sleepDrugFlag","sleepDrug"],
|
||||
["stayupLateFlag","stayupLateWeekNum","familyIllnessHistory"],["operationHistory","nearOperationFlag","recoveryeSituation"],
|
||||
["longEatDrugFlag","longEatDrugClassify","allergyFlag"],["allergySituation","allergen",""]
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
components: {
|
||||
AutoHideMessage
|
||||
},
|
||||
methods: {
|
||||
/** 查询客户健康列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listHealthy(this.queryParams).then(response => {
|
||||
this.healthyList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 查看按钮操作 */
|
||||
handleLookDetail(row) {
|
||||
const id = row.id || this.ids
|
||||
getHealthy(id).then(response => {
|
||||
let detailHealthy = this.dealHealthy(response.data);
|
||||
//性别
|
||||
detailHealthy.sex = detailHealthy.sex == 0 ? "男" : (detailHealthy.sex == 1 ? "女" : "未知");
|
||||
//调味品
|
||||
detailHealthy.condiment += detailHealthy.otherCondiment ? (","+detailHealthy.otherCondiment) : "";
|
||||
//烹饪频次
|
||||
let cookingStyleRate = "";
|
||||
console.log(detailHealthy.cookingStyleRate);
|
||||
if(detailHealthy.cookingStyleRate != null){
|
||||
detailHealthy.cookingStyleRate.split(",").forEach(function(item, index){
|
||||
cookingStyleRate += (cookingStyleRate != "" ? "," : "") + (healthyData["cookingStyleRateArray"][index])+item +"次";
|
||||
});
|
||||
}
|
||||
detailHealthy.cookingStyleRate = cookingStyleRate;
|
||||
//洗菜方式
|
||||
detailHealthy.washVegetablesStyle += detailHealthy.otherWashVegetablesStyle ? (","+detailHealthy.otherWashVegetablesStyle) : "";
|
||||
//素菜占比
|
||||
detailHealthy.vegetableRate += "成";
|
||||
//零食
|
||||
detailHealthy.snacks += detailHealthy.otherSnacks ? ("," + detailHealthy.otherSnacks) : "";
|
||||
detailHealthy.healthProductsFlag = detailHealthy.healthProductsFlag == 1 ? "有" : "无";
|
||||
detailHealthy.healthProductsWeekRate = detailHealthy.healthProductsDayRate+"次/天,"+detailHealthy.healthProductsWeekRate+"次/周";
|
||||
detailHealthy.waterNum += "毫升";
|
||||
//饮品
|
||||
let drinksNumString = "";
|
||||
if(detailHealthy.drinksNum != null){
|
||||
detailHealthy.drinksNum.split(",").forEach(function(item, index){
|
||||
drinksNumString += (drinksNumString != "" ? "," : "") + (healthyData["drinksNumArray"][index])+item +"次";
|
||||
});
|
||||
}
|
||||
detailHealthy.drinksNum = drinksNumString;
|
||||
detailHealthy.drinkWineClassify += detailHealthy.otherWineClassify ? (","+detailHealthy.otherWineClassify) : "";
|
||||
let drinkWineAmountString = "";
|
||||
if(detailHealthy.drinkWineAmount != null){
|
||||
detailHealthy.drinkWineAmount.split(",").forEach(function(item, index){
|
||||
drinkWineAmountString += (drinkWineAmountString != "" ? "," : "") + (healthyData["drinkWineAmountArray"][index])+item + healthyData["drinkWineAmountUnitArray"][index];
|
||||
});
|
||||
}
|
||||
detailHealthy.drinkWineAmount = drinkWineAmountString;
|
||||
detailHealthy.smokeFlag = detailHealthy.smokeFlag == 1 ? "是" : "否";
|
||||
detailHealthy.secondSmoke = detailHealthy.secondSmoke == 1 ? "是" : "否";
|
||||
|
||||
let smokeRateString = "";
|
||||
if(detailHealthy.smokeRate != null){
|
||||
detailHealthy.smokeRate.split(",").forEach(function(item, index){
|
||||
smokeRateString += (smokeRateString != "" ? "," : "") + (healthyData["smokeRateArray"][index])+item + healthyData["smokeRateUnitArray"][index];
|
||||
});
|
||||
}
|
||||
detailHealthy.smokeRate = smokeRateString;
|
||||
detailHealthy.defecationNum = detailHealthy.defecationNum + "次/天";
|
||||
detailHealthy.motionDuration = detailHealthy.motionDuration +"分钟";
|
||||
|
||||
let motionStr = "";
|
||||
if(detailHealthy.aerobicMotionClassify != null){
|
||||
detailHealthy.aerobicMotionClassify.split(",").forEach(function(item, index){
|
||||
motionStr += item ? ((motionStr != "" ? "," : "") + item) : "";
|
||||
});
|
||||
}
|
||||
if(detailHealthy.anaerobicMotionClassify != null){
|
||||
detailHealthy.anaerobicMotionClassify.split(",").forEach(function(item, index){
|
||||
motionStr += item ? ((motionStr != "" ? "," : "") + item) : "";
|
||||
});
|
||||
}
|
||||
if(detailHealthy.anaerobicAerobicMotionClassify != null){
|
||||
detailHealthy.anaerobicAerobicMotionClassify.split(",").forEach(function(item, index){
|
||||
motionStr += item ? ((motionStr != "" ? "," : "") + item) : "";
|
||||
});
|
||||
}
|
||||
detailHealthy.motion = motionStr + (detailHealthy.otherMotionClassify ? ( ","+ detailHealthy.otherMotionClassify) : "");
|
||||
detailHealthy.motionField += detailHealthy.otherMotionField ? (","+detailHealthy.otherMotionField) : "";
|
||||
|
||||
detailHealthy.sleepDrugFlag = detailHealthy.sleepDrugFlag == 1 ? "有" : "无";
|
||||
detailHealthy.stayupLateFlag = detailHealthy.stayupLateFlag == 1 ? "有" : "无";
|
||||
detailHealthy.stayupLateWeekNum += "次/周";
|
||||
detailHealthy.familyIllnessHistory += detailHealthy.otherFamilyIllnessHistory ? ("," + detailHealthy.otherFamilyIllnessHistory) : "";
|
||||
detailHealthy.operationHistory += detailHealthy.otherOperationHistory ? ("," + detailHealthy.otherOperationHistory) : "";
|
||||
detailHealthy.nearOperationFlag = detailHealthy.nearOperationFlag == 1 ? "有" : "无";
|
||||
|
||||
detailHealthy.longEatDrugFlag = detailHealthy.longEatDrugFlag == 1 ? "有" : "无";
|
||||
detailHealthy.longEatDrugClassify += detailHealthy.otherLongEatDrugClassify ? ("," + detailHealthy.otherLongEatDrugClassify) : "";
|
||||
|
||||
detailHealthy.allergyFlag = detailHealthy.allergyFlag == 1 ? "有" : "无";
|
||||
detailHealthy.allergen += detailHealthy.otherAllergen ? ("," +detailHealthy.otherAllergen) : "";
|
||||
|
||||
for(let i = 0; i < this.healthyTitleData.length; i++){
|
||||
let stepArray = [];
|
||||
for(let j= 0; j < this.healthyTitleData[i].length; j++){
|
||||
stepArray[j] = ({"attr_name_one": this.healthyTitleData[i][j][0],"value_one": detailHealthy[this.healthyValueData[i][j][0]],"attr_name_two": this.healthyTitleData[i][j][1],"value_two": detailHealthy[this.healthyValueData[i][j][1]],"attr_name_three": this.healthyTitleData[i][j][2],"value_three": detailHealthy[this.healthyValueData[i][j][2]]});
|
||||
}
|
||||
this.healthyDetailList[i] = stepArray;
|
||||
}
|
||||
this.healthyDetailOpen = true;
|
||||
});
|
||||
},
|
||||
//健康信息处理
|
||||
dealHealthy(customerHealthy){
|
||||
let array = healthyData["needAttrName"];
|
||||
for(let i = 0; i < array.length; i++){
|
||||
customerHealthy[array[i]] = this.getHealthyStringByArray(array[i]+"Array", customerHealthy[array[i]]);
|
||||
}
|
||||
return customerHealthy;
|
||||
},
|
||||
getHealthyStringByArray(key, valueArray){
|
||||
var str = "";
|
||||
if(valueArray != null && valueArray.split(",").length > 0){
|
||||
valueArray.split(",").forEach(function (item, index) {
|
||||
let data = healthyData[key].find(opt => opt.value == item);
|
||||
if(data != null){
|
||||
str += (str != "" ? "," : "") + data.name;
|
||||
}
|
||||
})
|
||||
}
|
||||
return str;
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
@ -691,7 +904,16 @@
|
||||
}).then(response => {
|
||||
this.download(response.msg);
|
||||
}).catch(function() {});
|
||||
}
|
||||
},
|
||||
// 自定义列背景色
|
||||
columnStyle({ row, column, rowIndex, columnIndex }) {
|
||||
if (columnIndex == 0 || columnIndex == 2 || columnIndex == 4 || columnIndex == 6) {
|
||||
//第三第四列的背景色就改变了2和3都是列数的下标
|
||||
return "background:#f3f6fc;font-weight:bold";
|
||||
}else{
|
||||
return "background:#ffffff;";
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -97,7 +97,7 @@
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item :label="'(4) 正餐荤素中素菜占比几成'" prop="eatSituation" class="margin-left">
|
||||
<el-input-number v-model="form.vegetableRate" :step="1" :min="0"></el-input-number>
|
||||
<el-input-number v-model="form.vegetableRate" :step="1" :min="0" :max="10"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item :label="'(4) 最常吃的肉类'" prop="eatSituation" class="margin-left">
|
||||
<el-input v-model="form.commonMeat" placeholder="请输入肉类名称"></el-input>
|
||||
@ -253,9 +253,9 @@
|
||||
<div class="margin-top-10">
|
||||
<span>红酒</span><el-input-number class="width-50-left-8-right-5" type="number" v-model="form.drinkWineAmount[2]" :step="100" :min="0"></el-input-number><span> 毫升</span>
|
||||
</div>
|
||||
<div class="margin-top-10">
|
||||
<!--<div class="margin-top-10">
|
||||
<span>其他</span><el-input-number class="width-50-left-8-right-5" type="number" v-model="form.drinkWineAmount[3]" :step="100" :min="0"></el-input-number><span> 毫升</span>
|
||||
</div>
|
||||
</div>-->
|
||||
</el-form-item>
|
||||
<p class="p_title_2">4、您的吸烟习惯</p>
|
||||
<el-form-item label="(1) 是否吸烟" prop="smokeFlag" class="margin-left">
|
||||
@ -292,12 +292,12 @@
|
||||
</el-form-item>
|
||||
<p class="p_title_2">4、您的排便状况</p>
|
||||
<el-form-item label="(1) 排便次数" prop="defecationNum" style="padding-top: 10px;">
|
||||
<el-radio-group v-model="form.defecationNum">
|
||||
<!--<el-radio-group v-model="form.defecationNum">
|
||||
<el-radio :label="1" key="1">1次/天</el-radio>
|
||||
<el-radio :label="2" key="2">2次/天</el-radio>
|
||||
<el-radio :label="3" key="3">3次/天</el-radio>
|
||||
</el-radio-group>
|
||||
<div class="margin-top-10"><span>其他次数 </span><el-input-number style="width:35%;margin-right: 10px;" type="number" v-model="form.otherDefecationNum" :step="1" :min="0"></el-input-number><span>次/天</span></div>
|
||||
</el-radio-group>-->
|
||||
<div class="margin-top-10"><span>排便次数 </span><el-input-number style="width:35%;margin-right: 10px;" type="number" v-model="form.defecationNum" :step="1" :min="0"></el-input-number><span>次/天</span></div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="(2) 排便时间" prop="defecationTime" style="padding-top: 10px;">
|
||||
@ -638,7 +638,7 @@ export default {
|
||||
drinkWineClassifyArray:[
|
||||
{"name":"白酒","value": "1"},{"name":"红酒","value": "2"},{"name":"啤酒","value": "3"}
|
||||
],
|
||||
drinkWineAmountArray:["白酒","啤酒","红酒","其他"],
|
||||
drinkWineAmountArray:["白酒","啤酒","红酒"],
|
||||
smokeRateArray:["每天抽烟","烟龄","已戒烟"],
|
||||
workTypeArray:[
|
||||
{"name":"工作时间长","value": "1"},{"name":"久坐","value": "2"},{"name":"久站","value": "3"},
|
||||
@ -712,7 +712,7 @@ export default {
|
||||
dinner:["2"],
|
||||
vegetableRate: 5,
|
||||
commonMeat: null,
|
||||
dinnerTime: "07:00",
|
||||
dinnerTime: "19:00",
|
||||
supperNum:1,
|
||||
supperFood:null,
|
||||
dietHotAndCold: "3",
|
||||
@ -740,7 +740,7 @@ export default {
|
||||
drinkWineFlag: "3",
|
||||
drinkWineClassify:["3"],
|
||||
otherWineClassify: null,
|
||||
drinkWineAmount:[0,0,0,0],
|
||||
drinkWineAmount:[0,0,0],
|
||||
smokeFlag: 0,
|
||||
smokeRate:[0,0,0],
|
||||
secondSmoke: 0,
|
||||
@ -785,7 +785,7 @@ export default {
|
||||
allergySituation: null,
|
||||
allergen:[],
|
||||
otherAllergen:null,
|
||||
fileNameList:[]
|
||||
medicalReport:[]
|
||||
},
|
||||
upload: {
|
||||
// 是否禁用上传
|
||||
@ -842,7 +842,7 @@ export default {
|
||||
"condiment","cookingStyle","cookingStyleRate", "washVegetablesStyle","lunchType","dinner","dietFlavor",
|
||||
"snacks","waterType","waterHabit","drinksNum","drinkWineClassify","drinkWineAmount","smokeRate",
|
||||
"workType","defecationTime","aerobicMotionClassify","anaerobicMotionClassify","anaerobicAerobicMotionClassify",
|
||||
"motionField","sleepQuality", "familyIllnessHistory", "operationHistory", "longEatDrugClassify", "allergen", "fileNameList"
|
||||
"motionField","sleepQuality", "familyIllnessHistory", "operationHistory", "longEatDrugClassify", "allergen", "medicalReport"
|
||||
]
|
||||
|
||||
};
|
||||
@ -859,7 +859,7 @@ export default {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitFlag = true;
|
||||
this.form.fileNameList = [];
|
||||
this.form.medicalReport = [];
|
||||
if(this.upload.fileList.length > 0){
|
||||
this.$refs.upload.submit();
|
||||
}else{
|
||||
@ -955,8 +955,8 @@ export default {
|
||||
// 文件上传成功处理
|
||||
handleFileSuccess(response, file, fileList) {
|
||||
if(response != null && response.code === 200){
|
||||
this.form.fileNameList.push(response.fileName);
|
||||
if(this.form.fileNameList.length === this.upload.fileList.length){
|
||||
this.form.medicalReport.push(response.fileName);
|
||||
if(this.form.medicalReport.length === this.upload.fileList.length){
|
||||
//文件全部上传成功,则调用添加客户信息方法
|
||||
this.addCustomerHealthy();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user