Explorar o código

暂无可用历史病历提示

yanqiliang hai 1 semana
pai
achega
d99c5475bc

+ 3 - 3
src/pages/entryWrite/page/Entry/medicalRecord/InfoCollection.js

@@ -12,7 +12,7 @@ Page({
       title: '信息采集单', //导航栏 中间的标题
     },
     imgHost: httpConfig && httpConfig.imgHost,
-    windowHost: httpConfig && httpConfig.ipDeault ? httpConfig.ipDeault : "https://np.h03.p0551.com",
+    windowHost: httpConfig && httpConfig.ipDeault ? httpConfig.ipDeault : "",
     navHeight: app.globalData.navHeight,
     spaceHeight: app.globalData.spaceHeight,
     navTitleHeight: app.globalData.navTitleHeight,
@@ -58,7 +58,7 @@ Page({
     let that = this;
     wx.request({
       // todo html模板链接
-      url: 'https://np.h03.p0551.com' + '/EMRFile/download/emr_html/' + url,
+      url: 'https://hlwyy.scsmysgkyy.cn' + '/EMRFile/download/emr_html/' + url,
       method: 'GET',
       success: function (res) {
         const htmlStr = res.data;
@@ -231,4 +231,4 @@ Page({
       }
     });
   }
-})
+})

+ 34 - 3
src/pages/entryWrite/page/Entry/medicalRecord/medicalRecord.vue

@@ -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>