From 28fc65c34d1642b007dc45b83782e23be58d718c Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期三, 08 七月 2026 16:43:58 +0800
Subject: [PATCH] 已进行排班并且人员已打卡的前提下,对应的班次配置不能编辑删除。
---
src/views/productionManagement/productionOrder/index.vue | 240 +++++++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 206 insertions(+), 34 deletions(-)
diff --git a/src/views/productionManagement/productionOrder/index.vue b/src/views/productionManagement/productionOrder/index.vue
index 93fc177..ba1d155 100644
--- a/src/views/productionManagement/productionOrder/index.vue
+++ b/src/views/productionManagement/productionOrder/index.vue
@@ -8,7 +8,7 @@
placeholder="璇疯緭鍏�"
clearable
prefix-icon="Search"
- style="width: 160px;"
+ style="width: 160px"
@change="handleQuery" />
</el-form-item>
<el-form-item label="浜у搧鍚嶇О:">
@@ -16,7 +16,7 @@
placeholder="璇疯緭鍏�"
clearable
prefix-icon="Search"
- style="width: 160px;"
+ style="width: 160px"
@change="handleQuery" />
</el-form-item>
<el-form-item label="瑙勬牸:">
@@ -24,13 +24,13 @@
placeholder="璇疯緭鍏�"
clearable
prefix-icon="Search"
- style="width: 160px;"
+ style="width: 160px"
@change="handleQuery" />
</el-form-item>
<el-form-item label="鐘舵��:">
<el-select v-model="searchForm.status"
placeholder="璇烽�夋嫨"
- style="width: 160px;"
+ style="width: 160px"
@change="handleQuery">
<el-option label="寰呭紑濮�"
value="1" />
@@ -38,8 +38,8 @@
value="2" />
<el-option label="宸插畬鎴�"
value="3" />
- <el-option label="宸插彇娑�"
- value="4" />
+ <!-- <el-option label="宸插彇娑�"-->
+ <!-- value="4" />-->
<el-option label="宸茬粨鏉�"
value="5" />
</el-select>
@@ -67,13 +67,44 @@
:tableLoading="tableLoading"
:row-class-name="tableRowClassName"
:isSelection="true"
- :selectable="row => !row.endOrder"
+ :selectable="(row) => !row.endOrder"
@selection-change="handleSelectionChange"
@pagination="pagination">
<template #completionStatus="{ row }">
<el-progress :percentage="toProgressPercentage(row?.completionStatus)"
:color="progressColor(toProgressPercentage(row?.completionStatus))"
- :status="toProgressPercentage(row?.completionStatus) >= 100 ? 'success' : ''" />
+ :status="
+ toProgressPercentage(row?.completionStatus) >= 100
+ ? 'success'
+ : ''
+ " />
+ </template>
+ <template #processRouteStatus="{ row }">
+ <div v-if="row.processRouteStatus && row.processRouteStatus.length"
+ class="process-progress-container">
+ <div v-for="(item, index) in row.processRouteStatus"
+ :key="index"
+ class="process-step">
+ <div class="step-content">
+ <div class="step-circle"
+ :class="{ 'is-completed': item.percentage >= 100 }">
+ <span class="step-percentage"
+ :style="{
+ color:
+ item.percentage >= 70
+ ? item.percentage >= 100
+ ? '#67c23a'
+ : '#f56c6c'
+ : '#000',
+ }">{{ item.percentage }}%</span>
+ </div>
+ <div class="step-name">{{ item.name }}</div>
+ </div>
+ <div v-if="index < row.processRouteStatus.length - 1"
+ class="step-line"></div>
+ </div>
+ </div>
+ <span v-else>-</span>
</template>
</PIMTable>
</div>
@@ -84,7 +115,7 @@
<el-form-item label="宸ヨ壓璺嚎">
<el-select v-model="bindForm.routeId"
placeholder="璇烽�夋嫨宸ヨ壓璺嚎"
- style="width: 100%;"
+ style="width: 100%"
:loading="bindRouteLoading">
<el-option v-for="item in routeOptions"
:key="item.id"
@@ -105,18 +136,23 @@
<!-- 鏉ユ簮鏁版嵁寮圭獥 -->
<el-dialog v-model="sourceDataDialogVisible"
title="鏉ユ簮鏁版嵁"
- width="1200px">
+ width="1200px"
+ top="5vh"
+ class="source-data-dialog"
+ append-to-body>
<div v-if="sourceRowData"
class="applyno-summary1">
<div class="summary-item">
<span class="summary-label">浜у搧鍚嶇О锛�</span>
<span class="summary-value">
- <el-tag type="primary">{{ sourceRowData.productName || '-' }}</el-tag>
+ <el-tag type="primary">{{
+ sourceRowData.productName || "-"
+ }}</el-tag>
</span>
</div>
<div class="summary-item">
<span class="summary-label">瑙勬牸锛�</span>
- <span class="summary-value">{{ sourceRowData.model || '-' }}</span>
+ <span class="summary-value">{{ sourceRowData.model || "-" }}</span>
</div>
<div class="summary-item">
<span class="summary-label">璁㈠崟闇�姹傛暟閲忥細</span>
@@ -132,39 +168,49 @@
<div class="info-grid">
<div class="info-item">
<div class="info-label">璁″垝鍙�</div>
- <div class="info-value">{{ item.mpsNo || '-' }}</div>
+ <div class="info-value">{{ item.mpsNo || "-" }}</div>
</div>
<div class="info-item">
<div class="info-label">鏁版嵁鏉ユ簮</div>
<div class="info-value">
<el-tag :type="item.source === '閿�鍞�' ? 'primary' : 'warning'">
- {{ item.source || '鏈煡' }}
+ {{ item.source || "鏈煡" }}
</el-tag>
</div>
</div>
<div class="info-item">
<div class="info-label">鍚堝悓鍙�</div>
- <div class="info-value">{{ item.salesContractNo || '-' }}</div>
+ <div class="info-value">
+ {{ item.salesContractNo || "-" }}
+ </div>
</div>
<div class="info-item">
<div class="info-label">瀹㈡埛鍚嶇О</div>
- <div class="info-value">{{ item.customerName || '-' }}</div>
+ <div class="info-value">{{ item.customerName || "-" }}</div>
</div>
<div class="info-item">
<div class="info-label">椤圭洰鍚嶇О</div>
- <div class="info-value">{{ item.projectName || '-' }}</div>
+ <div class="info-value">{{ item.projectName || "-" }}</div>
</div>
<div class="info-item">
<div class="info-label">璁″垝闇�姹傛暟閲�</div>
- <div class="info-value">{{ item.qtyRequired || 0 }} {{ item.unit || '' }}</div>
+ <div class="info-value">
+ {{ item.qtyRequired || 0 }} {{ item.unit || "" }}
+ </div>
</div>
<div class="info-item">
<div class="info-label">鍗曚綅</div>
- <div class="info-value">{{ item.unit || '-' }}</div>
+ <div class="info-value">{{ item.unit || "-" }}</div>
</div>
<div class="info-item">
<div class="info-label">闇�姹傛棩鏈�</div>
- <div class="info-value">{{ item.requiredDate ? dayjs(item.requiredDate).format('YYYY-MM-DD') : '-' }}</div>
+ <div class="info-value">
+ {{
+ item.requiredDate
+ ? dayjs(item.requiredDate).format("YYYY-MM-DD")
+ : "-"
+ }}
+ </div>
</div>
</div>
</div>
@@ -215,6 +261,7 @@
getProductOrderSource,
updateProductOrder,
} from "@/api/productionManagement/productionOrder.js";
+ import { productWorkOrderPage } from "@/api/productionManagement/workOrder.js";
import { listMain as getOrderProcessRouteMain } from "@/api/productionManagement/productProcessRoute.js";
import MaterialLedgerDialog from "@/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue";
import MaterialDetailDialog from "@/views/productionManagement/productionOrder/components/MaterialDetailDialog.vue";
@@ -241,7 +288,17 @@
total: 0,
});
- const tableColumn = ref([
+ const processColumnWidth = computed(() => {
+ if (!tableData.value || tableData.value.length === 0) return "200px";
+ const maxProcesses = Math.max(
+ ...tableData.value.map(row => row.processRouteStatus?.length || 0)
+ );
+ if (maxProcesses === 0) return "100px";
+ // 姣忎釜宸ュ簭鍦嗗湀 36px + 绾挎潯 30px = 66px锛岄澶栧姞 60px 杈硅窛鍜屾枃瀛楃┖闂�
+ return `${maxProcesses * 66 + 60}px`;
+ });
+
+ const tableColumn = computed(() => [
{
label: "鐢熶骇璁㈠崟鍙�",
prop: "npsNo",
@@ -298,6 +355,13 @@
prop: "completeQuantity",
},
{
+ label: "宸ュ簭鐢熶骇杩涘害",
+ prop: "processRouteStatus",
+ dataType: "slot",
+ slot: "processRouteStatus",
+ width: processColumnWidth.value,
+ },
+ {
dataType: "slot",
label: "瀹屾垚杩涘害",
prop: "completionStatus",
@@ -340,7 +404,8 @@
{
name: "缁戝畾宸ヨ壓璺嚎",
type: "text",
- showHide: row => !row.processRouteCode && !row.endOrder,
+ showHide: row =>
+ !row.processRouteCode && !row.endOrder && row.status !== 3,
clickFun: row => {
openBindRouteDialog(row, "add");
},
@@ -348,7 +413,8 @@
{
name: "鏇存崲宸ヨ壓璺嚎",
type: "text",
- showHide: row => row.processRouteCode && !row.endOrder,
+ showHide: row =>
+ row.processRouteCode && !row.endOrder && row.status !== 3,
clickFun: row => {
openBindRouteDialog(row, "change");
},
@@ -364,7 +430,7 @@
name: "棰嗘枡",
type: "text",
color: "#5EC7AB",
- showHide: row => !row.endOrder,
+ showHide: row => !row.endOrder && !row.returned,
clickFun: row => {
openMaterialDialog(row);
},
@@ -373,7 +439,7 @@
name: "琛ユ枡",
type: "text",
color: "#5EC7AB",
- showHide: row => !row.endOrder,
+ showHide: row => !row.endOrder && !row.returned,
clickFun: row => {
openMaterialSupplementDialog(row);
},
@@ -449,7 +515,7 @@
if (!Number.isFinite(n)) return 0;
if (n <= 0) return 0;
if (n >= 100) return 100;
- return Math.round(n);
+ return parseFloat(n.toFixed(2));
};
// 30/50/80/100 鍒嗘棰滆壊锛氱孩/姗�/钃�/缁�
@@ -532,7 +598,7 @@
const openBindRouteDialog = async (row, type) => {
bindForm.orderId = row.id;
- bindForm.routeId = type === "add" ? null : row.processRouteCode;
+ bindForm.routeId = type === "add" ? null : row.technologyRoutingId;
bindRouteDialogVisible.value = true;
routeOptions.value = [];
if (!row.productModelId) {
@@ -630,10 +696,35 @@
const params = { ...searchForm.value, ...page };
params.entryDate = undefined;
productOrderListPage(params)
- .then(res => {
- tableLoading.value = false;
- tableData.value = res.data.records;
+ .then(async res => {
+ const records = res.data.records || [];
+ // 涓烘瘡涓鍗曟煡璇㈠搴旂殑宸ュ簭杩涘害鏁版嵁
+ const processPromises = records.map(async item => {
+ if (item.npsNo) {
+ try {
+ const workOrderRes = await productWorkOrderPage({
+ npsNo: item.npsNo,
+ size: 100,
+ });
+ const workOrders = workOrderRes.data.records || [];
+ // 鎸夌収宸ュ簭椤哄簭鎺掑簭锛堝鏋滄湁椤哄簭瀛楁锛屽亣璁句负 orderNum 鎴栨寜杩斿洖椤哄簭锛�
+ // 杞崲涓� processRouteStatus 鏍煎紡
+ const processRouteStatus = workOrders.map(wo => ({
+ name: wo.operationName || "鏈煡宸ュ簭",
+ percentage: wo.completionStatus > 100 ? 100 : wo.completionStatus,
+ }));
+ return { ...item, processRouteStatus };
+ } catch (error) {
+ console.error(`鑾峰彇宸ュ崟 ${item.npsNo} 杩涘害澶辫触:`, error);
+ return { ...item, processRouteStatus: [] };
+ }
+ }
+ return { ...item, processRouteStatus: [] };
+ });
+
+ tableData.value = await Promise.all(processPromises);
page.total = res.data.total;
+ tableLoading.value = false;
})
.catch(() => {
tableLoading.value = false;
@@ -660,9 +751,10 @@
bomNo: row.bomNo || "",
description: data.description || "",
quantity: row.quantity || 0,
+ technologyRoutingId: data.technologyRoutingId,
orderId,
type: "order",
- editable: !row.endOrder,
+ editable: !row.endOrder && row.status !== 3,
},
});
} catch (e) {
@@ -747,9 +839,9 @@
})
.then(() => {
proxy.download(
- "/productOrder/export",
+ "/productionOrder/export",
{ ...searchForm.value },
- "鐢熶骇璁㈠崟.xlsx"
+ "鐢熶骇璁㈠崟鏁版嵁.xlsx"
);
})
.catch(() => {
@@ -813,6 +905,64 @@
.table_list {
margin-top: unset;
}
+
+ .process-progress-container {
+ display: inline-flex;
+ align-items: center;
+ padding: 10px 0;
+ white-space: nowrap;
+
+ .process-step {
+ display: flex;
+ align-items: center;
+ position: relative;
+
+ .step-content {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ z-index: 1;
+
+ .step-circle {
+ width: 36px;
+ height: 36px;
+ border-radius: 50%;
+ border: 2px solid #409eff;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background-color: #fff;
+ margin-bottom: 4px;
+
+ .step-percentage {
+ font-size: 11px;
+ font-weight: bold;
+ }
+
+ &.is-completed {
+ border-color: #67c23a;
+ .step-percentage {
+ color: #67c23a;
+ }
+ }
+ }
+
+ .step-name {
+ font-size: 12px;
+ color: #606266;
+ white-space: nowrap;
+ }
+ }
+
+ .step-line {
+ width: 30px;
+ height: 1px;
+ background-color: #dcdfe6;
+ margin: 0 -2px;
+ margin-top: -20px; // 鍚戜笂鍋忕Щ浠ュ榻愬渾蹇�
+ }
+ }
+ }
</style>
<style lang="scss">
.status-cell {
@@ -824,13 +974,19 @@
.source-table-container {
margin-top: 20px;
+ flex: 1;
+ min-height: 0;
+ max-height: 500px;
+ overflow: auto;
}
.source-data-cards-container {
display: flex;
flex-direction: column;
gap: 16px;
- max-height: 500px;
+ flex: 1;
+ min-height: 0;
+ max-height: none;
overflow-y: auto;
padding: 10px;
background-color: #f5f7fa;
@@ -900,4 +1056,20 @@
}
}
}
+
+ .source-data-dialog {
+ .el-dialog {
+ display: flex;
+ flex-direction: column;
+ max-height: 90vh;
+ }
+
+ .el-dialog__body {
+ flex: 1;
+ min-height: 0;
+ display: flex;
+ flex-direction: column;
+ overflow: hidden;
+ }
+ }
</style>
--
Gitblit v1.9.3