| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <PageHeader v-if="showHeader" |
| | | content="生产订单" /> |
| | | <el-card style="height:82vh;overflow:auto;"> |
| | | <template #header> |
| | | <div class="card-header"> |
| | |
| | | </el-tag> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="客户名称">{{ rowData.productionOrderDto?.customerName || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="开始日期">{{ parseTime(rowData.productionOrderDto?.startTime) || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="开始日期">{{ parseTime(rowData.productionOrderDto?.startTime,'{y}-{m}-{d}') || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="完成进度"> |
| | | <el-progress :percentage="rowData.productionOrderDto?.completionStatus>=100?100:rowData.productionOrderDto?.completionStatus" |
| | | :color="customColors(rowData.productionOrderDto?.completionStatus)" |
| | |
| | | {{ row.workOrder.model || '-' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="工序" |
| | | prop="workOrder.operationName" |
| | | align="center" /> |
| | | <el-table-column prop="workOrder.planQuantity" |
| | | label="需求数量" |
| | | align="center" /> |
| | | <el-table-column prop="workOrder.completeQuantity" |
| | | label="完成数量" |
| | | align="center" /> |
| | | <el-table-column prop="workOrder.scrapQty" |
| | | label="报废数量" |
| | | align="center" /> |
| | | <el-table-column prop="workOrder.completionStatus" |
| | | label="完成进度" |
| | |
| | | <el-descriptions-item label="生产工单号">{{ detailData.workOrder.workOrderNo || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="计划数量">{{ detailData.workOrder.planQuantity || 0 }}</el-descriptions-item> |
| | | <el-descriptions-item label="完成数量">{{ detailData.workOrder.completeQuantity || 0 }}</el-descriptions-item> |
| | | <el-descriptions-item label="实际开始时间">{{ parseTime(detailData.workOrder.actualStartTime) || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="实际结束时间">{{ parseTime(detailData.workOrder.actualEndTime) || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="实际开始时间">{{ parseTime(detailData.workOrder.actualStartTime, '{y}-{m}-{d}') || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="实际结束时间">{{ parseTime(detailData.workOrder.actualEndTime, '{y}-{m}-{d}') || '-' }}</el-descriptions-item> |
| | | <!-- <el-descriptions-item label="完成进度"> |
| | | <el-progress :percentage="detailData.workOrder.completionStatus >= 100 ? 100 : (detailData.workOrder.completionStatus || 0)" |
| | | :color="customColors(detailData.workOrder.completionStatus)" |
| | |
| | | {{ parseTime(row.createTime) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="工时(h)" |
| | | prop="workHour" |
| | | align="center" /> |
| | | <el-table-column label="产出数量" |
| | | prop="quantity" |
| | | align="center" /> |
| | | <el-table-column label="报废数量" |
| | | prop="scrapQty" |
| | | align="center" /> |
| | | <el-table-column label="操作" |
| | | align="center" |
| | | width="200"> |
| | | <template #default="{ row }"> |
| | | <el-button type="primary" |
| | | link |
| | | @click="showInput(row.id)">查看投入</el-button> |
| | | @click="showInput(row.productionProductMainId)">查看投入</el-button> |
| | | <el-button type="primary" |
| | | link |
| | | @click="showParamDetail(row.productionOperationParamList)">参数详情</el-button> |
| | |
| | | :key="record.id" |
| | | class="quality-record-block"> |
| | | <div class="detail-section"> |
| | | <h3 class="section-title">检测记录 {{ index + 1 }} - {{ parseTime(record.createTime) }}</h3> |
| | | <h3 class="section-title">检测记录 {{ index + 1 }} - {{ parseTime(record.createTime, '{y}-{m}-{d}') }}</h3> |
| | | <el-descriptions :column="3" |
| | | border> |
| | | <el-descriptions-item label="检测日期">{{ parseTime(record.createTime) || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="检测日期">{{ parseTime(record.createTime, '{y}-{m}-{d}') || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="报工单号">{{ record.reportNo || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="检验员">{{ record.userName || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="产品名称">{{ record.productName || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="规格型号">{{ record.model || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="数量">{{ record.quantity || 0 }} {{ record.unit || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="检测单位">{{ record.checkCompany || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="检测结果"> |
| | | <el-tag :type="record.checkResult === '合格' ? 'success' : 'danger'"> |
| | | {{ record.checkResult || '待检测' }} |
| | | <el-descriptions-item label="合格率"> |
| | | <el-tag :type="getPassRateTagType(record)"> |
| | | {{ getPassRateDisplay(record) }} |
| | | </el-tag> |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive, onMounted } from "vue"; |
| | | import { ref, reactive, onMounted, computed } from "vue"; |
| | | import { useRoute, useRouter } from "vue-router"; |
| | | import { ElMessage } from "element-plus"; |
| | | import { parseTime } from "@/utils/ruoyi"; |
| | |
| | | |
| | | const route = useRoute(); |
| | | const router = useRouter(); |
| | | |
| | | // 判断是否显示页头 |
| | | const showHeader = computed(() => { |
| | | return ( |
| | | Object.keys(route.query).length > 0 || Object.keys(route.params).length > 0 |
| | | ); |
| | | }); |
| | | |
| | | // 搜索相关 |
| | | const searchForm = reactive({ |
| | |
| | | return "#67c23a"; |
| | | }; |
| | | |
| | | const getPassRate = (record) => { |
| | | const qualified = Number(record.qualifiedQuantity) || 0; |
| | | const unqualified = Number(record.unqualifiedQuantity) || 0; |
| | | const total = qualified + unqualified; |
| | | if (total === 0) return null; |
| | | return Number(((qualified / total) * 100).toFixed(2)); |
| | | }; |
| | | |
| | | const getPassRateDisplay = (record) => { |
| | | const rate = getPassRate(record); |
| | | if (rate === null) return '—'; |
| | | return `${rate}%`; |
| | | }; |
| | | |
| | | const getPassRateTagType = (record) => { |
| | | const rate = getPassRate(record); |
| | | if (rate === null) return 'info'; |
| | | if (rate >= 100) return 'success'; |
| | | if (rate >= 75) return 'primary'; |
| | | return 'danger'; |
| | | }; |
| | | |
| | | // 模拟搜索方法 |
| | | const handleNpsNoSearch = async query => { |
| | | npsNoLoading.value = true; |
| | |
| | | workOrder: row.workOrder || {}, |
| | | reports: (row.reportList || []).map(r => ({ |
| | | ...r.reportMain, |
| | | ...(r.reportOutputList[0] || {}), |
| | | productionOperationParamList: r.reportParamList || [], |
| | | })), |
| | | }; |