yanqiliang 1 месяц назад
Родитель
Сommit
f8f0e3b2a8
7 измененных файлов с 89 добавлено и 81 удалено
  1. 4 32
      App.vue
  2. 2 2
      manifest.json
  3. 10 0
      pages.json
  4. 0 9
      pages/authentication/authentication.vue
  5. 32 31
      pages/index/index.vue
  6. 25 1
      utils/common.js
  7. 16 6
      utils/util.js

+ 4 - 32
App.vue

@@ -64,40 +64,11 @@ function initScan() {
             if (typeof code === 'string') {
               code = code.replace(/\s+/g, '')
             }
-            console.log('接收的条码数据:', code)
-      
              // 从全局变量中获取当前路由(避开uni API)
 			  const currentRoute = uni.$appGlobal?.globalData?.value?.currentRoute || ''
-		
-			  // 目标页面路由
-			  const targetPagePath = 'pages/nurseRecordPage/nurseRecordPage'
-			  
-			 if (currentRoute === targetPagePath) {
-				 // 调用目标页面方法(需确保页面已加载)
-				 // 延迟确保页面已完全加载
-				 setTimeout(() => {
-				   const pages = getCurrentPages()
-				   if (!pages || pages.length === 0) {
-					 console.error('页面栈为空,无法获取页面实例')
-					 return
-				   }
-				   const currentPage = pages[pages.length - 1]
-				   // 严格检查页面实例和函数是否存在
-				   if (!currentPage) {
-					 console.error('当前页面实例不存在')
-					 return
-				   }
-				   if (!currentPage.$vm) {
-					 console.error('当前页面的Vue实例不存在')
-					 return
-				   }
-				   if (typeof currentPage.$vm.getPDAScanInfo !== 'function') {
-					 console.error('目标页面未定义getPDAScanInfo函数,请检查页面代码')
-					 return
-				   }
-				   // 所有检查通过后调用
-				   currentPage.$vm.getPDAScanInfo(code)
-				 }, 100) // 适当延长延迟时间,确保页面初始化完成
+			 if (currentRoute === 'pages/nurseRecordPage/nurseRecordPage' ||
+			 currentRoute === 'pages/addVisitatPage/addVisitatPage') {
+				 uni.$emit('callGetPDAScanInfo', code);
 			   } else {
 				 if (code.length === 10) {
 				   Util.getPatInfoNew(code, (patInfo) => {
@@ -190,6 +161,7 @@ page {
   justify-content: center;
   display: flex;
   border-radius: 0 !important;
+  color: #000;
 }
 
 .multiBtn-right {

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "普瑞眼科移动护理v3",
     "appid" : "__UNI__58FA072",
     "description" : "",
-    "versionName" : "1.2.3",
-    "versionCode" : 123,
+    "versionName" : "1.2.4",
+    "versionCode" : 124,
     "transformPx" : false,
     "app-plus" : {
         "usingComponents" : true,

+ 10 - 0
pages.json

@@ -61,6 +61,16 @@
 				},
 				"navigationStyle": "custom"
 			}
+		},
+		{
+			"path" : "pages/addVisitatPage/addVisitatPage",
+			"style": {
+				"navigationBarTitleText": "新巡视单记录",
+				"usingComponents": {
+					"nav-bar": "/pages/components/navbar/index"
+				},
+				"navigationStyle": "custom"
+			}
 		}
 	],
 	"uniIdRouter": {},

+ 0 - 9
pages/authentication/authentication.vue

@@ -63,8 +63,6 @@ const wxUserValue = ref('');
 const wxUserValuePass = ref('');
 const motto = ref('请确保设备在医院内网环境下使用!');
 const userInfo = ref({});
-const hasUserInfo = ref(false);
-const canIUse = ref(uni.canIUse('button.open-type.getUserInfo'));
 const agreeFlag = ref(true);
 
 // 导航栏数据
@@ -97,13 +95,6 @@ onShow(() => {
     }
 });
 
-// 方法定义
-const getUserInfo = (e) => {
-    // 注释掉的代码保持不变
-    // userInfo.value = e.detail.userInfo;
-    // hasUserInfo.value = true;
-};
-
 const confirm = () => {
     const currentHospUrl = hospUrlIP.value;
     const userName = wxUserValue.value;

+ 32 - 31
pages/index/index.vue

@@ -32,13 +32,16 @@
                 <view class="changeloc" @tap="changeloc">切换科室</view>
               </span>
             </view>
+			<progress :percent="percent" activeColor="#D52424" stroke-width="1"></progress>
           </view>
         </view>
-        <progress :percent="percent" activeColor="#D52424" stroke-width="1"></progress>
       </view>
-
+		
+		<view class="activeButView">
+			<button class="activeBut" type="primary" @click="gotoAddVisitat">快捷巡视单</button>
+		</view>
+		
       <view class="wardtitle">
-        <!-- <text style="padding-left: 3px">在院患者 ({{ userData.locDesc }})</text> -->
 		 <view @click="togglePatientType">
 		      <text style="padding-left: 3px">{{ currentType }}</text>
 		      <text class="refresh-icon"> ↺切换</text>
@@ -157,25 +160,6 @@ import { $http } from '../../config/https';
 import navBar from '@/pages/components/navbar/index';
 import PaymentDetailPopup from '@/pages/components/PaymentDetailPopup.vue'
 
-// // 工具函数(替代原wxs模块)
-// const getspan = (widh) => {
-//   return widh.replace("px", "");
-// };
-
-// const findPat = (patinfo, searchData) => {
-//   if (!searchData) return 1;
-//   const searchStr = searchData.toUpperCase();
-//   return (
-//     patinfo.patName.includes(searchData) ||
-//     patinfo.admBedCode.includes(searchData) ||
-//     patinfo.patID.includes(searchData) ||
-//     patinfo.patNameSpell.includes(searchStr) ||
-//     patinfo.patNo.includes(searchStr) ||
-//     patinfo.patMedicalNo.includes(searchStr) ||
-//     patinfo.admID === searchData
-//   ) ? 1 : 0;
-// };
-
 const getposition = (iconitem) => {
   return `-${(iconitem.position % 10 - 1) * 18}px -${Math.floor(iconitem.position / 10) * 18}px`;
 };
@@ -204,7 +188,6 @@ const locList = ref([]);
 const curLoc = ref(-1);
 const wardPatList = ref('');
 const percent = ref(0);
-const downLineShow = ref(true);
 // 控制弹框显示/隐藏
 const showPopup = ref(false);
 // 患者信息(响应式对象)
@@ -229,6 +212,11 @@ const togglePatientType = () => {
 const currentType = computed(() => {
   return patientTypes[currentTypeIndex.value].label;
 });
+//跳转到添加巡视单快捷页面
+const gotoAddVisitat = () => {
+	// 新巡视单模板id:  306
+	Common.getToAddVisitatRecordPage('306', 0, '快捷巡视单记录', 'E');
+}
 
 onShow(() => {
   try {
@@ -408,7 +396,11 @@ const getWardPatList = () => {
   $http.post('urlDeault',this, {
     code: '04020025',
     data: {
-      params: [{ wardID: userData.locID, patMessage: searchData.value || '' }]
+      params: [{ 
+		wardID: userData.locID, 
+		patMessage: searchData.value || '',
+		deviceType:'PDA'
+		}]
     },
     success: (res) => {
       uni.hideLoading();
@@ -620,7 +612,6 @@ const changeToLoc = (loc) => {
 
 .userbg {
     width: 100%;
-    height: 340rpx;
     background-size: 100% auto;
     background-repeat: no-repeat;
 }
@@ -661,7 +652,7 @@ const changeToLoc = (loc) => {
 
 .user {
     width: calc(100% - 30rpx);
-    height: 200rpx;
+    height: 160rpx;
     background-size: 100% auto;
     background-repeat: no-repeat;
     padding: 0 18rpx 20rpx;
@@ -672,10 +663,10 @@ const changeToLoc = (loc) => {
     border-radius: 50%;
     margin-left: 12rpx;
     background: #e3e4fc;
-    height: 120rpx;
+    height: 100rpx;
     width: 120rpx;
     text-align: center;
-    line-height: 120rpx;
+    line-height: 100rpx;
     float: left;
     margin: 40rpx 20rpx;
 }
@@ -683,7 +674,7 @@ const changeToLoc = (loc) => {
 .userinfo {
     float: left;
     width: calc(100% - 190rpx);
-    height: 120rpx;
+    height: 100rpx;
     margin: 40rpx 0;
     line-height: 60rpx;
     padding-right: 30rpx;
@@ -700,7 +691,17 @@ const changeToLoc = (loc) => {
     width: 120rpx;
     border-radius: 50%;
 }
-
+.progressView{
+	width: 100%;
+}
+.activeButView{
+	padding: 0 30rpx 30rpx 30rpx;
+}
+.activeBut{
+	height: 70rpx;
+	line-height: 70rpx;
+	padding-top: 4rpx;
+}
 .wardtitle {
     width: calc(100% - 56px);
     margin: 0 28rpx;
@@ -768,7 +769,7 @@ const changeToLoc = (loc) => {
 
 .patcontent {
     overflow: auto;
-    height: calc(100% - 500rpx);
+    height: calc(100% - 560rpx);
 }
 
 .patlist .van-cell,

+ 25 - 1
utils/common.js

@@ -21,8 +21,32 @@ export const getToRecordPage = (templateID, newFlag, title, editFlag) => {
         }
     });
 };
+/**
+ * 跳转到巡视单书写界面
+ * @param {模板ID} templateID
+ * @param {是否新增} newFlag
+ * @param {标题} title
+ * @param {编辑标识} editFlag
+ */
+export const getToAddVisitatRecordPage = (templateID, newFlag, title, editFlag) => {
+    // 处理编辑标识
+    if (newFlag === '0') {
+        editFlag = 'E';
+    }
+    // 跳转页面
+    uni.navigateTo({
+        url: `/pages/addVisitatPage/addVisitatPage?templateID=${templateID}&newFlag=${newFlag}&title=${title}&editFlag=${editFlag}`,
+        success: () => {
+            // 跳转成功
+        },
+        fail: () => {
+            // 跳转失败
+        }
+    });
+};
 
 // 导出为默认模块(可选,根据使用习惯)
 export default {
-    getToRecordPage
+    getToRecordPage,
+	getToAddVisitatRecordPage
 };

+ 16 - 6
utils/util.js

@@ -82,12 +82,22 @@ const getPatInfoNew = (patNo, callback) => {
         },
         success: (res) => {
             if (res.errorCode === '0') {
-                uni.setStorage({
-                    data: res.result,
-                    key: 'patInfo'
-                });
-                callback(res.result);
-            }
+				uni.setStorage({
+				  key: 'patInfo',
+				  data: res.result,
+				  success: () => {
+				    callback(res.result);
+				  },
+				  fail: (err) => {
+				    console.error('存储 patInfo 失败:', err);
+				  }
+				});
+            }else{
+				uni.showToast({
+				    title: res.errorMessage,
+				    icon: 'none'
+				});
+			}
         }
     });
 };