Kaynağa Gözat

瑞恒报表

yanghao 4 hafta önce
ebeveyn
işleme
4169d13e5c
4 değiştirilmiş dosya ile 818 ekleme ve 666 silme
  1. 11 1
      api/ruiHengReport.js
  2. 553 422
      pages/home/index.vue
  3. 0 177
      pages/ruiHengReport/data.js
  4. 254 66
      pages/ruiHengReport/index.vue

+ 11 - 1
api/ruiHengReport.js

@@ -9,4 +9,14 @@ export const getRhRate = (params) => {
     method: "get",
     method: "get",
     params,
     params,
   });
   });
-};
+};
+
+// 队伍明细
+export const getRhTeamDetail = (params) => {
+  return request({
+    url: "rq/stat/rh/device/teamUtilizationRate",
+    method: "get",
+    params,
+  });
+};
+

Dosya farkı çok büyük olduğundan ihmal edildi
+ 553 - 422
pages/home/index.vue


+ 0 - 177
pages/ruiHengReport/data.js

@@ -1,177 +0,0 @@
-{
-    "code": 0,
-    "data": [
-        {
-            "projectDeptId": 157,
-            "projectDeptName": "合计",
-            "teamCount": 101,
-            "sgTeamCount": 63,
-            "zbTeamCount": 13,
-            "dmTeamCount": 25,
-            "cumulativeDays": null,
-            "constructionDays": null,
-            "utilizationRate": null,
-            "hourUtilizationRate": 0.4908,
-            "yearHourUtilizationRate": 0.5789,
-            "waterInjection": 0.39,
-            "yearWaterInjection": 38.09,
-            "gasInjection": 222.86,
-            "yearGasInjection": 41473.15,
-            "sort": 0,
-            "productionSummary": null
-        },
-        {
-            "projectDeptId": 164,
-            "projectDeptName": "塔河项目部",
-            "teamCount": 49,
-            "sgTeamCount": 37,
-            "zbTeamCount": 6,
-            "dmTeamCount": 6,
-            "cumulativeDays": 49,
-            "constructionDays": 37,
-            "utilizationRate": 0.7551,
-            "hourUtilizationRate": 0.7024,
-            "yearHourUtilizationRate": 0.692,
-            "waterInjection": 0.39,
-            "yearWaterInjection": 36.98,
-            "gasInjection": 165.52,
-            "yearGasInjection": 25593.15,
-            "sort": 1,
-            "productionSummary": "三厂:施工6套设备,准备1套设备(共7套设备)\nTK1078CH,;\n二厂:施工4套设备,准备1套设备(共5套设备)\nT什10398X,;\n四厂:施工13套设备,准备6套设备(共19套设备)\nSHB1-11,D5设备6月2日16:00至6月3日16:00 ,因油压上限暂停注气24小时;\nSHB1-3,;\nSHB1-31H,;\nSHZ4-1X,6月2日接通知收拾井场,准备搬迁至SHZ4-7X井;\n雅厂:施工1套设备,准备3套设备(共4套设备)\nDLK21X,5月29日接生产指挥中心通知14点停止注气;\nYD1-2H,现场待命;\nYK16,接甲方通知待命24小时;\n"
-        },
-        {
-            "projectDeptId": 165,
-            "projectDeptName": "塔里木项目部",
-            "teamCount": 17,
-            "sgTeamCount": 11,
-            "zbTeamCount": 3,
-            "dmTeamCount": 3,
-            "cumulativeDays": 17,
-            "constructionDays": 11,
-            "utilizationRate": 0.6471,
-            "hourUtilizationRate": 0.3252,
-            "yearHourUtilizationRate": 0.8111,
-            "waterInjection": 0,
-            "yearWaterInjection": 0,
-            "gasInjection": 24.72,
-            "yearGasInjection": 9918.91,
-            "sort": 2,
-            "productionSummary": "哈得:施工11套设备,准备3套设备(共14套设备)\nGL301H,;\n满深502-H5,线路断电,停止注气;\n满深809,甲方电力检修 现场待命 施工0小时;\n"
-        },
-        {
-            "projectDeptId": 160,
-            "projectDeptName": "吐哈项目部",
-            "teamCount": 14,
-            "sgTeamCount": 9,
-            "zbTeamCount": 2,
-            "dmTeamCount": 3,
-            "cumulativeDays": 14,
-            "constructionDays": 9,
-            "utilizationRate": 0.6429,
-            "hourUtilizationRate": 0.3958,
-            "yearHourUtilizationRate": 0.436,
-            "waterInjection": 0,
-            "yearWaterInjection": 0,
-            "gasInjection": 20.78,
-            "yearGasInjection": 3840.66,
-            "sort": 3,
-            "productionSummary": null
-        },
-        {
-            "projectDeptId": 256,
-            "projectDeptName": "川庆项目部",
-            "teamCount": 6,
-            "sgTeamCount": 1,
-            "zbTeamCount": 0,
-            "dmTeamCount": 5,
-            "cumulativeDays": 6,
-            "constructionDays": 1,
-            "utilizationRate": 0.1667,
-            "hourUtilizationRate": 0.0208,
-            "yearHourUtilizationRate": 0.2743,
-            "waterInjection": 0,
-            "yearWaterInjection": 0,
-            "gasInjection": 0.36,
-            "yearGasInjection": 817.35,
-            "sort": 9,
-            "productionSummary": "海洋平台:施工0套设备,准备1套设备(共1套设备)\nHY2-2平台,待维修;\n西南:施工1套设备,准备3套设备(共4套设备)\n宁209H33-2,待命;\n宁209H50-3,驻地待命,等待施工通知;\n文页1井,待命;\n陕蒙:施工0套设备,准备1套设备(共1套设备)\n苏59-17-48-X1,无施工 ;\n"
-        },
-        {
-            "projectDeptId": 269,
-            "projectDeptName": "非洲项目部",
-            "teamCount": 5,
-            "sgTeamCount": 4,
-            "zbTeamCount": 0,
-            "dmTeamCount": 1,
-            "cumulativeDays": 5,
-            "constructionDays": 4,
-            "utilizationRate": 0.8,
-            "hourUtilizationRate": 0.725,
-            "yearHourUtilizationRate": 0.3962,
-            "waterInjection": 0,
-            "yearWaterInjection": 0,
-            "gasInjection": 10.53,
-            "yearGasInjection": 962.9,
-            "sort": 8,
-            "productionSummary": null
-        },
-        {
-            "projectDeptId": 273,
-            "projectDeptName": "南美项目部",
-            "teamCount": 1,
-            "sgTeamCount": 0,
-            "zbTeamCount": 0,
-            "dmTeamCount": 1,
-            "cumulativeDays": 1,
-            "constructionDays": null,
-            "utilizationRate": 0,
-            "hourUtilizationRate": null,
-            "yearHourUtilizationRate": 0.5098,
-            "waterInjection": 0,
-            "yearWaterInjection": 1.12,
-            "gasInjection": 0,
-            "yearGasInjection": 136.04,
-            "sort": 10,
-            "productionSummary": "巴西:施工0套设备,准备1套设备(共1套设备)\nFZB-936,现场待命;\n"
-        },
-        {
-            "projectDeptId": 275,
-            "projectDeptName": "中东项目部",
-            "teamCount": 5,
-            "sgTeamCount": 0,
-            "zbTeamCount": 1,
-            "dmTeamCount": 4,
-            "cumulativeDays": 5,
-            "constructionDays": null,
-            "utilizationRate": 0,
-            "hourUtilizationRate": null,
-            "yearHourUtilizationRate": 0.0438,
-            "waterInjection": 0,
-            "yearWaterInjection": 0,
-            "gasInjection": 0,
-            "yearGasInjection": 65.52,
-            "sort": 11,
-            "productionSummary": "ABQAIQ:施工0套设备,准备1套设备(共1套设备)\nABQAIQ,现场待命;\n沙特:施工0套设备,准备2套设备(共2套设备)\nS1AFANIYA,6月3日吊装回基地;\n"
-        },
-        {
-            "projectDeptId": 282,
-            "projectDeptName": "中亚项目部",
-            "teamCount": 4,
-            "sgTeamCount": 1,
-            "zbTeamCount": 1,
-            "dmTeamCount": 2,
-            "cumulativeDays": 4,
-            "constructionDays": 1,
-            "utilizationRate": 0.25,
-            "hourUtilizationRate": 0.0833,
-            "yearHourUtilizationRate": 0.0788,
-            "waterInjection": 0,
-            "yearWaterInjection": 0,
-            "gasInjection": 0.96,
-            "yearGasInjection": 138.61,
-            "sort": 12,
-            "productionSummary": null
-        }
-    ],
-    "msg": ""
-}

+ 254 - 66
pages/ruiHengReport/index.vue

@@ -1,30 +1,5 @@
 <template>
 <template>
   <view class="report-page">
   <view class="report-page">
-    <view class="filter-bar">
-      <view class="filter-main">
-        <text class="filter-label">统计日期</text>
-        <uni-datetime-picker
-          v-model="selectedDate"
-          class="date-picker"
-          type="date"
-          return-type="string"
-          :clear-icon="false"
-          :border="false"
-          @change="handleDateChange"
-        />
-      </view>
-      <button
-        class="filter-button"
-        type="primary"
-        size="mini"
-        @click="loadList"
-      >
-        查询
-      </button>
-    </view>
-
-    <view class="filter-tip">查询范围:{{ queryRangeText }}</view>
-
     <scroll-view class="report-scroll" scroll-y>
     <scroll-view class="report-scroll" scroll-y>
       <view v-if="loading" class="state-card">
       <view v-if="loading" class="state-card">
         <text class="state-text">数据加载中...</text>
         <text class="state-text">数据加载中...</text>
@@ -43,10 +18,9 @@
           <view class="card-header">
           <view class="card-header">
             <view>
             <view>
               <view class="dept-name">{{ item.projectDeptName || "--" }}</view>
               <view class="dept-name">{{ item.projectDeptName || "--" }}</view>
-              <view class="dept-meta">排序 {{ item.sort ?? "--" }}</view>
             </view>
             </view>
-            <view class="rate-badge">
-              {{ formatPercent(item.utilizationRate) }}
+            <view class="rate-badge" @click="openTeamDetail(item)">
+              查看队伍明细
             </view>
             </view>
           </view>
           </view>
 
 
@@ -64,64 +38,52 @@
               }}</text>
               }}</text>
             </view>
             </view>
             <view class="metric-item">
             <view class="metric-item">
-              <text class="metric-label">值班队伍</text>
+              <text class="metric-label">施工准备</text>
               <text class="metric-value">{{
               <text class="metric-value">{{
                 formatNumber(item.zbTeamCount)
                 formatNumber(item.zbTeamCount)
               }}</text>
               }}</text>
             </view>
             </view>
             <view class="metric-item">
             <view class="metric-item">
-              <text class="metric-label">待命队伍</text>
+              <text class="metric-label">待命</text>
               <text class="metric-value">{{
               <text class="metric-value">{{
                 formatNumber(item.dmTeamCount)
                 formatNumber(item.dmTeamCount)
               }}</text>
               }}</text>
             </view>
             </view>
             <view class="metric-item">
             <view class="metric-item">
-              <text class="metric-label">累计天数</text>
+              <text class="metric-label">当日运行时效</text>
               <text class="metric-value">{{
               <text class="metric-value">{{
-                formatNumber(item.cumulativeDays)
+                formatPercent(item.hourUtilizationRate)
               }}</text>
               }}</text>
             </view>
             </view>
             <view class="metric-item">
             <view class="metric-item">
-              <text class="metric-label">施工天数</text>
+              <text class="metric-label">平均运行时效</text>
               <text class="metric-value">{{
               <text class="metric-value">{{
-                formatNumber(item.constructionDays)
+                formatPercent(item.yearHourUtilizationRate)
               }}</text>
               }}</text>
             </view>
             </view>
           </view>
           </view>
 
 
           <view class="summary-panel">
           <view class="summary-panel">
             <view class="summary-row">
             <view class="summary-row">
-              <text class="summary-label">小时利用率</text>
-              <text class="summary-value">
-                {{ formatPercent(item.hourUtilizationRate) }}
-              </text>
-            </view>
-            <view class="summary-row">
-              <text class="summary-label">年小时利用率</text>
-              <text class="summary-value">
-                {{ formatPercent(item.yearHourUtilizationRate) }}
-              </text>
-            </view>
-            <view class="summary-row">
-              <text class="summary-label">注水量</text>
+              <text class="summary-label">日注水量(万方)</text>
               <text class="summary-value">
               <text class="summary-value">
                 {{ formatDecimal(item.waterInjection) }}
                 {{ formatDecimal(item.waterInjection) }}
               </text>
               </text>
             </view>
             </view>
             <view class="summary-row">
             <view class="summary-row">
-              <text class="summary-label">年注水量</text>
+              <text class="summary-label">累计注水量(万方)</text>
               <text class="summary-value">
               <text class="summary-value">
                 {{ formatDecimal(item.yearWaterInjection) }}
                 {{ formatDecimal(item.yearWaterInjection) }}
               </text>
               </text>
             </view>
             </view>
             <view class="summary-row">
             <view class="summary-row">
-              <text class="summary-label">注气量</text>
+              <text class="summary-label">日注气量(万方)</text>
               <text class="summary-value">
               <text class="summary-value">
                 {{ formatDecimal(item.gasInjection) }}
                 {{ formatDecimal(item.gasInjection) }}
               </text>
               </text>
             </view>
             </view>
             <view class="summary-row">
             <view class="summary-row">
-              <text class="summary-label">年注气量</text>
+              <text class="summary-label">累计注气量(万方)</text>
               <text class="summary-value">
               <text class="summary-value">
                 {{ formatDecimal(item.yearGasInjection) }}
                 {{ formatDecimal(item.yearGasInjection) }}
               </text>
               </text>
@@ -137,6 +99,97 @@
         </view>
         </view>
       </view>
       </view>
     </scroll-view>
     </scroll-view>
+
+    <view class="filter-bar">
+      <view class="filter-main">
+        <text class="filter-label">统计日期</text>
+
+        <uni-datetime-picker
+          v-model="selectedDate"
+          class="date-picker"
+          type="date"
+          :teleport="true"
+          return-type="string"
+          :clear-icon="false"
+          :border="false"
+          @change="handleDateChange"
+        />
+      </view>
+      <button
+        class="filter-button"
+        type="primary"
+        size="mini"
+        @click="loadList"
+      >
+        查询
+      </button>
+    </view>
+
+    <uni-popup
+      ref="teamDetailPopup"
+      type="right"
+      background-color="#fff"
+      :is-mask-click="true"
+    >
+      <view class="team-drawer">
+        <view class="team-drawer__header">
+          <text class="team-drawer__title">
+            {{ currentDetailTitle || "队伍明细" }}
+          </text>
+          <text class="team-drawer__close" @click="closeTeamDetail">关闭</text>
+        </view>
+
+        <view class="team-drawer__sub">
+          统计日期:{{ selectedDate || "--" }}
+        </view>
+
+        <scroll-view class="team-drawer__scroll" scroll-y>
+          <view v-if="teamDetailLoading" class="team-state-card">
+            <text class="team-state-text">数据加载中...</text>
+          </view>
+
+          <view
+            v-else-if="!teamDetailList.length"
+            class="team-state-card empty"
+          >
+            <text class="team-state-text">暂无队伍明细</text>
+          </view>
+
+          <view v-else class="team-detail-list">
+            <view
+              v-for="(team, index) in teamDetailList"
+              :key="team.teamName || index"
+              class="team-detail-card"
+            >
+              <view class="team-detail-card__title">
+                {{ team.teamName || "--" }}
+              </view>
+
+              <view class="team-detail-grid">
+                <view class="team-detail-item">
+                  <text class="team-detail-label">累计天数</text>
+                  <text class="team-detail-value">{{
+                    formatNumber(team.cumulativeDays)
+                  }}</text>
+                </view>
+                <view class="team-detail-item">
+                  <text class="team-detail-label">施工天数</text>
+                  <text class="team-detail-value">{{
+                    formatNumber(team.constructionDays)
+                  }}</text>
+                </view>
+                <view class="team-detail-item team-detail-item--full">
+                  <text class="team-detail-label">设备利用率</text>
+                  <text class="team-detail-value">{{
+                    formatPercent(team.utilizationRate)
+                  }}</text>
+                </view>
+              </view>
+            </view>
+          </view>
+        </scroll-view>
+      </view>
+    </uni-popup>
   </view>
   </view>
 </template>
 </template>
 
 
@@ -144,11 +197,15 @@
 import { computed, ref } from "vue";
 import { computed, ref } from "vue";
 import { onMounted } from "vue";
 import { onMounted } from "vue";
 import dayjs from "dayjs";
 import dayjs from "dayjs";
-import { getRhRate } from "@/api/ruiHengReport";
+import { getRhRate, getRhTeamDetail } from "@/api/ruiHengReport";
 
 
 const selectedDate = ref(dayjs().subtract(1, "day").format("YYYY-MM-DD"));
 const selectedDate = ref(dayjs().subtract(1, "day").format("YYYY-MM-DD"));
 const dataList = ref([]);
 const dataList = ref([]);
 const loading = ref(false);
 const loading = ref(false);
+const teamDetailPopup = ref(null);
+const teamDetailLoading = ref(false);
+const teamDetailList = ref([]);
+const currentDetailTitle = ref("");
 
 
 const buildQueryParams = () => {
 const buildQueryParams = () => {
   const baseDate = selectedDate.value
   const baseDate = selectedDate.value
@@ -163,11 +220,6 @@ const buildQueryParams = () => {
   };
   };
 };
 };
 
 
-const queryRangeText = computed(() => {
-  const [startTime, endTime] = buildQueryParams().createTime;
-  return `${startTime} - ${endTime}`;
-});
-
 const sortedList = computed(() =>
 const sortedList = computed(() =>
   [...dataList.value].sort((a, b) => (a.sort ?? 999999) - (b.sort ?? 999999)),
   [...dataList.value].sort((a, b) => (a.sort ?? 999999) - (b.sort ?? 999999)),
 );
 );
@@ -192,6 +244,33 @@ const handleDateChange = () => {
   loadList();
   loadList();
 };
 };
 
 
+const openTeamDetail = async (item) => {
+  currentDetailTitle.value = `${item.projectDeptName || "--"} 队伍明细`;
+  teamDetailList.value = [];
+  teamDetailLoading.value = true;
+  teamDetailPopup.value?.open();
+
+  try {
+    const response = await getRhTeamDetail({
+      deptId: item.projectDeptId,
+      createTime: buildQueryParams().createTime,
+    });
+    teamDetailList.value = Array.isArray(response?.data) ? response.data : [];
+  } catch (error) {
+    teamDetailList.value = [];
+    uni.showToast({
+      title: "队伍明细加载失败",
+      icon: "none",
+    });
+  } finally {
+    teamDetailLoading.value = false;
+  }
+};
+
+const closeTeamDetail = () => {
+  teamDetailPopup.value?.close();
+};
+
 const formatNumber = (value) => {
 const formatNumber = (value) => {
   if (value === null || value === undefined || value === "") return "--";
   if (value === null || value === undefined || value === "") return "--";
   return value;
   return value;
@@ -217,13 +296,6 @@ onMounted(() => {
   min-height: 100vh;
   min-height: 100vh;
   padding: 12px;
   padding: 12px;
   box-sizing: border-box;
   box-sizing: border-box;
-  background:
-    radial-gradient(
-      circle at top left,
-      rgba(0, 64, 152, 0.14),
-      transparent 28%
-    ),
-    linear-gradient(180deg, #f4f7fb 0%, #eef2f8 100%);
 }
 }
 
 
 .filter-bar {
 .filter-bar {
@@ -240,6 +312,10 @@ onMounted(() => {
 .filter-main {
 .filter-main {
   flex: 1;
   flex: 1;
   min-width: 0;
   min-width: 0;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  gap: 10rpx;
 }
 }
 
 
 .filter-label {
 .filter-label {
@@ -259,13 +335,11 @@ onMounted(() => {
 
 
 .filter-button {
 .filter-button {
   width: 76px;
   width: 76px;
-  height: 40px;
+  height: 38px;
   line-height: 40px;
   line-height: 40px;
-  margin: 20px 0 0;
   border-radius: 12px;
   border-radius: 12px;
   background: linear-gradient(135deg, #004098 0%, #1f68d8 100%);
   background: linear-gradient(135deg, #004098 0%, #1f68d8 100%);
   font-size: 14px;
   font-size: 14px;
-  box-shadow: 0 10px 22px rgba(0, 64, 152, 0.22);
 }
 }
 
 
 .filter-tip {
 .filter-tip {
@@ -417,4 +491,118 @@ onMounted(() => {
   color: #73839a;
   color: #73839a;
   font-size: 14px;
   font-size: 14px;
 }
 }
+
+.team-drawer {
+  width: 82vw;
+  max-width: 620rpx;
+  height: 100vh;
+  padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
+  box-sizing: border-box;
+  background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
+  display: flex;
+  flex-direction: column;
+}
+
+.team-drawer__header {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  gap: 12px;
+}
+
+.team-drawer__title {
+  min-width: 0;
+  color: #122033;
+  font-size: 18px;
+  font-weight: 700;
+}
+
+.team-drawer__close {
+  flex-shrink: 0;
+  color: #004098;
+  font-size: 14px;
+  font-weight: 600;
+}
+
+.team-drawer__sub {
+  margin-top: 8px;
+  margin-bottom: 14px;
+  color: #70819a;
+  font-size: 12px;
+}
+
+.team-drawer__scroll {
+  flex: 1;
+  min-height: 0;
+  padding-bottom: 50rpx;
+}
+
+.team-detail-list {
+  display: flex;
+  flex-direction: column;
+  gap: 12px;
+  padding-bottom: 10px;
+}
+
+.team-detail-card {
+  padding: 14px;
+  border-radius: 16px;
+  background: rgba(255, 255, 255, 0.96);
+  box-shadow: 0 10px 24px rgba(31, 57, 90, 0.08);
+}
+
+.team-detail-card__title {
+  margin-bottom: 12px;
+  color: #18273b;
+  font-size: 16px;
+  font-weight: 700;
+}
+
+.team-detail-grid {
+  display: grid;
+  grid-template-columns: repeat(2, minmax(0, 1fr));
+  gap: 10px;
+}
+
+.team-detail-item {
+  padding: 10px 12px;
+  border-radius: 12px;
+  background: #f6f9fd;
+}
+
+.team-detail-item--full {
+  grid-column: 1 / -1;
+}
+
+.team-detail-label {
+  display: block;
+  color: #6e7e95;
+  font-size: 12px;
+}
+
+.team-detail-value {
+  display: block;
+  margin-top: 6px;
+  color: #18273b;
+  font-size: 18px;
+  font-weight: 700;
+}
+
+.team-state-card {
+  margin-top: 8px;
+  padding: 36px 20px;
+  border-radius: 16px;
+  background: rgba(255, 255, 255, 0.92);
+  text-align: center;
+  box-shadow: 0 12px 28px rgba(30, 54, 88, 0.06);
+}
+
+.team-state-card.empty {
+  border: 1px dashed rgba(0, 64, 152, 0.16);
+}
+
+.team-state-text {
+  color: #73839a;
+  font-size: 14px;
+}
 </style>
 </style>

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor