From 86b87d62f68ffd892ad02071c5eb4a3cd4cf501c Mon Sep 17 00:00:00 2001 From: Developer Date: Mon, 1 Jun 2026 08:21:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=AE=A2=E5=8D=95=E4=B8=8B?= =?UTF-8?q?=E8=BE=BE=E3=80=81=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93=E5=92=8C?= =?UTF-8?q?=E4=BB=93=E5=82=A8=E6=B1=87=E6=80=BB=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PurchasePartsStorage/index.vue | 1 + .../WarehouseSummary/index.vue | 233 ++++++++++++++---- 2 files changed, 189 insertions(+), 45 deletions(-) diff --git a/src/views/WarehouseManagement/PurchasePartsStorage/index.vue b/src/views/WarehouseManagement/PurchasePartsStorage/index.vue index aa30730d..7aeb11bf 100644 --- a/src/views/WarehouseManagement/PurchasePartsStorage/index.vue +++ b/src/views/WarehouseManagement/PurchasePartsStorage/index.vue @@ -527,6 +527,7 @@ + diff --git a/src/views/WarehouseManagement/WarehouseSummary/index.vue b/src/views/WarehouseManagement/WarehouseSummary/index.vue index c49c54b3..3ef5a03d 100644 --- a/src/views/WarehouseManagement/WarehouseSummary/index.vue +++ b/src/views/WarehouseManagement/WarehouseSummary/index.vue @@ -6,52 +6,58 @@ -
{{ statistics.待入库 }}
待入库
+
{{ statistics.待入库 }}
-
{{ statistics.待出库 }}
待出库
+
{{ statistics.待出库 }}
+
领料单 {{ 领料单数 }}
-
{{ statistics.可出库 }}
可出库
+
{{ statistics.可出库 }}
-
{{ statistics.变更BOM }}
变更BOM
+
{{ statistics.变更BOM }}
-
{{ statistics.补货中 }}
补货中
+
{{ statistics.补货中 }}
- -
{{ statistics.生产中 }}
+
生产中
+
{{ statistics.生产中 }}
+
+ 正常 {{ 生产中统计.正常 }} + 临期 {{ 生产中统计.临期 }} + 超期 {{ 生产中统计.超期 }} +
- + +
待补货
{{ statistics.待投产 }}
-
待投产
-
{{ statistics.采购中 }}
采购中
+
{{ statistics.采购中 }}
@@ -74,7 +80,15 @@ :label="column.label" :align="column.align">
@@ -104,7 +118,15 @@ export default { detailData: [], detailColumns: [], 领料单流水号列表: [], - statisticsTimer: null + statisticsTimer: null, + 生产中统计: { + 正常: 0, + 临期: 0, + 超期: 0 + }, + 生产中期限筛选: null, + 生产中全部数据: [], + 领料单数: 0 } }, computed: { @@ -128,7 +150,44 @@ export default { } }, methods: { - // 获取统计数据 + calculateDeadlineStatus(item) { + if (!item.补货期限) return '正常' + var deadline = new Date(item.补货期限) + var now = new Date() + var diffMs = deadline.getTime() - now.getTime() + var diffDays = Math.ceil(diffMs / (1000 * 60 * 60 * 24)) + if (diffDays < 0) return '超期' + if (diffDays <= 3) return '临期' + return '正常' + }, + + calculateOverdueDays(item) { + if (!item.补货期限) return 0 + var deadline = new Date(item.补货期限) + var now = new Date() + var diffMs = now.getTime() - deadline.getTime() + var diffDays = Math.ceil(diffMs / (1000 * 60 * 60 * 24)) + return diffDays > 0 ? diffDays : 0 + }, + + getDeadlineStatusClass(status) { + if (status === '超期') return 'text-danger' + if (status === '临期') return 'text-warning' + return '' + }, + + filterProductionByStatus(status) { + if (this.生产中期限筛选 === status) { + this.生产中期限筛选 = null + this.detailData = this.生产中全部数据 + } else { + this.生产中期限筛选 = status + this.currentDetail = '生产中' + this.detailData = this.生产中全部数据.filter(item => item.期限状态 === status) + } + }, + + getStatistics() { this.loading = true @@ -162,11 +221,11 @@ export default { // 获取待入库数据 getPendingInStorage() { var param = [] - var Data = this.CreateData('11', '仓储管理_补货件查询', param) + var Data = this.CreateData('11', '仓储管理_入库单_查询', param) this.ExecDatabase(Data).then(response => { let count = 0 response.data.forEach(item => { - if (item.状态 === '未到' || item.状态 === '加工中' || item.状态 === '部分到') { + if (item.是否入库 === false) { count++ } }) @@ -187,7 +246,6 @@ export default { param2[0] = ['领料单流水号列表', this.领料单流水号列表] var Data2 = this.CreateData('11', '装配管理_领料单明细_查询_汇总', param2) this.ExecDatabase(Data2).then(response2 => { - // 计算物料种类数量 let count = 0 response2.data.forEach(item => { if (item.已领数 < item.申请数) { @@ -195,6 +253,8 @@ export default { } }) this.statistics.待出库 = count + var uniqueOrders = new Set(response2.data.map(item => item.领料单号)) + this.领料单数 = uniqueOrders.size }) } else { this.statistics.待出库 = 0 @@ -265,28 +325,40 @@ export default { // 获取生产中数据 getInProduction() { var param = [] - var Data = this.CreateData('11', '仓储管理_补货件查询', param) + var Data = this.CreateData('11', '仓储管理_生产订单_查询', param) this.ExecDatabase(Data).then(response => { let count = 0 + let normalCount = 0 + let nearExpiryCount = 0 + let expiredCount = 0 response.data.forEach(item => { if (item.状态 === '加工中') { count++ + const status = this.calculateDeadlineStatus(item) + if (status === '超期') { + expiredCount++ + } else if (status === '临期') { + nearExpiryCount++ + } else { + normalCount++ + } } }) this.statistics.生产中 = count + this.生产中统计.正常 = normalCount + this.生产中统计.临期 = nearExpiryCount + this.生产中统计.超期 = expiredCount }) }, // 获取待投产数据 getPendingProduction() { var param = [] - var Data = this.CreateData('11', '仓储管理_补货件查询', param) + var Data = this.CreateData('11', '仓储管理_待投产_查询', param) this.ExecDatabase(Data).then(response => { let count = 0 response.data.forEach(item => { - if (item.状态 === '未开始') { - count++ - } + count++ }) this.statistics.待投产 = count }) @@ -311,6 +383,7 @@ export default { showDetail(type) { this.currentDetail = type this.loading = true + this.生产中期限筛选 = null switch (type) { case '待入库': @@ -331,7 +404,7 @@ export default { case '生产中': this.getInProductionDetail() break - case '待投产': + case '待补货': this.getPendingProductionDetail() break case '采购中': @@ -343,15 +416,14 @@ export default { // 获取待入库详情 getPendingInStorageDetail() { var param = [] - var Data = this.CreateData('11', '仓储管理_补货件查询', param) + var Data = this.CreateData('11', '仓储管理_入库单_查询', param) this.ExecDatabase(Data).then(response => { - this.detailData = response.data.filter(item => item.状态 === '未到' || item.状态 === '加工中' || item.状态 === '部分到') + this.detailData = response.data.filter(item => item.是否入库 === false) this.detailColumns = [ - { prop: '补货单号', label: '补货单号', width: '150px', align: 'center' }, - { prop: '补货人', label: '补货人', width: '100px', align: 'center' }, - { prop: '状态', label: '状态', width: '120px', align: 'center' }, - { prop: '补货日期', label: '补货日期', width: '150px', align: 'center' }, - { prop: '补货期限', label: '补货期限', width: '180px', align: 'center' } + { prop: '入库单号', label: '入库单号', width: '150px', align: 'center' }, + { prop: '采购合同号', label: '采购合同号', width: '100px', align: 'center' }, + { prop: '供应商名称', label: '供应商', width: '120px', align: 'center' }, + { prop: '到货数', label: '数量', width: '150px', align: 'center' } ] this.loading = false }) @@ -436,16 +508,36 @@ export default { // 获取生产中详情 getInProductionDetail() { var param = [] - var Data = this.CreateData('11', '仓储管理_补货件查询', param) + var Data = this.CreateData('11', '仓储管理_生产订单_查询', param) this.ExecDatabase(Data).then(response => { - this.detailData = response.data.filter(item => item.状态 === '加工中') + var filtered = response.data.filter(item => item.状态 === '加工中') + filtered.forEach(item => { + item.期限状态 = this.calculateDeadlineStatus(item) + item.超期时间 = this.calculateOverdueDays(item) + }) + filtered.sort((a, b) => { + if (a.期限状态 === '超期' && b.期限状态 !== '超期') return -1 + if (a.期限状态 !== '超期' && b.期限状态 === '超期') return 1 + if (a.期限状态 === '超期' && b.期限状态 === '超期') { + return (b.超期时间 || 0) - (a.超期时间 || 0) + } + return new Date(a.补货期限) - new Date(b.补货期限) + }) + this.生产中全部数据 = filtered + if (this.生产中期限筛选) { + this.detailData = filtered.filter(item => item.期限状态 === this.生产中期限筛选) + } else { + this.detailData = filtered + } this.detailColumns = [ { prop: '补货单号', label: '补货单号', width: '150px', align: 'center' }, { prop: '名称', label: '物料名称', width: '180px', align: 'center' }, { prop: '补货数', label: '补货数量', width: '100px', align: 'center' }, { prop: '状态', label: '状态', width: '100px', align: 'center' }, { prop: '补货日期', label: '补货日期', width: '150px', align: 'center' }, - { prop: '补货期限', label: '补货期限', width: '150px', align: 'center' } + { prop: '补货期限', label: '补货期限', width: '150px', align: 'center' }, + { prop: '期限状态', label: '期限状态', width: '100px', align: 'center' }, + { prop: '超期时间', label: '超期时间(天)', width: '120px', align: 'center' } ] this.loading = false }) @@ -454,16 +546,14 @@ export default { // 获取待投产详情 getPendingProductionDetail() { var param = [] - var Data = this.CreateData('11', '仓储管理_补货件查询', param) + var Data = this.CreateData('11', '仓储管理_待投产_查询', param) this.ExecDatabase(Data).then(response => { - this.detailData = response.data.filter(item => item.状态 === '未开始') + this.detailData = response.data.slice(0, 1000) this.detailColumns = [ - { prop: '补货单号', label: '补货单号', width: '150px', align: 'center' }, - { prop: '名称', label: '物料名称', width: '180px', align: 'center' }, - { prop: '补货数', label: '补货数量', width: '100px', align: 'center' }, - { prop: '状态', label: '状态', width: '100px', align: 'center' }, - { prop: '补货日期', label: '补货日期', width: '150px', align: 'center' }, - { prop: '补货期限', label: '补货期限', width: '150px', align: 'center' } + { prop: '物料名称', label: '物料名称', width: '180px', align: 'center' }, + { prop: '图号', label: '图号或型号', width: '150px', align: 'center' }, + { prop: '库存数量', label: '库存数量', width: '100px', align: 'center' }, + { prop: '应补数量', label: '应补数量', width: '100px', align: 'center' }, ] this.loading = false }) @@ -495,11 +585,11 @@ export default { height: 120px; cursor: pointer; transition: all 0.3s ease; - text-align: center; padding: 10px 0; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); border-radius: 4px; background-color: #fff; + position: relative; } .stat-card:hover { @@ -507,19 +597,73 @@ export default { box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1); } + .stat-card-production { + height: 150px; + } + .stat-number { - font-size: 24px; + font-size: 36px; font-weight: bold; text-align: center; - margin-top: 15px; + margin-top: 10px; color: #303133; } .stat-label { + font-size: 13px; + text-align: left; + color: #909399; + padding-left: 5px; + } + + .stat-sub-info { font-size: 12px; text-align: center; - margin-top: 8px; color: #909399; + margin-top: 4px; + } + + .stat-sub-labels { + display: flex; + justify-content: space-around; + margin-top: 8px; + font-size: 12px; + } + + .sub-normal { + color: #67c23a; + } + + .sub-warning { + color: #e6a23c; + } + + .sub-danger { + color: #f56c6c; + } + + .sub-normal.sub-active, + .sub-warning.sub-active, + .sub-danger.sub-active { + font-weight: bold; + text-decoration: underline; + cursor: pointer; + } + + .sub-normal, + .sub-warning, + .sub-danger { + cursor: pointer; + } + + .text-danger { + color: #f56c6c; + font-weight: bold; + } + + .text-warning { + color: #e6a23c; + font-weight: bold; } .summary-card { @@ -546,7 +690,6 @@ export default { padding: 20px; } - /* 为不同类型的卡片设置不同的颜色 */ .stat-card:nth-child(1) .stat-number { color: #4caf50; }