|
@@ -3,7 +3,7 @@
|
|
<view class="patient-box">
|
|
<view class="patient-box">
|
|
<view class="patient-head">
|
|
<view class="patient-head">
|
|
<view class="patient-title">选择就诊人</view>
|
|
<view class="patient-title">选择就诊人</view>
|
|
- <view class="x-f" @click="addPatient()"><u-icon name="plus-circle" size="36rpx" color="#222"></u-icon>添加</view>
|
|
|
|
|
|
+ <view class="x-f" @click="addPatient()"><uni-icons type="plus" size="36rpx" color="#222"></uni-icons>添加</view>
|
|
</view>
|
|
</view>
|
|
<scroll-view scroll-x :scroll-into-view="scrollIntoView" :scroll-with-animation="true" class="patient-list" v-if="patientList&&patientList.length>0">
|
|
<scroll-view scroll-x :scroll-into-view="scrollIntoView" :scroll-with-animation="true" class="patient-list" v-if="patientList&&patientList.length>0">
|
|
<view :id="'patient_'+i" :class="current == i ? 'patient-item patient-active':'patient-item'" v-for="(item,i) in patientList" :key="item.patientId" @click="handlePatient(item,i)">
|
|
<view :id="'patient_'+i" :class="current == i ? 'patient-item patient-active':'patient-item'" v-for="(item,i) in patientList" :key="item.patientId" @click="handlePatient(item,i)">
|
|
@@ -13,9 +13,7 @@
|
|
<text class="text" v-if="item.sex==2">女</text>
|
|
<text class="text" v-if="item.sex==2">女</text>
|
|
<text class="text">{{$getAge(item.birthday)}}岁</text>
|
|
<text class="text">{{$getAge(item.birthday)}}岁</text>
|
|
</view>
|
|
</view>
|
|
- <view class="checkmarkempty" v-show="current == i">
|
|
|
|
- <u-icon name="checkmark" size="28rpx" color="#fff"></u-icon>
|
|
|
|
- </view>
|
|
|
|
|
|
+ <uni-icons v-show="current == i" class="checkmarkempty" type="checkmarkempty" size="28rpx" color="#fff"></uni-icons>
|
|
</view>
|
|
</view>
|
|
</scroll-view>
|
|
</scroll-view>
|
|
</view>
|
|
</view>
|
|
@@ -33,18 +31,6 @@
|
|
patientList: [],
|
|
patientList: [],
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- mounted() {
|
|
|
|
- this.getPatientList()
|
|
|
|
- },
|
|
|
|
- watch: {
|
|
|
|
- patient(newVal) {
|
|
|
|
- const index = this.patientList.findIndex(item=>item.patientId == newVal.patientId)
|
|
|
|
- this.current = index > -1 ? index : 0
|
|
|
|
- setTimeout(()=>{
|
|
|
|
- this.scrollIntoView = `patient_${this.current}`
|
|
|
|
- },100)
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
methods: {
|
|
methods: {
|
|
getPatientList(){
|
|
getPatientList(){
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
@@ -55,6 +41,12 @@
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
if(res.code==200){
|
|
if(res.code==200){
|
|
this.patientList=res.data;
|
|
this.patientList=res.data;
|
|
|
|
+ if(this.patient&&this.patient.patientId) {
|
|
|
|
+ const index = this.patientList.findIndex(item=>item.patientId == this.patient.patientId)
|
|
|
|
+ this.current = index > -1 ? index : 0
|
|
|
|
+ } else {
|
|
|
|
+ this.current = 0
|
|
|
|
+ }
|
|
const patient = this.patientList&&this.patientList.length> 0 ? this.patientList[this.current] : null
|
|
const patient = this.patientList&&this.patientList.length> 0 ? this.patientList[this.current] : null
|
|
uni.$emit('refreshOrderPatient',patient)
|
|
uni.$emit('refreshOrderPatient',patient)
|
|
}else{
|
|
}else{
|