Commit 13b24a20 authored by songrui's avatar songrui

Merge branch 'chronic-dev' of http://gitlab.yiboshi.com/nightkis1995/frontend-h5 into chronic-dev

parents 3ab5ffa4 dbe549f8
...@@ -494,7 +494,7 @@ export default { ...@@ -494,7 +494,7 @@ export default {
// 创建一个电话号码的URL // 创建一个电话号码的URL
let phoneNumber = this.form.telephone // 替换为需要拨打的号码 let phoneNumber = this.form.telephone // 替换为需要拨打的号码
//判断是否是iOS环境 //判断是否是iOS环境
if (isIOSWebKit) { if (isIOSWebKit()) {
console.log('tel:', phoneNumber) console.log('tel:', phoneNumber)
callMobile('startCallUpActivity', phoneNumber) callMobile('startCallUpActivity', phoneNumber)
} else { } else {
......
<template>
<div class='disease-select'>
<div class='label-title mb-4'>请选择慢病类型</div>
<div v-for="(item, index) in store.getDict('CP00117')" :key='index'
:class="['flex justify-between items-center text-16 mb-3 disease-checked',
{ 'disease-checked-active': isSelect(item)},
]"
@click='onSelect(item)'>
<span>{{ item.name }}</span>
</div>
<div class='warn-error' v-if='showWarn'>请选择</div>
</div>
</template>
<script>
import { useStore } from '@/doctor/store/index.js'
import { showToast } from 'vant'
export default {
props: {
infoValue: String
},
data() {
return {
store: useStore(),
// 选中的疾病类型
innerValue: [],
//显示校验
showWarn: false
}
},
watch: {
infoValue: {
handler(value) {
if (value) {
this.innerValue = value.split(',')
}
},
immediate: true
}
},
created() {
this.init()
},
methods: {
init() {
if (!(this.innerValue && this.innerValue.length)) {
this.innerValue = this.store.getDict('CP00117').map(e => e.value)
}
},
// 是否选中
isSelect(item) {
return this.innerValue.includes(item.value)
},
onSelect(val) {
if (this.innerValue.includes(val.value)) {
this.innerValue = this.innerValue.filter(e => e !== val.value)
} else {
this.innerValue.push(val.value)
}
if (this.innerValue && this.innerValue.length) {
this.showWarn = false
} else {
this.showWarn = true
}
},
onSubmit() {
return new Promise((resolve, reject) => {
if (!(this.innerValue && this.innerValue.length)) {
this.showWarn = true
return
}
resolve(this.innerValue)
})
}
}
}
</script>
<style lang='less' scoped>
.label-title {
font-size: 14px;
color: #262626;
font-weight: 500;
&::after {
content: "*";
color: red;
font-weight: bold;
margin-left: 4px;
}
}
.no-req-label {
font-size: 13px;
color: #595959;
font-weight: 500;
}
.disease-checked {
border: 1px solid #BFBFBF;
border-radius: 40px;
color: #595959;
background-color: #fff;
padding: 10px 16px;
line-height: 22.4px;
}
.disease-checked-active {
color: var(--van-primary-color);
border-color: var(--van-primary-color);
}
.disease-checked-disabled {
border-color: #EFF2F7;
background-color: #EFF2F7;
}
.warn-error {
color: #FF4D4F;
}
</style>
<template> <template>
<div class="screening-first-cont"> <div class='screening-first-cont'>
form form
</div> </div>
</template> </template>
<script> <script>
import { useStore } from '@/doctor/store'
import { checkboxReject } from '@/utils/common'
const defaultForm = (info = {}) => {
const form = {
id: undefined,
residentInfoId: undefined,
diseaseArrays: [],
currentAge: undefined,
gender: undefined,
genderName: undefined,
medicalHistory: [],
familyHistory: [],
relativeType: undefined,
height: undefined,
weight: undefined,
bmi: undefined,
waistline: undefined,
exerciseFrequency: undefined,
everyExercise: undefined,
femaleMedicalHistory: undefined,
hdlCholesterin: undefined,
triglyceride: undefined,
serumCholesterin: undefined,
touchHarmful: undefined,
pressureOneSbp: undefined,
pressureOneDbp: undefined,
pressureTwoSbp: undefined,
pressureTwoDbp: undefined,
dietaryHabit: undefined,
drinkFrequency: undefined,
startDrinkAge: undefined,
drinkKind: undefined,
drinkKindOther: undefined,
dayDrink: undefined,
giveDrink: undefined,
giveDrinkStart: undefined,
// 吸烟情况
isSmoking: undefined,
daySmoking: undefined,
startSmoking: undefined,
secondSmoking: undefined,
// 戒烟年龄
giveSmokingAge: undefined,
blackSpinySkin: undefined,
mentalTension: undefined,
xanthoma: undefined,
tendoIncrassation: undefined,
riskScore: undefined,
specialScreenResult: [],
hypertensionHighItem: [],
diabetesHighItem: [],
coronaryHighItem: [],
strokeHighItem: [],
pulmonaryHighItem: [],
nephrosisHighItem: [],
dyslipemiaHighItem: [],
// 日饮酒量
drinkKindCapacityList: [],
diseaseRelativeList: [],
mediumStrength: undefined,
medicineHistory: [],
informedConsent: undefined,
isExerciseFive: undefined
}
Reflect.ownKeys(form).forEach(key => {
if (info[key] != undefined) {
form[key] = info[key]
}
})
return form
}
export default { export default {
props: { props: {
info:Object info: Object,
diseaseArraysInfo: Array
}, },
data() { data() {
return {} return {
store: useStore(),
form: {},
formRight: {
hypertensionHighItemSelect: [],
diabetesHighItemSelect: [],
coronaryHighItemSelect: [],
strokeHighItemSelect: [],
pulmonaryHighItemSelect: [],
nephrosisHighItemSelect: [],
dyslipemiaHighItemSelect: []
},
specialScreenResultSelect: [],
riskScoreInfo: undefined,
// 饮酒种类及饮用量关系
drinkKindCapacityList: [],
familyHistoryList: [],
imageData: [],
rules: {
diseaseArrays: [{ required: true, message: '请选择' }],
medicalHistory: [{ required: true, message: '请选择' }],
familyHistory: [{ required: true, message: '请选择' }],
height: [
{ required: true, message: '请输入' },
{
validator: (rule, value, callback) => {
// const regex = /^([1-9]\d{1}(?:\.\d{1})?|[1-2]\d{2}(?:\.\d{1})?|300)$/
const regex = /^\d+(\.\d{1})?$/
if (value && !(Number(value) >= 10 && Number(value) <= 300 && regex.test(Number(value)))) {
callback('请输入10到300之间的数字,允许一位小数')
} else {
callback()
}
}
}
],
weight: [
{ required: true, message: '请输入' },
{
validator: (rule, value, callback) => {
// const regex = /^([2-9]\d{1}(?:\.\d{1,2})?|[1-4]\d{2}(?:\.\d{1,2})?|500)$/
const regex = /^\d+(\.\d{1,2})?$/
if (value && !(Number(value) >= 20 && Number(value) <= 500 && regex.test(Number(value)))) {
callback('请输入20到500之间的数字,允许两位小数')
} else {
callback()
}
}
}
],
waistline: [
{ required: true, message: '请输入' },
{
validator: (rule, value, callback) => {
// const regex = /^([1-9]\d{1}(?:\.\d{1})?|[1][0-4]\d(?:\.\d{1})?|150)$/
const regex = /^\d+(\.\d{1})?$/
if (value && !(Number(value) >= 10 && Number(value) <= 150 && regex.test(Number(value)))) {
callback('请输入10到150之间的数字,允许一位小数')
} else {
callback()
}
}
}
],
hdlCholesterin: [{
validator: (rule, value, callback) => {
const regex = /^\d+(\.\d{1,2})?$/
if (value && !regex.test(value)) {
callback('请输入正确的数字')
} else {
callback()
}
}
}],
triglyceride: [{
validator: (rule, value, callback) => {
const regex = /^\d+(\.\d{1,2})?$/
if (value && !regex.test(value)) {
callback('请输入正确的数字')
} else {
callback()
}
}
}],
serumCholesterin: [{
validator: (rule, value, callback) => {
const regex = /^\d+(\.\d{1,2})?$/
if (value && !regex.test(value)) {
callback('请输入正确的数字')
} else {
callback()
}
}
}],
exerciseFrequency: [{ required: true, message: '请选择' }],
dietaryHabit: [{ required: true, message: '请选择' }],
drinkFrequency: [{ required: true, message: '请选择' }],
isSmoking: [{ required: true, message: '请选择' }],
specialScreenResult: [{ required: true, message: '请选择' }],
secondSmoking: [{ required: true, message: '请选择' }],
drinkKind: [{ required: true, message: '请选择' }],
startDrinkAge: [{ required: true, message: '请输入' }],
giveDrink: [{ required: true, message: '请选择' }],
giveDrinkStart: [{ required: true, message: '请输入' }],
giveSmokingAge: [{ required: true, message: '请输入' }],
startSmoking: [{ required: true, message: '请输入' }],
daySmoking: [{ required: true, message: '请输入' }],
everyExercise: [{ required: true, message: '请输入' }],
mediumStrength: [{ required: true, message: '请选择' }]
}
}
},
computed: {
//判断年龄显示隐藏
ageShow() {
let res = false
const { diseaseArrays = [] } = this.form
if (diseaseArrays.includes(1) || diseaseArrays.includes(2) || diseaseArrays.includes(3)
|| diseaseArrays.includes(5) || diseaseArrays.includes(6)) {
res = true
}
return res
},
//判断性别显示隐藏
sexShow() {
let res = false
const { diseaseArrays = [] } = this.form
if (diseaseArrays.includes(3)) {
res = true
}
return res
},
//判断病史显示隐藏
medicalHistoryShow() {
let res = false
const { diseaseArrays = [] } = this.form
if (diseaseArrays.includes(1) || diseaseArrays.includes(2) || diseaseArrays.includes(3) || diseaseArrays.includes(4)
|| diseaseArrays.includes(5) || diseaseArrays.includes(6) || diseaseArrays.includes(7)) {
res = true
}
return res
},
//判断家族史显示隐藏
familyHistoryShow() {
let res = false
const { diseaseArrays = [] } = this.form
if (diseaseArrays.includes(1) || diseaseArrays.includes(2) || diseaseArrays.includes(3) || diseaseArrays.includes(4)
|| diseaseArrays.includes(5) || diseaseArrays.includes(6) || diseaseArrays.includes(7)) {
res = true
}
return res
},
//判断身高、体重、BMI显示隐藏
highShow() {
let res = false
const { diseaseArrays = [] } = this.form
if (diseaseArrays.includes(1) || diseaseArrays.includes(2) || diseaseArrays.includes(4)
|| diseaseArrays.includes(6) || diseaseArrays.includes(7)) {
res = true
}
return res
},
//判断腰围显示隐藏
waistShow() {
let res = false
const { diseaseArrays = [] } = this.form
if (diseaseArrays.includes(1) || diseaseArrays.includes(2)) {
res = true
}
return res
},
//判断锻炼频率显示隐藏
exerciseShow() {
let res = false
const { diseaseArrays = [] } = this.form
if (diseaseArrays.includes(1) || diseaseArrays.includes(2) || diseaseArrays.includes(4)) {
res = true
}
return res
},
//判断女性病史显示隐藏
womanMHShow() {
let res = false
const { diseaseArrays = [] } = this.form
if (diseaseArrays.includes(2)) {
res = true
}
return res
},
//判断用药史显示隐藏
medicationHShow() {
let res = false
const { diseaseArrays = [] } = this.form
if (diseaseArrays.includes(2) || diseaseArrays.includes(4) || diseaseArrays.includes(6)) {
res = true
}
return res
},
//判断高密度脂蛋白胆固醇、甘油三酯、总胆固醇显示隐藏
triglycerideShow() {
let res = false
const { diseaseArrays = [] } = this.form
if (diseaseArrays.includes(2)) {
res = true
}
return res
},
//判断有害物质接触或婴幼儿时期病史显示隐藏
babyMHShow() {
let res = false
const { diseaseArrays = [] } = this.form
if (diseaseArrays.includes(5)) {
res = true
}
return res
},
//判断血压显示隐藏
bloodPressureShow() {
let res = false
const { diseaseArrays = [] } = this.form
if (diseaseArrays.includes(1)) {
res = true
}
return res
},
//判断饮食习惯显示隐藏
eatHabitShow() {
let res = false
const { diseaseArrays = [] } = this.form
if (diseaseArrays.includes(1)) {
res = true
}
return res
},
//判断饮酒情况显示隐藏
drinkShow() {
let res = false
const { diseaseArrays = [] } = this.form
if (diseaseArrays.includes(1)) {
res = true
}
return res
},
//判断吸烟情况显示隐藏
smokeShow() {
let res = false
const { diseaseArrays = [] } = this.form
if (diseaseArrays.includes(1) || diseaseArrays.includes(3) || diseaseArrays.includes(4) || diseaseArrays.includes(5) || diseaseArrays.includes(7)) {
res = true
}
return res
},
//判断黑棘皮病显示隐藏
blackSpinySkinShow() {
let res = false
const { diseaseArrays = [] } = this.form
if (diseaseArrays.includes(2)) {
res = true
}
return res
},
//判断长期精神紧张显示隐藏
mentalTensionShow() {
let res = false
const { diseaseArrays = [] } = this.form
if (diseaseArrays.includes(1)) {
res = true
}
return res
},
//判断皮肤或肌腱黄色瘤显示隐藏
xanthomaShow() {
let res = false
const { diseaseArrays = [] } = this.form
if (diseaseArrays.includes(7)) {
res = true
}
return res
},
//判断跟腱增厚显示隐藏
tendoIncrassationShow() {
let res = false
const { diseaseArrays = [] } = this.form
if (diseaseArrays.includes(7)) {
res = true
}
return res
},
//判断中国糖尿病风险评分显示隐藏
riskScoreShow() {
let res = false
const { diseaseArrays = [] } = this.form
if (diseaseArrays.includes(2)) {
res = true
}
return res
},
//生成病史选择项
medicalHistoryList() {
//默认为无
let result = []
let res = [99]
let list = this.$dict('CP00125')
const { diseaseArrays = [] } = this.form
if (diseaseArrays.includes(1)) {
let arr = [1, 2, 7]
res = [
...res,
...arr
]
}
if (diseaseArrays.includes(2)) {
let arr = [3, 5, 18, 19]
res = [
...res,
...arr
]
}
if (diseaseArrays.includes(3)) {
let arr = [1, 2, 7]
res = [
...res,
...arr
]
}
if (diseaseArrays.includes(4)) {
let arr = [2, 7, 16, 17]
res = [
...res,
...arr
]
}
if (diseaseArrays.includes(5)) {
let arr = [8, 9, 10, 11]
res = [
...res,
...arr
]
}
if (diseaseArrays.includes(6)) {
let arr = [1, 2, 3, 5, 12, 13, 14, 15]
res = [
...res,
...arr
]
}
if (diseaseArrays.includes(7)) {
let arr = [1, 2, 3, 5]
res = [
...res,
...arr
]
}
res = Array.from(new Set(res))
list.forEach(item1 => {
res.forEach(item2 => {
if (item1.value == item2) {
result.push(item1)
}
})
})
return result
},
//生成家族史选择项
familyHistoryInfoList() {
//默认为无
let result = []
let res = [9]
let list = this.$dict('CP00149')
const { diseaseArrays = [] } = this.form
if (diseaseArrays.includes(1)) {
let arr = [2]
res = [
...res,
...arr
]
}
if (diseaseArrays.includes(2)) {
let arr = [1]
res = [
...res,
...arr
]
}
if (diseaseArrays.includes(3)) {
let arr = [3]
res = [
...res,
...arr
]
}
if (diseaseArrays.includes(4)) {
let arr = [4]
res = [
...res,
...arr
]
}
if (diseaseArrays.includes(5)) {
let arr = [5]
res = [
...res,
...arr
]
}
if (diseaseArrays.includes(6)) {
let arr = [6]
res = [
...res,
...arr
]
}
if (diseaseArrays.includes(7)) {
let arr = [7]
res = [
...res,
...arr
]
}
res = Array.from(new Set(res))
list.forEach(item1 => {
res.forEach(item2 => {
if (item1.value == item2) {
result.push(item1)
}
})
})
return result
},
//生成用药史选择项
medicineHistoryList() {
//默认为无
let result = []
let res = []
let list = this.$dict('CP00129')
const { diseaseArrays = [] } = this.form
if (diseaseArrays.includes(2)) {
let arr = [1, 2, 3, 4]
res = [
...res,
...arr
]
}
if (diseaseArrays.includes(4)) {
let arr = [1]
res = [
...res,
...arr
]
}
if (diseaseArrays.includes(6)) {
let arr = [5]
res = [
...res,
...arr
]
}
res = Array.from(new Set(res))
list.forEach(item1 => {
res.forEach(item2 => {
if (item1.value == item2) {
result.push(item1)
}
})
})
return result
}
},
watch: {
'info': {
handler() {
this.initForm()
},
immediate: true
},
diseaseArraysInfo: {
handler() {
this.form.diseaseArrays = this.diseaseArraysInfo
}
},
'form': {
handler(now, old) {
if (Object.keys(old).length === 0) return
this.formChangeHandle()
},
deep: true
},
//右侧高危选项变化监测
'formRight': {
handler(now, old) {
if (Object.keys(old).length === 0) return
this.changeFormRightHandle()
},
deep: true
},
// 计算日均饮酒量
drinkKindCapacityList: {
handler(val) {
if (!val) {
this.form.dayDrink = 0
return
}
let num = 0
val.forEach(e => {
if (e.drinkKind == 2) { // 啤酒
num = num + e.drinkCapacity * 0.1
} else if (e.drinkKind == 3) { // 红酒
num = num + e.drinkCapacity * 0.25
} else if (e.drinkKind == 4) { // 黄酒
num = num + e.drinkCapacity * 0.2
} else {
num = num + e.drinkCapacity
}
})
this.form.dayDrink = Math.round(num * 100) / 100
},
deep: true
},
//家族史
'form.familyHistory': {
handler() {
//非空校验
this.familyHistoryReq()
}
},
'familyHistoryList': {
handler(now, old) {
if (old.length == 0) return
if (this.form.diseaseArrays?.includes(3)) {
this.coronaryHigh()
}
//非空校验
this.familyHistoryReq()
},
deep: true
},
//病种变更监听
'form.diseaseArrays': {
handler(val = []) {
const option = this.store.getDict('CP00117')
this.cleanFormRight()
this.cleanMedicalHistory()
this.cleanFamilyHistory()
this.cleanMedicineHistory()
this.changeFamilyHis(this.form.familyHistory)
},
immediate: true
}
},
methods: {
checkboxReject,
//初始化表单
initForm() {
this.form = defaultForm(this.info)
if (!this.info.id) {
//是否是引用上一次复筛数据
if (this.info.flag && this.info.flag == 'lastInfo') {
this.setUpdateInfo()
} else {//新增时
this.form.diseaseArrays = [1, 2, 3, 4, 5, 6, 7]
}
} else {
this.setUpdateInfo()
}
},
//修改时 或者引用上一次复筛数据时赋值
setUpdateInfo() {
this.formRight.hypertensionHighItemSelect = this.form.hypertensionHighItem || []
this.formRight.diabetesHighItemSelect = this.form.diabetesHighItem || []
this.formRight.coronaryHighItemSelect = this.form.coronaryHighItem || []
this.formRight.strokeHighItemSelect = this.form.strokeHighItem || []
this.formRight.pulmonaryHighItemSelect = this.form.pulmonaryHighItem || []
this.formRight.nephrosisHighItemSelect = this.form.nephrosisHighItem || []
this.formRight.dyslipemiaHighItemSelect = this.form.dyslipemiaHighItem || []
this.drinkKindCapacityList = this.form.drinkKindCapacityList || []
this.familyHistoryList = this.form.diseaseRelativeList || []
//修改时若中国糖尿病风险评分、专病高危评估结果存在时 以用户选择的结果为主展示
//利用setTimeout改变值的赋值顺序让这两个值在watch事件结束后再被赋值
setTimeout(() => {
this.riskScoreInfo = this.form.riskScore
this.specialScreenResultSelect = this.form.specialScreenResult || [9]
}, 0)
this.imageData = this.info.informedConsentUrl
},
//表单触发事件
formChangeHandle() {
//高血压
if (this.form.diseaseArrays?.includes(1)) {
this.hypertensionHigh()
}
//糖尿病
if (this.form.diseaseArrays?.includes(2)) {
this.diabetesHigh()
//糖尿病风险
this.diabetesHighCompute()
}
//冠心病
if (this.form.diseaseArrays?.includes(3)) {
this.coronaryHigh()
}
//脑卒中
if (this.form.diseaseArrays?.includes(4)) {
this.strokeHigh()
}
//慢阻肺
if (this.form.diseaseArrays?.includes(5)) {
this.pulmonaryHigh()
}
//慢性肾病
if (this.form.diseaseArrays?.includes(6)) {
this.nephrosisHigh()
}
//血脂异常
if (this.form.diseaseArrays?.includes(7)) {
this.dyslipemiaHigh()
}
},
//右侧高危选项触发事件
changeFormRightHandle() {
let list = []
const {
hypertensionHighItemSelect = [],
diabetesHighItemSelect = [],
coronaryHighItemSelect = [],
strokeHighItemSelect = [],
pulmonaryHighItemSelect = [],
nephrosisHighItemSelect = [],
dyslipemiaHighItemSelect = []
} = this.formRight
//高血压高危选项
if (hypertensionHighItemSelect.length >= 3) {
list.push(1)
}
//糖尿病高危选项
if (diabetesHighItemSelect.length >= 1) {
list.push(2)
}
//冠心病高危选项
if (coronaryHighItemSelect.length >= 3) {
list.push(3)
}
//脑卒中高危选项
if (strokeHighItemSelect.length >= 3) {
list.push(4)
}
//慢阻肺高危选项
if (pulmonaryHighItemSelect.length >= 1) {
list.push(5)
}
//慢性肾脏病高危选项
if (nephrosisHighItemSelect.length >= 2) {
list.push(6)
}
//血脂异常高危选项
if (dyslipemiaHighItemSelect.length >= 1) {
list.push(7)
}
//不满足高危病种时默认为无
if (!list.length) {
list = [9]
}
list = Array.from(new Set(list))
this.specialScreenResultSelect = list
},
//清洗右侧高危选项表单
cleanFormRight() {
if (!this.form.diseaseArrays?.includes(1)) {
this.formRight.hypertensionHighItemSelect = []
}
if (!this.form.diseaseArrays?.includes(2)) {
this.formRight.diabetesHighItemSelect = []
}
if (!this.form.diseaseArrays?.includes(3)) {
this.formRight.coronaryHighItemSelect = []
}
if (!this.form.diseaseArrays?.includes(4)) {
this.formRight.strokeHighItemSelect = []
}
if (!this.form.diseaseArrays?.includes(5)) {
this.formRight.pulmonaryHighItemSelect = []
}
if (!this.form.diseaseArrays?.includes(6)) {
this.formRight.nephrosisHighItemSelect = []
}
if (!this.form.diseaseArrays?.includes(7)) {
this.formRight.dyslipemiaHighItemSelect = []
}
},
//清洗病史的选择数据(去掉不存在的病种对应的选项选择)
cleanMedicalHistory() {
if (!this.form.diseaseArrays.length) {
this.form.medicalHistory = []
} else {
if (this.form.medicalHistory && this.form.medicalHistory.length) {
let res = []
this.medicalHistoryList.forEach(item => {
res.push(item.value)
})
let list = this.form.medicalHistory.filter(item => {
return res.includes(item)
}
) || []
this.form.medicalHistory = list
}
}
},
//清洗家族史的选择数据
cleanFamilyHistory() {
if (!this.form.diseaseArrays.length) {
this.form.familyHistory = []
} else {
if (this.form.familyHistory && this.form.familyHistory.length) {
let res = []
this.familyHistoryInfoList.forEach(item => {
res.push(item.value)
})
let list = this.form.familyHistory.filter(item => {
return res.includes(item)
}
) || []
this.form.familyHistory = list
}
}
},
//清洗用药史的选择数据
cleanMedicineHistory() {
if (!this.form.diseaseArrays.length) {
this.form.medicineHistory = []
} else {
if (this.form.medicineHistory && this.form.medicineHistory.length) {
let res = []
this.medicineHistoryList.forEach(item => {
res.push(item.value)
})
let list = this.form.medicineHistory.filter(item => {
return res.includes(item)
}
) || []
this.form.medicineHistory = list
}
}
},
changeFamilyHis(e = []) {
this.form.familyHistory = this.checkboxReject(this.form.familyHistory, e, [9])
let temp = []
this.form.familyHistory.forEach((item, index) => {
if (item == 1 || item == 3 || item == 5 || item == 7) {
let name = this.store.getDictValue(this.store.getDict('CP00149'), item)
let base = this.familyHistoryList.filter(item1 => item1.diseaseType == item) || []
let obj = {
id_: index + 1,
diseaseTypeName: `${name}-亲人类型`,
diseaseType: item,
selectRelativeType: [],
checkRequired: false,
relativeAgeList: [
{relativeTypeName: "父亲", relativeType: 1, gender: 1, age: undefined, inputRequired: false},
{relativeTypeName: "母亲", relativeType: 2, gender: 2, age: undefined, inputRequired: false},
{relativeTypeName: "兄弟", relativeType: 3, gender: 1, age: undefined, inputRequired: false},
{relativeTypeName: "姐妹", relativeType: 4, gender: 2, age: undefined, inputRequired: false},
{relativeTypeName: "儿子", relativeType: 5, gender: 1, age: undefined, inputRequired: false},
{relativeTypeName: "女儿", relativeType: 6, gender: 2, age: undefined, inputRequired: false}
]
}
if (base.length) {
obj = base[0]
}
temp.push(obj)
}
})
this.familyHistoryList = temp
},
calculateBMI() {
if (this.form.weight && this.form.height) {
let res = this.form.weight / (this.form.height * this.form.height / 100 / 100);
this.form.bmi = parseFloat(res.toFixed(1));
} else {
this.form.bmi = null;
}
},
hypertensionHigh() {
const {
currentAge,
height = 0,
weight = 0,
waistline,
familyHistory = [],
isSmoking,
medicalHistory = [],
dietaryHabit = [],
pressureOneSbp,
pressureOneDbp,
pressureTwoSbp,
pressureTwoDbp,
dayDrink,
secondSmoking,
gender,
exerciseFrequency,
everyExercise,
mentalTension
} = this.form
let list = []
if (((pressureOneSbp >= 120) || (pressureTwoSbp >= 120 )) ||
((pressureOneDbp >= 80 ) || (pressureTwoDbp >= 80))
) {
list.push(1)
}
if (currentAge >= 45) {
list.push(2)
}
let res = weight / (height * height / 100 / 100)
let bmi = parseFloat(res.toFixed(1))
if ((bmi >= 24) ||
(gender == 2 && waistline >= 85) ||
(gender == 1 && waistline >= 90)) {
list.push(3)
}
if (familyHistory.includes(2)) {
list.push(4)
}
if (dietaryHabit.includes(4)) {
list.push(5)
}
if (dayDrink >= 100) {
list.push(6)
}
if (isSmoking == 3 || secondSmoking == 1) {
list.push(7)
}
if (exerciseFrequency == 3 || exerciseFrequency == 4 || everyExercise < 30) {
list.push(8)
}
if (mentalTension == 2) {
list.push(9)
}
if (medicalHistory.includes(7)) {
list.push(10)
}
if (medicalHistory.includes(2)) {
list.push(11)
}
this.formRight.hypertensionHighItemSelect = Array.from(new Set(list))
},
diabetesHigh() {
let list = []
const {
currentAge,
medicalHistory = [],
height = 0,
weight = 0,
waistline,
gender,
exerciseFrequency,
everyExercise,
familyHistory = [],
femaleMedicalHistory = [],
blackSpinySkin,
medicineHistory = [],
hdlCholesterin,
triglyceride
} = this.form
if (currentAge >= 40) {
list.push(1)
}
if (medicalHistory.includes(19)) {
list.push(2)
}
let res = weight / (height * height / 100 / 100)
let bmi = parseFloat(res.toFixed(1))
if ((bmi >= 24) ||
(gender == 2 && waistline >= 85) ||
(gender == 1 && waistline >= 90)) {
list.push(3)
}
if (exerciseFrequency == 3 || exerciseFrequency == 4 || everyExercise < 30) {
list.push(4)
}
if (familyHistory.includes(1)) {
list.push(5)
}
if (femaleMedicalHistory.includes(1)) {
list.push(6)
}
if (femaleMedicalHistory.includes(3)) {
list.push(7)
}
if (blackSpinySkin == 2) {
list.push(8)
}
if (medicalHistory.includes(1) || medicineHistory.includes(1)) {
list.push(9)
}
if ((hdlCholesterin != null && hdlCholesterin < 0.9) || (triglyceride != null && triglyceride > 2.22) || medicineHistory.includes(2)) {
list.push(10)
}
if (medicalHistory.includes(3) || medicalHistory.includes(5)) {
list.push(11)
}
if (medicineHistory.includes(3)) {
list.push(12)
}
if (medicineHistory.includes(4)) {
list.push(13)
}
let socre = this.diabetesHighScore()
if (socre >= 25) {
list.push(14)
}
this.formRight.diabetesHighItemSelect = Array.from(new Set(list))
},
//冠心病高危选择
coronaryHigh() {
let list = []
const {currentAge, gender, isSmoking, medicalHistory = [], familyHistory = []} = this.form
if (gender == 1) {
list.push(2)
if (currentAge >= 45) {
list.push(1)
}
}
if (gender == 2 && currentAge >= 55) {
list.push(1)
}
if (isSmoking == 3) {
list.push(3)
}
if (medicalHistory.includes(1)) {
list.push(4)
}
if (medicalHistory.includes(2)) {
list.push(5)
}
if (medicalHistory.includes(7)) {
list.push(6)
}
if (familyHistory.includes(3)) {
let obj = this.familyHistoryList.filter(item => item.diseaseType == 3)[0] || {}
let objList = obj.selectRelativeType || []
let listArry = obj?.relativeAgeList || []
let flag = 0
listArry.forEach(item => {
if (item.gender == 1 && item.age && item.age < 55) {
flag++
}
if (item.gender == 2 && item.age && item.age < 65) {
flag++
}
})
if (flag > 0 && objList.length) {
list.push(7)
}
}
this.formRight.coronaryHighItemSelect = Array.from(new Set(list))
},
strokeHigh() {
let list = []
const {
medicalHistory = [],
medicineHistory = [],
isSmoking,
familyHistory = [],
exerciseFrequency,
everyExercise,
height = 0,
weight = 0
} = this.form
if (medicalHistory.includes(1) || medicineHistory.includes(1)) {
list.push(1)
}
if (medicalHistory.includes(16) || medicalHistory.includes(17)) {
list.push(2)
}
if (isSmoking == 3) {
list.push(3)
}
if (medicalHistory.includes(7)) {
list.push(4)
}
if (medicalHistory.includes(2)) {
list.push(5)
}
if (exerciseFrequency == 3 || exerciseFrequency == 4 || everyExercise < 30) {
list.push(6)
}
let res = weight / (height * height / 100 / 100)
let bmi = parseFloat(res.toFixed(1))
if (bmi >= 26) {
list.push(7)
}
if (familyHistory.includes(4)) {
list.push(8)
}
this.formRight.strokeHighItemSelect = Array.from(new Set(list))
},
pulmonaryHigh() {
let list = []
const {
currentAge,
isSmoking,
secondSmoking,
medicalHistory = [],
familyHistory = [],
touchHarmful = []
} = this.form
if (currentAge >= 35) {
list.push(1)
}
if (isSmoking == 3) {
list.push(2)
}
if (touchHarmful.includes(1)) {
list.push(3)
}
if (medicalHistory.includes(8)) {
list.push(4)
}
if (medicalHistory.includes(11)) {
list.push(5)
}
if (medicalHistory.includes(9)) {
list.push(6)
}
if (medicalHistory.includes(10)) {
list.push(7)
}
if (familyHistory.includes(5)) {
list.push(8)
}
if (touchHarmful.includes(4)) {
list.push(9)
}
if (touchHarmful.includes(2)) {
list.push(10)
}
if (touchHarmful.includes(3)) {
list.push(11)
}
if (touchHarmful.includes(5)) {
list.push(12)
}
if (touchHarmful.includes(6)) {
list.push(13)
}
if (touchHarmful.includes(7)) {
list.push(14)
}
this.formRight.pulmonaryHighItemSelect = Array.from(new Set(list))
},
nephrosisHigh() {
let list = []
const {
currentAge,
familyHistory = [],
medicalHistory = [],
height = 0,
weight = 0,
medicineHistory = []
} = this.form
if (currentAge > 65) {
list.push(1)
}
if (familyHistory.includes(6)) {
list.push(2)
}
if (medicalHistory.includes(2)) {
list.push(3)
}
if (medicalHistory.includes(1)) {
list.push(4)
}
if (medicalHistory.includes(3) || medicalHistory.includes(5)) {
list.push(5)
}
if (medicalHistory.includes(12)) {
list.push(6)
}
let res = weight / (height * height / 100 / 100)
let bmi = parseFloat(res.toFixed(1))
if (bmi >= 28) {
list.push(7)
}
if (medicalHistory.includes(14) || medicalHistory.includes(15)) {
list.push(8)
}
if (medicineHistory.includes(5)) {
list.push(9)
}
if (medicalHistory.includes(13)) {
list.push(10)
}
this.formRight.nephrosisHighItemSelect = Array.from(new Set(list))
},
dyslipemiaHigh() {
let list = []
const {
currentAge,
gender,
medicalHistory = [],
height = 0,
weight = 0,
isSmoking,
familyHistory = [],
xanthoma,
tendoIncrassation
} = this.form
if (medicalHistory.includes(3) || medicalHistory.includes(5)) {
list.push(1)
}
let res = weight / (height * height / 100 / 100)
let bmi = parseFloat(res.toFixed(1))
if (medicalHistory.includes(1) || medicalHistory.includes(2) || bmi >= 28 || isSmoking == 3) {
list.push(2)
}
if (familyHistory.includes(3) || familyHistory.includes(4) || familyHistory.includes(7)) {
list.push(3)
}
if (xanthoma == 2) {
list.push(4)
}
if (tendoIncrassation == 1) {
list.push(5)
}
this.formRight.dyslipemiaHighItemSelect = Array.from(new Set(list))
},
diabetesHighCompute() {
let score = this.diabetesHighScore()
if (score < 25) {
this.riskScoreInfo = 2
}
if (score >= 25) {
this.riskScoreInfo = 1
}
},
//糖尿病风险评分
diabetesHighScore() {
let total = 0
const {
currentAge,
height = 0,
weight = 0,
waistline,
gender,
familyHistory = [],
pressureOneSbp,
pressureTwoSbp
} = this.form
//年龄分数
if (currentAge >= 20 && currentAge <= 24) {
total += 0
}
if (currentAge >= 25 && currentAge <= 34) {
total += 4
}
if (currentAge >= 35 && currentAge <= 39) {
total += 8
}
if (currentAge >= 40 && currentAge <= 44) {
total += 11
}
if (currentAge >= 45 && currentAge <= 49) {
total += 12
}
if (currentAge >= 50 && currentAge <= 54) {
total += 13
}
if (currentAge >= 55 && currentAge <= 59) {
total += 15
}
if (currentAge >= 60 && currentAge <= 64) {
total += 16
}
if (currentAge >= 65 && currentAge <= 74) {
total += 18
}
//体质分数
let res1 = weight / (height * height / 100 / 100)
let bmi = parseFloat(res1.toFixed(1))
if (bmi < 22) {
total += 0
}
if (bmi >= 22 && bmi <= 23.9) {
total += 1
}
if (bmi >= 24 && bmi <= 29.9) {
total += 3
}
if (bmi >= 30) {
total += 5
}
//腰围分数 以及性别分数
//男性
if (gender == 1) {
total += 2
if (waistline < 75) {
total += 0
}
if (waistline >= 75 && waistline <= 79.9) {
total += 3
}
if (waistline >= 80 && waistline <= 84.9) {
total += 5
}
if (waistline >= 85 && waistline <= 89.9) {
total += 7
}
if (waistline >= 90 && waistline <= 94.9) {
total += 8
}
if (waistline >= 95) {
total += 10
}
}
//女性
if (gender == 2) {
total += 0
if (waistline < 70) {
total += 0
}
if (waistline >= 70 && waistline <= 74.9) {
total += 3
}
if (waistline >= 75 && waistline <= 79.9) {
total += 5
}
if (waistline >= 80 && waistline <= 84.9) {
total += 7
}
if (waistline >= 85 && waistline <= 89.9) {
total += 8
}
if (waistline >= 90) {
total += 10
}
}
//糖尿病家族史
if (familyHistory.includes(1)) {
total += 6
}
//收缩压分数(取两次测试结果的最大值)
let pressureSbp = pressureTwoSbp || 0
let res = Number(pressureOneSbp || 0) - Number(pressureTwoSbp || 0)
if (res > 0) {
pressureSbp = pressureOneSbp
}
if (pressureSbp < 110) {
total += 0
}
if (pressureSbp >= 110 && pressureSbp <= 119) {
total += 1
}
if (pressureSbp >= 120 && pressureSbp <= 129) {
total += 3
}
if (pressureSbp >= 130 && pressureSbp <= 139) {
total += 6
}
if (pressureSbp >= 140 && pressureSbp <= 149) {
total += 7
}
if (pressureSbp >= 150 && pressureSbp <= 159) {
total += 8
}
if (pressureSbp >= 160) {
total += 10
}
return total
},
//家族史 非空校验
familyHistoryReq() {
let flag = 0
this.familyHistoryList.forEach(item => {
let list = item.selectRelativeType || []
if (!item.selectRelativeType.length) {
item.checkRequired = true
flag++
} else {
item.checkRequired = false
}
item.relativeAgeList.forEach(item1 => {
if (list.includes(item1.relativeType) && !item1.age) {
item1.inputRequired = true
flag++
} else {
item1.inputRequired = false
}
if (!list.includes(item1.relativeType)) {
item1.age = undefined
}
})
})
return flag
},
// 饮酒种类变化
drinkKindChange(val = [], option) {
// console.log(val, option)
this.drinkKindCapacityList = val.map(e => {
const item = this.drinkKindCapacityList.find(i => i.drinkKind == e) || {}
return {
drinkKind: e,
drinkKindName: this.$dictValue('CP00133', e),
drinkCapacity: item.drinkCapacity || 0
}
})
},
drinkFrequencyChange() {
const val = this.form.drinkFrequency
if (!val || val == 1) {
this.drinkKindCapacityList = []
}
},
//提交
submit() {
return new Promise((resolve, reject) => {
this.$refs.form.validate().then(() => {
if (!this.specialScreenResultSelect.length) {
this.$message.info('请选择专病高危评估结果')
reject(e)
return
}
let flag = this.familyHistoryReq()
if (flag > 0) {
return
}
let res = {
...this.form,
hypertensionHighItem: this.formRight.hypertensionHighItemSelect,
diabetesHighItem: this.formRight.diabetesHighItemSelect,
coronaryHighItem: this.formRight.coronaryHighItemSelect,
strokeHighItem: this.formRight.strokeHighItemSelect,
pulmonaryHighItem: this.formRight.pulmonaryHighItemSelect,
nephrosisHighItem: this.formRight.nephrosisHighItemSelect,
dyslipemiaHighItem: this.formRight.dyslipemiaHighItemSelect,
specialScreenResult: this.specialScreenResultSelect,
drinkKindCapacityList: this.drinkKindCapacityList,
diseaseRelativeList: this.familyHistoryList,
riskScore: this.riskScoreInfo
}
resolve(
fetchDataHandle(res, {
diseaseArrays: 'arrToStr',
medicalHistory: 'arrToStr',
familyHistory: 'arrToStr',
relativeType: 'arrToStr',
femaleMedicalHistory: 'arrToStr',
medicineHistory: 'arrToStr',
touchHarmful: 'arrToStr',
dietaryHabit: 'arrToStr',
drinkKind: 'arrToStr',
specialScreenResult: 'arrToStr',
highItem: 'arrToStr',
hypertensionHighItem: 'arrToStr',
diabetesHighItem: 'arrToStr',
coronaryHighItem: 'arrToStr',
strokeHighItem: 'arrToStr',
pulmonaryHighItem: 'arrToStr',
nephrosisHighItem: 'arrToStr',
dyslipemiaHighItem: 'arrToStr',
})
)
}).catch((e) => {
console.warn('SecondScreenForm error', e)
reject(e)
})
})
},
} }
} }
</script> </script>
<style lang="less" scoped> <style lang='less' scoped>
</style> </style>
...@@ -6,12 +6,18 @@ ...@@ -6,12 +6,18 @@
v-show='step ==1' v-show='step ==1'
ref='baseInfo' ref='baseInfo'
></archive-common> ></archive-common>
<DiseaseSelect
:infoValue='info.diseaseArrays'
v-show='step == 2'
ref='diseaseInfo'
></DiseaseSelect>
<form-cont :info='info' <form-cont :info='info'
v-show='step == 2' :disease-arrays-info='diseaseArraysInfo'
v-show='step == 3'
ref='formInfo' ref='formInfo'
></form-cont> ></form-cont>
<result :residentInfoId="residentInfoId" <result :residentInfoId="residentInfoId"
v-show='step == 3' v-show='step == 4'
></result> ></result>
</div> </div>
<div class='bottom-small-line'></div> <div class='bottom-small-line'></div>
...@@ -22,16 +28,24 @@ ...@@ -22,16 +28,24 @@
</van-button> </van-button>
</div> </div>
<!-- <div class='px-5 flex align-center justify-around' v-if='step == 2'> <div class='px-5 flex align-center justify-around' v-if='step == 2'>
<van-button type='primary' round plain style='width: 44%' <van-button type='primary' round plain style='width: 44%'
@click='toNext(1)'>上一步 @click='toNext(1)'>上一步
</van-button> </van-button>
<van-button type='primary' round style='width: 44%' <van-button type='primary' round style='width: 44%'
@click='toNext(3)'>下一步 @click='toNext(3)'>下一步
</van-button> </van-button>
</div>--> </div>
<div class='px-5 flex align-center justify-around' v-if='step == 3'>
<van-button type='primary' round plain style='width: 44%'
@click='toNext(2)'>上一步
</van-button>
<van-button type='primary' round style='width: 44%'
@click='toNext(4)'>下一步
</van-button>
</div>
<div class='px-5 grow flex flex-col justify-end' v-if='step == 2'> <div class='px-5 grow flex flex-col justify-end' v-if='step == 4'>
<van-button type='primary' block round <van-button type='primary' block round
@click='onsubmit'>提交 @click='onsubmit'>提交
</van-button> </van-button>
...@@ -43,12 +57,14 @@ ...@@ -43,12 +57,14 @@
<script> <script>
import DocNavBar from '@/doctor/components/docNavBar/DocNavBar.vue' import DocNavBar from '@/doctor/components/docNavBar/DocNavBar.vue'
import ArchiveCommon from '@/doctor/components/archiveCommon/archiveCommon' import ArchiveCommon from '@/doctor/components/archiveCommon/archiveCommon'
import { fetchCurrencyById, getChronicResidentsId, getResidentWX } from '@/api/doctor/generalFU' import { fetchCurrencyById, getChronicResidentsId } from '@/api/doctor/generalFU'
import FormCont from '@/doctor/screening/second/FormCont' import FormCont from '@/doctor/screening/second/FormCont'
import Result from '@/doctor/screening/second/Result' import Result from '@/doctor/screening/second/Result'
import DiseaseSelect from '@/doctor/screening/second/DiseaseSelect'
export default { export default {
components: { components: {
DiseaseSelect,
Result, Result,
FormCont, FormCont,
ArchiveCommon, ArchiveCommon,
...@@ -57,7 +73,8 @@ export default { ...@@ -57,7 +73,8 @@ export default {
data() { data() {
return { return {
step: 1, step: 1,
info: {} info: {},
diseaseArraysInfo: []
} }
}, },
computed: { computed: {
...@@ -107,11 +124,14 @@ export default { ...@@ -107,11 +124,14 @@ export default {
async toNext(val) { async toNext(val) {
this.$refs.all.scrollTo(0, 0) this.$refs.all.scrollTo(0, 0)
if (val == 2) { if (val == 2) {
this.firstForm = await this.$refs.baseInfo.onSubmit() await this.$refs.baseInfo.onSubmit()
}
if (val == 3) {
this.diseaseArraysInfo = await this.$refs.diseaseInfo.onSubmit() || []
}
if (val == 4) {
await this.$refs.formInfo.onSubmit()
} }
// if (val == 3) {
// await this.$refs.formInfo.onSubmit()
// }
this.step = val this.step = val
}, },
//提交所有表单 //提交所有表单
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment