| | |
| | | placeholder="请输入" |
| | | clearable |
| | | prefix-icon="Search" |
| | | style="width: 160px" |
| | | style="width: 160px;" |
| | | @change="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="产品名称:"> |
| | |
| | | placeholder="请输入" |
| | | clearable |
| | | prefix-icon="Search" |
| | | style="width: 160px" |
| | | style="width: 160px;" |
| | | @change="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="规格:"> |
| | |
| | | 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" /> |
| | |
| | | value="2" /> |
| | | <el-option label="已完成" |
| | | value="3" /> |
| | | <!-- <el-option label="已取消"--> |
| | | <!-- value="4" />--> |
| | | <el-option label="已取消" |
| | | value="4" /> |
| | | <el-option label="已结束" |
| | | value="5" /> |
| | | </el-select> |
| | |
| | | :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" |
| | |
| | | <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> |
| | | :style="{ color: item.percentage >= 70 ? item.percentage >= 100 ? '#67c23a' : '#f56c6c' : '#000' }">{{ item.percentage }}%</span> |
| | | </div> |
| | | <div class="step-name">{{ item.name }}</div> |
| | | </div> |
| | |
| | | <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" |
| | |
| | | <!-- 来源数据弹窗 --> |
| | | <el-dialog v-model="sourceDataDialogVisible" |
| | | title="来源数据" |
| | | width="1200px" |
| | | top="5vh" |
| | | class="source-data-dialog" |
| | | append-to-body> |
| | | width="1200px"> |
| | | <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> |
| | |
| | | <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> |
| | |
| | | </el-dialog> |
| | | <MaterialLedgerDialog v-model="materialDialogVisible" |
| | | :order-row="currentMaterialOrder" |
| | | @saved="getList" /> |
| | | /> |
| | | <MaterialDetailDialog v-model="materialDetailDialogVisible" |
| | | :order-row="currentMaterialDetailOrder" |
| | | @confirmed="getList" /> |
| | |
| | | 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"; |
| | |
| | | if (!Number.isFinite(n)) return 0; |
| | | if (n <= 0) return 0; |
| | | if (n >= 100) return 100; |
| | | return parseFloat(n.toFixed(2)); |
| | | return Math.round(n); |
| | | }; |
| | | |
| | | // 30/50/80/100 分段颜色:红/橙/蓝/绿 |
| | |
| | | }; |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | // 构造一个新的对象,不包含entryDate字段 |
| | | const params = { ...searchForm.value, ...page }; |
| | | params.entryDate = undefined; |
| | | productOrderListPage(params) |
| | | .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); |
| | | .then(res => { |
| | | tableData.value = res.data.records || []; |
| | | page.total = res.data.total; |
| | | tableLoading.value = false; |
| | | }) |
| | |
| | | |
| | | .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; |
| | | flex: 1; |
| | | min-height: 0; |
| | | max-height: none; |
| | | max-height: 500px; |
| | | overflow-y: auto; |
| | | padding: 10px; |
| | | background-color: #f5f7fa; |
| | |
| | | color: #303133; |
| | | font-weight: 500; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .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> |