Просмотр исходного кода

Merge branch 'master' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-vis into test

yusheng 3 дней назад
Родитель
Сommit
b28b97ba98

+ 8 - 0
src/api/vis/productionDailyDashboard.js

@@ -17,6 +17,14 @@ export async function getTeamProductionDayDataThree(params) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+// 班组生产日综合看板-任务单
+ export async function pageByCurrentUserTeam(params) {
+  const res = await request.get(`/aps/assign/pageByCurrentUserTeam`, {params});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
 
 // 班组生产日综合看板-各工序在岗人数、设备实时状态-按工序、产品生产数量top10、各产品合格率
 export async function getTeamProductionDayDataTwo(teamId) {

+ 158 - 63
src/views/bpm/vis-page/productionDailyDashboard.vue

@@ -45,7 +45,7 @@
       <div class="box-middle">
         <div class="box-middle-sidebar left-sidebar">
           <!-- 当日生产数量卡片 -->
-          <div style="height: 25vh;">
+          <div class="card-container">
             <chart-card
               title="当日生产数量"
               size="small"
@@ -127,9 +127,9 @@
             </chart-card>
           </div>
 
-          <div style="height: 25vh;">
+          <div class="card-container">
             <!-- 各工序生产数量卡片 -->
-            <chart-card
+            <!-- <chart-card
               title="各工序生产数量"
               size="small"
             >
@@ -137,10 +137,81 @@
                 :data="eachProcessOnDutyNum"
                 class="process-chart-container"
               ></bar-chart>
+            </chart-card> -->
+                   <div class="content-top-container" style="height: 100%;">
+            <chart-card
+              title="生产工单进度"
+              size="small"
+            >
+              <div class="content-table" v-if="isFlag">
+                <table class="main-table">
+                  <colgroup>
+                    <col style="width: 12%"></col>
+                    <col style="width: 15%"></col>
+                    <col style="width: 13%"></col>
+                    <col style="width: 13%"></col>
+                    <col style="width: 12%"></col>
+                    <col style="width: 15%"></col>
+                    <col style="width: 15%"></col>
+                    <col style="width: 15%"></col>
+                  </colgroup>
+                  <thead>
+                    <tr>
+                      <th style="width: 12%">生产工单号</th>
+                      <th style="width: 15%">产品名称</th>
+                      <th style="width: 13%">要求完成数量</th>
+                      <th style="width: 13%">已完成数量</th>
+                      <th style="width: 12%">生产达成率</th>
+                      <th style="width: 15%">计划开始时间</th>
+                      <th style="width: 15%">计划结束时间</th>
+                      <th style="width: 15%">当前工序</th>
+                    </tr>
+                  </thead>
+                </table>
+                <div class="scroll-container">
+                  <vue-seamless-scroll :data="tableData" :class-option="classOption">
+                    <table class="main-table">
+                      <colgroup>
+                        <col style="width: 12%"></col>
+                        <col style="width: 15%"></col>
+                        <col style="width: 13%"></col>
+                        <col style="width: 13%"></col>
+                        <col style="width: 12%"></col>
+                        <col style="width: 15%"></col>
+                        <col style="width: 15%"></col>
+                        <col style="width: 15%"></col>
+                      </colgroup>
+                      <tbody>
+                        <!-- 非红色行(State=N) -->
+                        <tr
+                          v-for="item in tableData"
+                          :key="`scroll-${item.productionOrderNumber}`"
+                          class="table-row"
+                          :style="{ backgroundColor: item.isDelayed === 1 ? '#ff4d4f' : '#031d42' }"
+                        >
+                          <td class="table-cell">{{ item.productionOrderNumber }}</td>
+                          <td class="table-cell">{{ item.productName }}</td>
+                          <td class="table-cell">{{ item.requestProductionQuantity }}</td>
+                          <td class="table-cell">{{ item.completedQuantity }}</td>
+                          <td class="table-cell">{{ item.productionAchievementRate }}</td>
+                          <td class="table-cell">{{ item.plannedStartTime }}</td>
+                          <td class="table-cell">{{ item.plannedEndTime }}</td>
+                          <td class="table-cell">{{ item.currentProcess }}</td>
+                        </tr>
+                      </tbody>
+                    </table>
+                  </vue-seamless-scroll>
+                  <!-- 无数据时显示占位 -->
+                  <div v-if="fixedRows.length === 0 && scrollRows.length === 0">
+                    <div class="empty-cell"> 暂无生产工单数据 </div>
+                  </div>
+                </div>
+              </div>
             </chart-card>
           </div>
+          </div>
 
-          <div style="height: 25vh;">
+          <div class="card-container">
             <!-- 产品生产数量TOP10 -->
             <chart-card
               title="各工序生产达成率"
@@ -190,73 +261,81 @@
             </div>
           </div>
 
-          <!-- 生产工单进度:移除滚动功能 -->
-          <div class="content-top-container">
+
+          <div class="content-top-container" style="height: 56vh">
             <chart-card
-              title="生产工单进度"
+              title="工位任务单"
               size="small"
             >
               <div class="content-table" v-if="isFlag">
                 <table class="main-table">
                   <colgroup>
-                    <col style="width: 12%"></col>
-                    <col style="width: 15%"></col>
-                    <col style="width: 13%"></col>
-                    <col style="width: 13%"></col>
-                    <col style="width: 12%"></col>
-                    <col style="width: 15%"></col>
-                    <col style="width: 15%"></col>
-                    <col style="width: 15%"></col>
+                        <col style="width: 10%"></col>
+                        <col style="width: 10%"></col>
+                        <col style="width: 14%"></col>
+                        <col style="width: 14%"></col>
+                        <col style="width: 15%"></col>
+                        <col style="width: 15%"></col>
+                        <col style="width: 15%"></col>
+                        <col style="width: 10%"></col>
+                        <col style="width: 10%"></col>
+                        <col style="width: 15%"></col>
                   </colgroup>
                   <thead>
                     <tr>
-                      <th style="width: 12%">生产工单号</th>
+                      <th style="width: 10%">任务编号</th>
+                      <th style="width: 10%">计划编号</th>
+                      <th style="width: 14%">执行对象名称</th>
+                      <th style="width: 14%">产品编码</th>
                       <th style="width: 15%">产品名称</th>
-                      <th style="width: 13%">要求完成数量</th>
-                      <th style="width: 13%">已完成数量</th>
-                      <th style="width: 12%">生产达成率</th>
-                      <th style="width: 15%">计划开始时间</th>
-                      <th style="width: 15%">计划结束时间</th>
-                      <th style="width: 15%">当前工序</th>
+                      <th style="width: 15%">班组名称</th>
+                      <th style="width: 15%">工序名称</th>
+                      <th style="width: 10%">任务数量</th>
+                      <th style="width: 10%">报工数量</th>
+                      <th style="width: 15%">报工时间</th>
                     </tr>
                   </thead>
                 </table>
                 <div class="scroll-container">
-                  <vue-seamless-scroll :data="tableData" :class-option="classOption">
+                  <vue-seamless-scroll :data="tableData1" :class-option="classOption">
                     <table class="main-table">
                       <colgroup>
-                        <col style="width: 12%"></col>
+                        <col style="width: 10%"></col>
+                        <col style="width: 10%"></col>
+                        <col style="width: 14%"></col>
+                        <col style="width: 14%"></col>
                         <col style="width: 15%"></col>
-                        <col style="width: 13%"></col>
-                        <col style="width: 13%"></col>
-                        <col style="width: 12%"></col>
                         <col style="width: 15%"></col>
                         <col style="width: 15%"></col>
+                        <col style="width: 10%"></col>
+                        <col style="width: 10%"></col>
                         <col style="width: 15%"></col>
                       </colgroup>
                       <tbody>
                         <!-- 非红色行(State=N) -->
                         <tr
-                          v-for="item in tableData"
-                          :key="`scroll-${item.productionOrderNumber}`"
+                          v-for="item in tableData1"
+                          :key="`scroll-${item.productionPlanCode}`"
                           class="table-row"
-                          :style="{ backgroundColor: item.isDelayed === 1 ? '#ff4d4f' : '#031d42' }"
+                        
                         >
-                          <td class="table-cell">{{ item.productionOrderNumber }}</td>
+                          <td class="table-cell">{{ item.assigneeCode }}</td>
+                          <td class="table-cell">{{ item.productionPlanCode }}</td>
+                          <td class="table-cell">{{ item.assigneeName }}</td>
+                          <td class="table-cell">{{ item.productCode }}</td>
                           <td class="table-cell">{{ item.productName }}</td>
-                          <td class="table-cell">{{ item.requestProductionQuantity }}</td>
-                          <td class="table-cell">{{ item.completedQuantity }}</td>
-                          <td class="table-cell">{{ item.productionAchievementRate }}</td>
-                          <td class="table-cell">{{ item.plannedStartTime }}</td>
-                          <td class="table-cell">{{ item.plannedEndTime }}</td>
-                          <td class="table-cell">{{ item.currentProcess }}</td>
+                          <td class="table-cell">{{ item.assignTeamName }}</td>
+                          <td class="table-cell">{{ item.taskName }}</td>
+                          <td class="table-cell">{{ item.quantity }}</td>
+                          <td class="table-cell">{{ item.reportQuantity }}</td>
+                          <td class="table-cell">{{ item.reportTime }}</td>
                         </tr>
                       </tbody>
                     </table>
                   </vue-seamless-scroll>
                   <!-- 无数据时显示占位 -->
-                  <div v-if="fixedRows.length === 0 && scrollRows.length === 0">
-                    <div class="empty-cell"> 暂无生产工单数据 </div>
+                  <div v-if="tableData1.length === 0">
+                    <div class="empty-cell"> 暂无任务单数据 </div>
                   </div>
                 </div>
               </div>
@@ -265,9 +344,18 @@
         </div>
 
         <div class="box-middle-sidebar right-sidebar">
-          <div style="height: 25vh;">
+          <div class="card-container">
+              <chart-card
+              title="各工序生产数量"
+              size="small"
+            >
+              <bar-chart
+                :data="eachProcessOnDutyNum"
+                class="process-chart-container"
+              ></bar-chart>
+            </chart-card>
             <!-- 设备实时状态 -->
-            <chart-card
+            <!-- <chart-card
               title="设备实时状态"
               size="small"
             >
@@ -275,10 +363,10 @@
                 :data="eachProcessEquipmentNum"
                 class="process-chart-container"
               ></device-status-chart>
-            </chart-card>
+            </chart-card> -->
           </div>
 
-          <div style="height: 25vh;">
+          <div class="card-container">
             <!-- 设备实时状态 -->
             <chart-card
               title="各工序报工数"
@@ -295,7 +383,7 @@
             </chart-card>
           </div>
 
-          <div style="height: 25vh;">
+          <div class="card-container">
             <!-- 各产品合格率 -->
             <chart-card
               title="各工序损耗率"
@@ -316,7 +404,7 @@
 <script>
 import { component as VueFullscreen } from 'vue-fullscreen';
 import { toggleFullscreen } from 'ele-admin';
-import { getTeamProductionDayDataOne, getTeamProductionDayDataThree, getTeamProductionDayDataTwo, queryTeamListAll } from '@/api/vis/productionDailyDashboard';
+import { getTeamProductionDayDataOne, getTeamProductionDayDataThree, getTeamProductionDayDataTwo, queryTeamListAll ,pageByCurrentUserTeam} from '@/api/vis/productionDailyDashboard';
 // 导入图表组件
 import ChartCard from './components/ChartCard';
 import ProcessPersonnelChart from './components/charts/ProcessPersonnelChart';
@@ -399,6 +487,7 @@ export default {
 
       // 生产工单表格数据
       tableData: [],
+      tableData1: [],
 
       productionData: {
         quantity: 0, // 当日生产数量(核心数据)
@@ -489,6 +578,7 @@ export default {
       this.getTeamProductionDayDataOneData();
       this.getTeamProductionDayDataTwoData();
       this.getTeamProductionDayDataThreeData();
+      this.pageByCurrentUserTeam()
     },
     // 班组生产日综合看板-当日生产情况、数量、重量
     getTeamProductionDayDataOneData() {
@@ -572,6 +662,14 @@ export default {
         this.tableData = []; // 错误时重置表格数据
       });
     },
+    //任务单
+    pageByCurrentUserTeam() {
+     pageByCurrentUserTeam({teamId: this.teamId, pageNum: 1, size: 999}).then((data) => {
+        this.tableData1 = data.list;
+      }).catch((error) => {
+        this.tableData1 = []; // 错误时重置表格数据
+      });
+    },
     // 表格数据排序 - State为"Y"的置顶
     sortTableData() {
       this.tableData.sort((a, b) => {
@@ -610,7 +708,9 @@ export default {
 [v-cloak] {
   display: none;
 }
-
+.card-container{
+ height: 26vh;
+}
 .box-container {
   font-size: 16px;
   font-family: 'AlibabaPuHuiTi';
@@ -681,6 +781,7 @@ export default {
     }
   }
 
+
   .box-middle {
     width: 100% !important;
     flex: 1;
@@ -690,8 +791,8 @@ export default {
     box-sizing: border-box;
 
     .box-middle-sidebar {
-      flex-basis: 38%;
-      max-width: 420px;
+      flex-basis: 28%;
+      max-width: 600px;
       min-width: 280px;
       flex-shrink: 1;
       flex-grow: 0;
@@ -750,14 +851,7 @@ export default {
         //   }
         // }
 
-        // .card-content {
-        //   flex: 1;
-        //   display: flex;
-        //   flex-direction: column;
-        //   padding: 0 1rem 0.5rem 1rem;
-        //   box-sizing: border-box;
-        //   overflow: hidden;
-        // }
+    
         .number-display-container {
           display: flex;
           flex-direction: column;
@@ -862,7 +956,7 @@ export default {
         // flex: 1;
         display: flex;
         flex-direction: column;
-        height: 25vh;
+        // height: 28%;
 
         .sidebar-card {
           flex: 1;
@@ -960,15 +1054,17 @@ export default {
         }
       }
 
+    
+    }
       .content-top-container {
         // flex: 2;
-        display: flex;
-        flex-direction: column;
-        height: 52vh;
+        // display: flex;
+        // flex-direction: column;
+        // height: 78%;
 
           /* 表格容器:移除滚动相关样式 */
           .content-table {
-            flex: 1;
+            // flex: 1;
             padding: 8px;
             box-sizing: border-box;
             height: 90%;
@@ -1039,7 +1135,6 @@ export default {
           }
         
       }
-    }
   }
 }
 
@@ -1140,7 +1235,7 @@ export default {
       }
     }
     .box-middle .box-middle-sidebar {
-      flex-basis: 35%;
+      flex-basis: 25%;
       min-width: 220px;
 
       .sidebar-card .card-header .card-title {