|
@@ -5,13 +5,13 @@
|
|
|
<template v-for="(item, idx) in sickHisList" :key="idx">
|
|
<template v-for="(item, idx) in sickHisList" :key="idx">
|
|
|
<view :id="'a' + item.id" v-if="isShowItem(item)">
|
|
<view :id="'a' + item.id" v-if="isShowItem(item)">
|
|
|
<uni-forms-item :label=" item.is_child == '0' ? item.number + '.' + item.name : item.number + item.name" :isMultiple="item.type" isBold="bold" :nowLabelItem="item" :isShowInput="item.type == 3"
|
|
<uni-forms-item :label=" item.is_child == '0' ? item.number + '.' + item.name : item.number + item.name" :isMultiple="item.type" isBold="bold" :nowLabelItem="item" :isShowInput="item.type == 3"
|
|
|
- :nowIndex='item.number' @input="titleInput(item,$event)" @change="totalCalc(item,$event)" @percent="percentCalc(item,$event)" v-if="item.id != 205">
|
|
|
|
|
|
|
+ :nowIndex='item.number' @input="titleInput(item,$event)" @change="totalCalc(item,$event)" @percent="percentCalc(item,$event)" v-if="!isHeadacheItem(item)">
|
|
|
<view v-if="item.pic_url">
|
|
<view v-if="item.pic_url">
|
|
|
<image :src="globalUrl + item.pic_url" mode="aspectFit" style="width: 95%;height: 230rpx;" @click="preview(globalUrl + item.pic_url)"></image>
|
|
<image :src="globalUrl + item.pic_url" mode="aspectFit" style="width: 95%;height: 230rpx;" @click="preview(globalUrl + item.pic_url)"></image>
|
|
|
</view>
|
|
</view>
|
|
|
<uni-data-checkbox v-model="item.answer" :multiple="item.type" :localdata="item.items" @change="change(idx,item,$event)" v-if="item.type!=3"/>
|
|
<uni-data-checkbox v-model="item.answer" :multiple="item.type" :localdata="item.items" @change="change(idx,item,$event)" v-if="item.type!=3"/>
|
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
|
- <uni-forms-item label="( 1 ) 头痛的时间" isBold="bold" v-if="item.id == 205" >
|
|
|
|
|
|
|
+ <uni-forms-item label="( 1 ) 头痛的时间" isBold="bold" v-if="isHeadacheItem(item)" >
|
|
|
<view class="display-between" style="width:350rpx">
|
|
<view class="display-between" style="width:350rpx">
|
|
|
<uni-easyinput :value="headache" @input="headache = $event" type="number" widthStyle="160rpx" />
|
|
<uni-easyinput :value="headache" @input="headache = $event" type="number" widthStyle="160rpx" />
|
|
|
<uni-data-checkbox v-model="unitValue" :localdata="unitList" @change="unitChange($event)" :wrap="true" />
|
|
<uni-data-checkbox v-model="unitValue" :localdata="unitList" @change="unitChange($event)" :wrap="true" />
|
|
@@ -57,8 +57,9 @@ export default {
|
|
|
},
|
|
},
|
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
|
this.pageId = option.id || 1;
|
|
this.pageId = option.id || 1;
|
|
|
|
|
+ this.pageName = option.name || '病史信息'
|
|
|
uni.setNavigationBarTitle({
|
|
uni.setNavigationBarTitle({
|
|
|
- title: option.name || '病史信息'
|
|
|
|
|
|
|
+ title: this.pageName
|
|
|
});
|
|
});
|
|
|
this.getcategory(this.pageId)
|
|
this.getcategory(this.pageId)
|
|
|
},
|
|
},
|
|
@@ -66,6 +67,13 @@ export default {
|
|
|
isShowItem(item){
|
|
isShowItem(item){
|
|
|
return !!(item && item.isShow)
|
|
return !!(item && item.isShow)
|
|
|
},
|
|
},
|
|
|
|
|
+ // "头痛的时间"是"病史信息"模块里一道写死用 id=205 特殊渲染的题目。题目 id 是各量表各自独立编号的,不是全局唯一,
|
|
|
|
|
+ // VHI-30 量表里也存在 id=205 的题目(内容跟头痛无关),加了两层判断:进入模块时的顶层 category_id(pageId) + 题目 id,
|
|
|
|
|
+ // pageId=1 已确认是进入"病史信息"模块时传的顶层分类 ID,比页面名称字符串更可靠,顺带保留页面名称兜底。
|
|
|
|
|
+ // TODO: 等"病史信息"题目接口有真实数据后,最好换成后台专门给这道题的类型标识字段来判断,不再靠 id/分类猜测
|
|
|
|
|
+ isHeadacheItem(item){
|
|
|
|
|
+ return !!(item && (item.id == 205 || item.id == '205') && (this.pageId == 1 || this.pageId == '1') && this.pageName === '病史信息')
|
|
|
|
|
+ },
|
|
|
unitChange(e){
|
|
unitChange(e){
|
|
|
this.unitValue = e.detail.value;
|
|
this.unitValue = e.detail.value;
|
|
|
this.unitSubmit = e.detail.value;
|
|
this.unitSubmit = e.detail.value;
|
|
@@ -267,7 +275,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
that.sickHisList.forEach((item)=>{
|
|
that.sickHisList.forEach((item)=>{
|
|
|
- if (item.id == 205 || item.id == "205"){
|
|
|
|
|
|
|
+ if (this.isHeadacheItem(item)){
|
|
|
this.unitValue = item.answer.substr(-1);
|
|
this.unitValue = item.answer.substr(-1);
|
|
|
this.unitSubmit = this.unitValue;
|
|
this.unitSubmit = this.unitValue;
|
|
|
this.headache = item.answer.substr(0,(item.answer.length-1));
|
|
this.headache = item.answer.substr(0,(item.answer.length-1));
|
|
@@ -332,13 +340,13 @@ export default {
|
|
|
if(result){
|
|
if(result){
|
|
|
// 修复:其他题目已有答案时,原来这里直接原样返回,完全没处理"头痛的时间"(id=205),
|
|
// 修复:其他题目已有答案时,原来这里直接原样返回,完全没处理"头痛的时间"(id=205),
|
|
|
// 会导致这道题的答案静默丢失,不会提交给后端。补上和 else 分支一致的拼接方式。
|
|
// 会导致这道题的答案静默丢失,不会提交给后端。补上和 else 分支一致的拼接方式。
|
|
|
- let headacheItem = this.sickHisList.find((item)=>{ return item.id == 205 })
|
|
|
|
|
|
|
+ let headacheItem = this.sickHisList.find((item)=>{ return this.isHeadacheItem(item) })
|
|
|
if(headacheItem){
|
|
if(headacheItem){
|
|
|
result = headacheItem.id + ':' + this.headache + this.unitSubmit + ';' + result
|
|
result = headacheItem.id + ':' + this.headache + this.unitSubmit + ';' + result
|
|
|
}
|
|
}
|
|
|
}else {
|
|
}else {
|
|
|
this.sickHisList.forEach((item)=>{
|
|
this.sickHisList.forEach((item)=>{
|
|
|
- if (item.id == 205){
|
|
|
|
|
|
|
+ if (this.isHeadacheItem(item)){
|
|
|
result = item.id + ':' + this.headache + this.unitSubmit + ';' + result
|
|
result = item.id + ':' + this.headache + this.unitSubmit + ';' + result
|
|
|
}
|
|
}
|
|
|
else{
|
|
else{
|
|
@@ -354,7 +362,7 @@ export default {
|
|
|
if(Array.isArray(item.answer) && item.answer.length === 1 && item.answer[0] === ''){
|
|
if(Array.isArray(item.answer) && item.answer.length === 1 && item.answer[0] === ''){
|
|
|
item.answer = ''
|
|
item.answer = ''
|
|
|
}
|
|
}
|
|
|
- if(item.id == 205){
|
|
|
|
|
|
|
+ if(this.isHeadacheItem(item)){
|
|
|
item.answer = this.headache;
|
|
item.answer = this.headache;
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|