修复健康评估弹窗
This commit is contained in:
@ -114,4 +114,9 @@ public class SysCustomerController extends BaseController {
|
||||
}
|
||||
return AjaxResult.success(sysCustomer);
|
||||
}
|
||||
|
||||
@GetMapping("/physicalSigns/{id}")
|
||||
public AjaxResult getPhysicalSignsById(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(sysCustomerPhysicalSignsService.selectSysCustomerPhysicalSignsByCusId(id));
|
||||
}
|
||||
}
|
@ -22,6 +22,8 @@ public interface SysCustomerPhysicalSignsMapper
|
||||
*/
|
||||
public SysCustomerPhysicalSigns selectSysCustomerPhysicalSignsById(Long id);
|
||||
|
||||
public SysCustomerPhysicalSigns selectSysCustomerPhysicalSignsByCusId(Long id);
|
||||
|
||||
/**
|
||||
* 新增客户体征信息
|
||||
*
|
||||
|
@ -22,6 +22,8 @@ public interface ISysCustomerPhysicalSignsService {
|
||||
*/
|
||||
public SysCustomerPhysicalSigns selectSysCustomerPhysicalSignsById(Long id);
|
||||
|
||||
public SysCustomerPhysicalSigns selectSysCustomerPhysicalSignsByCusId(Long id);
|
||||
|
||||
/**
|
||||
* 新增客户体征信息
|
||||
*
|
||||
|
@ -41,6 +41,11 @@ public class SysCustomerPhysicalSignsServiceImpl implements ISysCustomerPhysical
|
||||
return sysCustomerPhysicalSignsMapper.selectSysCustomerPhysicalSignsById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysCustomerPhysicalSigns selectSysCustomerPhysicalSignsByCusId(Long cusId) {
|
||||
return sysCustomerPhysicalSignsMapper.selectSysCustomerPhysicalSignsByCusId(cusId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增客户体征信息
|
||||
*
|
||||
|
@ -67,6 +67,10 @@
|
||||
<include refid="selectSysCustomerPhysicalSigns"/> where scps.del_flag = 0 and sc.del_flag = 0 and scps.id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectSysCustomerPhysicalSignsByCusId" parameterType="Long" resultMap="SysCustomerSignResult">
|
||||
<include refid="selectSysCustomerPhysicalSigns"/> where scps.del_flag = 0 and sc.del_flag = 0 and scps.customer_id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysCustomerPhysicalSigns" parameterType="SysCustomerPhysicalSigns" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_customer_physical_signs
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
@ -1,63 +1,70 @@
|
||||
import request from '@/utils/request'
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 查询客户信息列表
|
||||
export function listCustomer(query) {
|
||||
return request({
|
||||
url: '/custom/customer/list',
|
||||
method: 'get',
|
||||
url: "/custom/customer/list",
|
||||
method: "get",
|
||||
params: query
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
// 查询客户信息详细
|
||||
export function getCustomer(id) {
|
||||
return request({
|
||||
url: '/custom/customer/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
url: "/custom/customer/" + id,
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
|
||||
// 新增客户信息
|
||||
export function addCustomer(data) {
|
||||
return request({
|
||||
url: '/custom/customer',
|
||||
method: 'post',
|
||||
url: "/custom/customer",
|
||||
method: "post",
|
||||
data: data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
// 修改客户信息
|
||||
export function updateCustomer(data) {
|
||||
return request({
|
||||
url: '/custom/customer',
|
||||
method: 'put',
|
||||
url: "/custom/customer",
|
||||
method: "put",
|
||||
data: data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
// 删除客户信息
|
||||
export function delCustomer(id) {
|
||||
return request({
|
||||
url: '/custom/customer/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
url: "/custom/customer/" + id,
|
||||
method: "delete"
|
||||
});
|
||||
}
|
||||
|
||||
// 导出客户信息
|
||||
export function exportCustomer(query) {
|
||||
return request({
|
||||
url: '/custom/customer/export',
|
||||
method: 'get',
|
||||
url: "/custom/customer/export",
|
||||
method: "get",
|
||||
params: query
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
// 查询客户信息详细
|
||||
export function getCustomerAndSignByPhone(query) {
|
||||
return request({
|
||||
url: '/custom/customer/getCustomerAndSignByPhone',
|
||||
method: 'get',
|
||||
url: "/custom/customer/getCustomerAndSignByPhone",
|
||||
method: "get",
|
||||
params: query
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**获取用户体征信息 */
|
||||
export function getCustomerPhysicalSignsByCusId(id) {
|
||||
return request({
|
||||
url: `/custom/customer/physicalSigns/${id}`,
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
|
142
stdiet-ui/src/components/PhysicalSignsDialog/index.vue
Normal file
142
stdiet-ui/src/components/PhysicalSignsDialog/index.vue
Normal file
@ -0,0 +1,142 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:visible.sync="visible"
|
||||
:title="title"
|
||||
append-to-body
|
||||
@closed="onClosed"
|
||||
>
|
||||
<el-table
|
||||
:show-header="false"
|
||||
:data="dataList"
|
||||
border
|
||||
:cell-style="columnStyle"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column width="120" prop="attr_name_one"> </el-table-column>
|
||||
<el-table-column prop="value_one">
|
||||
<template slot-scope="scope">
|
||||
<auto-hide-message
|
||||
:data="scope.row.value_one == null ? '' : scope.row.value_one + ''"
|
||||
:maxLength="20"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="120" prop="attr_name_two"></el-table-column>
|
||||
<el-table-column prop="value_two">
|
||||
<template slot-scope="scope">
|
||||
<auto-hide-message
|
||||
:data="scope.row.value_two == null ? '' : scope.row.value_two + ''"
|
||||
:maxLength="20"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="120" prop="attr_name_three"></el-table-column>
|
||||
<el-table-column prop="value_three">
|
||||
<template slot-scope="scope">
|
||||
<auto-hide-message
|
||||
:data="
|
||||
scope.row.value_three == null ? '' : scope.row.value_three + ''
|
||||
"
|
||||
:maxLength="20"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { getCustomerPhysicalSignsByCusId } from "@/api/custom/customer";
|
||||
import AutoHideMessage from "@/components/AutoHideMessage";
|
||||
|
||||
export default {
|
||||
name: "PhysicalSignsDialog",
|
||||
components: {
|
||||
"auto-hide-message": AutoHideMessage,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
title: "",
|
||||
dataList: [],
|
||||
// 标题
|
||||
titleData: [
|
||||
["创建时间", "姓名", "年龄"],
|
||||
["性别", "手机号", "身高(cm)"],
|
||||
["体重(斤)", "地域", "病史"],
|
||||
["忌口或过敏源", "便秘", "熬夜失眠"],
|
||||
["经常运动", "饮食方式", "饮食备注"],
|
||||
["饮食特点", "工作职业", "上夜班"],
|
||||
["久坐/运动多", "浑身乏力", "减脂反弹"],
|
||||
["意识到生活习惯是减脂关键", "睡觉时间", "起床时间"],
|
||||
["方便沟通时间", "湿气数据", "气血数据"],
|
||||
["减脂经历", "减脂遇到的困难", "备注"],
|
||||
],
|
||||
// 属性
|
||||
valueData: [
|
||||
["createTime", "name", "age"],
|
||||
["sex", "phone", "tall"],
|
||||
["weight", "position", "singList"],
|
||||
["dishesIngredientId", "constipation", "staylate"],
|
||||
["motion", "makeFoodType", "remarks"],
|
||||
["makeFoodTaste", "vocation", "night"],
|
||||
["walk", "weakness", "rebound"],
|
||||
["crux", "sleepTime", "getupTime"],
|
||||
["connectTime", "bloodData", "moistureDate"],
|
||||
["experience", "difficulty", "comments"],
|
||||
],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 自定义列背景色
|
||||
columnStyle({ row, column, rowIndex, columnIndex }) {
|
||||
if (columnIndex % 2 === 0) {
|
||||
//第三第四列的背景色就改变了2和3都是列数的下标
|
||||
return "background:#f3f6fc;font-weight:bold";
|
||||
} else {
|
||||
return "background:#ffffff;";
|
||||
}
|
||||
},
|
||||
showDialog(data) {
|
||||
this.title = `「${data.name}」客户体征`;
|
||||
getCustomerPhysicalSignsByCusId(data.id).then((res) => {
|
||||
if (!res.data) {
|
||||
this.visible = true;
|
||||
return;
|
||||
}
|
||||
const sign = res.data;
|
||||
sign.sex = sign.sex === 0 ? `男` : "女";
|
||||
sign.position = sign.position === 0 ? `南方` : "北方";
|
||||
sign.signString = sign.signList.join(",");
|
||||
sign.constipation = sign.constipation === 0 ? "是" : "否";
|
||||
sign.staylate = sign.staylate === 0 ? "是" : "否";
|
||||
sign.motion = sign.motion === 0 ? "是" : "否";
|
||||
sign.makeFoodType = sign.makeFoodType === 0 ? `自己做` : "外面吃";
|
||||
sign.makeFoodTaste = sign.makeFoodTaste === 0 ? "清淡" : "重口味";
|
||||
sign.night = sign.night === 0 ? `是` : "否";
|
||||
sign.walk = sign.walk === 0 ? `久坐多` : "走动多";
|
||||
sign.weakness = sign.weakness === 0 ? `是` : "否";
|
||||
sign.rebound = sign.rebound === 0 ? `是` : "否";
|
||||
sign.crux = sign.crux === 0 ? `是` : "否";
|
||||
sign.sleepTime = sign.sleepTime + "点";
|
||||
sign.getupTime = sign.getupTime + "点";
|
||||
sign.connectTime = sign.connectTime + "点";
|
||||
for (let i = 0; i < this.titleData.length; i++) {
|
||||
this.dataList.push({
|
||||
attr_name_one: this.titleData[i][0],
|
||||
value_one: sign[this.valueData[i][0]],
|
||||
attr_name_two: this.titleData[i][1],
|
||||
value_two: sign[this.valueData[i][1]],
|
||||
attr_name_three: this.titleData[i][2],
|
||||
value_three: sign[this.valueData[i][2]],
|
||||
});
|
||||
}
|
||||
|
||||
this.visible = true;
|
||||
});
|
||||
},
|
||||
onClosed() {
|
||||
this.dataList = [];
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
@ -82,6 +82,7 @@
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['custom:customer:add']"
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
@ -91,6 +92,7 @@
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['custom:customer:export']"
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
@ -198,7 +200,7 @@
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['custom:customerCenter:edit']"
|
||||
v-hasPermi="['custom:customer:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button
|
||||
@ -206,7 +208,7 @@
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['custom:customerCenter:remove']"
|
||||
v-hasPermi="['custom:customer:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
@ -308,6 +310,7 @@
|
||||
<order-drawer ref="cusOrderDrawerRef" />
|
||||
<!-- 合同抽屉 -->
|
||||
<!-- 健康评估弹窗 -->
|
||||
<physical-signs-dialog ref="physicalSignsDialogRef" />
|
||||
<!-- 食谱计划抽屉 -->
|
||||
</div>
|
||||
</template>
|
||||
@ -321,16 +324,19 @@ import {
|
||||
listCustomer,
|
||||
updateCustomer,
|
||||
} from "@/api/custom/customer";
|
||||
|
||||
import store from "@/store";
|
||||
|
||||
import { getOptions } from "@/api/custom/order";
|
||||
|
||||
import OrderDrawer from "@/components/OrderDrawer";
|
||||
import PhysicalSignsDialog from "@/components/PhysicalSignsDialog";
|
||||
|
||||
export default {
|
||||
name: "Customer",
|
||||
components: {
|
||||
"order-drawer": OrderDrawer,
|
||||
"physical-signs-dialog": PhysicalSignsDialog,
|
||||
},
|
||||
data() {
|
||||
const userId = store.getters && store.getters.userId;
|
||||
@ -378,7 +384,7 @@ export default {
|
||||
// 表单校验
|
||||
rules: {
|
||||
customer: [
|
||||
// { required: true, message: "客户姓名不能为空", trigger: "blur" },
|
||||
{ required: true, message: "客户姓名不能为空", trigger: "blur" },
|
||||
],
|
||||
phone: [
|
||||
{ required: true, message: "手机号不能为空", trigger: "blur" },
|
||||
@ -476,7 +482,7 @@ export default {
|
||||
console.log(row);
|
||||
},
|
||||
handleOnHealthSignClick(row) {
|
||||
console.log(row);
|
||||
this.$refs["physicalSignsDialogRef"].showDialog(row);
|
||||
},
|
||||
handleOnMenuClick(row) {
|
||||
console.log(row);
|
||||
|
Reference in New Issue
Block a user