|
|
@@ -13,7 +13,7 @@
|
|
|
</mp-cell>
|
|
|
</view> -->
|
|
|
<view style="border-top: 8rpx solid #eee;" v-if="patientData.changeDataFlag != 'N'">
|
|
|
- <picker @change="bindHistoryRecordChange" :value="historyRecordIndex" :range="historyRecordList" range-key="name">
|
|
|
+ <picker v-if="historyRecordList.length > 0" @change="bindHistoryRecordChange" :value="historyRecordIndex" :range="historyRecordList" range-key="name">
|
|
|
<mp-cell class="diag-form__cell">
|
|
|
<view class="diag-form__line">
|
|
|
<view class="diag-form__label">历史病历</view>
|
|
|
@@ -23,6 +23,14 @@
|
|
|
</view>
|
|
|
</mp-cell>
|
|
|
</picker>
|
|
|
+ <mp-cell v-else class="diag-form__cell" @tap="showNoHistoryRecord">
|
|
|
+ <view class="diag-form__line">
|
|
|
+ <view class="diag-form__label">历史病历</view>
|
|
|
+ <view class="diag-form__picker empty-history-record">
|
|
|
+ {{ historyRecordLoading ? '加载中...' : '暂无可引用病历' }}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </mp-cell>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view style="padding-bottom: 60rpx;">
|
|
|
@@ -426,7 +434,8 @@ export default {
|
|
|
hisDataMap: {}, //HIS默认值映射(以code为key,值为dataInfo)
|
|
|
historyRecordIndex: -1, // 历史病历当前选中的索引
|
|
|
historyRecordList: [], // 历史病历列表数据
|
|
|
- selectedHistoryRecord: {} // 当前选中的历史病历
|
|
|
+ selectedHistoryRecord: {}, // 当前选中的历史病历
|
|
|
+ historyRecordLoading: false // 历史病历列表加载状态
|
|
|
};
|
|
|
},
|
|
|
/**
|
|
|
@@ -1371,6 +1380,7 @@ export default {
|
|
|
getHistoryRecordList() {
|
|
|
let patientData = Cache.get('patientData');
|
|
|
let that = this;
|
|
|
+ this.setData({ historyRecordLoading: true });
|
|
|
$http.post('urlS', this, {
|
|
|
code: '06010117',
|
|
|
data: {
|
|
|
@@ -1390,15 +1400,32 @@ export default {
|
|
|
};
|
|
|
});
|
|
|
that.setData({
|
|
|
- historyRecordList: mappedList
|
|
|
+ historyRecordList: mappedList,
|
|
|
+ historyRecordLoading: false
|
|
|
});
|
|
|
} else {
|
|
|
+ that.setData({
|
|
|
+ historyRecordList: [],
|
|
|
+ historyRecordLoading: false
|
|
|
+ });
|
|
|
uni.showToast({ title: '请求异常:' + res.errorCode + res.errorMessage, icon: 'none' });
|
|
|
}
|
|
|
+ },
|
|
|
+ fail: function () {
|
|
|
+ that.setData({
|
|
|
+ historyRecordList: [],
|
|
|
+ historyRecordLoading: false
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ // 无可用历史病历时不打开空白 picker,给出明确提示
|
|
|
+ showNoHistoryRecord() {
|
|
|
+ if (this.historyRecordLoading) return;
|
|
|
+ uni.showToast({ title: '暂无可引用病历', icon: 'none' });
|
|
|
+ },
|
|
|
+
|
|
|
// 历史病历 picker 选择事件
|
|
|
bindHistoryRecordChange(e) {
|
|
|
let index = e.detail.value;
|
|
|
@@ -2035,4 +2062,8 @@ export default {
|
|
|
word-break: break-all;
|
|
|
white-space: nowrap;
|
|
|
}
|
|
|
+
|
|
|
+.empty-history-record {
|
|
|
+ color: #9ca3af;
|
|
|
+}
|
|
|
</style>
|