Merge branch 'master' of gitee.com:darlk/ShengTangManage into develop
This commit is contained in:
@ -15,13 +15,13 @@
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="年龄" prop="age" >
|
||||
<el-input type="number" v-model="form.age" placeholder="请输入年龄" autocomplete="off" ></el-input>
|
||||
<el-input type="number" v-model="form.age" placeholder="请输入年龄(整数)" autocomplete="off" ></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="身高(厘米)" prop="tall" >
|
||||
<el-input type="number" v-model="form.tall" placeholder="请输入身高" autocomplete="off" ></el-input>
|
||||
<el-input type="number" v-model="form.tall" placeholder="请输入身高(整数)" autocomplete="off" ></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="体重(斤)" prop="weight" >
|
||||
<el-input type="number" v-model="form.weight" placeholder="请输入体重" autocomplete="off" ></el-input>
|
||||
<el-input v-model="form.weight" placeholder="请输入体重(可保留一位小数)" autocomplete="off" ></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="调理项目" prop="conditioningProjectId">
|
||||
<el-select v-model="form.conditioningProjectId" filterable clearable placeholder="请选择">
|
||||
|
@ -46,10 +46,10 @@
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<p class="p_title_2">4、生食果蔬状况</p>
|
||||
<el-form-item :label="'(1) 平均每周吃生/拌菜几次'" prop="vegetablesNum" class="margin-left">
|
||||
<el-form-item :label="'(1) 平均每周吃生蔬菜几次'" prop="vegetablesNum" class="margin-left">
|
||||
<el-input-number v-model="form.vegetablesNum" :step="1" :min="0"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item :label="'(2) 每周吃生/拌菜的频次'" prop="vegetablesRateType" class="margin-left">
|
||||
<el-form-item :label="'(2) 每周吃生蔬菜的频次'" prop="vegetablesRateType" class="margin-left">
|
||||
<el-radio-group v-model="form.vegetablesRateType">
|
||||
<el-radio v-for="(item,index) in healthyData['vegetablesRateTypeArray']" :label="item.value" :key="index">{{item.name}}</el-radio>
|
||||
</el-radio-group>
|
||||
|
@ -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 v-hasPermi="['custom:healthy:edit']" type="primary" v-show="dataType == 0" @click="handleEditHealthyClick()" 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>
|
||||
</div>
|
||||
<!-- 客户健康评估 -->
|
||||
@ -14,6 +15,15 @@
|
||||
<p class="p_title_1" style="margin-top: 5px;">{{titleArray[index]}}</p>
|
||||
<table-detail-message :data="item" ></table-detail-message>
|
||||
</div>
|
||||
<!-- 备注 -->
|
||||
<el-table :data="remarkList" :show-header="false" border :cell-style="remarkColumnStyle" style="width: 100%;">
|
||||
<el-table-column width="140" prop="remarkTitle">
|
||||
</el-table-column>
|
||||
<el-table-column prop="remarkValue">
|
||||
<template slot-scope="scope">
|
||||
<auto-hide-message :data="scope.row.remarkValue" :maxLength="100"/></template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- 其他信息 -->
|
||||
<div style="height:400px;overflow: auto">
|
||||
@ -59,7 +69,8 @@
|
||||
</div>
|
||||
<!-- 编辑 -->
|
||||
<physicalSigns-edit ref="physicalSignsEditDialog" @refreshHealthyData="getCustomerHealthyByCusId()"></physicalSigns-edit>
|
||||
|
||||
<!-- 编辑备注 -->
|
||||
<physicalSigns-remark ref="physicalSignsRemarkDialog" @refreshHealthyData="getCustomerHealthyByCusId()"></physicalSigns-remark>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
@ -69,13 +80,14 @@ import AutoHideMessage from "@/components/AutoHideMessage";
|
||||
import * as healthyData from "@/utils/healthyData";
|
||||
import Clipboard from 'clipboard';
|
||||
import PhysicalSignsEdit from "@/components/PhysicalSignsEdit";
|
||||
|
||||
import PhysicalSignsRemark from "@/components/PhysicalSignsRemark";
|
||||
export default {
|
||||
name: "PhysicalSignsDialog",
|
||||
components: {
|
||||
"auto-hide-message": AutoHideMessage,
|
||||
"table-detail-message": TableDetailMessage,
|
||||
"physicalSigns-edit":PhysicalSignsEdit
|
||||
"physicalSigns-edit":PhysicalSignsEdit,
|
||||
"physicalSigns-remark":PhysicalSignsRemark
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -86,6 +98,7 @@ export default {
|
||||
dataList: [],
|
||||
dataType: 0,
|
||||
healthyData: null,
|
||||
remarkList:[{"remarkTitle": "备注信息", "remarkValue": ""}],
|
||||
// 体征标题
|
||||
signTitleData: [
|
||||
["创建时间", "姓名", "年龄"],
|
||||
@ -127,8 +140,8 @@ export default {
|
||||
],
|
||||
[
|
||||
["早餐习惯","早餐吃的食物","午餐习惯"],["晚餐习惯","正餐中素菜占比","最常吃的肉类"],
|
||||
["晚餐时间","每周吃夜宵次数","夜宵通常吃的食物"],["食物的冷热偏好","食物的口味偏好","平均每周吃生菜几次"],
|
||||
["每周吃生菜的频次类型","平均每天吃水果次数","吃水果的时间段"],["平时吃水果的频次","一餐吃几碗饭","吃几成饱"],
|
||||
["晚餐时间","每周吃夜宵次数","夜宵通常吃的食物"],["食物的冷热偏好","食物的口味偏好","平均每周吃生蔬菜几次"],
|
||||
["每周吃生蔬菜的频次类型","平均每天吃水果次数","吃水果的时间段"],["平时吃水果的频次","一餐吃几碗饭","吃几成饱"],
|
||||
["吃饭速度","饮食特点","常吃的零食"],["有无服用营养保健品","营养保健品品牌名","营养保健品产品名"],
|
||||
["服用营养保健品频次","忌口过敏食物",""]
|
||||
],
|
||||
@ -204,13 +217,21 @@ export default {
|
||||
return "background:#ffffff;";
|
||||
}
|
||||
},
|
||||
// 自定义备注列背景色
|
||||
remarkColumnStyle({ row, column, rowIndex, columnIndex }) {
|
||||
if (columnIndex % 2 === 0) {
|
||||
//第三第四列的背景色就改变了2和3都是列数的下标
|
||||
return "background:#f3f6fc;font-weight:bold";
|
||||
} else {
|
||||
return "background:#ffffff;";
|
||||
}
|
||||
},
|
||||
showDialog(data) {
|
||||
this.data = data;
|
||||
this.title = `「${data.name}」客户健康评估信息`;
|
||||
this.getCustomerHealthyByCusId();
|
||||
},
|
||||
getCustomerHealthyByCusId(){
|
||||
|
||||
getCustomerPhysicalSignsByCusId(this.data.id).then((res) => {
|
||||
this.showFlag = false;
|
||||
if (res.data.customerHealthy) {
|
||||
@ -218,6 +239,7 @@ export default {
|
||||
this.dataType = res.data.type;
|
||||
if(this.dataType == 0){
|
||||
this.healthyData = Object.assign({}, res.data.customerHealthy);
|
||||
this.remarkList[0].remarkValue = this.healthyData.remark;
|
||||
this.getDataListByHealthyMessage(res.data.customerHealthy);
|
||||
}else{
|
||||
this.getDataListBySignMessage(res.data.customerHealthy)
|
||||
@ -443,6 +465,9 @@ export default {
|
||||
handleEditHealthyClick() {
|
||||
//console.log(JSON.stringify(this.healthyData));
|
||||
this.$refs["physicalSignsEditDialog"].showDialog(this.data, this.healthyData);
|
||||
},
|
||||
handleEditRemarkClick(){
|
||||
this.$refs["physicalSignsRemarkDialog"].showDialog(this.data, this.healthyData);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -20,7 +20,7 @@
|
||||
<healthy-form7 v-show="stepArray[6]" :form.sync="form"></healthy-form7>
|
||||
<healthy-form8 v-show="stepArray[7]" :flag="1" :form.sync="form"></healthy-form8>
|
||||
<edit-file v-show="stepArray[8]" ref="editFile" :form.sync="form"></edit-file>
|
||||
<el-form-item style="text-align: center; margin: 30px auto" >
|
||||
<el-form-item style="text-align: center; margin: 30px auto" v-show="submitShow">
|
||||
<el-button type="primary" @click="submit()" style="width: 40%" >提交</el-button>
|
||||
<el-button @click="onClosed()" style="width: 40%" >取消</el-button>
|
||||
</el-form-item>
|
||||
@ -61,6 +61,7 @@ export default {
|
||||
healthyData:healthyData,
|
||||
showModuleArray:[0],
|
||||
stepArray: [true,false,false,false,false,false,false,false,false],
|
||||
submitShow: true,
|
||||
visible: false,
|
||||
title: "",
|
||||
data: undefined,
|
||||
@ -90,7 +91,7 @@ export default {
|
||||
{
|
||||
required: true,
|
||||
trigger: "blur",
|
||||
pattern: /^[1-9]\d*$/,
|
||||
pattern: /^(\d+)(\.\d{1})?$/,
|
||||
message: "体重格式不正确",
|
||||
},
|
||||
],
|
||||
@ -162,12 +163,14 @@ export default {
|
||||
});
|
||||
},
|
||||
changeShowModule(){
|
||||
// console.log("---------------");
|
||||
let allShow = false;
|
||||
for(var i = 0; i < this.stepArray.length; i++){
|
||||
let flag = this.showModuleArray.find((opt) => opt === i);
|
||||
// console.log(flag != null && flag != undefined);
|
||||
this.$set(this.stepArray, i, (flag != null && flag != undefined));
|
||||
let showFlag = flag != null && flag != undefined
|
||||
this.$set(this.stepArray, i, showFlag);
|
||||
allShow = showFlag ? showFlag : allShow;
|
||||
}
|
||||
this.submitShow = allShow;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
88
stdiet-ui/src/components/PhysicalSignsRemark/index.vue
Normal file
88
stdiet-ui/src/components/PhysicalSignsRemark/index.vue
Normal 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="remark" >
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="5"
|
||||
maxlength="300"
|
||||
show-word-limit
|
||||
placeholder="请输入备注"
|
||||
v-model="form.remark">
|
||||
</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: "PhysicalSignsRemark",
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
title: "",
|
||||
data: undefined,
|
||||
form: {
|
||||
id: null,
|
||||
remark: null
|
||||
},
|
||||
rules: {
|
||||
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
showDialog(data, healthy) {
|
||||
this.data = data;
|
||||
this.title = "修改"+`「${data.name}」`+"备注";
|
||||
this.form.id = healthy.id;
|
||||
this.form.remark = healthy.remark;
|
||||
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>
|
||||
.margin-top-20{
|
||||
margin-top:20px;
|
||||
}
|
||||
.p_title_1{
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
margin-top: 20px;
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user