From 1273cbc1079a978ad30b607411823d53014f02d1 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期三, 25 三月 2026 09:57:45 +0800
Subject: [PATCH] 一些修改
---
src/views/productionManagement/productionReporting/index.vue | 16 ++++-
src/views/productionManagement/productionReporting/detailDialog.vue | 83 ++++++++++++++++++++-------
src/views/productionManagement/productionReporting/reportingDialog.vue | 25 +++++---
3 files changed, 89 insertions(+), 35 deletions(-)
diff --git a/src/views/productionManagement/productionReporting/detailDialog.vue b/src/views/productionManagement/productionReporting/detailDialog.vue
index c68f8fd..aec6b5c 100644
--- a/src/views/productionManagement/productionReporting/detailDialog.vue
+++ b/src/views/productionManagement/productionReporting/detailDialog.vue
@@ -11,14 +11,14 @@
<el-descriptions :column="3"
border>
<el-descriptions-item label="鐢熶骇璁㈠崟鍙�">{{ detailData.npsNo || '-' }}</el-descriptions-item>
- <el-descriptions-item label="鐝粍">{{ detailData.schedule || '-' }}</el-descriptions-item>
+ <el-descriptions-item label="鐝粍"><el-tag :type="detailData.schedule == '鐧界彮' ? 'primary' : 'warning'">{{ detailData.schedule || '-' }}</el-tag></el-descriptions-item>
<el-descriptions-item label="宀椾綅浜哄憳">{{ detailData.postName || '-' }}</el-descriptions-item>
<el-descriptions-item label="浜у搧缂栫爜">{{ detailData.materialCode || '-' }}</el-descriptions-item>
<el-descriptions-item label="浜у搧鍚嶇О">{{ detailData.productName || '-' }}</el-descriptions-item>
<el-descriptions-item label="瑙勬牸">{{ detailData.model || '-' }}</el-descriptions-item>
- <el-descriptions-item label="鍚堟牸鏁伴噺">{{ detailData.qualifiedQuantity || 0 }} 鏂�</el-descriptions-item>
- <el-descriptions-item label="涓嶅悎鏍兼暟閲�">{{ detailData.unqualifiedQuantity || 0 }} 鏂�</el-descriptions-item>
- <el-descriptions-item label="鎬绘暟閲�">{{ detailData.quantity || 0 }} 鏂�</el-descriptions-item>
+ <el-descriptions-item label="鍚堟牸鏁伴噺"><span class="num2">{{ detailData.qualifiedQuantity || 0 }}</span> <span class="unit">鏂�</span></el-descriptions-item>
+ <el-descriptions-item label="涓嶅悎鏍兼暟閲�"><span class="num3">{{ detailData.unqualifiedQuantity || 0 }}</span> <span class="unit">鏂�</span></el-descriptions-item>
+ <el-descriptions-item label="鎬绘暟閲�"><span class="num1">{{ detailData.quantity || 0 }}</span> <span class="unit">鏂�</span></el-descriptions-item>
<el-descriptions-item label="鎶ュ伐鏃堕棿">{{ formatTime(detailData.reportingTime) }}</el-descriptions-item>
<el-descriptions-item label="鍒涘缓鏃堕棿">{{ formatTime(detailData.createTime) }}</el-descriptions-item>
<el-descriptions-item label="鏇存柊鏃堕棿">{{ formatTime(detailData.updateTime) }}</el-descriptions-item>
@@ -32,10 +32,10 @@
:key="process.id"
class="process-item">
<div class="process-header">
- <h4 class="process-title">宸ュ簭 {{ index + 1 }}</h4>
+ <h4 class="process-title">{{ process.processName || '-' }}</h4>
<div class="process-info">
<span class="process-label">宀椾綅浜哄憳锛歿{ process.postName || '-' }}</span>
- <span class="process-label">宸ュ簭ID锛歿{ process.processId || '-' }}</span>
+ <span class="process-label">宸ュ簭ID锛歿{ process.processNo || '-' }}</span>
</div>
</div>
<!-- 宸ュ簭鍩烘湰淇℃伅 -->
@@ -53,15 +53,18 @@
<!-- BOM淇℃伅 -->
<div class="param-section"
v-if="getBomList(process.productionProductRouteItemParamDtoList).length > 0">
- <h5 class="param-title">BOM淇℃伅</h5>
+ <h5 class="param-title">鎶曞叆鍝佷俊鎭�</h5>
<el-table :data="getBomList(process.productionProductRouteItemParamDtoList)"
style="width: 100%"
size="small">
<el-table-column prop="paramName"
- label="鍙傛暟鍚嶇О"
+ label="浜у搧鍚嶇О"
+ min-width="120"></el-table-column>
+ <el-table-column prop="model"
+ label="瑙勬牸鍨嬪彿"
min-width="120"></el-table-column>
<el-table-column prop="productValue"
- label="浜у搧鍊�"
+ label="鎶曞叆閲�"
min-width="100"></el-table-column>
<el-table-column prop="unit"
label="鍗曚綅"
@@ -71,12 +74,12 @@
<!-- 鍙傛暟淇℃伅 -->
<div class="param-section"
v-if="getParamList(process.productionProductRouteItemParamDtoList).length > 0">
- <h5 class="param-title">鍙傛暟淇℃伅</h5>
+ <h5 class="param-title">鐢熶骇璁板綍</h5>
<div v-for="(group, sort) in getParamGroups(process.productionProductRouteItemParamDtoList)"
:key="sort"
class="param-group">
<div class="group-header">
- <span class="group-title">鍙傛暟缁� {{ sort }}</span>
+ <span class="group-title">鐢熶骇璁板綍缁� {{ sort }}</span>
</div>
<div class="param-grid">
<div v-for="param in group"
@@ -99,11 +102,17 @@
<div v-for="file in process.fileList"
:key="file.id"
class="file-item">
- <img v-if="file.fileUrl"
- :src="baseUrl + file.fileUrl"
- :alt="file.fileName"
- class="file-image"
- @click="handleFilePreview(file)" />
+ <el-image style="width: 100px; height: 100px"
+ v-if="file.fileUrl"
+ :src="baseUrl + file.fileUrl"
+ :zoom-rate="1.2"
+ :max-scale="7"
+ :alt="file.fileName"
+ :min-scale="0.2"
+ :preview-src-list="formatFileList(process.fileList)"
+ show-progress
+ :initial-index="4"
+ fit="cover" />
<div class="file-info">
<span class="file-name">{{ file.fileName || '-' }}</span>
</div>
@@ -156,15 +165,18 @@
const formatFileList = fileList => {
return fileList.map(file => ({
name: file.fileName,
- url: file.fileUrl,
+ url: baseUrl + file.fileUrl,
size: file.fileSize,
}));
};
// 澶勭悊鏂囦欢棰勮
const handleFilePreview = file => {
- // 杩欓噷鍙互瀹炵幇鏂囦欢棰勮閫昏緫
- console.log("棰勮鏂囦欢:", file);
+ if (file.fileUrl) {
+ window.open(baseUrl + file.fileUrl, "_blank");
+ } else {
+ console.log("鏂囦欢娌℃湁URL锛屾棤娉曢瑙�");
+ }
};
// 鑾峰彇BOM鍒楄〃
@@ -339,12 +351,25 @@
}
.file-image {
- width: 80px;
- height: 80px;
+ width: 100px;
+ height: 100px;
object-fit: cover;
border-radius: 4px;
cursor: pointer;
margin-bottom: 8px;
+ }
+
+ :deep(.el-image) {
+ border-radius: 4px;
+ overflow: hidden;
+ }
+
+ :deep(.el-image__inner) {
+ transition: transform 0.3s ease;
+ }
+
+ .file-item:hover :deep(.el-image__inner) {
+ transform: scale(1.05);
}
.file-info {
@@ -372,6 +397,22 @@
padding-bottom: 8px;
border-bottom: 1px solid #f0f2f5;
}
+ .num1 {
+ color: #1107cc;
+ font-weight: 600;
+ }
+ .num2 {
+ color: #0fcf25;
+ font-weight: 600;
+ }
+ .num3 {
+ color: #d31818;
+ font-weight: 600;
+ }
+ .unit {
+ font-size: 12px;
+ color: #5d5a66;
+ }
.group-title {
font-size: 14px;
diff --git a/src/views/productionManagement/productionReporting/index.vue b/src/views/productionManagement/productionReporting/index.vue
index 81ea100..2f30d64 100644
--- a/src/views/productionManagement/productionReporting/index.vue
+++ b/src/views/productionManagement/productionReporting/index.vue
@@ -89,9 +89,12 @@
const tableColumn = ref([
{
+ label: "鎶ュ伐缂栧彿",
+ prop: "productNo",
+ },
+ {
label: "鐢熶骇璁㈠崟鍙�",
prop: "npsNo",
- width: "150px",
},
{
label: "鐝粍",
@@ -105,20 +108,25 @@
{
label: "浜у搧缂栫爜",
prop: "materialCode",
- width: "150px",
},
{
label: "浜у搧鍚嶇О",
prop: "productName",
- width: "150px",
},
{
label: "瑙勬牸",
prop: "productModelName",
- width: "150px",
className: "productModelName-cell",
},
{
+ label: "寮哄害",
+ prop: "strength",
+ dataType: "tag",
+ formatType: params => {
+ return params == "A3.5" ? "primary" : "warning";
+ },
+ },
+ {
label: "浜у嚭鏂归噺",
prop: "totalQuantity",
width: "100px",
diff --git a/src/views/productionManagement/productionReporting/reportingDialog.vue b/src/views/productionManagement/productionReporting/reportingDialog.vue
index 7e079d9..9d49874 100644
--- a/src/views/productionManagement/productionReporting/reportingDialog.vue
+++ b/src/views/productionManagement/productionReporting/reportingDialog.vue
@@ -305,10 +305,10 @@
:label="`${item.productName} ${item.model}`"
class="form-item">
<div class="consumable-input-group">
- <el-input-number v-model="getProcessInfo(parseInt(activeProcessId)).consumables[item.bomId]"
+ <el-input-number v-model="getProcessInfo(parseInt(activeProcessId)).consumables[item.productModelId]"
:min="0"
- :model-value="getConsumableValue(parseInt(activeProcessId), item.bomId)"
- @change="val => getProcessInfo(parseInt(activeProcessId)).consumables[item.bomId] = val"
+ :model-value="getConsumableValue(parseInt(activeProcessId), item.productModelId)"
+ @change="val => getProcessInfo(parseInt(activeProcessId)).consumables[item.productModelId] = val"
class="consumable-input" />
<span class="consumable-unit">{{ item.unit }}</span>
</div>
@@ -812,12 +812,12 @@
};
// 鑾峰彇娑堣�楀搧鏁伴噺锛岄粯璁や负0
- const getConsumableValue = (processId, bomId) => {
+ const getConsumableValue = (processId, productModelId) => {
const processInfo = getProcessInfo(processId);
- if (!processInfo.consumables[bomId]) {
- processInfo.consumables[bomId] = 0;
+ if (!processInfo.consumables[productModelId]) {
+ processInfo.consumables[productModelId] = 0;
}
- return processInfo.consumables[bomId];
+ return processInfo.consumables[productModelId];
};
// 澶勭悊鏂囦欢棰勮
@@ -980,10 +980,15 @@
if (editProcess.productionProductRouteItemParamDtoList) {
editProcess.productionProductRouteItemParamDtoList.forEach(
param => {
+ // console.log(form.processStructures[processId], "========");
if (param.bomId) {
// 浣跨敤bomId浣滀负key锛屽洜涓篻etProcessStructures杩斿洖鐨刬tem.id鏄痓omId
- processInfo.consumables[param.bomId] =
- param.productValue || 0;
+ form.processStructures[processId].forEach(item => {
+ if (item.productModelId == param.productId) {
+ processInfo.consumables[param.productId] =
+ param.productValue || 0;
+ }
+ });
}
}
);
@@ -1091,7 +1096,7 @@
structures.forEach(structure => {
const consumableValue = getConsumableValue(
process.processId,
- structure.bomId
+ structure.productModelId
);
if (consumableValue > 0) {
productionProductRouteItemParamDtoList.push({
--
Gitblit v1.9.3