From 30dc46174a37613366081bd1abab8eb71c171f7f Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期五, 16 一月 2026 16:17:46 +0800
Subject: [PATCH] 浪潮对接单点登录:MES制造执行系统功能迁移

---
 src/views/reportAnalysis/reportManagement/index.vue |  401 +++++++++++---------------------------------------------
 1 files changed, 82 insertions(+), 319 deletions(-)

diff --git a/src/views/reportAnalysis/reportManagement/index.vue b/src/views/reportAnalysis/reportManagement/index.vue
index 2adfb54..be7b2c4 100644
--- a/src/views/reportAnalysis/reportManagement/index.vue
+++ b/src/views/reportAnalysis/reportManagement/index.vue
@@ -16,22 +16,13 @@
 						@change="handleFilterChange"
 					/>
 				</el-form-item>
-				<el-form-item label="鎶ヨ〃绫诲瀷">
-					<el-select v-model="filterForm.reportType" placeholder="璇烽�夋嫨鎶ヨ〃绫诲瀷" @change="handleFilterChange" style="width: 300px">
-						<el-option label="鏍峰搧杩涘害鎶ヨ〃" value="sample" />
-						<el-option label="璁惧浣跨敤鎶ヨ〃" value="equipment" />
-						<el-option label="妫�娴嬮」鐩姤琛�" value="inspection" />
-						<el-option label="棰嗙敤璁板綍鎶ヨ〃" value="usage" />
-					</el-select>
-				</el-form-item>
 				<el-form-item>
 					<el-button type="primary" @click="handleFilterChange">鏌ヨ</el-button>
 					<el-button @click="resetFilter">閲嶇疆</el-button>
-					<el-button type="success" @click="exportReport">瀵煎嚭鎶ヨ〃</el-button>
 				</el-form-item>
 			</el-form>
 		</el-card>
-		
+
 		<!-- 缁熻鍗$墖 -->
 		<div class="statistics-cards">
 			<el-row :gutter="20">
@@ -43,7 +34,7 @@
 							</div>
 							<div class="stat-info">
 								<div class="stat-number">{{ statistics.totalSamples }}</div>
-								<div class="stat-label">鎬绘牱鍝佹暟</div>
+								<div class="stat-label">鎬昏鍗曟暟</div>
 							</div>
 						</div>
 					</el-card>
@@ -56,7 +47,7 @@
 							</div>
 							<div class="stat-info">
 								<div class="stat-number">{{ statistics.activeEquipment }}</div>
-								<div class="stat-label">鍦ㄧ敤璁惧</div>
+								<div class="stat-label">寰呯敓浜ф暟閲�</div>
 							</div>
 						</div>
 					</el-card>
@@ -69,7 +60,7 @@
 							</div>
 							<div class="stat-info">
 								<div class="stat-number">{{ statistics.completedInspections }}</div>
-								<div class="stat-label">宸插畬鎴愭娴�</div>
+								<div class="stat-label">宸茬敓浜ф暟閲�</div>
 							</div>
 						</div>
 					</el-card>
@@ -82,14 +73,14 @@
 							</div>
 							<div class="stat-info">
 								<div class="stat-number">{{ statistics.totalUsage }}</div>
-								<div class="stat-label">鎬婚鐢ㄦ鏁�</div>
+								<div class="stat-label">鎬绘牳绠楀伐鏃�</div>
 							</div>
 						</div>
 					</el-card>
 				</el-col>
 			</el-row>
 		</div>
-		
+
 		<!-- 鍥捐〃鍖哄煙 -->
 		<div class="charts-container">
 			<el-row :gutter="20">
@@ -98,69 +89,37 @@
 					<el-card class="chart-card" shadow="hover">
 						<template #header>
 							<div class="card-header">
-								<span>鏍峰搧杩涘害缁熻</span>
-								<el-button link @click="refreshSampleChart">鍒锋柊</el-button>
+								<span>鐢熶骇鎶ュ伐缁熻</span>
 							</div>
 						</template>
 						<div ref="sampleChartRef" class="chart-container"></div>
 					</el-card>
 				</el-col>
-				
+
 				<!-- 璁惧浣跨敤鍥捐〃 -->
 				<el-col :span="12">
 					<el-card class="chart-card" shadow="hover">
 						<template #header>
 							<div class="card-header">
-								<span>璁惧浣跨敤鐜囩粺璁�</span>
-								<el-button link @click="refreshEquipmentChart">鍒锋柊</el-button>
+								<span>鐢熶骇鏍哥畻缁熻</span>
 							</div>
 						</template>
 						<div ref="equipmentChartRef" class="chart-container"></div>
 					</el-card>
 				</el-col>
 			</el-row>
-			
-			<el-row :gutter="20" style="margin-top: 20px;">
-				<!-- 妫�娴嬮」鐩粺璁� -->
-				<el-col :span="12">
-					<el-card class="chart-card" shadow="hover">
-						<template #header>
-							<div class="card-header">
-								<span>妫�娴嬮」鐩垎甯�</span>
-								<el-button link @click="refreshInspectionChart">鍒锋柊</el-button>
-							</div>
-						</template>
-						<div ref="inspectionChartRef" class="chart-container"></div>
-					</el-card>
-				</el-col>
-				
-				<!-- 棰嗙敤璁板綍瓒嬪娍 -->
-				<el-col :span="12">
-					<el-card class="chart-card" shadow="hover">
-						<template #header>
-							<div class="card-header">
-								<span>棰嗙敤璁板綍瓒嬪娍</span>
-								<el-button link @click="refreshUsageChart">鍒锋柊</el-button>
-							</div>
-						</template>
-						<div ref="usageChartRef" class="chart-container"></div>
-					</el-card>
-				</el-col>
-			</el-row>
 		</div>
-		
+
 		<!-- 璇︾粏鏁版嵁琛ㄦ牸 -->
 		<el-card class="table-card" shadow="hover">
 			<template #header>
 				<div class="card-header">
-					<span>璇︾粏鏁版嵁</span>
+					<span>鐢熶骇鎶ュ伐璇︽儏</span>
 					<div>
-						<el-button type="primary" size="small" @click="refreshTable">鍒锋柊</el-button>
-						<el-button type="success" size="small" @click="exportTable">瀵煎嚭</el-button>
 					</div>
 				</div>
 			</template>
-			
+
 			<el-table
 				:data="tableData"
 				style="width: 100%"
@@ -169,40 +128,28 @@
 				border
 			>
 				<el-table-column prop="id" label="缂栧彿" width="80" />
-				<el-table-column prop="name" label="鍚嶇О" />
+				<el-table-column prop="orderNo" label="鐢熶骇璁㈠崟鍙�" />
+				<el-table-column prop="productCategory" label="浜у搧澶х被" />
+				<el-table-column prop="specificationModel" label="瑙勬牸鍨嬪彿" />
+				<el-table-column prop="unit" label="鍗曚綅" />
+				<el-table-column prop="schedulingUserName" label="鎺掍骇浜�" />
+				<el-table-column prop="schedulingDate" label="鎺掍骇鏃ユ湡" />
+				<el-table-column prop="process" label="宸ュ簭" />
+				<el-table-column prop="schedulingNum" label="鎺掍骇鏁伴噺" />
+				<el-table-column prop="finishedNum" label="鐢熶骇鏁伴噺" />
+        <el-table-column prop="pendingFinishNum" label="寰呯敓浜ф暟閲�" >
+          <template #default="scope">
+            <span>{{ scope.row.schedulingNum - scope.row.finishedNum }}</span>
+          </template>
+        </el-table-column>
 				<el-table-column prop="status" label="鐘舵��">
 					<template #default="scope">
-						<el-tag :type="getStatusType(scope.row.status)">
-							{{ scope.row.status }}
+						<el-tag :type="getStatusType(scope.row.status).type">
+							{{ getStatusType(scope.row.status).label }}
 						</el-tag>
 					</template>
 				</el-table-column>
-				<el-table-column prop="progress" label="杩涘害">
-					<template #default="scope">
-						<el-progress :percentage="scope.row.progress" :status="getProgressStatus(scope.row.progress)" />
-					</template>
-				</el-table-column>
-				<el-table-column prop="createTime" label="鍒涘缓鏃堕棿" width="180" />
-				<el-table-column prop="updateTime" label="鏇存柊鏃堕棿" width="180" />
-				<el-table-column label="鎿嶄綔" width="150" fixed="right">
-					<template #default="scope">
-						<el-button link size="small" @click="viewDetail(scope.row)">鏌ョ湅</el-button>
-						<el-button link size="small" @click="editItem(scope.row)">缂栬緫</el-button>
-					</template>
-				</el-table-column>
 			</el-table>
-			
-			<div class="pagination-container">
-				<el-pagination
-					v-model:current-page="pagination.currentPage"
-					v-model:page-size="pagination.pageSize"
-					:page-sizes="[10, 20, 50, 100]"
-					:total="pagination.total"
-					layout="total, sizes, prev, pager, next, jumper"
-					@size-change="handleSizeChange"
-					@current-change="handleCurrentChange"
-				/>
-			</div>
 		</el-card>
 	</div>
 </template>
@@ -212,6 +159,7 @@
 import { ElMessage, ElMessageBox } from 'element-plus'
 import * as echarts from 'echarts'
 import { Box, Tools, Document, ShoppingCart } from '@element-plus/icons-vue'
+import {reportAnalysis} from '@/api/productionManagement/productionOrder'
 
 // 鍝嶅簲寮忔暟鎹�
 const filterForm = reactive({
@@ -220,25 +168,18 @@
 })
 
 const statistics = reactive({
-	totalSamples: 1250,
-	activeEquipment: 45,
-	completedInspections: 890,
-	totalUsage: 2340
+  totalSamples: 0,
+  activeEquipment: 0,
+  completedInspections: 0,
+  totalUsage: 0
 })
 
 const tableData = ref([])
 const tableLoading = ref(false)
-const pagination = reactive({
-	currentPage: 1,
-	pageSize: 20,
-	total: 0
-})
 
 // 鍥捐〃寮曠敤
 const sampleChartRef = ref(null)
 const equipmentChartRef = ref(null)
-const inspectionChartRef = ref(null)
-const usageChartRef = ref(null)
 
 // 鍥捐〃瀹炰緥
 let sampleChart = null
@@ -248,60 +189,34 @@
 
 // 鍒濆鍖栨暟鎹�
 const initData = () => {
-	// 妯℃嫙琛ㄦ牸鏁版嵁
-	tableData.value = [
-		{
-			id: 'SP001',
-			name: '鏍峰搧A-001',
-			type: '閲戝睘鏉愭枡',
-			status: '妫�娴嬩腑',
-			progress: 75,
-			createTime: '2025-01-15 09:30:00',
-			updateTime: '2025-01-20 14:20:00'
-		},
-		{
-			id: 'SP002',
-			name: '鏍峰搧B-002',
-			type: '濉戞枡鍒跺搧',
-			status: '宸插畬鎴�',
-			progress: 100,
-			createTime: '2025-01-10 10:15:00',
-			updateTime: '2025-01-18 16:45:00'
-		},
-		{
-			id: 'SP003',
-			name: '鏍峰搧C-003',
-			type: '鐢靛瓙鍏冧欢',
-			status: '寰呮娴�',
-			progress: 0,
-			createTime: '2025-01-22 08:45:00',
-			updateTime: '2025-01-22 08:45:00'
-		},
-		{
-			id: 'EQ001',
-			name: '妫�娴嬭澶嘇',
-			type: '鍏夎氨浠�',
-			status: '浣跨敤涓�',
-			progress: 60,
-			createTime: '2025-01-05 14:20:00',
-			updateTime: '2025-01-20 11:30:00'
-		},
-		{
-			id: 'EQ002',
-			name: '妫�娴嬭澶嘊',
-			type: '鏄惧井闀�',
-			status: '绌洪棽',
-			progress: 0,
-			createTime: '2025-01-08 16:10:00',
-			updateTime: '2025-01-19 09:15:00'
-		}
-	]
-	
-	pagination.total = tableData.value.length
+  let startDate=null,endDate=null;
+  if(filterForm.dateRange && filterForm.dateRange.length===2){
+    startDate = filterForm.dateRange[0];
+    endDate = filterForm.dateRange[1];
+  }
+  reportAnalysis({startDate:startDate,endDate:endDate}).then(res=>{
+    statistics.totalSamples = res.data.totalData.totalOrderNum
+    statistics.activeEquipment = res.data.totalData.tobeProduced
+    statistics.completedInspections = res.data.totalData.finishProduced
+    statistics.totalUsage = res.data.totalData.totalWorkhours
+    // 鍒濆鍖栧浘琛�
+    let chartData = res.data.productData?res.data.productData:{
+      finishProduced:0,
+      inProduced:0,
+      tobeProduced:0
+    };
+    initSampleChart([
+      { value: chartData.finishProduced, name: '宸插畬鎴�' },
+      { value: chartData.inProduced, name: '鐢熶骇涓�' },
+      { value: chartData.tobeProduced, name: '寰呮姤宸�' },
+    ])
+    initEquipmentChart(res.data.workHours)
+    tableData.value = res.data.productDetails
+  })
 }
 
 // 鍒濆鍖栨牱鍝佽繘搴﹀浘琛�
-const initSampleChart = () => {
+const initSampleChart = (charData) => {
 	if (sampleChartRef.value) {
 		sampleChart = echarts.init(sampleChartRef.value)
 		const option = {
@@ -336,12 +251,7 @@
 					labelLine: {
 						show: false
 					},
-					data: [
-						{ value: 450, name: '宸插畬鎴�' },
-						{ value: 320, name: '妫�娴嬩腑' },
-						{ value: 280, name: '寰呮娴�' },
-						{ value: 200, name: '宸叉殏鍋�' }
-					]
+					data: charData
 				}
 			]
 		}
@@ -350,8 +260,16 @@
 }
 
 // 鍒濆鍖栬澶囦娇鐢ㄥ浘琛�
-const initEquipmentChart = () => {
+const initEquipmentChart = (chartData) => {
 	if (equipmentChartRef.value) {
+    let processData = [];
+    let workHoursData = [];
+    if(chartData){
+      chartData.forEach(item=>{
+        processData.push(item.process);
+        workHoursData.push(item.workHours);
+      })
+    }
 		equipmentChart = echarts.init(equipmentChartRef.value)
 		const option = {
 			title: {
@@ -365,22 +283,23 @@
 			},
 			xAxis: {
 				type: 'category',
-				data: ['鍏夎氨浠�', '鏄惧井闀�', '纭害璁�', '鎷夊姏鏈�', '鍐插嚮鏈�', '閲戠浉浠�']
+				data: processData,
+        name: '宸ュ簭'
 			},
 			yAxis: {
 				type: 'value',
-				name: '浣跨敤鐜�(%)'
+				name: '鏍哥畻宸ユ椂'
 			},
 			series: [
 				{
-					name: '浣跨敤鐜�',
+					name: '鏍哥畻宸ユ椂',
 					type: 'bar',
-					data: [85, 60, 75, 90, 45, 70],
+					data: workHoursData,
 					itemStyle: {
-						color: function(params) {
-							const colors = ['#409EFF', '#67C23A', '#E6A23C', '#F56C6C', '#909399', '#9C27B0']
-							return colors[params.dataIndex]
-						}
+						// color: function(params) {
+						// 	const colors = ['#409EFF', '#67C23A', '#E6A23C', '#F56C6C', '#909399', '#9C27B0']
+						// 	return colors[params.dataIndex]
+						// }
 					}
 				}
 			]
@@ -389,92 +308,10 @@
 	}
 }
 
-// 鍒濆鍖栨娴嬮」鐩浘琛�
-const initInspectionChart = () => {
-	if (inspectionChartRef.value) {
-		inspectionChart = echarts.init(inspectionChartRef.value)
-		const option = {
-			title: {
-				show: false
-			},
-			tooltip: {
-				trigger: 'item'
-			},
-			legend: {
-				orient: 'vertical',
-				left: 'left'
-			},
-			series: [
-				{
-					name: '妫�娴嬮」鐩�',
-					type: 'pie',
-					radius: '50%',
-					data: [
-						{ value: 335, name: '鐗╃悊鎬ц兘' },
-						{ value: 310, name: '鍖栧鍒嗘瀽' },
-						{ value: 234, name: '灏哄娴嬮噺' },
-						{ value: 135, name: '澶栬妫�鏌�' },
-						{ value: 148, name: '鍏朵粬妫�娴�' }
-					],
-					emphasis: {
-						itemStyle: {
-							shadowBlur: 10,
-							shadowOffsetX: 0,
-							shadowColor: 'rgba(0, 0, 0, 0.5)'
-						}
-					}
-				}
-			]
-		}
-		inspectionChart.setOption(option)
-	}
-}
-
-// 鍒濆鍖栭鐢ㄨ褰曞浘琛�
-const initUsageChart = () => {
-	if (usageChartRef.value) {
-		usageChart = echarts.init(usageChartRef.value)
-		const option = {
-			title: {
-				show: false
-			},
-			tooltip: {
-				trigger: 'axis'
-			},
-			legend: {
-				data: ['棰嗙敤娆℃暟', '褰掕繕娆℃暟']
-			},
-			xAxis: {
-				type: 'category',
-				boundaryGap: false,
-				data: ['1鏈�', '2鏈�', '3鏈�', '4鏈�', '5鏈�', '6鏈�', '7鏈�', '8鏈�', '9鏈�', '10鏈�', '11鏈�', '12鏈�']
-			},
-			yAxis: {
-				type: 'value'
-			},
-			series: [
-				{
-					name: '棰嗙敤娆℃暟',
-					type: 'line',
-					stack: 'Total',
-					data: [120, 132, 101, 134, 90, 230, 210, 182, 191, 234, 290, 330]
-				},
-				{
-					name: '褰掕繕娆℃暟',
-					type: 'line',
-					stack: 'Total',
-					data: [110, 125, 95, 128, 85, 220, 200, 175, 185, 225, 280, 320]
-				}
-			]
-		}
-		usageChart.setOption(option)
-	}
-}
-
 // 浜嬩欢澶勭悊鍑芥暟
 const handleFilterChange = () => {
-	ElMessage.success('绛涢�夋潯浠跺凡鏇存柊')
 	// 杩欓噷鍙互鏍规嵁绛涢�夋潯浠堕噸鏂板姞杞芥暟鎹�
+   initData()
 }
 
 const resetFilter = () => {
@@ -483,62 +320,13 @@
 	ElMessage.info('绛涢�夋潯浠跺凡閲嶇疆')
 }
 
-const exportReport = () => {
-	ElMessage.success('鎶ヨ〃瀵煎嚭鍔熻兘寮�鍙戜腑...')
-}
-
-const refreshSampleChart = () => {
-	initSampleChart()
-	ElMessage.success('鏍峰搧杩涘害鍥捐〃宸插埛鏂�')
-}
-
-const refreshEquipmentChart = () => {
-	initEquipmentChart()
-	ElMessage.success('璁惧浣跨敤鍥捐〃宸插埛鏂�')
-}
-
-const refreshInspectionChart = () => {
-	initInspectionChart()
-	ElMessage.success('妫�娴嬮」鐩浘琛ㄥ凡鍒锋柊')
-}
-
-const refreshUsageChart = () => {
-	initUsageChart()
-	ElMessage.success('棰嗙敤璁板綍鍥捐〃宸插埛鏂�')
-}
-
-const refreshTable = () => {
-	tableLoading.value = true
-	setTimeout(() => {
-		tableLoading.value = false
-		ElMessage.success('琛ㄦ牸鏁版嵁宸插埛鏂�')
-	}, 1000)
-}
-
-const exportTable = () => {
-	ElMessage.success('琛ㄦ牸瀵煎嚭鍔熻兘寮�鍙戜腑...')
-}
-
-const handleSizeChange = (val) => {
-	pagination.pageSize = val
-	// 閲嶆柊鍔犺浇鏁版嵁
-}
-
-const handleCurrentChange = (val) => {
-	pagination.currentPage = val
-	// 閲嶆柊鍔犺浇鏁版嵁
-}
-
 const getStatusType = (status) => {
 	const statusMap = {
-		'宸插畬鎴�': 'success',
-		'妫�娴嬩腑': 'warning',
-		'寰呮娴�': 'info',
-		'宸叉殏鍋�': 'danger',
-		'浣跨敤涓�': 'primary',
-		'绌洪棽': 'info'
+		'3': {type:'success',label:'宸插畬鎴�'},
+		'2': {type:'warning',label:'鐢熶骇涓�'},
+		'1': {type:'info',label:'寰呯敓浜�'}
 	}
-	return statusMap[status] || 'info'
+	return statusMap[status] || {type:'info',label:'鏈煡鐘舵��'}
 }
 
 const getProgressStatus = (progress) => {
@@ -548,24 +336,9 @@
 	return 'exception'
 }
 
-const viewDetail = (row) => {
-	ElMessage.info(`鏌ョ湅璇︽儏: ${row.name}`)
-}
-
-const editItem = (row) => {
-	ElMessage.info(`缂栬緫椤圭洰: ${row.name}`)
-}
-
 // 鐢熷懡鍛ㄦ湡
 onMounted(() => {
 	initData()
-	nextTick(() => {
-		initSampleChart()
-		initEquipmentChart()
-		initInspectionChart()
-		initUsageChart()
-	})
-	
 	// 鐩戝惉绐楀彛澶у皬鍙樺寲锛岄噸鏂拌皟鏁村浘琛ㄥぇ灏�
 	window.addEventListener('resize', () => {
 		sampleChart?.resize()
@@ -581,11 +354,6 @@
 	padding: 20px;
 	background-color: #f5f5f5;
 	min-height: 100vh;
-}
-
-.page-header {
-	margin-bottom: 20px;
-	text-align: center;
 }
 
 .page-header h2 {
@@ -684,11 +452,6 @@
 
 .table-card {
 	margin-bottom: 20px;
-}
-
-.pagination-container {
-	margin-top: 20px;
-	text-align: right;
 }
 
 :deep(.el-card__header) {

--
Gitblit v1.9.3