| | |
| | | <template> |
| | | <div class="wms-dashboard"> |
| | | <!-- ç»è®¡å¡çåºå - ç»å®ååºå¼æ°æ® --> |
| | | <!-- ç»è®¡å¡çåºå --> |
| | | <el-row :gutter="20" class="stats-card-row"> |
| | | <el-col :span="4"> |
| | | <div class="stats-card"> |
| | | <div class="metric-icon"> |
| | | <el-icon :size="32"> |
| | | <Box /> |
| | | </el-icon> |
| | | <el-icon :size="32"><Box /></el-icon> |
| | | </div> |
| | | <div class="card-title">æ»åºå</div> |
| | | <div class="card-value">{{ formatNumber(bigscreendata.totalStockQuantity) }}</div> |
| | | <div class="card-title">å¾
å
¥åºè®¢å</div> |
| | | <div class="card-value">{{ bigscreendata.unInBoundOrderCount }}</div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <div class="stats-card"> |
| | | <div class="metric-icon"> |
| | | <el-icon :size="32"> |
| | | <Document /> |
| | | </el-icon> |
| | | <el-icon :size="32"><Document /></el-icon> |
| | | </div> |
| | | <div class="card-title">å¾
åºåºè®¢å</div> |
| | | <div class="card-value">{{ bigscreendata.unOutBoundOrderCount }}</div> |
| | |
| | | <el-col :span="4"> |
| | | <div class="stats-card"> |
| | | <div class="metric-icon"> |
| | | <el-icon :size="32"> |
| | | <Download /> |
| | | </el-icon> |
| | | <el-icon :size="32"><Download /></el-icon> |
| | | </div> |
| | | <div class="card-title">仿¥å
¥åºå®ææ°</div> |
| | | <div class="card-title">仿¥å
¥åºå®æç®±æ°</div> |
| | | <div class="card-value">{{ bigscreendata.inboundCount }}</div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <div class="stats-card"> |
| | | <div class="metric-icon"> |
| | | <el-icon :size="32"> |
| | | <Upload /> |
| | | </el-icon> |
| | | <el-icon :size="32"><Upload /></el-icon> |
| | | </div> |
| | | <div class="card-title">仿¥åºåºå®ææ°</div> |
| | | <div class="card-title">仿¥åºåºå®æç®±æ°</div> |
| | | <div class="card-value">{{ bigscreendata.outboundCount }}</div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <div class="stats-card"> |
| | | <div class="metric-icon"> |
| | | <el-icon :size="32"> |
| | | <Box /> |
| | | </el-icon> |
| | | <el-icon :size="32"><Box /></el-icon> |
| | | </div> |
| | | <div class="card-title">æè´§æç®±</div> |
| | | <div class="card-value">{{ formatNumber(bigscreendata.inStockPallet) }}</div> |
| | |
| | | <el-col :span="4"> |
| | | <div class="stats-card"> |
| | | <div class="metric-icon"> |
| | | <el-icon :size="32"> |
| | | <Box /> |
| | | </el-icon> |
| | | <el-icon :size="32"><Box /></el-icon> |
| | | </div> |
| | | <div class="card-title">空箱æ°é</div> |
| | | <div class="card-value">{{ formatNumber(bigscreendata.freeStockPallet) }}</div> |
| | |
| | | <div ref="locationRateRef" class="chart-container"></div> |
| | | </div> |
| | | </el-col> |
| | | <!-- 临æä¿¡æ¯æ¹ä¸ºè¡¨æ ¼ --> |
| | | <el-col :span="8"> |
| | | <div class="chart-card"> |
| | | <div class="chart-title">ç©æä¸´æä¿¡æ¯</div> |
| | | <!-- 临æç©æè¡¨æ ¼ --> |
| | | <div class="expiration-table-container"> |
| | | <el-table |
| | | :data="expirationTableData" |
| | |
| | | </span> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column prop="barcode" label="æ¡ç " align="center" /> --> |
| | | <el-table-column prop="stockQuantity" label="åºåæ°é" align="center" /> |
| | | <el-table-column prop="locationCode" label="åºä½" align="center" /> |
| | | <el-table-column prop="palletCode" label="æçç¼å·" align="center" /> |
| | |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <div class="chart-card"> |
| | | <div class="chart-title">è¿7æ¥åºå
¥åºè¶å¿ï¼å¾ååèµ°å¿ï¼</div> |
| | | <div class="chart-title">è¿7æ¥åºå
¥åºåæ®è¶å¿</div> |
| | | <div ref="stockTrendRef" class="chart-container"></div> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <!-- å¾è¡¨åºåï¼ç¬¬äºè¡ï¼ --> |
| | | <el-row :gutter="20" class="chart-row"> |
| | | </el-row> |
| | | |
| | | <!-- è¡¨æ ¼åºå - ç»å®å端ä½ä¸æ°æ® --> |
| | | <!-- è¡¨æ ¼åºå - 宿¶ä½ä¸çæ§ï¼åºåæ£å¸¸/失败ä½ä¸ï¼ --> |
| | | <el-row :gutter="20" class="table-row" width="100%"> |
| | | <el-col :span="24"> |
| | | <!-- 左侧ï¼å½å¤©æ£å¸¸ä½ä¸åæ® --> |
| | | <el-col :span="12"> |
| | | <div class="table-card"> |
| | | <div class="table-title">宿¶ä½ä¸çæ§</div> |
| | | <el-table :data="showTaskList" border style="width: 100%;"> |
| | | <el-table-column prop="taskNum" label="ä»»å¡å·" /> |
| | | <el-table-column prop="taskStatus" label="ä»»å¡ç¶æ" > |
| | | <div class="table-title">宿¶ä½ä¸çæ§ï¼æ£å¸¸åæ®ï¼</div> |
| | | <el-table |
| | | :data="normalShowTaskList" |
| | | border |
| | | style="width: 100%;" |
| | | :empty-text="normalShowTaskList.length === 0 ? 'ææ æ£å¸¸ä½ä¸æ°æ®' : ''" |
| | | > |
| | | <el-table-column prop="upperOrderNo" label="åæ®ç¼å·" /> |
| | | <el-table-column label="åæ®ç¶æ" > |
| | | <template #default="{ row }"> |
| | | <span class="task-status" :class="getStatusClass(row.taskStatus)">{{ getTaskStatusText(row.taskStatus) }}</span> |
| | | <span class="task-status" :class="getStatusClass(row.taskStatus)"> |
| | | {{ getTaskStatusText(row.taskStatus, row.taskType) }} |
| | | </span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="taskType" label="ä»»å¡ç±»å" > |
| | | <el-table-column label="åæ®ç±»å" > |
| | | <template #default="{ row }"> |
| | | <span class="task-type" :class="getTypeClass(row.taskType)">{{ getTaskTypeText(row.taskType) }}</span> |
| | | <span class="task-type" :class="getTypeClass(row.taskType)"> |
| | | {{ getTaskTypeText(row) }} |
| | | </span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="palletCode" label="æçç¼å·" /> |
| | | <el-table-column prop="sourceAddress" label="èµ·ç¹ä½ç½®"/> |
| | | <el-table-column prop="targetAddress" label="ç»ç¹ä½ç½®"/> |
| | | <el-table-column label="åä¼ MESç¶æ" > |
| | | <template #default="{ row }"> |
| | | <span class="task-status" :class="getMESStatusClass(row.returnToMESStatus)"> |
| | | {{ getMESStatusText(row.returnToMESStatus) }} |
| | | </span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="factoryArea" label="ååº" /> |
| | | <el-table-column prop="modifier" label="ä¿®æ¹äºº" /> |
| | | <el-table-column prop="createDate" label="å建æ¶é´"/> |
| | | <el-table-column prop="modifyDate" label="ä¿®æ¹æ¶é´"/> |
| | | </el-table> |
| | | <div class="table-pagination"> |
| | | <el-pagination layout="prev, pager, next, jumper" :current-page="1" :total="50" /> |
| | | <el-pagination |
| | | layout="prev, pager, next, jumper" |
| | | v-model:current-page="normalCurrentPage" |
| | | :page-size="5" |
| | | :total="normalTaskList.length" |
| | | @current-change="handleNormalPageChange" |
| | | /> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <!-- å³ä¾§ï¼è¿3天åä¼ å¤±è´¥/é¨åå¤±è´¥åæ® --> |
| | | <el-col :span="12"> |
| | | <div class="table-card"> |
| | | <div class="table-title">宿¶ä½ä¸çæ§ï¼åä¼ å¤±è´¥ï¼</div> |
| | | <el-table |
| | | :data="failShowTaskList" |
| | | border |
| | | style="width: 100%;" |
| | | :empty-text="failShowTaskList.length === 0 ? 'ææ åä¼ å¤±è´¥æ°æ®' : ''" |
| | | > |
| | | <el-table-column prop="upperOrderNo" label="åæ®ç¼å·" /> |
| | | <el-table-column label="åæ®ç¶æ" > |
| | | <template #default="{ row }"> |
| | | <span class="task-status" :class="getStatusClass(row.taskStatus)"> |
| | | {{ getTaskStatusText(row.taskStatus, row.taskType) }} |
| | | </span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="åæ®ç±»å" > |
| | | <template #default="{ row }"> |
| | | <span class="task-type" :class="getTypeClass(row.taskType)"> |
| | | {{ getTaskTypeText(row) }} |
| | | </span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="åä¼ MESç¶æ" > |
| | | <template #default="{ row }"> |
| | | <span class="task-status" :class="getMESStatusClass(row.returnToMESStatus)"> |
| | | {{ getMESStatusText(row.returnToMESStatus) }} |
| | | </span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="remark" label="失败åå " show-overflow-tooltip /> |
| | | <el-table-column prop="factoryArea" label="ååº" /> |
| | | <el-table-column prop="modifier" label="ä¿®æ¹äºº" /> |
| | | <el-table-column prop="createDate" label="å建æ¶é´"/> |
| | | <el-table-column prop="modifyDate" label="ä¿®æ¹æ¶é´"/> |
| | | </el-table> |
| | | <div class="table-pagination"> |
| | | <el-pagination |
| | | layout="prev, pager, next, jumper" |
| | | v-model:current-page="failCurrentPage" |
| | | :page-size="5" |
| | | :total="failTaskList.length" |
| | | @current-change="handleFailPageChange" |
| | | /> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, onMounted, onUnmounted, nextTick, computed } from 'vue'; |
| | | import { ref, onMounted, onUnmounted, nextTick, computed, watch } from 'vue'; |
| | | import * as echarts from 'echarts'; |
| | | import http from "@/api/http.js"; |
| | | // è¡¥å
缺失ç徿 导å
¥ |
| | | import { Box, Document, Download, Upload } from '@element-plus/icons-vue'; |
| | | // è¡¥å
ElMessage导å
¥ |
| | | import { ElMessage } from 'element-plus'; |
| | | |
| | | // ååºå¼æ°æ® |
| | | const month = ref('month'); |
| | | const orderType = ref('return'); |
| | | |
| | | // å端è¿åæ°æ®ï¼ååºå¼ï¼ |
| | | const bigscreendata = ref({ |
| | | totalStockQuantity: 0, |
| | | unOutBoundOrderCount: 0, |
| | | unInBoundOrderCount:0, |
| | | dailyCompletionRate: 0, |
| | | unhandledExceptionCount: 0, |
| | | locationUtilizationRate: 0, |
| | | inStockPallet: 0, |
| | | freeStockPallet: 0, |
| | | dailyInOutBoundList: [], |
| | | taskList: [], |
| | | completeTask: [], // å端è¿åç任塿°æ®ï¼å½å¤©æ£å¸¸+è¿3å¤©å¤±è´¥ï¼ |
| | | inboundCount: 0, |
| | | outboundCount: 0, |
| | | inventoryLocationDist: [], |
| | | exceptionTypeTrend: [], |
| | | nearExpirationList: [] // æ¹ä¸ºæ°ç»ç±»åï¼å¹é
æ°æ°æ®ç»æ |
| | | nearExpirationList: [] |
| | | }); |
| | | |
| | | // 临æè¡¨æ ¼æ°æ®ï¼è®¡ç®å±æ§ï¼éé
æ°çæ°ç»æ°æ®ç»æï¼ |
| | | // 临æè¡¨æ ¼æ°æ®ï¼ä¿æä¸åï¼ |
| | | const expirationTableData = computed(() => { |
| | | // æ°æ°æ®ç»ææ¯æ°ç»ï¼ç´æ¥åæ°ç»å¹¶å¤çç©ºå¼ |
| | | const expirationList = bigscreendata.value.nearExpirationList || []; |
| | | |
| | | // ç¬¬ä¸æ¥ï¼å»é - æ ç©æç¼ç +æ¹æ¬¡å·+æçç¼å·+æææ å¯ä¸æ è¯å»é |
| | | const uniqueMap = new Map(); |
| | | expirationList.forEach(item => { |
| | | // æ¼æ¥å¯ä¸æ è¯ï¼å¤ç空å¼ï¼é¿å
å 空å¼å¯¼è´éå¤å¤æéè¯¯ï¼ |
| | | const uniqueKey = [ |
| | | item.materielCode || 'æªç¥ç¼ç ', |
| | | item.batchNo || 'æªç¥æ¹æ¬¡', |
| | | item.palletCode || 'æªç¥æç', |
| | | ].join('|'); // ç¨ç¹æ®å符åéï¼é¿å
åæ®µå¼æ¼æ¥åæ··æ· |
| | | |
| | | // åªä¿çç¬¬ä¸æ¬¡åºç°çè®°å½ |
| | | if (!uniqueMap.has(uniqueKey)) { |
| | | uniqueMap.set(uniqueKey, item); |
| | | } |
| | | const uniqueKey = [item.materielCode, item.batchNo, item.palletCode].join('|'); |
| | | if (!uniqueMap.has(uniqueKey)) uniqueMap.set(uniqueKey, item); |
| | | }); |
| | | |
| | | // æåå»éåçæ°ç» |
| | | const uniqueExpirationList = Array.from(uniqueMap.values()); |
| | | |
| | | // ç¬¬äºæ¥ï¼éåå»éåçæ°æ®ï¼è¡¥å
临æç级åé»è®¤å¼ |
| | | return uniqueExpirationList.map(item => { |
| | | // æåå½åç©æç临æå¤©æ°ï¼æ ¸å¿åæ®µï¼ |
| | | const daysToExpiration = item.daysToExpiration || 0; |
| | | // 计ç®ä¸´æç级 |
| | | let expireLevel = ''; |
| | | if (daysToExpiration < 0) { |
| | | expireLevel = 'å·²è¿æ'; |
| | | } else if (daysToExpiration <= 7) { |
| | | expireLevel = '7天å
临æ'; |
| | | } else if (daysToExpiration <= 15) { |
| | | expireLevel = '15天å
临æ'; |
| | | } else if (daysToExpiration <= 30) { |
| | | expireLevel = '30天å
临æ'; |
| | | } else { |
| | | expireLevel = '30天以ä¸'; |
| | | } |
| | | |
| | | if (daysToExpiration < 0) expireLevel = 'å·²è¿æ'; |
| | | else if (daysToExpiration <= 7) expireLevel = '7天å
临æ'; |
| | | else if (daysToExpiration <= 15) expireLevel = '15天å
临æ'; |
| | | else if (daysToExpiration <= 30) expireLevel = '30天å
临æ'; |
| | | else expireLevel = '30天以ä¸'; |
| | | return { |
| | | materielCode: item.materielCode || 'æªç¥ç¼ç ', |
| | | materielName: item.materielName || 'æªç¥åç§°', |
| | | batchNo: item.batchNo || 'æªç¥æ¹æ¬¡', |
| | | validDate: item.validDate || 'æªç¥æææ', |
| | | materielCode: item.materielCode, |
| | | materielName: item.materielName, |
| | | batchNo: item.batchNo, |
| | | validDate: item.validDate, |
| | | daysToExpiration: daysToExpiration, |
| | | expireLevel: expireLevel, |
| | | stockQuantity: item.stockQuantity || 0, |
| | | locationCode: item.locationCode || 'æªç¥åºä½', |
| | | palletCode: item.palletCode || 'æªç¥æç', |
| | | unit: item.unit || 'PCS' |
| | | locationCode: item.locationCode, |
| | | palletCode: item.palletCode, |
| | | unit: item.unit |
| | | }; |
| | | }); |
| | | }); |
| | | |
| | | // ç©ºæ°æ®æç¤ºææ¬ï¼ä¿®æ£å¤æé»è¾ï¼ |
| | | const emptyText = computed(() => { |
| | | const expirationList = bigscreendata.value.nearExpirationList || []; |
| | | // æ°ç»é¿åº¦ä¸º0æ¶æ¾ç¤ºç©ºæç¤ºï¼å¦å䏿¾ç¤ºï¼åé»è¾ååäºï¼ |
| | | return expirationList.length === 0 ? 'ææ ä¸´æç©ææ°æ®' : ''; |
| | | }); |
| | | |
| | | // è·å临æççº§æ ·å¼ç±» |
| | | const getExpireLevelClass = (level) => { |
| | | switch(level) { |
| | | case 'å·²è¿æ': return 'expire-level expired'; |
| | |
| | | } |
| | | }; |
| | | |
| | | const taskStatusMap = { |
| | | 100: "æ°å»º", |
| | | 105: "å·²åé", |
| | | 200: "å åæºå¾
æ§è¡", |
| | | 210: "å åæºæ§è¡ä¸", |
| | | 220: "å åæºå®æ", |
| | | 400: "è¾é线å¾
æ§è¡", |
| | | 410: "è¾é线æ§è¡ä¸", |
| | | 420: "è¾éçº¿å®æ", |
| | | 300: "AGVå¾
æ§è¡", |
| | | 310: "AGVæ§è¡ä¸", |
| | | 315: "AGVåè´§ä¸", |
| | | 320: "AGVå¾
ç»§ç»æ§è¡", |
| | | 325: "AGVæ¾è´§ä¸", |
| | | 330: "AGV宿", |
| | | 900: "ä»»å¡å®æ", |
| | | 970: "ä»»å¡æèµ·", |
| | | 980: "ä»»å¡åæ¶", |
| | | 990: "ä»»å¡å¼å¸¸", |
| | | 110: "æåæºæ§è¡ä¸" |
| | | // ä¸å¡ç±»åæ å° |
| | | const inboundBusinessTypeMap = { |
| | | 11: "éè´å
¥åº", 12: "ææ¶å", 13: "ç产éæå", |
| | | 14: "å¤åéæå", 15: "éå®éåºå", 3: "è°æ¨å
¥åºå" |
| | | }; |
| | | const outboundBusinessTypeMap = { |
| | | 21: "å·¥å颿åºåºå", 22: "æåå", 23: "éè´§å", |
| | | 24: "éå®åºåºå", 25: "å¤å颿ç³è¯·å", 2: "è°æ¨åºåºå" |
| | | }; |
| | | |
| | | // è·åä»»å¡ç¶æææ¬ |
| | | const getTaskStatusText = (statusNum) => { |
| | | if (statusNum === undefined || statusNum === null || isNaN(statusNum)) { |
| | | return "æªç¥ç¶æ"; |
| | | // æåï¼å½å¤©æ£å¸¸ä½ä¸åæ® |
| | | const normalTaskList = computed(() => { |
| | | const taskData = (bigscreendata.value.completeTask[0] || {}); |
| | | const inboundOrders = taskData.inboundOrders || []; |
| | | const outboundOrders = taskData.outboundOrders || []; |
| | | |
| | | // æ ¼å¼åå
¥åºè®¢å |
| | | const formattedInbound = inboundOrders.map(item => ({ |
| | | upperOrderNo: item.upperOrderNo || item.inboundOrderNo, |
| | | taskStatus: item.orderStatus || 0, |
| | | taskType: 'inbound', |
| | | businessType: item.businessType || '', |
| | | returnToMESStatus: item.returnToMESStatus || 0, |
| | | factoryArea: item.factoryArea || '', |
| | | modifier: item.modifier || '', |
| | | createDate: item.createDate || '', |
| | | modifyDate: item.modifyDate || '', |
| | | remark: item.remark || '' |
| | | })); |
| | | |
| | | // æ ¼å¼ååºåºè®¢å |
| | | const formattedOutbound = outboundOrders.map(item => ({ |
| | | upperOrderNo: item.upperOrderNo || item.orderNo, |
| | | taskStatus: item.orderStatus || 0, |
| | | taskType: 'outbound', |
| | | businessType: item.businessType || '', |
| | | returnToMESStatus: item.returnToMESStatus || 0, |
| | | factoryArea: item.factoryArea || '', |
| | | modifier: item.modifier || '', |
| | | createDate: item.createDate || '', |
| | | modifyDate: item.modifyDate || '', |
| | | remark: item.remark || '' |
| | | })); |
| | | |
| | | return [...formattedInbound, ...formattedOutbound]; |
| | | }); |
| | | |
| | | // æåï¼è¿3天åä¼ å¤±è´¥/é¨åå¤±è´¥åæ® |
| | | const failTaskList = computed(() => { |
| | | const taskData = (bigscreendata.value.completeTask[0] || {}); |
| | | const inboundFailOrders = taskData.inboundReturnFailOrders || []; |
| | | const outboundFailOrders = taskData.outboundReturnFailOrders || []; |
| | | |
| | | const formattedInboundFail = inboundFailOrders.map(item => ({ |
| | | upperOrderNo: item.upperOrderNo || item.inboundOrderNo, |
| | | taskStatus: item.orderStatus || 0, |
| | | taskType: 'inbound', |
| | | businessType: item.businessType || '', |
| | | returnToMESStatus: item.returnToMESStatus || 0, |
| | | factoryArea: item.factoryArea || '', |
| | | modifier: item.modifier || '', |
| | | createDate: item.createDate || '', |
| | | modifyDate: item.modifyDate || '', |
| | | remark: item.remark || '' |
| | | })); |
| | | |
| | | const formattedOutboundFail = outboundFailOrders.map(item => ({ |
| | | upperOrderNo: item.upperOrderNo || item.orderNo, |
| | | taskStatus: item.orderStatus || 0, |
| | | taskType: 'outbound', |
| | | businessType: item.businessType || '', |
| | | returnToMESStatus: item.returnToMESStatus || 0, |
| | | factoryArea: item.factoryArea || '', |
| | | modifier: item.modifier || '', |
| | | createDate: item.createDate || '', |
| | | modifyDate: item.modifyDate || '', |
| | | remark: item.remark || '' |
| | | })); |
| | | |
| | | return [...formattedInboundFail, ...formattedOutboundFail]; |
| | | }); |
| | | |
| | | // å页&è½®æç¸å
³ååºå¼åé |
| | | const normalCurrentPage = ref(1); |
| | | const failCurrentPage = ref(1); |
| | | const normalShowTaskList = ref([]); |
| | | const failShowTaskList = ref([]); |
| | | let normalCarouselTimer = null; |
| | | let failCarouselTimer = null; |
| | | |
| | | // ä¿®å¤ï¼åæ®ç¶æææ¬ï¼æ°å¢taskTypeåæ°ï¼ |
| | | const getTaskStatusText = (statusNum, taskType) => { |
| | | const statusMap = { |
| | | 0: "æªå¼å§", |
| | | 1: taskType === 'inbound' ? "å
¥åºä¸" : (taskType === 'outbound' ? "åºåºä¸" : "å¤çä¸"), |
| | | 2: "å¤çä¸", |
| | | 3: "已宿", |
| | | 4: "已忶", |
| | | 5: "å¼å¸¸" |
| | | }; |
| | | return statusMap[statusNum] ; |
| | | }; |
| | | |
| | | // MESåä¼ ç¶ææ å° |
| | | const mesStatusMap = { |
| | | 0: "æªåä¼ ", 1: "åä¼ æå", 2: "åä¼ å¤±è´¥", |
| | | 3: "é¨ååä¼ æå", 4: "é¨ååä¼ å¤±è´¥" |
| | | }; |
| | | const getMESStatusText = (statusNum) => { |
| | | if (statusNum === undefined || statusNum === null || isNaN(statusNum)) return "æªç¥ç¶æ"; |
| | | return mesStatusMap[statusNum] || `æªç¥ç¶æ(${statusNum})`; |
| | | }; |
| | | const getMESStatusClass = (statusNum) => { |
| | | if (statusNum === undefined || statusNum === null || isNaN(statusNum)) return "status-unknown"; |
| | | const classMap = { 0: "status-pending", 1: "status-completed", 2: "status-error", 3: "status-processing", 4: "status-error" }; |
| | | return classMap[statusNum] || "status-unknown"; |
| | | }; |
| | | |
| | | // åæ®ç±»åææ¬/æ ·å¼ |
| | | const getTaskTypeText = (row) => { |
| | | const businessType = Number(row.businessType) || 0; |
| | | if (row.taskType === 'inbound') { |
| | | return inboundBusinessTypeMap[businessType] || `æªç¥ç±»å(${businessType})`; |
| | | } else if (row.taskType === 'outbound') { |
| | | return outboundBusinessTypeMap[businessType] || `æªç¥ç±»å(${businessType})`; |
| | | } |
| | | return taskStatusMap[statusNum] || "æªç¥ç¶æ"; |
| | | return "å
¶ä»ä½ä¸"; |
| | | }; |
| | | const getStatusClass = (statusNum) => { |
| | | if (statusNum === undefined || statusNum === null || isNaN(statusNum)) return "status-unknown"; |
| | | const classMap = { 0: "status-pending", 1: "status-processing", 2: "status-processing", 3: "status-completed", 4: "status-canceled", 5: "status-error" }; |
| | | return classMap[statusNum] || "status-unknown"; |
| | | }; |
| | | const getTypeClass = (taskType) => { |
| | | const classMap = { 'inbound': "type-inbound", 'outbound': "type-outbound" }; |
| | | return classMap[taskType] || "type-other"; |
| | | }; |
| | | |
| | | // è¡¨æ ¼æ¾ç¤ºçä»»å¡å表ï¼è½®æç¨ï¼ |
| | | const showTaskList = ref([]); |
| | | const currentTaskIndex = ref(5); |
| | | let taskCarouselTimer = null; |
| | | |
| | | // æ°åæ ¼å¼åï¼ååä½åéï¼ |
| | | // æ°åæ ¼å¼å |
| | | const formatNumber = (num) => { |
| | | if (!num) return '0'; |
| | | return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','); |
| | | }; |
| | | |
| | | // ä»»å¡å表轮æé»è¾ |
| | | const startTaskCarousel = () => { |
| | | if (taskCarouselTimer) clearInterval(taskCarouselTimer); |
| | | // åå§åè¡¨æ ¼æ°æ®ï¼å页+è½®æï¼ |
| | | const initTableData = () => { |
| | | // 忢æ§å®æ¶å¨ |
| | | clearInterval(normalCarouselTimer); |
| | | clearInterval(failCarouselTimer); |
| | | |
| | | const totalTask = bigscreendata.value.taskList.length; |
| | | if (totalTask <= 5) { |
| | | showTaskList.value = [...bigscreendata.value.taskList]; |
| | | return; |
| | | // æ£å¸¸åæ®å页/è½®æ |
| | | const loadNormalData = (page) => { |
| | | const start = (page - 1) * 5; |
| | | const end = start + 5; |
| | | normalShowTaskList.value = normalTaskList.value.slice(start, end); |
| | | }; |
| | | loadNormalData(normalCurrentPage.value); |
| | | |
| | | // å¤±è´¥åæ®å页/è½®æ |
| | | const loadFailData = (page) => { |
| | | const start = (page - 1) * 5; |
| | | const end = start + 5; |
| | | failShowTaskList.value = failTaskList.value.slice(start, end); |
| | | }; |
| | | loadFailData(failCurrentPage.value); |
| | | |
| | | // è½®æé»è¾ï¼ä»
æ°æ®è¶
è¿5æ¡æ¶å¼å¯ï¼ |
| | | if (normalTaskList.value.length > 5) { |
| | | normalCarouselTimer = setInterval(() => { |
| | | normalCurrentPage.value = normalCurrentPage.value >= Math.ceil(normalTaskList.value.length / 5) ? 1 : normalCurrentPage.value + 1; |
| | | loadNormalData(normalCurrentPage.value); |
| | | }, 5000); |
| | | } |
| | | |
| | | taskCarouselTimer = setInterval(() => { |
| | | showTaskList.value.push(bigscreendata.value.taskList[currentTaskIndex.value]); |
| | | showTaskList.value.shift(); |
| | | currentTaskIndex.value++; |
| | | if (currentTaskIndex.value >= totalTask) { |
| | | currentTaskIndex.value = 0; |
| | | } |
| | | }, 5000); |
| | | }; |
| | | |
| | | // è·åä»»å¡ç±»åææ¬ |
| | | const getTaskTypeText = (taskTypeNum) => { |
| | | if (!taskTypeNum || isNaN(taskTypeNum)) return "æªç¥ç±»å"; |
| | | |
| | | if (taskTypeNum >= 500 && taskTypeNum < 900) return "å
¥åº"; |
| | | if (taskTypeNum >= 100 && taskTypeNum < 500) return "åºåº"; |
| | | if (taskTypeNum >= 900 && taskTypeNum < 1000) return "ç§»åº"; |
| | | return "å
¶ä»ä½ä¸"; |
| | | }; |
| | | |
| | | // è·åä»»å¡ç¶ææ ·å¼ç±» |
| | | const getStatusClass = (statusNum) => { |
| | | if (statusNum === undefined || statusNum === null || isNaN(statusNum)) { |
| | | return "status-unknown"; |
| | | if (failTaskList.value.length > 5) { |
| | | failCarouselTimer = setInterval(() => { |
| | | failCurrentPage.value = failCurrentPage.value >= Math.ceil(failTaskList.value.length / 5) ? 1 : failCurrentPage.value + 1; |
| | | loadFailData(failCurrentPage.value); |
| | | }, 5000); |
| | | } |
| | | |
| | | if (statusNum >= 900) return "status-completed"; |
| | | if (statusNum >= 400) return "status-processing"; |
| | | if (statusNum >= 300) return "status-processing"; |
| | | if (statusNum >= 200) return "status-processing"; |
| | | if (statusNum >= 100) return "status-pending"; |
| | | if (statusNum === 970) return "status-suspended"; |
| | | if (statusNum === 980) return "status-canceled"; |
| | | if (statusNum === 990) return "status-error"; |
| | | |
| | | return "status-unknown"; |
| | | }; |
| | | |
| | | // è·åä»»å¡ç±»åæ ·å¼ç±» |
| | | const getTypeClass = (taskTypeNum) => { |
| | | if (!taskTypeNum || isNaN(taskTypeNum)) return "type-unknown"; |
| | | |
| | | if (taskTypeNum >= 500 && taskTypeNum < 900) return "type-inbound"; |
| | | if (taskTypeNum >= 100 && taskTypeNum < 500) return "type-outbound"; |
| | | if (taskTypeNum >= 900 && taskTypeNum < 1000) return "type-transfer"; |
| | | |
| | | return "type-other"; |
| | | // å页忢äºä»¶ |
| | | const handleNormalPageChange = (page) => { |
| | | clearInterval(normalCarouselTimer); // æå¨åæ¢å页æ¶åæ¢è½®æ |
| | | normalCurrentPage.value = page; |
| | | const start = (page - 1) * 5; |
| | | const end = start + 5; |
| | | normalShowTaskList.value = normalTaskList.value.slice(start, end); |
| | | }; |
| | | const handleFailPageChange = (page) => { |
| | | clearInterval(failCarouselTimer); |
| | | failCurrentPage.value = page; |
| | | const start = (page - 1) * 5; |
| | | const end = start + 5; |
| | | failShowTaskList.value = failTaskList.value.slice(start, end); |
| | | }; |
| | | |
| | | // è·ååç«¯å¤§å±æ°æ® |
| | | // ç嬿°æ®ååï¼éæ°åå§åè¡¨æ ¼ |
| | | watch([normalTaskList, failTaskList], () => { |
| | | initTableData(); |
| | | }, { deep: true }); |
| | | |
| | | // è·ååç«¯æ°æ® |
| | | const fetchBigGreenData = async () => { |
| | | try { |
| | | const res = await http.get('/api/BigScreen/GetBigGreenData'); |
| | | console.log('大屿°æ®', res); |
| | | |
| | | bigscreendata.value = res.data || res; |
| | | // æ°æ®æ´æ°åå·æ°å¾è¡¨åè¡¨æ ¼ |
| | | nextTick(() => { |
| | | const total = bigscreendata.value.taskList.length; |
| | | showTaskList.value = total >=5 |
| | | ? [...bigscreendata.value.taskList.slice(0,5)] |
| | | : [...bigscreendata.value.taskList]; |
| | | startTaskCarousel(); |
| | | initTableData(); |
| | | refreshCharts(); |
| | | }); |
| | | } catch (error) { |
| | |
| | | } |
| | | }; |
| | | |
| | | // å¤ç¨æ¨¡ææ°æ® |
| | | const operationList = ref([ |
| | | { opNo: 'JW251224001', opType: 'å
¥åº', operator: 'å¼ ä¸', startTime: '15:30:22', status: 'å¤çä¸' }, |
| | | { opNo: 'CK251224002', opType: 'åºåº', operator: 'æå', startTime: '15:25:10', status: '已宿' }, |
| | | { opNo: 'PD251224003', opType: 'çç¹', operator: 'çäº', startTime: '15:20:05', status: 'å¾
确认' }, |
| | | { opNo: 'SC251224005', opType: '䏿¶', operator: 'åä¸', startTime: '15:10:18', status: 'å¼å¸¸' } |
| | | ]); |
| | | |
| | | // å¾è¡¨å®¹å¨Ref |
| | | const inventoryPieRef = ref(null); |
| | | // å¾è¡¨ç¸å
³ï¼ç²¾ç®åä½é»è¾ï¼ |
| | | const stockTrendRef = ref(null); |
| | | const locationRateRef = ref(null); |
| | | const exceptionTrendRef = ref(null); |
| | | |
| | | // å¾è¡¨å®ä¾ï¼å
¨å±ç®¡çï¼ |
| | | let inventoryPieChart = null; |
| | | let stockTrendChart = null; |
| | | let locationRateChart = null; |
| | | let exceptionTrendChart = null; |
| | | |
| | | // åå§ååºååºä½åå¸é¥¼å¾ |
| | | const initInventoryPie= () => { |
| | | if (!inventoryPieRef.value) return; |
| | | |
| | | if (inventoryPieChart) { |
| | | inventoryPieChart.dispose(); |
| | | } |
| | | |
| | | inventoryPieChart = echarts.init(inventoryPieRef.value); |
| | | const locationData = bigscreendata.value.inventoryLocationDist.length |
| | | ? bigscreendata.value.inventoryLocationDist |
| | | : [ |
| | | { value: 48.7, name: '常温åºAåº', itemStyle: { color: '#5470c6' } }, |
| | | { value: 29.2, name: 'å·èåºBåº', itemStyle: { color: '#91cc75' } }, |
| | | { value: 21.9, name: 'ä¿ç¨åºCåº', itemStyle: { color: '#fac858' } }, |
| | | { value: 2.2, name: 'æ®æ¬¡ååºDåº', itemStyle: { color: '#ee6666' } } |
| | | ]; |
| | | |
| | | const option = { |
| | | tooltip: { |
| | | trigger: 'item', |
| | | formatter: '{a} <br/>{b}: {c}%' |
| | | }, |
| | | legend: { |
| | | bottom: 0, |
| | | left: 'center', |
| | | data: locationData.map(item => item.name) |
| | | }, |
| | | series: [{ |
| | | name: 'åºååºä½åå¸', |
| | | type: 'pie', |
| | | radius: ['40%', '70%'], |
| | | center: ['50%', '40%'], |
| | | avoidLabelOverlap: false, |
| | | itemStyle: { |
| | | borderRadius: 10, |
| | | borderColor: '#fff', |
| | | borderWidth: 2 |
| | | }, |
| | | label: { |
| | | show: false, |
| | | position: 'center' |
| | | }, |
| | | emphasis: { |
| | | label: { |
| | | show: true, |
| | | fontSize: 20, |
| | | fontWeight: 'bold' |
| | | } |
| | | }, |
| | | labelLine: { |
| | | show: false |
| | | }, |
| | | data: locationData |
| | | }] |
| | | }; |
| | | |
| | | inventoryPieChart.setOption(option); |
| | | return inventoryPieChart; |
| | | }; |
| | | |
| | | // åå§åè¿7æ¥åºå
¥åºè¶å¿å¾ |
| | | const initStockTrend = () => { |
| | | if (!stockTrendRef.value) return; |
| | | |
| | | if (stockTrendChart) { |
| | | stockTrendChart.dispose(); |
| | | } |
| | | |
| | | if (stockTrendChart) stockTrendChart.dispose(); |
| | | stockTrendChart = echarts.init(stockTrendRef.value); |
| | | const trendData = bigscreendata.value.dailyInOutBoundList; |
| | | |
| | | const maxInbound = trendData.length ? Math.max(...trendData.map(item => item.dailyInboundQuantity || 0)) : 0; |
| | | const maxOutbound = trendData.length ? Math.max(...trendData.map(item => item.dailyOutboundQuantity || 0)) : 0; |
| | | const maxValue = Math.max(maxInbound, maxOutbound); |
| | | |
| | | const option = { |
| | | tooltip: { |
| | | trigger: 'axis', |
| | | axisPointer: { |
| | | type: 'cross' |
| | | } |
| | | }, |
| | | legend: { |
| | | data: ['å
¥åºé', 'åºåºé'], |
| | | top: 10 |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | top: '15%', |
| | | containLabel: true |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: true, |
| | | data: trendData.map(item => item.date) |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | | name: 'æ°é', |
| | | min: 0, |
| | | max: maxValue > 0 ? Math.ceil(maxValue * 1.2) : 10 |
| | | }, |
| | | tooltip: { trigger: 'axis', axisPointer: { type: 'cross' } }, |
| | | legend: { data: ['å
¥åºé', 'åºåºé'], top: 10 }, |
| | | grid: { left: '3%', right: '4%', bottom: '3%', top: '15%', containLabel: true }, |
| | | xAxis: { type: 'category', boundaryGap: true, data: trendData.map(item => item.date) }, |
| | | yAxis: { type: 'value', name: 'æ°é', min: 0, max: maxValue > 0 ? Math.ceil(maxValue * 1.2) : 10 }, |
| | | series: [ |
| | | { |
| | | name: 'å
¥åºé', |
| | | type: 'bar', |
| | | barWidth: '30%', |
| | | data: trendData.map(item => item.dailyInboundQuantity), |
| | | itemStyle: { |
| | | color: '#52c41a', |
| | | borderRadius: [4, 4, 0, 0] |
| | | } |
| | | }, |
| | | { |
| | | name: 'åºåºé', |
| | | type: 'bar', |
| | | barWidth: '30%', |
| | | data: trendData.map(item => item.dailyOutboundQuantity), |
| | | itemStyle: { |
| | | color: '#1890ff', |
| | | borderRadius: [4, 4, 0, 0] |
| | | } |
| | | } |
| | | { name: 'å
¥åºé', type: 'bar', barWidth: '30%', data: trendData.map(item => item.dailyInboundQuantity), itemStyle: { color: '#52c41a', borderRadius: [4, 4, 0, 0] } }, |
| | | { name: 'åºåºé', type: 'bar', barWidth: '30%', data: trendData.map(item => item.dailyOutboundQuantity), itemStyle: { color: '#1890ff', borderRadius: [4, 4, 0, 0] } } |
| | | ] |
| | | }; |
| | | |
| | | stockTrendChart.setOption(option); |
| | | return stockTrendChart; |
| | | }; |
| | | |
| | | // åå§ååºä½å©ç¨çç¯å½¢å¾ |
| | | const initLocationRate = () => { |
| | | if (!locationRateRef.value) return; |
| | | |
| | | if (locationRateChart) { |
| | | locationRateChart.dispose(); |
| | | } |
| | | |
| | | if (locationRateChart) locationRateChart.dispose(); |
| | | locationRateChart = echarts.init(locationRateRef.value); |
| | | const utilizationRate = bigscreendata.value.locationUtilizationRate || 0; |
| | | const freeRate = 100 - utilizationRate; |
| | | |
| | | const option = { |
| | | tooltip: { |
| | | trigger: 'item', |
| | | formatter: '{b}: {c}%' |
| | | }, |
| | | legend: { |
| | | bottom: 0, |
| | | left: 'center', |
| | | data: ['å·²å ç¨åºä½', '空é²åºä½'], |
| | | textStyle: { fontSize: 12, color: '#666' } |
| | | }, |
| | | tooltip: { trigger: 'item', formatter: '{b}: {c}%' }, |
| | | legend: { bottom: 0, left: 'center', data: ['å·²å ç¨åºä½', '空é²åºä½'], textStyle: { fontSize: 12, color: '#666' } }, |
| | | graphic: [ |
| | | { |
| | | type: 'text', |
| | | left: 'right', |
| | | top: '10%', |
| | | style: { |
| | | text: `${utilizationRate}%`, |
| | | fontSize: 24, |
| | | fontWeight: 'bold', |
| | | fill: '#333' |
| | | } |
| | | }, |
| | | { |
| | | type: 'text', |
| | | left: 'right', |
| | | top: '25%', |
| | | style: { |
| | | text: 'åºä½å©ç¨ç', |
| | | fontSize: 14, |
| | | fill: '#666' |
| | | } |
| | | } |
| | | { type: 'text', left: 'right', top: '10%', style: { text: `${utilizationRate}%`, fontSize: 24, fontWeight: 'bold', fill: '#333' } }, |
| | | { type: 'text', left: 'right', top: '25%', style: { text: 'åºä½å©ç¨ç', fontSize: 14, fill: '#666' } } |
| | | ], |
| | | series: [ |
| | | { |
| | | type: 'pie', |
| | | radius: ['50%', '70%'], |
| | | center: ['40%', '50%'], |
| | | avoidLabelOverlap: false, |
| | | label: { show: false }, |
| | | labelLine: { show: false }, |
| | | data: [ |
| | | { value: utilizationRate, name: 'å·²å ç¨åºä½', itemStyle: { color: '#1890ff' } }, |
| | | { value: freeRate, name: '空é²åºä½', itemStyle: { color: '#e5e9f2' } } |
| | | ] |
| | | } |
| | | ] |
| | | series: [{ |
| | | type: 'pie', radius: ['50%', '70%'], center: ['40%', '50%'], |
| | | avoidLabelOverlap: false, label: { show: false }, labelLine: { show: false }, |
| | | data: [ |
| | | { value: utilizationRate, name: 'å·²å ç¨åºä½', itemStyle: { color: '#1890ff' } }, |
| | | { value: freeRate, name: '空é²åºä½', itemStyle: { color: '#e5e9f2' } } |
| | | ] |
| | | }] |
| | | }; |
| | | |
| | | locationRateChart.setOption(option); |
| | | return locationRateChart; |
| | | }; |
| | | |
| | | // åå§åå¼å¸¸ç±»åç»è®¡è¶å¿å¾ |
| | | const initExceptionTrend = () => { |
| | | if (!exceptionTrendRef.value) return; |
| | | |
| | | if (exceptionTrendChart) { |
| | | exceptionTrendChart.dispose(); |
| | | } |
| | | |
| | | exceptionTrendChart = echarts.init(exceptionTrendRef.value); |
| | | const exceptionData = bigscreendata.value.exceptionTypeTrend.length |
| | | ? bigscreendata.value.exceptionTypeTrend |
| | | : { |
| | | dates: ['12-18', '12-19', '12-20', '12-21', '12-22', '12-23', '12-24'], |
| | | stockShort: [10, 11, 9, 12, 10, 13, 12], |
| | | orderTimeout: [8, 9, 7, 8, 7, 9, 8], |
| | | locationException: [4, 5, 2, 4, 3, 5, 4], |
| | | checkDiff: [2, 3, 1, 2, 1, 3, 2] |
| | | }; |
| | | |
| | | const option = { |
| | | tooltip: { |
| | | trigger: 'axis', |
| | | axisPointer: { |
| | | type: 'cross' |
| | | } |
| | | }, |
| | | legend: { |
| | | data: ['åºåä¸è¶³', '订åè¶
æ¶', 'åºä½å¼å¸¸', 'çç¹å·®å¼'], |
| | | top: 10 |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | top: '15%', |
| | | containLabel: true |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: exceptionData.dates |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | | name: 'å¼å¸¸æ°é' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: 'åºåä¸è¶³', |
| | | type: 'line', |
| | | smooth: true, |
| | | symbol: 'circle', |
| | | symbolSize: 8, |
| | | data: exceptionData.stockShort, |
| | | itemStyle: { color: '#ff4d4f' }, |
| | | lineStyle: { width: 3 } |
| | | }, |
| | | { |
| | | name: '订åè¶
æ¶', |
| | | type: 'line', |
| | | smooth: true, |
| | | symbol: 'circle', |
| | | symbolSize: 8, |
| | | data: exceptionData.orderTimeout, |
| | | itemStyle: { color: '#faad14' }, |
| | | lineStyle: { width: 3 } |
| | | }, |
| | | { |
| | | name: 'åºä½å¼å¸¸', |
| | | type: 'line', |
| | | smooth: true, |
| | | symbol: 'circle', |
| | | symbolSize: 8, |
| | | data: exceptionData.locationException, |
| | | itemStyle: { color: '#722ed1' }, |
| | | lineStyle: { width: 3 } |
| | | }, |
| | | { |
| | | name: 'çç¹å·®å¼', |
| | | type: 'line', |
| | | smooth: true, |
| | | symbol: 'circle', |
| | | symbolSize: 8, |
| | | data: exceptionData.checkDiff, |
| | | itemStyle: { color: '#13c2c2' }, |
| | | lineStyle: { width: 3 } |
| | | } |
| | | ] |
| | | }; |
| | | |
| | | exceptionTrendChart.setOption(option); |
| | | return exceptionTrendChart; |
| | | }; |
| | | |
| | | // å·æ°ææå¾è¡¨ |
| | | const refreshCharts = () => { |
| | | const charts = [ |
| | | initStockTrend, |
| | | initLocationRate |
| | | ]; |
| | | |
| | | charts.forEach(initFunc => { |
| | | [initStockTrend, initLocationRate].forEach(initFunc => { |
| | | const chart = initFunc(); |
| | | if (chart) { |
| | | chart.resize(); |
| | | } |
| | | if (chart) chart.resize(); |
| | | }); |
| | | }; |
| | | |
| | | // çªå£å¤§å°ååçå¬ |
| | | // 鲿å¤çresizeäºä»¶ |
| | | let resizeTimer = null; |
| | | const handleResize = () => { |
| | | const charts = [ |
| | | inventoryPieChart, |
| | | stockTrendChart, |
| | | locationRateChart, |
| | | exceptionTrendChart |
| | | ]; |
| | | |
| | | charts.forEach(chart => { |
| | | if (chart) { |
| | | chart.resize(); |
| | | } |
| | | }); |
| | | clearTimeout(resizeTimer); |
| | | resizeTimer = setTimeout(() => { |
| | | [stockTrendChart, locationRateChart].forEach(chart => { |
| | | if (chart) chart.resize(); |
| | | }); |
| | | }, 200); |
| | | }; |
| | | |
| | | // ç»ä»¶æè½½æ¶ |
| | | // çå½å¨æ |
| | | onMounted(() => { |
| | | // å
è·ååç«¯æ°æ® |
| | | fetchBigGreenData(); |
| | | // åå§åå¾è¡¨ï¼ç¡®ä¿DOM已渲æï¼ |
| | | nextTick(() => { |
| | | initInventoryPie(); |
| | | initStockTrend(); |
| | | initLocationRate(); |
| | | initExceptionTrend(); |
| | | window.addEventListener('resize', handleResize); |
| | | }); |
| | | }); |
| | | |
| | | // ç»ä»¶å¸è½½æ¶ |
| | | onUnmounted(() => { |
| | | const charts = [ |
| | | inventoryPieChart, |
| | | stockTrendChart, |
| | | locationRateChart, |
| | | exceptionTrendChart |
| | | ]; |
| | | |
| | | charts.forEach(chart => { |
| | | if (chart) { |
| | | chart.dispose(); |
| | | } |
| | | // 鿝å¾è¡¨å宿¶å¨ |
| | | [stockTrendChart, locationRateChart].forEach(chart => { |
| | | if (chart) chart.dispose(); |
| | | }); |
| | | clearInterval(taskCarouselTimer); |
| | | [normalCarouselTimer, failCarouselTimer, resizeTimer].forEach(timer => { |
| | | clearInterval(timer); |
| | | clearTimeout(timer); |
| | | }); |
| | | window.removeEventListener('resize', handleResize); |
| | | }); |
| | | </script> |
| | |
| | | font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; |
| | | } |
| | | |
| | | .header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | margin-bottom: 20px; |
| | | background: white; |
| | | padding: 15px 20px; |
| | | border-radius: 8px; |
| | | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); |
| | | } |
| | | |
| | | .stats-card-row, |
| | | .chart-row, |
| | | .table-row { |
| | | .stats-card-row, .chart-row, .table-row { |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | /* æ ¸å¿æ ·å¼ï¼å¡çåºç¡æ ·å¼ */ |
| | | .stats-card, .chart-card, .table-card { |
| | | background: #fff; |
| | | border-radius: 8px; |
| | |
| | | background-clip: text; |
| | | } |
| | | |
| | | .card-change { |
| | | margin-top: 3px; |
| | | } |
| | | |
| | | .chart-card { |
| | | height: 400px; |
| | | padding: 24px; |
| | |
| | | box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03); |
| | | } |
| | | |
| | | /* 临æç©æè¡¨æ ¼å®¹å¨æ ·å¼ */ |
| | | .expiration-table-container { |
| | | width: 100%; |
| | | height: 100%; |
| | |
| | | overflow-y: auto; |
| | | } |
| | | |
| | | /* 临æç级æ ç¾æ ·å¼ */ |
| | | .expire-level { |
| | | padding: 2px 8px; |
| | | border-radius: 4px; |
| | | font-size: 12px; |
| | | font-weight: 500; |
| | | } |
| | | .expire-level.expired { |
| | | background-color: #fff2f0; |
| | | color: #ff4d4f; |
| | | border: 1px solid #ffccc7; |
| | | } |
| | | .expire-level.urgent { |
| | | background-color: #fff7e6; |
| | | color: #fa8c16; |
| | | border: 1px solid #ffd591; |
| | | } |
| | | .expire-level.warning { |
| | | background-color: #f6ffed; |
| | | color: #52c41a; |
| | | border: 1px solid #b7eb8f; |
| | | } |
| | | .expire-level.normal { |
| | | background-color: #e6f7ff; |
| | | color: #1890ff; |
| | | border: 1px solid #91d5ff; |
| | | } |
| | | .expire-level.low { |
| | | background-color: #f0f2f5; |
| | | color: #666666; |
| | | border: 1px solid #d9d9d9; |
| | | } |
| | | .expire-level.default { |
| | | background-color: #fafafa; |
| | | color: #8c8c8c; |
| | | border: 1px solid #e8e8e8; |
| | | } |
| | | .expire-level.expired { background-color: #fff2f0; color: #ff4d4f; border: 1px solid #ffccc7; } |
| | | .expire-level.urgent { background-color: #fff7e6; color: #fa8c16; border: 1px solid #ffd591; } |
| | | .expire-level.warning { background-color: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; } |
| | | .expire-level.normal { background-color: #e6f7ff; color: #1890ff; border: 1px solid #91d5ff; } |
| | | .expire-level.low { background-color: #f0f2f5; color: #666666; border: 1px solid #d9d9d9; } |
| | | .expire-level.default { background-color: #fafafa; color: #8c8c8c; border: 1px solid #e8e8e8; } |
| | | |
| | | /* å·²è¿ææåçº¢è² */ |
| | | .text-red { |
| | | color: #ff4d4f; |
| | | font-weight: 500; |
| | | } |
| | | .text-red { color: #ff4d4f; font-weight: 500; } |
| | | |
| | | .chart-title, |
| | | .table-title { |
| | | .chart-title, .table-title { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | |
| | | border-left: 4px solid #409eff; |
| | | position: relative; |
| | | letter-spacing: 0.5px; |
| | | } |
| | | |
| | | .view-btn { |
| | | font-size: 12px; |
| | | } |
| | | |
| | | .table-card { |
| | |
| | | border-top: 1px solid #ebeef5; |
| | | } |
| | | |
| | | /* è¡¨æ ¼æ ·å¼ä¼å */ |
| | | :deep(.el-table) { |
| | | border-radius: 6px; |
| | | overflow: hidden; |
| | | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); |
| | | } |
| | | :deep(.el-table th) { background-color: #f5f7fa; color: #606266; font-weight: 600; padding: 12px 0; } |
| | | :deep(.el-table td) { padding: 12px 0; } |
| | | :deep(.el-table--border) { border-radius: 6px; } |
| | | :deep(.el-table--border::after), :deep(.el-table--group::after), :deep(.el-table::before), :deep(.el-table__fixed-right::before), :deep(.el-table__fixed::before) { display: none; } |
| | | |
| | | :deep(.el-table th) { |
| | | background-color: #f5f7fa; |
| | | color: #606266; |
| | | font-weight: 600; |
| | | padding: 12px 0; |
| | | } |
| | | |
| | | :deep(.el-table td) { |
| | | padding: 12px 0; |
| | | } |
| | | |
| | | :deep(.el-table--border) { |
| | | border-radius: 6px; |
| | | } |
| | | |
| | | :deep(.el-table--border::after) { |
| | | display: none; |
| | | } |
| | | |
| | | :deep(.el-table--group::after) { |
| | | display: none; |
| | | } |
| | | |
| | | :deep(.el-table::before) { |
| | | display: none; |
| | | } |
| | | |
| | | :deep(.el-table__fixed-right::before) { |
| | | display: none; |
| | | } |
| | | |
| | | :deep(.el-table__fixed::before) { |
| | | display: none; |
| | | } |
| | | |
| | | /* å页卿 ·å¼ä¼å */ |
| | | :deep(.el-pagination) { |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | :deep(.el-pagination .btn-prev), |
| | | :deep(.el-pagination .btn-next), |
| | | :deep(.el-pagination .el-pager li) { |
| | | :deep(.el-pagination .btn-prev), :deep(.el-pagination .btn-next), :deep(.el-pagination .el-pager li) { |
| | | border-radius: 4px; |
| | | margin: 0 2px; |
| | | transition: all 0.3s; |
| | | } |
| | | |
| | | :deep(.el-pagination .btn-prev:hover), |
| | | :deep(.el-pagination .btn-next:hover), |
| | | :deep(.el-pagination .el-pager li:hover) { |
| | | :deep(.el-pagination .btn-prev:hover), :deep(.el-pagination .btn-next:hover), :deep(.el-pagination .el-pager li:hover) { |
| | | transform: translateY(-2px); |
| | | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); |
| | | } |
| | | |
| | | :deep(.el-pagination .el-pager li.active) { |
| | | background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); |
| | | color: #fff; |
| | | } |
| | | |
| | | /* ä»»å¡ç¶ææ ·å¼ */ |
| | | .task-status { |
| | | .task-status, .task-type { |
| | | display: inline-block; |
| | | padding: 6px 12px; |
| | | border-radius: 20px; |
| | |
| | | letter-spacing: 0.5px; |
| | | } |
| | | |
| | | .status-pending { |
| | | background-color: rgba(64, 158, 255, 0.1); |
| | | color: #409eff; |
| | | border: 1px solid rgba(64, 158, 255, 0.2); |
| | | } |
| | | .status-pending { background-color: rgba(64, 158, 255, 0.1); color: #409eff; border: 1px solid rgba(64, 158, 255, 0.2); } |
| | | .status-processing { background-color: rgba(103, 194, 58, 0.1); color: #67c23a; border: 1px solid rgba(103, 194, 58, 0.2); } |
| | | .status-completed { background-color: rgba(103, 194, 58, 0.1); color: #67c23a; border: 1px solid rgba(103, 194, 58, 0.2); } |
| | | .status-suspended { background-color: rgba(230, 162, 60, 0.1); color: #e6a23c; border: 1px solid rgba(230, 162, 60, 0.2); } |
| | | .status-canceled { background-color: rgba(144, 147, 153, 0.1); color: #909399; border: 1px solid rgba(144, 147, 153, 0.2); } |
| | | .status-error { background-color: rgba(245, 108, 108, 0.1); color: #f56c6c; border: 1px solid rgba(245, 108, 108, 0.2); } |
| | | .status-unknown { background-color: rgba(144, 147, 153, 0.1); color: #909399; border: 1px solid rgba(144, 147, 153, 0.2); } |
| | | |
| | | .status-processing { |
| | | background-color: rgba(103, 194, 58, 0.1); |
| | | color: #67c23a; |
| | | border: 1px solid rgba(103, 194, 58, 0.2); |
| | | } |
| | | |
| | | .status-completed { |
| | | background-color: rgba(103, 194, 58, 0.1); |
| | | color: #67c23a; |
| | | border: 1px solid rgba(103, 194, 58, 0.2); |
| | | } |
| | | |
| | | .status-suspended { |
| | | background-color: rgba(230, 162, 60, 0.1); |
| | | color: #e6a23c; |
| | | border: 1px solid rgba(230, 162, 60, 0.2); |
| | | } |
| | | |
| | | .status-canceled { |
| | | background-color: rgba(144, 147, 153, 0.1); |
| | | color: #909399; |
| | | border: 1px solid rgba(144, 147, 153, 0.2); |
| | | } |
| | | |
| | | .status-error { |
| | | background-color: rgba(245, 108, 108, 0.1); |
| | | color: #f56c6c; |
| | | border: 1px solid rgba(245, 108, 108, 0.2); |
| | | } |
| | | |
| | | .status-unknown { |
| | | background-color: rgba(144, 147, 153, 0.1); |
| | | color: #909399; |
| | | border: 1px solid rgba(144, 147, 153, 0.2); |
| | | } |
| | | |
| | | /* ä»»å¡ç±»åæ ·å¼ */ |
| | | .task-type { |
| | | display: inline-flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | padding: 5px 12px; |
| | | border-radius: 16px; |
| | | font-size: 13px; |
| | | font-weight: 600; |
| | | text-align: center; |
| | | min-width: 70px; |
| | | position: relative; |
| | | overflow: hidden; |
| | | transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); |
| | | letter-spacing: 0.5px; |
| | | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); |
| | | } |
| | | |
| | | @keyframes pulse { |
| | | 0% { |
| | | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); |
| | | } |
| | | 50% { |
| | | box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12); |
| | | } |
| | | 100% { |
| | | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); |
| | | } |
| | | } |
| | | |
| | | .task-type::before { |
| | | content: ""; |
| | | position: absolute; |
| | | top: 0; |
| | | left: 0; |
| | | width: 100%; |
| | | height: 100%; |
| | | background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent); |
| | | transform: translateX(-100%); |
| | | transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1); |
| | | } |
| | | |
| | | .task-type:hover::before { |
| | | transform: translateX(0); |
| | | } |
| | | |
| | | .task-type:hover { |
| | | transform: translateY(-3px); |
| | | box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15); |
| | | } |
| | | |
| | | .task-type::after { |
| | | content: ""; |
| | | position: absolute; |
| | | bottom: 0; |
| | | left: 0; |
| | | width: 100%; |
| | | height: 3px; |
| | | background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent); |
| | | transform: scaleX(0); |
| | | transform-origin: center; |
| | | transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1); |
| | | } |
| | | |
| | | .task-type:hover::after { |
| | | transform: scaleX(1); |
| | | } |
| | | |
| | | .type-inbound:hover { |
| | | box-shadow: 0 5px 15px rgba(19, 194, 194, 0.4); |
| | | } |
| | | |
| | | .type-outbound:hover { |
| | | box-shadow: 0 5px 15px rgba(47, 84, 235, 0.4); |
| | | } |
| | | |
| | | .type-transfer:hover { |
| | | box-shadow: 0 5px 15px rgba(250, 140, 22, 0.4); |
| | | } |
| | | |
| | | .type-other:hover { |
| | | box-shadow: 0 5px 15px rgba(114, 46, 209, 0.4); |
| | | } |
| | | |
| | | .type-unknown:hover { |
| | | box-shadow: 0 5px 15px rgba(89, 89, 89, 0.4); |
| | | } |
| | | |
| | | .type-inbound { |
| | | background: linear-gradient(135deg, #13c2c2 0%, #36cfc9 100%); |
| | | color: white; |
| | | box-shadow: 0 3px 5px rgba(19, 194, 194, 0.3); |
| | | animation: pulse 2s infinite; |
| | | } |
| | | |
| | | .type-outbound { |
| | | background: linear-gradient(135deg, #2f54eb 0%, #597ef7 100%); |
| | | color: white; |
| | | box-shadow: 0 3px 5px rgba(47, 84, 235, 0.3); |
| | | animation: pulse 2.5s infinite; |
| | | } |
| | | |
| | | .type-transfer { |
| | | background: linear-gradient(135deg, #fa8c16 0%, #ffc53d 100%); |
| | | color: white; |
| | | box-shadow: 0 3px 5px rgba(250, 140, 22, 0.3); |
| | | animation: pulse 3s infinite; |
| | | } |
| | | |
| | | .type-other { |
| | | background: linear-gradient(135deg, #722ed1 0%, #b37feb 100%); |
| | | color: white; |
| | | box-shadow: 0 3px 5px rgba(114, 46, 209, 0.3); |
| | | animation: pulse 2.2s infinite; |
| | | } |
| | | |
| | | .type-unknown { |
| | | background: linear-gradient(135deg, #595959 0%, #8c8c8c 100%); |
| | | color: white; |
| | | box-shadow: 0 3px 5px rgba(89, 89, 89, 0.3); |
| | | animation: pulse 2.8s infinite; |
| | | } |
| | | |
| | | .btn-group { |
| | | margin-left: 10px; |
| | | } |
| | | .type-inbound { background-color: rgba(64, 158, 255, 0.1); color: #409eff; border: 1px solid rgba(64, 158, 255, 0.2); } |
| | | .type-outbound { background-color: rgba(103, 194, 58, 0.1); color: #67c23a; border: 1px solid rgba(103, 194, 58, 0.2); } |
| | | .type-transfer { background-color: rgba(230, 162, 60, 0.1); color: #e6a23c; border: 1px solid rgba(230, 162, 60, 0.2); } |
| | | .type-other { background-color: rgba(144, 147, 153, 0.1); color: #909399; border: 1px solid rgba(144, 147, 153, 0.2); } |
| | | .type-unknown { background-color: rgba(144, 147, 153, 0.1); color: #909399; border: 1px solid rgba(144, 147, 153, 0.2); } |
| | | </style> |