From 3a647bc5b90409997b2bdebe96646d7158b4b7a2 Mon Sep 17 00:00:00 2001 From: lynn Date: Thu, 8 May 2025 09:28:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=9B=98=E7=82=B9=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E8=BF=9B=E5=BA=A6+=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/inventorys/stocktaking.vue | 233 ++++++++++++++++++++++++++- 1 file changed, 231 insertions(+), 2 deletions(-) diff --git a/src/views/inventorys/stocktaking.vue b/src/views/inventorys/stocktaking.vue index 955ea2d..57c9fd9 100644 --- a/src/views/inventorys/stocktaking.vue +++ b/src/views/inventorys/stocktaking.vue @@ -36,11 +36,15 @@ + @@ -353,6 +357,86 @@
+ + + +
+
+
+ 计划编号: + {{ planDetailModal.data.no }} +
+
+ 计划名称: + {{ planDetailModal.data.name }} +
+
+ 开始日期: + {{ planDetailModal.data.start_date }} +
+
+ 结束日期: + {{ planDetailModal.data.end_date }} +
+
+ 状态: + + + {{ getStatusText(planDetailModal.data.status) }} + + +
+
+ 备注: + {{ planDetailModal.data.remark || '-' }} +
+
+ +
+

盘点物资列表

+ + + +
+
+ +
+
+
+ +
@@ -387,10 +471,15 @@ export default { slot: 'status', key: 'status' }, + { + title: '进度', + slot: 'progress', + width: 200 + }, { title: '操作', slot: 'action', - width: 200 + width: 280 } ], @@ -556,7 +645,59 @@ export default { align: 'center' } ], - previewUrl: '' + previewUrl: '', + planDetailModal: { + visible: false, + loading: false, + data: null, + pageIndex: 1, + pageSize: 10, + total: 0, + inventoryList: [] + }, + planDetailColumns: [ + { + title: '物资名称', + key: 'name', + minWidth: 150 + }, + { + title: '规格型号', + key: 'spec', + width: 120 + }, + { + title: '单位', + key: 'unit', + width: 80 + }, + { + title: '盘点数量', + key: 'checkQuantity', + width: 100 + }, + { + title: '盘点日期', + key: 'checkDate', + width: 150 + }, + { + title: '状态', + slot: 'status', + width: 100 + }, + { + title: '备注', + key: 'remark', + minWidth: 150, + tooltip: true + }, + { + title: '照片', + slot: 'photos', + width: 150 + } + ] } }, mounted() { @@ -1177,6 +1318,61 @@ export default { }, closePreview() { this.previewUrl = ''; + }, + getPlanProgress(row) { + // 根据状态值判断进度 + const status = row.status; + if (status === 0) { // 未开始 + return 0; + } else if (status === 1) { // 进行中 + return 50; + } else if (status === 2) { // 已完成 + return 100; + } + return 0; + }, + viewPlanDetail(row) { + this.planDetailModal.visible = true; + this.planDetailModal.data = row; + this.planDetailModal.pageIndex = 1; + this.loadPlanDetailData(); + }, + loadPlanDetailData() { + this.planDetailModal.loading = true; + // 模拟数据 + setTimeout(() => { + const mockData = []; + for (let i = 0; i < 20; i++) { + mockData.push({ + id: i + 1, + name: `测试物资${i + 1}`, + spec: `规格${i + 1}`, + unit: '个', + checkQuantity: Math.floor(Math.random() * 100), + checkDate: '2024-03-15', + status: Math.random() > 0.5 ? 1 : 0, + remark: `这是第${i + 1}个物资的备注信息`, + photos: [ + 'https://picsum.photos/200/200?random=1', + 'https://picsum.photos/200/200?random=2', + 'https://picsum.photos/200/200?random=3', + 'https://picsum.photos/200/200?random=4' + ] + }); + } + this.planDetailModal.inventoryList = mockData; + this.planDetailModal.total = 100; // 模拟总数 + this.planDetailModal.loading = false; + }, 500); + }, + handlePlanDetailPageChange(page) { + this.planDetailModal.pageIndex = page; + this.loadPlanDetailData(); + }, + handlePlanDetailPageSizeChange(size) { + this.planDetailModal.pageSize = size; + this.planDetailModal.pageIndex = 1; + this.loadPlanDetailData(); } }, watch: { @@ -1457,4 +1653,37 @@ export default { box-shadow: 0 4px 24px rgba(0,0,0,0.3); background: #fff; } + +.plan-detail-content { + padding: 20px; + + .detail-header { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 20px; + margin-bottom: 30px; + + .detail-item { + .label { + font-weight: bold; + color: #666; + margin-right: 10px; + } + + .value { + color: #333; + } + } + } + + .inventory-list-section { + margin-bottom: 30px; + + h3 { + margin: 0 0 15px 0; + font-size: 16px; + color: #17233d; + } + } +}