From a215940f3d3f52a1404317c3bb88da2ff12c5fc0 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期一, 23 三月 2026 13:22:04 +0800
Subject: [PATCH] 增加生产订单详情-生产记录页面
---
src/views/productionManagement/productionOrder/Detail/index.vue | 101 +++++++++++++++++++++++++++++++++-----------------
1 files changed, 66 insertions(+), 35 deletions(-)
diff --git a/src/views/productionManagement/productionOrder/Detail/index.vue b/src/views/productionManagement/productionOrder/Detail/index.vue
index 0b5858c..14d11d2 100644
--- a/src/views/productionManagement/productionOrder/Detail/index.vue
+++ b/src/views/productionManagement/productionOrder/Detail/index.vue
@@ -120,12 +120,12 @@
<div v-else class="right-content">
<el-table :data="reports" border height="420" v-loading="reportLoading">
<el-table-column label="搴忓彿" type="index" width="60" align="center" />
- <el-table-column label="鎶ュ伐鍗曞彿" prop="reportNo" min-width="140" show-overflow-tooltip />
- <el-table-column label="鎶ュ伐浜哄憳" prop="reportUser" min-width="120" show-overflow-tooltip />
- <el-table-column label="鎶ュ伐鏃堕棿" prop="reportTime" min-width="160" show-overflow-tooltip />
- <el-table-column label="浜у嚭鏁伴噺" prop="outputQty" min-width="110" />
+ <el-table-column label="鎶ュ伐鍗曞彿" prop="productNo" min-width="140" show-overflow-tooltip />
+ <el-table-column label="鎶ュ伐浜哄憳" prop="nickName" min-width="120" show-overflow-tooltip />
+ <el-table-column label="鎶ュ伐鏃堕棿" prop="createTime" min-width="160" show-overflow-tooltip />
+ <el-table-column label="浜у嚭鏁伴噺" prop="quantity" min-width="110" />
<el-table-column label="鍚堟牸鏁伴噺" prop="qualifiedQty" min-width="110" />
- <el-table-column label="涓嶈壇鏁伴噺" prop="badQty" min-width="110" />
+ <el-table-column label="涓嶈壇鏁伴噺" prop="scrapQty" min-width="110" />
<el-table-column label="涓嶅悎鏍煎鐞�" prop="dealResult" min-width="160" show-overflow-tooltip />
<el-table-column label="鎿嶄綔" width="150" fixed="right">
<template #default="{ row }">
@@ -140,21 +140,45 @@
</div>
</div>
</el-card>
- <el-dialog
- v-model="reportRecordDialogVisible"
- title="鎶ュ伐鐢熶骇璁板綍"
- width="680px"
- destroy-on-close
- >
- <div class="report-record-placeholder">
- <div>鎶ュ伐鍗曞彿锛歿{ currentReportRow?.reportNo || "-" }}</div>
- <div>宸ュ簭锛歿{ selectedProcess?.processName || "-" }}</div>
- <div class="placeholder-tip">寮规鍐呭寰呭畾锛堝悗缁ˉ鍏呰缁嗙敓浜ц褰曪級銆�</div>
- </div>
- <template #footer>
- <el-button @click="reportRecordDialogVisible = false">鍏抽棴</el-button>
- </template>
- </el-dialog>
+<!-- <el-dialog-->
+<!-- v-model="reportRecordDialogVisible"-->
+<!-- title="鎶ュ伐鐢熶骇璁板綍"-->
+<!-- width="680px"-->
+<!-- destroy-on-close-->
+<!-- >-->
+<!-- <div class="report-record-placeholder">-->
+<!-- <div>鎶ュ伐鍗曞彿锛歿{ currentReportRow?.reportNo || "-" }}</div>-->
+<!-- <div>宸ュ簭锛歿{ selectedProcess?.processName || "-" }}</div>-->
+<!-- <div class="placeholder-tip">寮规鍐呭寰呭畾锛堝悗缁ˉ鍏呰缁嗙敓浜ц褰曪級銆�</div>-->
+<!-- </div>-->
+<!-- <template #footer>-->
+<!-- <el-button @click="reportRecordDialogVisible = false">鍏抽棴</el-button>-->
+<!-- </template>-->
+<!-- </el-dialog>-->
+
+ <CopperPrintingForm
+ v-if="copperPrintingFormVisible"
+ v-model:isShow="copperPrintingFormVisible"
+ :isEdit="false"
+ :row="currentReportRow"
+ @refreshData="fetchReportsForProcess(selectedProcess.value)"/>
+ <VoltageSortingForm
+ v-if="voltageSortingFormVisible"
+ v-model:isShow="voltageSortingFormVisible"
+ :isEdit="false"
+ :row="currentReportRow"
+ @refreshData="fetchReportsForProcess(selectedProcess.value)"/>
+ <GranulationForm
+ v-if="granulationFormVisible"
+ v-model:isShow="granulationFormVisible"
+ :isEdit="false"
+ :row="currentReportRow"
+ @refreshData="fetchReportsForProcess(selectedProcess.value)"/>
+ <Detail
+ v-if="reportRecordDialogVisible"
+ v-model:isShow="reportRecordDialogVisible"
+ @refreshData="fetchReportsForProcess(selectedProcess.value)"
+ :row="currentReportRow"/>
</div>
</template>
@@ -163,7 +187,10 @@
import { useRoute } from "vue-router";
import { getByProductOrderId } from "@/api/productionManagement/workOrder.js";
import { getByProductWorkOrderId } from "@/api/productionManagement/productionProductMain.js";
-
+const VoltageSortingForm = defineAsyncComponent(() => import("@/views/productionManagement/workOrder/components/VoltageSortingForm.vue"));
+const CopperPrintingForm = defineAsyncComponent(() => import("@/views/productionManagement/workOrder/components/CopperPrintingForm.vue"));
+const GranulationForm = defineAsyncComponent(() => import("@/views/productionManagement/workOrder/components/GranulationForm.vue"));
+const Detail = defineAsyncComponent(() => import("@/views/productionManagement/productionReporting/components/Detail.vue"));
const route = useRoute();
const header = computed(() => ({
@@ -176,6 +203,10 @@
// 宸ュ簭鏁版嵁锛堟帴鍙f浛鎹級
const processes = ref([]);
+
+const copperPrintingFormVisible = ref(false);
+const voltageSortingFormVisible = ref(false);
+const granulationFormVisible = ref(false);
const normalizeStatus = (statusText, completionStatus, inputQty, outputQty) => {
const s = statusText === null || statusText === undefined ? "" : String(statusText).trim();
@@ -271,19 +302,11 @@
const reportLoading = ref(false);
const normalizeReport = (item) => {
- // 鎶ュ伐璁板綍锛歱roductNo/userName/createTime/quantity/qualifiedQty/scrapQty
- const outputQty = Number(item?.quantity ?? item?.outputQty ?? 0);
- const qualifiedQty = Number(item?.qualifiedQty ?? item?.completeQty ?? item?.goodQty ?? 0);
- const badQty = Number(item?.scrapQty ?? item?.badQty ?? 0);
-
return {
- reportNo: item?.productNo ?? item?.reportNo ?? item?.productionReportNo ?? item?.id ?? "",
- reportUser: item?.userName ?? item?.reportUser ?? item?.createdByName ?? item?.reportUserName ?? "",
- reportTime: item?.createTime ?? item?.reportTime ?? item?.createdAt ?? item?.reportDate ?? "",
- outputQty: Number.isFinite(outputQty) ? outputQty : 0,
- qualifiedQty: Math.max(0, Number.isFinite(qualifiedQty) ? qualifiedQty : 0),
- badQty: Number.isFinite(badQty) ? Math.max(0, badQty) : 0,
- dealResult: item?.dealResult ?? item?.dealResultText ?? item?.description ?? "",
+ ...item,
+ quantity: Math.max(0, Number.isFinite(item.quantity) ? item.quantity : 0),
+ scrapQty: Math.max(0, Number.isFinite(item.scrapQty) ? item.scrapQty : 0),
+ qualifiedQty: Math.max(0, Number.isFinite(item.qualifiedQty) ? item.qualifiedQty : 0),
};
};
@@ -323,9 +346,17 @@
);
const viewReportRecord = (row) => {
- if (!row?.reportNo) return;
+ if (!row?.productNo) return;
currentReportRow.value = row;
- reportRecordDialogVisible.value = true;
+ if (row.process ==='鍗伴摐' || row.process ==='鍗伴摱') {
+ copperPrintingFormVisible.value = true;
+ } else if (row.process === '鐢靛帇鍒嗛��') {
+ voltageSortingFormVisible.value = true;
+ } else if (row.process === '閫犵矑') {
+ granulationFormVisible.value = true;
+ } else {
+ reportRecordDialogVisible.value = true;
+ }
};
const reportRecordDialogVisible = ref(false);
--
Gitblit v1.9.3