|
@ -945,35 +945,57 @@
|
|
|
}
|
|
|
jbscAPI.getHealth(data).then(function (res) {
|
|
|
if (res.status == 200) {
|
|
|
vm.tizhongRecord =
|
|
|
_.find(res.data, function (o) {
|
|
|
return o.type == '3'
|
|
|
}) || {}
|
|
|
for (var i in vm.questions) {
|
|
|
if (vm.questions[i].question.thirdKey == 'height') {
|
|
|
vm.questions[i].question.content = vm.tizhongRecord.value2
|
|
|
vm.changeContent(vm.questions[i].question, vm.tizhongRecord.value2)
|
|
|
var obj = res.data
|
|
|
// vm.tizhongRecord =
|
|
|
// _.find(res.data, function (o) {
|
|
|
// return o.type == '3'
|
|
|
// }) || {}
|
|
|
vm.tizhongRecord = {}
|
|
|
for (var key in obj) {
|
|
|
if (obj[key] && obj[key] !== null && obj[key].type == '3') {
|
|
|
vm.tizhongRecord = res.data[key]
|
|
|
}
|
|
|
if (vm.questions[i].question.thirdKey == 'weight') {
|
|
|
vm.questions[i].question.content = vm.tizhongRecord.value1
|
|
|
vm.changeContent(vm.questions[i].question, vm.tizhongRecord.value1)
|
|
|
}
|
|
|
if (vm.questions[i].question.thirdKey == 'systolicPressure') {
|
|
|
vm.questions[i].question.content = res.data.xy.value1
|
|
|
vm.changeContent(vm.questions[i].question, res.data.xy.value1)
|
|
|
}
|
|
|
if (vm.questions[i].question.thirdKey == 'diastolicPressure') {
|
|
|
vm.questions[i].question.content = res.data.xy.value2
|
|
|
vm.changeContent(vm.questions[i].question, res.data.xy.value2)
|
|
|
}
|
|
|
if (JSON.stringify(vm.tizhongRecord) == '{}') {
|
|
|
if (vm.questions[16].question.thirdKey == 'ckd34') {
|
|
|
vm.questions[16].question.content = 'ckd34'
|
|
|
vm.changeContent(vm.questions[16].question, 'ckd34')
|
|
|
vm.questions[16].question.content = ''
|
|
|
vm.changeContent(vm.questions[16].question, '')
|
|
|
}
|
|
|
if (vm.questions[i].question.thirdKey == 'bmi') {
|
|
|
if (vm.tizhongRecord.value2 && vm.tizhongRecord.value1) {
|
|
|
var w = vm.tizhongRecord.value1
|
|
|
var h = vm.tizhongRecord.value2 / 100
|
|
|
var s = (w / (h * h)).toFixed(2)
|
|
|
vm.questions[i].question.content = s
|
|
|
vm.shaowas = s
|
|
|
vm.changeContent(vm.questions[i].question, s)
|
|
|
} else {
|
|
|
for (var i in vm.questions) {
|
|
|
if (vm.questions[i].question.thirdKey == 'height') {
|
|
|
vm.questions[i].question.content = vm.tizhongRecord.value2
|
|
|
vm.changeContent(vm.questions[i].question, vm.tizhongRecord.value2)
|
|
|
}
|
|
|
if (vm.questions[16].question.thirdKey == 'ckd34') {
|
|
|
vm.questions[16].question.content = 'ckd34'
|
|
|
vm.changeContent(vm.questions[16].question, 'ckd34')
|
|
|
vm.questions[16].question.content = ''
|
|
|
vm.changeContent(vm.questions[16].question, '')
|
|
|
}
|
|
|
if (vm.questions[i].question.thirdKey == 'weight') {
|
|
|
vm.questions[i].question.content = vm.tizhongRecord.value1
|
|
|
vm.changeContent(vm.questions[i].question, vm.tizhongRecord.value1)
|
|
|
}
|
|
|
if (vm.questions[i].question.thirdKey == 'systolicPressure') {
|
|
|
vm.questions[i].question.content = res.data.xy.value1
|
|
|
vm.changeContent(vm.questions[i].question, res.data.xy.value1)
|
|
|
}
|
|
|
if (vm.questions[i].question.thirdKey == 'diastolicPressure') {
|
|
|
vm.questions[i].question.content = res.data.xy.value2
|
|
|
vm.changeContent(vm.questions[i].question, res.data.xy.value2)
|
|
|
}
|
|
|
if (vm.questions[i].question.thirdKey == 'bmi') {
|
|
|
if (vm.tizhongRecord.value2 && vm.tizhongRecord.value1) {
|
|
|
var w = vm.tizhongRecord.value1
|
|
|
var h = vm.tizhongRecord.value2 / 100
|
|
|
var s = (w / (h * h)).toFixed(2)
|
|
|
vm.questions[i].question.content = s
|
|
|
vm.shaowas = s
|
|
|
vm.changeContent(vm.questions[i].question, s)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@ -997,6 +1019,7 @@
|
|
|
if (v.thirdKey == 'assessTime') {
|
|
|
v.content = new Date(v.content).format('yyyy-MM-dd HH:mm')
|
|
|
}
|
|
|
|
|
|
if (v.thirdKey == 'isCkd34') {
|
|
|
if (v.options[0].thirdValue == '0') {
|
|
|
vm.selectArr.forEach(function (it) {
|
|
@ -1007,7 +1030,8 @@
|
|
|
}
|
|
|
if (v.options[0].thirdValue == '1') {
|
|
|
vm.selectArr.forEach(function (it) {
|
|
|
if (it.thirdKey == 'ckd34' && (typeof it.content == 'undefined' || it.content == '')) {
|
|
|
if (it.thirdKey == 'ckd34' && (typeof it.content == 'undefined' || it.content == '' || it.content == 'ckd34')) {
|
|
|
it.content = ''
|
|
|
flag = 1
|
|
|
}
|
|
|
})
|
|
@ -1015,7 +1039,7 @@
|
|
|
}
|
|
|
})
|
|
|
if (flag) {
|
|
|
top.layer.msg('问卷还未全部填写', { icon: 5 })
|
|
|
top.layer.msg('肾小球过滤率还未填写', { icon: 5 })
|
|
|
return
|
|
|
}
|
|
|
var loadding = top.layer.load(0, { shade: false }) //0代表加载的风格,支持0-2
|