|
|
@@ -45,7 +45,7 @@
|
|
|
<view class="info">
|
|
|
<text class="sex" v-if="item.gender==1">男</text>
|
|
|
<text class="sex" v-if="item.gender==2">女</text>
|
|
|
- <text class="ege">{{$getAge(item.birthday)}}岁</text>
|
|
|
+ <text class="ege">{{item.birthday?$getAge(item.birthday):'-'}}岁</text>
|
|
|
</view>
|
|
|
<!-- 选中的对号角标 -->
|
|
|
<image v-if="patientId == item.patientId" class="active-img" src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/sel_right50.png" mode=""></image>
|
|
|
@@ -650,22 +650,24 @@
|
|
|
uni.hideLoading()
|
|
|
if(res.code==200){
|
|
|
this.patient=res.data;
|
|
|
- if(this.patient&&this.patient.length>0) {
|
|
|
- const existIndex = this.patient.findIndex(
|
|
|
- item => item.patientId === this.patientInfo.patientId
|
|
|
- );
|
|
|
-
|
|
|
- if (existIndex === -1) {
|
|
|
- // 使用 Vue 的数组变异方法,确保视图更新
|
|
|
- this.patient.unshift({ ...this.patientInfo });
|
|
|
- } else if (existIndex > 0) {
|
|
|
- // 已存在但不是第一个,移到最前面
|
|
|
- const item = this.patient[existIndex];
|
|
|
- this.patient.splice(existIndex, 1);
|
|
|
- this.patient.unshift(item);
|
|
|
+ if(this.dataPrescribeKey) {
|
|
|
+ if(this.patient&&this.patient.length>0) {
|
|
|
+ const existIndex = this.patient.findIndex(
|
|
|
+ item => item.patientId === this.patientInfo.patientId
|
|
|
+ );
|
|
|
+
|
|
|
+ if (existIndex === -1) {
|
|
|
+ // 使用 Vue 的数组变异方法,确保视图更新
|
|
|
+ this.patient.unshift({ ...this.patientInfo });
|
|
|
+ } else if (existIndex > 0) {
|
|
|
+ // 已存在但不是第一个,移到最前面
|
|
|
+ const item = this.patient[existIndex];
|
|
|
+ this.patient.splice(existIndex, 1);
|
|
|
+ this.patient.unshift(item);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.patient = [this.patientInfo]
|
|
|
}
|
|
|
- } else {
|
|
|
- this.patient = [this.patientInfo]
|
|
|
}
|
|
|
}else{
|
|
|
uni.showToast({
|