Browse Source

feat: 更新

贺智杰 5 days ago
parent
commit
4370cfa773

+ 1 - 1
.env.development

@@ -1,7 +1,7 @@
 # 本地环境
 VITE_NODE_ENV = dev
 
-VITE_APP_API_BASEURL4='http://10.144.117.40:8001'
+VITE_APP_API_BASEURL4='http://192.168.96.208:8001'
 
 VITE_APP_API_BASEURL3='http://120.24.148.97:443'
 

+ 1 - 1
manifest.json

@@ -59,7 +59,7 @@
     "quickapp" : {},
     /* 小程序特有相关 */
     "mp-weixin" : {
-        "appid" : "wx5fd8909f6a561daf",
+        "appid" : "wxc6266b2eeba52ee1",
         "setting" : {
             "urlCheck" : true,
             "minified" : true,

+ 7 - 0
packages/traceabilityReport/pages/blacklist/index.vue

@@ -6,6 +6,7 @@
 				{{ t.label }}
 			</view>
 		</view>
+		<view class="tip">数据更新时间:{{ formatDate(new Date().setDate(new Date().getDate() - 1), 'YYYY-MM-DD') || '--' }}</view>
 		<view class="card" :style="{ height: tableBodyHeight + 'rpx' }">
 			<scroll-view class="grid-scroll" scroll-y="true" scroll-x="true" :show-scrollbar="false"
 				:style="{ maxHeight: tableBodyHeight + 'rpx' }" enhanced @scrolltolower="onTableScrollToLower">
@@ -263,6 +264,12 @@ export default {
 	padding-bottom: calc(50rpx + env(safe-area-inset-bottom));
 }
 
+.tip {
+	font-size: 24rpx;
+	color: #999;
+	margin-bottom: 30rpx;
+}
+
 .tabs {
 	display: flex;
 	align-items: center;

+ 1 - 1
packages/traceabilityReport/pages/index.vue

@@ -3,7 +3,7 @@
     <view class="tabs-container">
       <view class="tabs">
         <view class="tab" :class="{ active: activeTab === 'scan' }" @click="activeTab = 'scan'">扫码率</view>
-        <view v-if="hasReportFunction" class="tab" :class="{ active: activeTab === 'export' }" @click="activeTab = 'export'">报表导出</view>
+        <view class="tab" :class="{ active: activeTab === 'export' }" @click="activeTab = 'export'">报表导出</view>
         <view class="tab" :class="{ active: activeTab === 'blacklist' }" @click="activeTab = 'blacklist'">黑名单汇总</view>
       </view>
     </view>

+ 1 - 0
packages/traceabilityReport/pages/reportExport/index.vue

@@ -625,6 +625,7 @@ export default {
       if (this.fetchLoading) return;
       this.fetchLoading = true;
       request("/report/getReportTaskPage", {
+        reportType: 2,
         taskType: statusMap?.[this.filterForm?.status] || "",
         drugEntBaseInfoId: this.filterForm?.product?.drugEntBaseInfoId,
         beginTime: this.filterDateRange[0],

+ 28 - 12
packages/utils/utils.js

@@ -6,17 +6,39 @@ import {
 //data: 日期对象或时间戳
 //format: 格式化字符串,默认"YYYY-MM-DD hh:mm:ss"
 export function formatDate(
-  data = { date: null, timestamp: null },
+  data,
   format = "YYYY-MM-DD hh:mm:ss"
 ) {
-  if (!data?.date && !data?.timestamp) {
+  if (data === null || data === undefined) {
     return ""
   }
-  let date = data?.date
+  let date = data
+  if (typeof data === 'object' && !(data instanceof Date)) {
+    if (data.date) {
+      date = data.date
+    } else if (data.timestamp) {
+      date = data.timestamp * 1000
+    } else if (Object.keys(data).length === 0) {
+        // empty object
+        return ""
+    }
+    // If object but no date/timestamp property found, and not a Date object, 
+    // it might be intended as 'date' if it was structured differently, 
+    // but based on previous code, it only looked for date/timestamp.
+    // However, if we want to support direct values, we assume 'date' holds the value 
+    // extracted above. 
+    // But wait, if data is { other: 1 }, date becomes { other: 1 }. new Date({other:1}) is Invalid Date usually.
+  }
+  
   if (!date) {
-    date = data?.timestamp * 1000
+      return ""
   }
+
   const d = new Date(date);
+  if (isNaN(d.getTime())) {
+      return ""
+  }
+
   const year = d.getFullYear();
   const month = String(d.getMonth() + 1).padStart(2, "0");
   const day = String(d.getDate()).padStart(2, "0");
@@ -39,22 +61,16 @@ export function getUid(len = 16) {
   return (ts + rand).slice(0, len);
 }
 
-let permissions = []
-
 //判断是否有某个功能权限
 export function hasFunction(key) {
   return new Promise((resolve, reject) => {
-    if (permissions.length) {
-      resolve(permissions.includes(key))
-      return
-    }
     Request(
       {
         url: "/v1/api/basic/home/menu?type=3",
-        method,
+        method: 'GET',
       }
     ).then((res) => {
-      permissions = res.data?.permissions || []
+      const permissions = res.data?.permissions || []
       resolve(permissions.includes(key))
     }).catch(err => {
       reject(err)

+ 23 - 17
pages/home/home.vue

@@ -89,27 +89,12 @@
 					</view>
 				</uni-grid-item>
 
-				<uni-grid-item>
-					<view class="grid-item-box" @click="goScan">
-						<view class="img-box">
-							<image src="@/static/scan.png" class="img" mode=""></image>
-						</view>
-						<text class="text">溯源扫码</text>
-					</view>
-				</uni-grid-item>
-
-				<uni-grid-item>
-					<view class="grid-item-box" @click="goReport">
-						<view class="img-box">
-							<image src="@/static/report.png" class="img" mode=""></image>
-						</view>
-						<text class="text">溯源报表</text>
-					</view>
-				</uni-grid-item>
 
 			</uni-grid>
 		</uni-section>
 
+
+
 		<uni-section title="智能预警" titleColor="#038CFF" type="line" :padding="false">
 			<uni-grid :column="4" :showBorder="false" :highlight="true">
 				<uni-grid-item>
@@ -127,6 +112,27 @@
 				</uni-grid-item>
 			</uni-grid>
 		</uni-section>
+		<uni-section title="鱼跃龙门" titleColor="#038CFF" type="line" :padding="false">
+			<uni-grid :column="4" :showBorder="false" :highlight="true">
+				<uni-grid-item>
+					<view class="grid-item-box" @click="goScan">
+						<view class="img-box">
+							<image src="@/static/scan.png" class="img" mode=""></image>
+						</view>
+						<text class="text">溯源扫码</text>
+					</view>
+				</uni-grid-item>
+
+				<uni-grid-item>
+					<view class="grid-item-box" @click="goReport">
+						<view class="img-box">
+							<image src="@/static/report.png" class="img" mode=""></image>
+						</view>
+						<text class="text">溯源报表</text>
+					</view>
+				</uni-grid-item>
+			</uni-grid>
+		</uni-section>
 
 		<view style="height: 140rpx;"></view>
 	</view>