Browse Source

统计指标进入接诊中心调整选中日期跟选中tab

yanqiliang 2 months ago
parent
commit
6f11f9da45

+ 3 - 66
src/pages/staticPages/receptionCenter/receptionCenter.vue

@@ -9,26 +9,6 @@
             <view class="nav-placeholder"></view>
         </view>
 
-        <!-- Tab 切换 -->
-        <!-- <view class="tab-header">
-            <view
-                class="tab-item"
-                :class="{ 'tab-active': currentTab === 'list' }"
-                @tap="switchTab('list')"
-            >
-                <text class="tab-text" :class="{ 'tab-text-active': currentTab === 'list' }">接诊列表</text>
-                <view v-if="currentTab === 'list'" class="tab-underline"></view>
-            </view>
-            <view
-                class="tab-item"
-                :class="{ 'tab-active': currentTab === 'query' }"
-                @tap="switchTab('query')"
-            >
-                <text class="tab-text" :class="{ 'tab-text-active': currentTab === 'query' }">挂号查询</text>
-                <view v-if="currentTab === 'query'" class="tab-underline"></view>
-            </view>
-        </view> -->
-
         <!-- 日期筛选区 -->
         <view class="filter-section">
             <view class="date-range-box">
@@ -109,7 +89,6 @@ import { $http } from '../../../config/https.js';
 export default {
     data() {
         return {
-            currentTab: 'list',
             dateFrom: '',
             dateTo: '',
             loading: false,
@@ -127,16 +106,15 @@ export default {
         };
     },
     onLoad(options) {
-        // 支持从工作台等页面跳转时带入状态参数(value / activeStatus)
+        // 支持入口传入日期和状态;未传入时保持当天至当天、全部状态的默认行为。
         const params = options || {};
         const incomingStatus = params.value !== undefined && params.value !== null && params.value !== ''
             ? params.value
             : params.activeStatus;
         this.activeStatus = incomingStatus === undefined || incomingStatus === null ? '' : String(incomingStatus);
-        // 默认查询日期范围为当天
         const today = this.formatDate(new Date());
-        this.dateFrom = today;
-        this.dateTo = today;
+        this.dateFrom = params.startDate ? String(params.startDate) : today;
+        this.dateTo = params.endDate ? String(params.endDate) : today;
         this.loadReceptionData();
     },
     methods: {
@@ -155,9 +133,6 @@ export default {
                 }
             });
         },
-        switchTab(tab) {
-            this.currentTab = tab;
-        },
         goHistory(item) {
             uni.navigateTo({
                 url: `/pages/staticPages/patientHistory/patientHistory?admID=${encodeURIComponent(item.admID)}`
@@ -278,44 +253,6 @@ export default {
     width: 80rpx;
 }
 
-/* Tab 切换 */
-.tab-header {
-    background: #ffffff;
-    display: flex;
-    flex-direction: row;
-    justify-content: center;
-    border-bottom: 1rpx solid #eef0f3;
-}
-
-.tab-item {
-    padding: 24rpx 48rpx;
-    position: relative;
-    display: flex;
-    flex-direction: column;
-    align-items: center;
-}
-
-.tab-text {
-    font-size: 30rpx;
-    color: #666666;
-}
-
-.tab-text-active {
-    color: #2B84FF;
-    font-weight: 600;
-}
-
-.tab-underline {
-    position: absolute;
-    bottom: 0;
-    left: 50%;
-    transform: translateX(-50%);
-    width: 64rpx;
-    height: 5rpx;
-    background: #2B84FF;
-    border-radius: 3rpx;
-}
-
 /* 日期筛选 */
 .filter-section {
     background: #ffffff;

+ 8 - 4
src/pages/staticPages/workbench/workbench.vue

@@ -13,11 +13,11 @@
                     <text class="title-text">累计数据</text>
                 </view>
                 <view class="stat-cards-row">
-                    <view class="stat-card-blue stat-card-slim" @tap="goReceptionCenter">
+                    <view class="stat-card-blue stat-card-slim" @tap="goReceptionCenter({ startDate: '2026-07-01', activeStatus: '挂号' })">
                         <text class="stat-number">{{ totalPatient }}</text>
                         <text class="stat-label">累计接诊人次</text>
                     </view>
-                    <view class="stat-card-blue" @tap="goReceptionCenter">
+                    <view class="stat-card-blue" @tap="goReceptionCenter({ startDate: '2026-07-01', activeStatus: '接诊' })">
                         <view class="amount-main">
                             <text class="stat-number">{{ totalAmount }}</text>
                             <text class="stat-label">累计收费金额</text>
@@ -195,9 +195,13 @@ export default {
                 uni.navigateTo({ url: item.path });
             }
         },
-        goReceptionCenter() {
+        goReceptionCenter(filters = {}) {
+            const query = Object.keys(filters)
+                .filter((key) => filters[key] !== undefined && filters[key] !== null && filters[key] !== '')
+                .map((key) => `${key}=${encodeURIComponent(String(filters[key]))}`)
+                .join('&');
             uni.navigateTo({
-                url: '/pages/staticPages/receptionCenter/receptionCenter'
+                url: `/pages/staticPages/receptionCenter/receptionCenter${query ? `?${query}` : ''}`
             });
         },
         onTodayStatTap(item) {