234 lines
7.1 KiB
Plaintext
234 lines
7.1 KiB
Plaintext
@page
|
|
@model YBDevice.NWeb.Pages.RegUser.DetailModel
|
|
@{
|
|
}
|
|
<div class="layui-card">
|
|
<div class="layui-card-header layuiadmin-card-header-auto">
|
|
<h3>家庭成员</h3>
|
|
</div>
|
|
<div class="layui-card-body layui-form">
|
|
<table class="layui-table" id="list" lay-filter="list">
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="layui-card">
|
|
<div class="layui-card-header layuiadmin-card-header-auto">
|
|
<h3>测量记录</h3>
|
|
</div>
|
|
<div class="layui-card-body layui-form">
|
|
<div class="layui-inline">
|
|
<div class="layui-input-inline">
|
|
<input type="text" class="layui-input" value="@Model.defaulttime" data-time="ysdatetime" autocomplete="off" name="time" id="time" placeholder="请选择时间" />
|
|
</div>
|
|
</div>
|
|
<div class="layui-inline">
|
|
<button class="btn btn-primary btn-lg js-search" type="button">查询</button>
|
|
</div>
|
|
<table class="layui-table" id="list1" lay-filter="list1">
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<script type="text/html" id="headtpl">
|
|
<img lay-src="{{d.headimg}}" data-src="preview" style="height: 35px; width: 35px; " />
|
|
</script>
|
|
<script type="text/html" id="optpl">
|
|
<a href="#" class="js-detail" title="详情" data-id="{{d.id}}">详情</a>
|
|
</script>
|
|
@section Scripts
|
|
{
|
|
<script type="text/javascript">
|
|
layui.use(['common'], function () {
|
|
var common = layui.common;
|
|
common.initTable({
|
|
url: "/api/result/getuserdatabyuserid?id=" + '@Model.userid',
|
|
method: "post",
|
|
cols:[[
|
|
{
|
|
field: 'headimg', title: '头像', templet: '#headtpl'
|
|
},
|
|
{
|
|
field: 'name', title: '名称'
|
|
},
|
|
{
|
|
field: 'sex', title: '性别', templet: function (d) {
|
|
return GenderType[d.sex];
|
|
}
|
|
},
|
|
{
|
|
field: 'age', title: '年龄'
|
|
},
|
|
{
|
|
field: 'firstresulttime', title: '首次测量'
|
|
},
|
|
{
|
|
field: 'firstweight', title: '首次体重'
|
|
},
|
|
{
|
|
field: 'lastresulttime', title: '最近测量'
|
|
},
|
|
{
|
|
field: 'lastweight', title: '最近体重'
|
|
}
|
|
,
|
|
{
|
|
field: 'todayresultcnt', title: '今日测量'
|
|
}
|
|
,
|
|
{
|
|
field: 'totalresultcnt', title: '累计测量'
|
|
}
|
|
,
|
|
{
|
|
title: '操作', templet: "#optpl", fixed: 'right'
|
|
}
|
|
]]
|
|
});
|
|
var queryparam = [];
|
|
var starttime = $("#time").val();
|
|
if (starttime != "") {
|
|
var times = starttime.split('~');
|
|
queryparam.push({
|
|
"Name": 'createtime',
|
|
"Type": QueryCond.GreaterThanOrEqual,
|
|
"Value": times[0].trim()
|
|
});
|
|
queryparam.push({
|
|
"Name": 'createtime',
|
|
"Type": QueryCond.LessThanOrEqual,
|
|
"Value": times[1].trim()
|
|
});
|
|
}
|
|
common.initTable({
|
|
url: "/api/result/getuserresultbyuserid?id=" + '@Model.userid',
|
|
elem: "#list1",
|
|
where: {
|
|
queryParam: queryparam
|
|
},
|
|
id:"list1",
|
|
method: "post",
|
|
cols: [[
|
|
{
|
|
field: 'nickname', title: '用户'
|
|
},
|
|
{
|
|
field: 'sex', title: '性别', templet: function (d) {
|
|
return GenderType[d.sex];
|
|
}
|
|
},
|
|
{
|
|
field: 'weight', title: '体重(KG)'
|
|
},
|
|
{
|
|
field: 'height', title: '身高(CM)'
|
|
}
|
|
,
|
|
{
|
|
field: 'age', title: '年龄'
|
|
}
|
|
,
|
|
{
|
|
field: 'bmi', title: 'BMI'
|
|
}
|
|
,
|
|
{
|
|
field: 'fat_r', title: '脂肪率'
|
|
}
|
|
,
|
|
{
|
|
field: 'body', title: '体型'
|
|
}
|
|
,
|
|
{
|
|
field: 'bodyage', title: '体龄'
|
|
}
|
|
,
|
|
{
|
|
field: 'bone', title: '骨重'
|
|
}
|
|
,
|
|
{
|
|
field: 'cmi', title: '分数'
|
|
}
|
|
,
|
|
{
|
|
field: 'fat_w', title: '脂肪量'
|
|
}
|
|
,
|
|
{
|
|
field: 'fatlevel', title: '等级'
|
|
}
|
|
,
|
|
{
|
|
field: 'kcal', title: '基础代谢'
|
|
}
|
|
,
|
|
{
|
|
field: 'lbm', title: '去脂体重'
|
|
}
|
|
,
|
|
{
|
|
field: 'muscle', title: '肌肉率'
|
|
}
|
|
,
|
|
{
|
|
field: 'muscleval', title: '肌肉量'
|
|
}
|
|
,
|
|
{
|
|
field: 'protein', title: '蛋白率'
|
|
}
|
|
,
|
|
{
|
|
field: 'proteinval', title: '蛋白量'
|
|
}
|
|
,
|
|
{
|
|
field: 'sfr', title: '皮下脂肪'
|
|
}
|
|
,
|
|
{
|
|
field: 'visceral', title: '内脂'
|
|
}
|
|
,
|
|
{
|
|
field: 'water', title: '水份'
|
|
}
|
|
,
|
|
{
|
|
field: 'createtime', title: '测量时间'
|
|
}
|
|
]]
|
|
});
|
|
|
|
$(".js-search").on("click", function () {
|
|
var queryparam = [];
|
|
var starttime = $("#time").val();
|
|
if (starttime != "") {
|
|
var times = starttime.split('~');
|
|
queryparam.push({
|
|
"Name": 'createtime',
|
|
"Type": QueryCond.GreaterThanOrEqual,
|
|
"Value": times[0].trim()
|
|
});
|
|
queryparam.push({
|
|
"Name": 'createtime',
|
|
"Type": QueryCond.LessThanOrEqual,
|
|
"Value": times[1].trim()
|
|
});
|
|
}
|
|
common.reloadtable("list1", {
|
|
where: {
|
|
queryParam: queryparam
|
|
}
|
|
});
|
|
});
|
|
$("body").on("click", ".js-detail", function () {
|
|
var id = $(this).data("id");
|
|
common.dialog({
|
|
title: '趋势统计',
|
|
content:"/reguser/family?id="+id
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
} |