| | |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | // ç产æ¥å·¥-ç¼è¾ |
| | | export function productionRecordEditSubmit(data) { |
| | | return request({ |
| | | url: "/productionRecord/edit", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | |
| | | data: query, |
| | | }); |
| | | } |
| | | // ç产æ¥å·¥-å é¤ |
| | | export function productionReportDelete(query) { |
| | | |
| | | |
| | | // ç产æ¥å·¥-å页æ¥è¯¢ |
| | | export function productionReportListPage(query) { |
| | | return request({ |
| | | url: "/productionProductMain/delete", |
| | | method: "delete", |
| | | data: query, |
| | | url: "/productionProductMain/listPage", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | // ç产æ¥å·¥-详æ
|
| | | export function productionReportDetail(id) { |
| | | return request({ |
| | | url: "/productionRecord/detail/" + id, |
| | | method: "get", |
| | | }); |
| | | } |
| | | |
| | | // ç产æ¥å·¥-å é¤ |
| | | export function productionReportDelete(id) { |
| | | return request({ |
| | | url: `/productionRecord/`+id, |
| | | method: "delete", |
| | | }); |
| | | } |
| | |
| | | prop="paramFormat"> |
| | | <el-input v-model="formData.paramFormat" |
| | | placeholder="请è¾å
¥å弿 ¼å¼" /> |
| | | <!-- <el-select v-model="formData.paramFormat" |
| | | placeholder="è¯·éæ©å弿¨¡å¼"> |
| | | <el-option label="#.00000" |
| | | value="#.00000" /> |
| | | <el-option label="#.0000" |
| | | value="#.0000" /> |
| | | <el-option label="#.000" |
| | | value="#.000" /> |
| | | <el-option label="#.00" |
| | | value="#.00" /> |
| | | </el-select> --> |
| | | </el-form-item> |
| | | <el-form-item label="䏿åå
¸" |
| | | v-else-if="formData.paramType == '3'" |
| | |
| | | // const isProductTypeEdit = ref(false); |
| | | const handleParamTypeChange = () => { |
| | | if (formData.paramType === "1") { |
| | | formData.paramFormat = "#.0000"; |
| | | formData.paramFormat = "#.00000"; |
| | | } else if (formData.paramType === "4") { |
| | | formData.paramFormat = "YYYY-MM-DD HH:mm:ss"; |
| | | } else { |
| | |
| | | row.valueMode !== undefined ? String(row.valueMode) : "1"; |
| | | formData.unit = row.unit || ""; |
| | | formData.remark = row.remark || ""; |
| | | formData.paramFormat = row.paramFormat || ""; |
| | | dialogVisible.value = true; |
| | | }; |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-dialog v-model="dialogVisible" |
| | | :title="dialogTitle" |
| | | width="1000px" |
| | | :close-on-click-modal="false" |
| | | custom-class="custom-dialog"> |
| | | <div class="detail-container"> |
| | | <!-- åºç¡ä¿¡æ¯ --> |
| | | <div class="detail-section"> |
| | | <h3 class="section-title">åºç¡ä¿¡æ¯</h3> |
| | | <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="å²ä½äººå">{{ 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="æ¥å·¥æ¶é´">{{ 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> |
| | | </el-descriptions> |
| | | </div> |
| | | <!-- å·¥åºä¿¡æ¯ --> |
| | | <div class="detail-section" |
| | | v-if="detailData.productionProductRouteItemDtoList && detailData.productionProductRouteItemDtoList.length > 0"> |
| | | <h3 class="section-title">å·¥åºä¿¡æ¯</h3> |
| | | <div v-for="(process, index) in detailData.productionProductRouteItemDtoList" |
| | | :key="process.id" |
| | | class="process-item"> |
| | | <div class="process-header"> |
| | | <h4 class="process-title">å·¥åº {{ index + 1 }}</h4> |
| | | <div class="process-info"> |
| | | <span class="process-label">å²ä½äººåï¼{{ process.postName || '-' }}</span> |
| | | <span class="process-label">å·¥åºIDï¼{{ process.processId || '-' }}</span> |
| | | </div> |
| | | </div> |
| | | <!-- å·¥åºåºæ¬ä¿¡æ¯ --> |
| | | <div class="process-details"> |
| | | <el-descriptions :column="2" |
| | | border> |
| | | <el-descriptions-item label="设å¤å¼å¸¸æ
åµ">{{ process.equipmentMalfunction || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="å½ç设å¤å¤ç½®">{{ process.equipmentDisposal || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="å·¥èºäººå交å¾
" |
| | | :span="2">{{ process.processExplained || '-' }}</el-descriptions-item> |
| | | </el-descriptions> |
| | | </div> |
| | | <!-- å·¥åºåæ° --> |
| | | <div v-if="process.productionProductRouteItemParamDtoList && process.productionProductRouteItemParamDtoList.length > 0"> |
| | | <!-- BOMä¿¡æ¯ --> |
| | | <div class="param-section" |
| | | v-if="getBomList(process.productionProductRouteItemParamDtoList).length > 0"> |
| | | <h5 class="param-title">BOMä¿¡æ¯</h5> |
| | | <el-table :data="getBomList(process.productionProductRouteItemParamDtoList)" |
| | | style="width: 100%" |
| | | size="small"> |
| | | <el-table-column prop="paramName" |
| | | label="åæ°åç§°" |
| | | min-width="120"></el-table-column> |
| | | <el-table-column prop="productValue" |
| | | label="产åå¼" |
| | | min-width="100"></el-table-column> |
| | | <el-table-column prop="unit" |
| | | label="åä½" |
| | | width="80"></el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <!-- åæ°ä¿¡æ¯ --> |
| | | <div class="param-section" |
| | | v-if="getParamList(process.productionProductRouteItemParamDtoList).length > 0"> |
| | | <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> |
| | | </div> |
| | | <div class="param-grid"> |
| | | <div v-for="param in group" |
| | | :key="param.id" |
| | | class="param-item"> |
| | | <span class="param-label">{{ param.paramName || '-' }}:</span> |
| | | <span class="param-value">{{ param.paramValue || '-' }}</span> |
| | | <span v-if="param.unit && param.unit !== '/'" |
| | | class="param-unit">{{ param.unit }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- ä¸ä¼ æä»¶ --> |
| | | <div class="file-section" |
| | | v-if="process.fileList && process.fileList.length > 0"> |
| | | <h5 class="file-title">ä¸ä¼ æä»¶</h5> |
| | | <div class="file-grid"> |
| | | <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)" /> |
| | | <div class="file-info"> |
| | | <span class="file-name">{{ file.fileName || '-' }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button @click="dialogVisible = false">å
³é</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, computed, watch } from "vue"; |
| | | import dayjs from "dayjs"; |
| | | |
| | | const baseUrl = import.meta.env.VITE_APP_BASE_API; |
| | | const props = defineProps({ |
| | | visible: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | data: { |
| | | type: Object, |
| | | default: () => ({}), |
| | | }, |
| | | }); |
| | | |
| | | const emit = defineEmits(["update:visible"]); |
| | | |
| | | const dialogVisible = computed({ |
| | | get: () => props.visible, |
| | | set: value => emit("update:visible", value), |
| | | }); |
| | | |
| | | const dialogTitle = computed(() => "ç产æ¥å·¥è¯¦æ
"); |
| | | const detailData = ref(props.data); |
| | | |
| | | // æ ¼å¼åæ¶é´ |
| | | const formatTime = time => { |
| | | return time ? dayjs(time).format("YYYY-MM-DD HH:mm:ss") : "-"; |
| | | }; |
| | | |
| | | // æ ¼å¼åæä»¶å表 |
| | | const formatFileList = fileList => { |
| | | return fileList.map(file => ({ |
| | | name: file.fileName, |
| | | url: file.fileUrl, |
| | | size: file.fileSize, |
| | | })); |
| | | }; |
| | | |
| | | // å¤çæä»¶é¢è§ |
| | | const handleFilePreview = file => { |
| | | // è¿éå¯ä»¥å®ç°æä»¶é¢è§é»è¾ |
| | | console.log("é¢è§æä»¶:", file); |
| | | }; |
| | | |
| | | // è·åBOMå表 |
| | | const getBomList = paramList => { |
| | | return paramList.filter(item => item.bomId); |
| | | }; |
| | | |
| | | // è·ååæ°å表 |
| | | const getParamList = paramList => { |
| | | return paramList.filter(item => !item.bomId); |
| | | }; |
| | | |
| | | // æsourceSortåç»åæ° |
| | | const getParamGroups = paramList => { |
| | | const params = getParamList(paramList); |
| | | const groups = {}; |
| | | |
| | | params.forEach(param => { |
| | | const sort = param.sourceSort || 1; |
| | | if (!groups[sort]) { |
| | | groups[sort] = []; |
| | | } |
| | | groups[sort].push(param); |
| | | }); |
| | | |
| | | return groups; |
| | | }; |
| | | |
| | | // ç嬿°æ®åå |
| | | watch( |
| | | () => props.data, |
| | | newData => { |
| | | detailData.value = newData; |
| | | }, |
| | | { deep: true } |
| | | ); |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .detail-container { |
| | | max-height: 600px; |
| | | overflow-y: auto; |
| | | padding: 0 16px; |
| | | } |
| | | |
| | | .detail-section { |
| | | margin-bottom: 28px; |
| | | background-color: #ffffff; |
| | | border-radius: 8px; |
| | | padding: 20px; |
| | | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); |
| | | } |
| | | |
| | | .section-title { |
| | | font-size: 16px; |
| | | font-weight: 600; |
| | | margin-bottom: 16px; |
| | | color: #1a1a1a; |
| | | border-bottom: 2px solid #409eff; |
| | | padding-bottom: 10px; |
| | | } |
| | | |
| | | .process-item { |
| | | margin-bottom: 24px; |
| | | padding: 20px; |
| | | background-color: #ffffff; |
| | | border-radius: 8px; |
| | | border: 1px solid #ebeef5; |
| | | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); |
| | | } |
| | | |
| | | .process-header { |
| | | margin-bottom: 20px; |
| | | padding-bottom: 12px; |
| | | border-bottom: 1px solid #f0f2f5; |
| | | } |
| | | |
| | | .process-title { |
| | | font-size: 15px; |
| | | font-weight: 600; |
| | | margin-bottom: 12px; |
| | | color: #1a1a1a; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .process-title::before { |
| | | content: ""; |
| | | display: inline-block; |
| | | width: 4px; |
| | | height: 16px; |
| | | background-color: #409eff; |
| | | margin-right: 8px; |
| | | border-radius: 2px; |
| | | } |
| | | |
| | | .process-info { |
| | | display: flex; |
| | | gap: 20px; |
| | | font-size: 13px; |
| | | color: #606266; |
| | | } |
| | | |
| | | .process-label { |
| | | padding: 4px 12px; |
| | | background-color: #ecf5ff; |
| | | border-radius: 4px; |
| | | color: #409eff; |
| | | font-weight: 500; |
| | | } |
| | | |
| | | .process-details { |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .param-section { |
| | | margin-bottom: 20px; |
| | | background-color: #f9f9f9; |
| | | border-radius: 6px; |
| | | padding: 16px; |
| | | border: 1px solid #f0f2f5; |
| | | } |
| | | |
| | | .param-title { |
| | | font-size: 14px; |
| | | font-weight: 600; |
| | | margin-bottom: 14px; |
| | | color: #1a1a1a; |
| | | padding-bottom: 8px; |
| | | border-bottom: 1px solid #e8e8e8; |
| | | } |
| | | |
| | | .file-section { |
| | | margin-top: 20px; |
| | | background-color: #f9f9f9; |
| | | border-radius: 6px; |
| | | padding: 16px; |
| | | border: 1px solid #f0f2f5; |
| | | } |
| | | |
| | | .file-title { |
| | | font-size: 14px; |
| | | font-weight: 600; |
| | | margin-bottom: 14px; |
| | | color: #1a1a1a; |
| | | padding-bottom: 8px; |
| | | border-bottom: 1px solid #e8e8e8; |
| | | } |
| | | |
| | | .file-grid { |
| | | display: grid; |
| | | grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); |
| | | gap: 16px; |
| | | } |
| | | |
| | | .file-item { |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | background-color: #ffffff; |
| | | border: 1px solid #e8e8e8; |
| | | border-radius: 6px; |
| | | padding: 10px; |
| | | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); |
| | | transition: all 0.3s ease; |
| | | } |
| | | |
| | | .file-item:hover { |
| | | box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); |
| | | border-color: #409eff; |
| | | transform: translateY(-2px); |
| | | } |
| | | |
| | | .file-image { |
| | | width: 80px; |
| | | height: 80px; |
| | | object-fit: cover; |
| | | border-radius: 4px; |
| | | cursor: pointer; |
| | | margin-bottom: 8px; |
| | | } |
| | | |
| | | .file-info { |
| | | width: 100%; |
| | | text-align: center; |
| | | } |
| | | |
| | | .file-name { |
| | | font-size: 12px; |
| | | color: #606266; |
| | | word-break: break-all; |
| | | line-height: 1.4; |
| | | } |
| | | |
| | | .param-group { |
| | | margin-bottom: 16px; |
| | | padding: 14px; |
| | | background-color: #ffffff; |
| | | border-radius: 6px; |
| | | border: 1px solid #e8e8e8; |
| | | } |
| | | |
| | | .group-header { |
| | | margin-bottom: 12px; |
| | | padding-bottom: 8px; |
| | | border-bottom: 1px solid #f0f2f5; |
| | | } |
| | | |
| | | .group-title { |
| | | font-size: 14px; |
| | | font-weight: 600; |
| | | color: #303133; |
| | | } |
| | | |
| | | .param-grid { |
| | | display: grid; |
| | | grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); |
| | | gap: 16px; |
| | | } |
| | | |
| | | .param-item { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 12px; |
| | | padding: 8px 0; |
| | | border-bottom: 1px solid #f5f7fa; |
| | | } |
| | | |
| | | .param-item:last-child { |
| | | border-bottom: none; |
| | | } |
| | | |
| | | .param-label { |
| | | font-size: 13px; |
| | | color: #606266; |
| | | min-width: 100px; |
| | | font-weight: 500; |
| | | } |
| | | |
| | | .param-value { |
| | | font-size: 13px; |
| | | color: #1a1a1a; |
| | | font-weight: 600; |
| | | flex: 1; |
| | | } |
| | | |
| | | .param-unit { |
| | | font-size: 12px; |
| | | color: #909399; |
| | | background-color: #f0f2f5; |
| | | padding: 2px 6px; |
| | | border-radius: 3px; |
| | | } |
| | | |
| | | .dialog-footer { |
| | | text-align: center; |
| | | padding: 20px; |
| | | border-top: 1px solid #ebeef5; |
| | | } |
| | | |
| | | .dialog-footer .el-button { |
| | | min-width: 100px; |
| | | padding: 8px 20px; |
| | | } |
| | | |
| | | /* èªå®ä¹å¯¹è¯æ¡æ ·å¼ */ |
| | | :deep(.custom-dialog) { |
| | | border-radius: 12px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | :deep(.custom-dialog .el-dialog__header) { |
| | | background-color: #f5f7fa; |
| | | padding: 20px; |
| | | border-bottom: 1px solid #ebeef5; |
| | | } |
| | | |
| | | :deep(.custom-dialog .el-dialog__title) { |
| | | font-size: 18px; |
| | | font-weight: 600; |
| | | color: #1a1a1a; |
| | | } |
| | | |
| | | :deep(.custom-dialog .el-dialog__body) { |
| | | padding: 20px; |
| | | } |
| | | |
| | | /* è¡¨æ ¼æ ·å¼ä¼å */ |
| | | :deep(.el-table) { |
| | | border-radius: 6px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | :deep(.el-table th) { |
| | | background-color: #f5f7fa; |
| | | font-weight: 600; |
| | | color: #303133; |
| | | } |
| | | |
| | | :deep(.el-table tr:hover > td) { |
| | | background-color: #ecf5ff !important; |
| | | } |
| | | |
| | | /* æè¿°åè¡¨æ ·å¼ä¼å */ |
| | | :deep(.el-descriptions) { |
| | | border-radius: 6px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | :deep(.el-descriptions__label) { |
| | | font-weight: 500; |
| | | color: #606266; |
| | | } |
| | | |
| | | :deep(.el-descriptions__content) { |
| | | color: #1a1a1a; |
| | | font-weight: 500; |
| | | } |
| | | </style> |
| | |
| | | <el-form :model="searchForm" |
| | | :inline="true"> |
| | | <el-form-item label="ç产订åå·:"> |
| | | <el-input v-model="searchForm.orderNo" |
| | | <el-input v-model="searchForm.npsNo" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | style="width: 160px;" |
| | | @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="çç»:"> |
| | | <el-select v-model="searchForm.teamName" |
| | | <el-select v-model="searchForm.schedule" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | style="width: 160px;" |
| | |
| | | <el-option label="å¤ç" |
| | | value="å¤ç" /> |
| | | </el-select> |
| | | <!-- <el-input v-model="searchForm.teamName" |
| | | <!-- <el-input v-model="searchForm.schedule" |
| | | placeholder="请è¾å
¥"" |
| | | @keyup.enter="handleQuery" /> --> |
| | | </el-form-item> |
| | |
| | | :isSelection="false" |
| | | @selection-change="handleSelectionChange" |
| | | @pagination="pagination"> |
| | | <template #outputVolume="{ row }"> |
| | | <span style="font-weight: bold;color: #409eff;">{{ row.outputVolume }}</span><span style="margin-left: 5px;color: #909399;">æ¹</span> |
| | | <template #totalQuantity="{ row }"> |
| | | <span style="font-weight: bold;color: #409eff;">{{ row.totalQuantity }}</span><span style="margin-left: 5px;color: #909399;">æ¹</span> |
| | | </template> |
| | | <template #unqualifiedVolume="{ row }"> |
| | | <span style="font-weight: bold;color: #b43434;">{{ row.unqualifiedVolume }}</span><span style="margin-left: 5px;color: #909399;">æ¹</span> |
| | | <template #scrapQty="{ row }"> |
| | | <span style="font-weight: bold;color: #b43434;">{{ row.scrapQty }}</span><span style="margin-left: 5px;color: #909399;">æ¹</span> |
| | | </template> |
| | | <template #completedVolume="{ row }"> |
| | | <span style="font-weight: bold;color: #28e431;">{{ row.completedVolume }}</span><span style="margin-left: 5px;color: #909399;">æ¹</span> |
| | | <template #quantity="{ row }"> |
| | | <span style="font-weight: bold;color: #28e431;">{{ row.quantity }}</span><span style="margin-left: 5px;color: #909399;">æ¹</span> |
| | | </template> |
| | | </PIMTable> |
| | | </div> |
| | | <!-- 详æ
å¼¹çª --> |
| | | <detail-dialog v-model:visible="detailDialogVisible" |
| | | :data="detailData" /> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import { ElMessage, ElMessageBox } from "element-plus"; |
| | | import dayjs from "dayjs"; |
| | | import { |
| | | workListPage, |
| | | productionReport, |
| | | productionReportUpdate, |
| | | productionReportDelete, |
| | | productionReportDetail, |
| | | productionReportListPage, |
| | | } from "@/api/productionManagement/productionReporting.js"; |
| | | import PIMTable from "@/components/PIMTable/PIMTable.vue"; |
| | | import DetailDialog from "./detailDialog.vue"; |
| | | |
| | | const router = useRouter(); |
| | | const { proxy } = getCurrentInstance(); |
| | |
| | | const tableColumn = ref([ |
| | | { |
| | | label: "ç产订åå·", |
| | | prop: "orderNo", |
| | | prop: "npsNo", |
| | | width: "150px", |
| | | }, |
| | | { |
| | | label: "çç»", |
| | | prop: "teamName", |
| | | prop: "schedule", |
| | | width: "120px", |
| | | dataType: "tag", |
| | | formatType: params => { |
| | |
| | | }, |
| | | { |
| | | label: "è§æ ¼", |
| | | prop: "specification", |
| | | width: "120px", |
| | | className: "specification-cell", |
| | | prop: "productModelName", |
| | | width: "150px", |
| | | className: "productModelName-cell", |
| | | }, |
| | | { |
| | | label: "äº§åºæ¹é", |
| | | prop: "outputVolume", |
| | | width: "120px", |
| | | prop: "totalQuantity", |
| | | width: "100px", |
| | | align: "right", |
| | | dataType: "slot", |
| | | slot: "outputVolume", |
| | | slot: "totalQuantity", |
| | | }, |
| | | { |
| | | label: "ä¸åæ ¼æ¹é", |
| | | prop: "unqualifiedVolume", |
| | | width: "120px", |
| | | prop: "scrapQty", |
| | | width: "100px", |
| | | align: "right", |
| | | dataType: "slot", |
| | | slot: "unqualifiedVolume", |
| | | slot: "scrapQty", |
| | | }, |
| | | { |
| | | label: "宿æ¹é", |
| | | prop: "completedVolume", |
| | | width: "120px", |
| | | prop: "quantity", |
| | | width: "100px", |
| | | align: "right", |
| | | dataType: "slot", |
| | | slot: "completedVolume", |
| | | slot: "quantity", |
| | | }, |
| | | { |
| | | label: "å建人", |
| | | prop: "createBy", |
| | | prop: "postName", |
| | | width: "120px", |
| | | dataType: "tag", |
| | | }, |
| | |
| | | }); |
| | | |
| | | const searchForm = reactive({ |
| | | orderNo: "", |
| | | teamName: "", |
| | | npsNo: "", |
| | | schedule: "", |
| | | productName: "", |
| | | }); |
| | | |
| | | const mockData = [ |
| | | { |
| | | id: 1, |
| | | orderNo: "PO202401001", |
| | | teamName: "ç½ç", |
| | | materialCode: "PC001", |
| | | productName: "æ åç å", |
| | | specification: "600Ã240Ã200", |
| | | outputVolume: 120.5, |
| | | unqualifiedVolume: 2.3, |
| | | completedVolume: 118.2, |
| | | createBy: "å¼ ä¸", |
| | | createTime: "2024-01-15 08:30:00", |
| | | }, |
| | | { |
| | | id: 2, |
| | | orderNo: "PO202401002", |
| | | teamName: "å¤ç", |
| | | materialCode: "PC002", |
| | | productName: "æ åç å", |
| | | specification: "600Ã240Ã200", |
| | | outputVolume: 150.8, |
| | | unqualifiedVolume: 1.5, |
| | | completedVolume: 149.3, |
| | | createBy: "æå", |
| | | createTime: "2024-01-15 09:15:00", |
| | | }, |
| | | { |
| | | id: 3, |
| | | orderNo: "PO202401003", |
| | | teamName: "ç½ç", |
| | | materialCode: "PC003", |
| | | productName: "å æ°ç å", |
| | | specification: "600Ã240Ã250", |
| | | outputVolume: 95.2, |
| | | unqualifiedVolume: 0.8, |
| | | completedVolume: 94.4, |
| | | createBy: "çäº", |
| | | createTime: "2024-01-15 10:00:00", |
| | | }, |
| | | { |
| | | id: 4, |
| | | orderNo: "PO202401004", |
| | | teamName: "ç½ç", |
| | | materialCode: "PC004", |
| | | productName: "æ åç å", |
| | | specification: "600Ã240Ã200", |
| | | outputVolume: 180.6, |
| | | unqualifiedVolume: 3.2, |
| | | completedVolume: 177.4, |
| | | createBy: "èµµå
", |
| | | createTime: "2024-01-15 14:20:00", |
| | | }, |
| | | { |
| | | id: 5, |
| | | orderNo: "PO202401005", |
| | | teamName: "å¤ç", |
| | | materialCode: "PC005", |
| | | productName: "å æ°ç å", |
| | | specification: "600Ã240Ã250", |
| | | outputVolume: 110.3, |
| | | unqualifiedVolume: 1.1, |
| | | completedVolume: 109.2, |
| | | createBy: "åä¸", |
| | | createTime: "2024-01-15 15:45:00", |
| | | }, |
| | | { |
| | | id: 6, |
| | | orderNo: "PO202401006", |
| | | teamName: "ç½ç", |
| | | materialCode: "PC006", |
| | | productName: "æ åç å", |
| | | specification: "600Ã240Ã200", |
| | | outputVolume: 135.7, |
| | | unqualifiedVolume: 2.5, |
| | | completedVolume: 133.2, |
| | | createBy: "å¨å
«", |
| | | createTime: "2024-01-16 08:00:00", |
| | | }, |
| | | { |
| | | id: 7, |
| | | orderNo: "PO202401007", |
| | | teamName: "ç½ç", |
| | | materialCode: "PC007", |
| | | productName: "å æ°ç å", |
| | | specification: "600Ã240Ã250", |
| | | outputVolume: 88.4, |
| | | unqualifiedVolume: 0.6, |
| | | completedVolume: 87.8, |
| | | createBy: "å´ä¹", |
| | | createTime: "2024-01-16 09:30:00", |
| | | }, |
| | | { |
| | | id: 8, |
| | | orderNo: "PO202401008", |
| | | teamName: "å¤ç", |
| | | materialCode: "PC008", |
| | | productName: "æ åç å", |
| | | specification: "600Ã240Ã200", |
| | | outputVolume: 165.2, |
| | | unqualifiedVolume: 2.8, |
| | | completedVolume: 162.4, |
| | | createBy: "éå", |
| | | createTime: "2024-01-16 11:00:00", |
| | | }, |
| | | { |
| | | id: 9, |
| | | orderNo: "PO202401009", |
| | | teamName: "ç½ç", |
| | | materialCode: "PC009", |
| | | productName: "å æ°ç å", |
| | | specification: "600Ã240Ã250", |
| | | outputVolume: 102.5, |
| | | unqualifiedVolume: 1.3, |
| | | completedVolume: 101.2, |
| | | createBy: "é±åä¸", |
| | | createTime: "2024-01-16 13:15:00", |
| | | }, |
| | | { |
| | | id: 10, |
| | | orderNo: "PO202401010", |
| | | teamName: "ç½ç", |
| | | materialCode: "PC010", |
| | | productName: "æ åç å", |
| | | specification: "600Ã240Ã200", |
| | | outputVolume: 142.8, |
| | | unqualifiedVolume: 2.1, |
| | | completedVolume: 140.7, |
| | | createBy: "ååäº", |
| | | createTime: "2024-01-16 15:00:00", |
| | | }, |
| | | ]; |
| | | |
| | | const form = reactive({ |
| | | id: undefined, |
| | | orderId: "", |
| | | orderNo: "", |
| | | teamName: "", |
| | | npsNo: "", |
| | | schedule: "", |
| | | materialCode: "", |
| | | productName: "", |
| | | specification: "", |
| | | outputVolume: 0, |
| | | unqualifiedVolume: 0, |
| | | completedVolume: 0, |
| | | productModelName: "", |
| | | totalQuantity: 0, |
| | | scrapQty: 0, |
| | | quantity: 0, |
| | | processId: "", |
| | | params: {}, |
| | | }); |
| | | |
| | | const selectedRows = ref([]); |
| | | const detailDialogVisible = ref(false); |
| | | const detailData = ref({}); |
| | | |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | setTimeout(() => { |
| | | productionReportListPage({ |
| | | current: page.current, |
| | | size: page.size, |
| | | ...searchForm, |
| | | }).then(res => { |
| | | tableData.value = res.data.records; |
| | | page.total = res.data.total; |
| | | tableLoading.value = false; |
| | | const start = (page.current - 1) * page.size; |
| | | const end = start + page.size; |
| | | tableData.value = mockData.slice(start, end); |
| | | page.total = mockData.length; |
| | | }, 500); |
| | | }); |
| | | }; |
| | | |
| | | const handleQuery = () => { |
| | |
| | | }; |
| | | |
| | | const handleReset = () => { |
| | | searchForm.orderNo = ""; |
| | | searchForm.teamName = ""; |
| | | searchForm.npsNo = ""; |
| | | searchForm.schedule = ""; |
| | | searchForm.productName = ""; |
| | | page.current = 1; |
| | | getList(); |
| | |
| | | |
| | | const handleAdd = () => { |
| | | Object.assign(form, { |
| | | type: "add", |
| | | id: undefined, |
| | | orderId: "", |
| | | orderNo: "", |
| | | teamName: "", |
| | | npsNo: "", |
| | | schedule: "", |
| | | materialCode: "", |
| | | productName: "", |
| | | specification: "", |
| | | outputVolume: 0, |
| | | unqualifiedVolume: 0, |
| | | completedVolume: 0, |
| | | productModelName: "", |
| | | totalQuantity: 0, |
| | | scrapQty: 0, |
| | | quantity: 0, |
| | | processId: "", |
| | | params: {}, |
| | | }); |
| | |
| | | }; |
| | | |
| | | const handleEdit = row => { |
| | | Object.assign(form, { |
| | | id: row.id, |
| | | orderId: row.orderId || "", |
| | | orderNo: row.orderNo, |
| | | teamName: row.teamName, |
| | | materialCode: row.materialCode, |
| | | productName: row.productName, |
| | | specification: row.specification, |
| | | outputVolume: row.outputVolume, |
| | | unqualifiedVolume: row.unqualifiedVolume, |
| | | completedVolume: row.completedVolume, |
| | | createBy: row.createBy || "", |
| | | createTime: row.createTime || new Date(), |
| | | processId: row.processId || "", |
| | | params: row.params || {}, |
| | | }); |
| | | router.push({ |
| | | path: "/productionManagement/ReportingDialog", |
| | | query: { data: JSON.stringify(form) }, |
| | | }); |
| | | // è°ç¨è¯¦æ
æ¥å£è·å宿´æ°æ® |
| | | productionReportDetail(row.id) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | const detailData = res.data; |
| | | // æå»ºç¼è¾è¡¨åæ°æ® |
| | | const editForm = { |
| | | id: row.id, |
| | | type: "edit", |
| | | orderId: detailData.productOrderId || "", |
| | | npsNo: detailData.npsNo || "", |
| | | schedule: detailData.schedule || "", |
| | | materialCode: detailData.materialCode || "", |
| | | productName: detailData.productName || "", |
| | | productModelName: detailData.model || "", |
| | | totalQuantity: detailData.quantity || 0, |
| | | scrapQty: detailData.unqualifiedQuantity || 0, |
| | | quantity: detailData.qualifiedQuantity || 0, |
| | | createBy: detailData.postName || "", |
| | | createTime: detailData.createTime || new Date(), |
| | | processId: "", |
| | | params: {}, |
| | | // ä¼ éå·¥åºä¿¡æ¯ |
| | | productionProductRouteItemDtoList: |
| | | detailData.productionProductRouteItemDtoList || [], |
| | | }; |
| | | router.push({ |
| | | path: "/productionManagement/ReportingDialog", |
| | | query: { data: JSON.stringify(editForm) }, |
| | | }); |
| | | } else { |
| | | ElMessage.error("è·å详æ
失败"); |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | ElMessage.error("è·å详æ
失败"); |
| | | }); |
| | | }; |
| | | |
| | | const handleDetail = row => { |
| | | ElMessage.info("详æ
åè½å¾
å®ç°"); |
| | | productionReportDetail(row.id) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | detailData.value = res.data; |
| | | detailDialogVisible.value = true; |
| | | } else { |
| | | ElMessage.error("è·å详æ
失败"); |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | ElMessage.error("è·å详æ
失败"); |
| | | }); |
| | | }; |
| | | |
| | | const handleDelete = row => { |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | productionReportDelete({ id: row.id }) |
| | | productionReportDelete(row.id) |
| | | .then(() => { |
| | | ElMessage.success("å 餿å"); |
| | | getList(); |
| | |
| | | } |
| | | </style> |
| | | <style lang="scss"> |
| | | .specification-cell { |
| | | .productModelName-cell { |
| | | color: #7a7d81; |
| | | font-style: italic; |
| | | } |
| | |
| | | :label="`${item.productName} ${item.model}`" |
| | | class="form-item"> |
| | | <div class="consumable-input-group"> |
| | | <el-input-number v-model="getProcessInfo(parseInt(activeProcessId)).consumables[item.id]" |
| | | <el-input-number v-model="getProcessInfo(parseInt(activeProcessId)).consumables[item.bomId]" |
| | | :min="0" |
| | | :model-value="getConsumableValue(parseInt(activeProcessId), item.id)" |
| | | @change="val => getProcessInfo(parseInt(activeProcessId)).consumables[item.id] = val" |
| | | :model-value="getConsumableValue(parseInt(activeProcessId), item.bomId)" |
| | | @change="val => getProcessInfo(parseInt(activeProcessId)).consumables[item.bomId] = val" |
| | | class="consumable-input" /> |
| | | <span class="consumable-unit">{{ item.unit }}</span> |
| | | </div> |
| | |
| | | </div> |
| | | <div class="card-body"> |
| | | <div class="param-grid"> |
| | | <el-form-item v-for="param in params" |
| | | <el-form-item v-for="param in params[activeProcessId] || []" |
| | | :key="param.id" |
| | | :label="param.paramName" |
| | | :label-width="120" |
| | |
| | | <template v-if="param.paramType == '1'"> |
| | | <!-- æ°åç±»å --> |
| | | <div class="param-input-group"> |
| | | <!-- :precision="getPrecision(param.paramFormat)" --> |
| | | <el-input-number v-model="form.paramGroups[activeProcessId][index][param.id]" |
| | | controls-position="right" |
| | | :precision="getPrecision(param.paramFormat)" |
| | | :key="param.id" |
| | | class="param-input" /> |
| | | <span v-if="param.unit && param.unit != '/'" |
| | | class="param-unit"> |
| | |
| | | <!-- ææ¬ç±»å --> |
| | | <div class="param-input-group"> |
| | | <el-input v-model="form.paramGroups[activeProcessId][index][param.id]" |
| | | :key="param.id" |
| | | class="param-input" /> |
| | | <span v-if="param.unit && param.unit != '/'" |
| | | class="param-unit"> |
| | |
| | | <div class="param-input-group"> |
| | | <el-select v-model="form.paramGroups[activeProcessId][index][param.id]" |
| | | placeholder="è¯·éæ©" |
| | | :key="param.id" |
| | | class="param-select" |
| | | style="width: 100%"> |
| | | <el-option v-for="option in dictOptions[param.paramFormat] || []" |
| | |
| | | <div class="param-input-group"> |
| | | <el-date-picker :value-format="param.paramFormat" |
| | | :format="param.paramFormat" |
| | | :key="param.id" |
| | | :type="param.paramFormat=='YYYY-MM-DD'?'date':'datetime'" |
| | | v-model="form.paramGroups[activeProcessId][index][param.id]" |
| | | class="param-input" /> |
| | |
| | | <!-- å
¶ä»ç±»å --> |
| | | <div class="param-input-group"> |
| | | <el-input v-model="form.paramGroups[activeProcessId][index][param.id]" |
| | | :key="param.id" |
| | | class="param-input" /> |
| | | <span v-if="param.unit && param.unit != '/'" |
| | | class="param-unit"> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <!-- åæ°å --> |
| | | <el-table-column v-for="param in params" |
| | | <el-table-column v-for="param in params[activeProcessId] || []" |
| | | :key="param.id" |
| | | :min-width="200"> |
| | | <template #header> |
| | |
| | | <template #default="{ row }"> |
| | | <template v-if="param.paramType == '1'"> |
| | | <!-- æ°åç±»å --> |
| | | <!-- :precision="getPrecision(param.paramFormat)" --> |
| | | <el-input-number v-model="row[param.id]" |
| | | controls-position="right" |
| | | :precision="getPrecision(param.paramFormat)" |
| | | :key="param.id" |
| | | class="table-input" /> |
| | | </template> |
| | | <template v-else-if="param.paramType == '2'"> |
| | | <!-- ææ¬ç±»å --> |
| | | <el-input v-model="row[param.id]" |
| | | :key="param.id" |
| | | class="table-input" /> |
| | | </template> |
| | | <template v-else-if="param.paramType == '3'"> |
| | | <!-- åå
¸ç±»å --> |
| | | <el-select v-model="row[param.id]" |
| | | placeholder="è¯·éæ©" |
| | | :key="param.id" |
| | | class="table-select"> |
| | | <el-option v-for="option in dictOptions[param.paramFormat] || []" |
| | | :key="option.dictValue" |
| | |
| | | <!-- æ¥æç±»å --> |
| | | <el-date-picker :value-format="param.paramFormat" |
| | | :format="param.paramFormat" |
| | | :key="param.id" |
| | | width="100%" |
| | | :type="param.paramFormat=='YYYY-MM-DD'?'date':'datetime'" |
| | | v-model="row[param.id]" |
| | |
| | | import { |
| | | productionRecordAdd, |
| | | productionRecordAddSubmit, |
| | | productionRecordEditSubmit, |
| | | } from "@/api/productionManagement/productProcessRoute.js"; |
| | | import { userListNoPage } from "@/api/system/user.js"; |
| | | import { getInfo } from "@/api/login.js"; |
| | |
| | | const route = useRoute(); |
| | | const data = route.query.data ? JSON.parse(route.query.data) : {}; |
| | | |
| | | const dialogTitle = computed(() => (data.id ? "ç¼è¾æ¥å·¥" : "æ°å¢æ¥å·¥")); |
| | | const dialogTitle = computed(() => |
| | | form.type === "edit" ? "ç¼è¾æ¥å·¥" : "æ°å¢æ¥å·¥" |
| | | ); |
| | | |
| | | const formRef = ref(null); |
| | | const isSubmitting = ref(false); |
| | |
| | | const useTableView = ref(false); // æ§å¶æ¯å¦ä½¿ç¨è¡¨æ ¼è§å¾ |
| | | |
| | | const form = reactive({ |
| | | type: data.type || "add", |
| | | id: data.id || undefined, |
| | | orderId: data.orderId || "", |
| | | orderId: data.productOrderId || "", |
| | | npsNo: data.npsNo || "", |
| | | teamName: data.teamName || "ç½ç", |
| | | teamName: data.schedule || data.teamName || "ç½ç", |
| | | materialCode: data.materialCode || "", |
| | | productName: data.productName || "", |
| | | specification: data.specification || "", |
| | | outputVolume: data.outputVolume || 0, |
| | | unqualifiedVolume: data.unqualifiedVolume || 0, |
| | | completedVolume: data.completedVolume || 0, |
| | | createBy: data.createBy || "å½åç»å½äºº", |
| | | specification: data.productModelName || "", |
| | | outputVolume: data.totalQuantity || data.outputVolume || 0, |
| | | unqualifiedVolume: data.scrapQty || data.unqualifiedQuantity || 0, |
| | | completedVolume: data.quantity || data.completedVolume || 0, |
| | | createBy: data.createBy || data.postName || "å½åç»å½äºº", |
| | | createTime: data.createTime || new Date(), |
| | | paramGroups: data.paramGroups || {}, // å卿¯ä¸ªå·¥åºçåæ°ç» |
| | | processInfo: data.processInfo || {}, // å卿¯ä¸ªå·¥åºçåºæ¬ä¿¡æ¯ |
| | | productionProductRouteItemDtoList: |
| | | data.productionProductRouteItemDtoList || [], // å·¥åºä¿¡æ¯ |
| | | }); |
| | | |
| | | const rules = { |
| | |
| | | processExplained: "", |
| | | files: [], |
| | | consumables: {}, |
| | | delFileIds: [], // åå¨è¦å é¤çæä»¶id |
| | | }; |
| | | } |
| | | return form.processInfo[processId]; |
| | |
| | | }; |
| | | |
| | | // è·åæ¶èåæ°éï¼é»è®¤ä¸º0 |
| | | const getConsumableValue = (processId, itemId) => { |
| | | const getConsumableValue = (processId, bomId) => { |
| | | const processInfo = getProcessInfo(processId); |
| | | if (!processInfo.consumables[itemId]) { |
| | | processInfo.consumables[itemId] = 0; |
| | | if (!processInfo.consumables[bomId]) { |
| | | processInfo.consumables[bomId] = 0; |
| | | } |
| | | return processInfo.consumables[itemId]; |
| | | return processInfo.consumables[bomId]; |
| | | }; |
| | | |
| | | // å¤çæä»¶é¢è§ |
| | |
| | | const processId = parseInt(activeProcessId.value); |
| | | if (processId) { |
| | | const processInfo = getProcessInfo(processId); |
| | | // è®°å½è¢«å é¤çæä»¶idï¼åªæç¼è¾æ¨¡å¼ä¸çç°ææä»¶æéè¦è®°å½ï¼ |
| | | if (file.uid && !file.tempId) { |
| | | processInfo.delFileIds.push(file.uid); |
| | | } |
| | | processInfo.files = fileList; |
| | | } |
| | | }; |
| | | |
| | | // å¤çæä»¶åæ´ |
| | | const handleFileChange = async (file, fileList) => { |
| | | console.log(file, fileList); |
| | | const formData = new FormData(); |
| | | formData.append("file", file.raw); |
| | | |
| | |
| | | Authorization: `Bearer ${getToken()}`, |
| | | }, |
| | | }); |
| | | console.log(uploadRes); |
| | | if (uploadRes.code === 200) { |
| | | const tempId = uploadRes.data.tempId; |
| | | // å°tempIdåå¨å°fileå¯¹è±¡ä¸ |
| | |
| | | p => p.processId === parseInt(processId) |
| | | ); |
| | | if (process) { |
| | | params.value = process.orderRouteItemParaVos || []; |
| | | params.value[processId] = process.orderRouteItemParaVos || []; |
| | | |
| | | // åå§ååæ°ç» |
| | | if (!form.paramGroups[processId]) { |
| | | form.paramGroups[processId] = []; |
| | | } |
| | | |
| | | // æ£æ¥æ¯å¦æç¼è¾æ°æ® |
| | | if ( |
| | | form.productionProductRouteItemDtoList && |
| | | form.productionProductRouteItemDtoList.length > 0 |
| | | ) { |
| | | const editProcess = form.productionProductRouteItemDtoList.find( |
| | | p => p.processId === parseInt(processId) |
| | | ); |
| | | if (editProcess && editProcess.productionProductRouteItemParamDtoList) { |
| | | // æsourceSortåç»åæ° |
| | | const paramGroups = {}; |
| | | editProcess.productionProductRouteItemParamDtoList.forEach(param => { |
| | | if (!param.bomId) { |
| | | // åªå¤çéBOMåæ° |
| | | const sort = param.sourceSort || 1; |
| | | if (!paramGroups[sort]) { |
| | | paramGroups[sort] = {}; |
| | | } |
| | | paramGroups[sort][param.orderItemParamId] = param.paramValue || ""; |
| | | // 妿æ¯åå
¸ç±»ååæ°ï¼è·ååå
¸æ°æ® |
| | | if (param.paramType == "3" && param.paramFormat) { |
| | | getDictOptions(param.paramFormat); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | // 转æ¢ä¸ºæ°ç» |
| | | form.paramGroups[processId] = Object.values(paramGroups); |
| | | |
| | | // åå§åå·¥åºåºæ¬ä¿¡æ¯ |
| | | if (editProcess) { |
| | | const processInfo = getProcessInfo(parseInt(processId)); |
| | | processInfo.postName = editProcess.postName || ""; |
| | | processInfo.equipmentMalfunction = |
| | | editProcess.equipmentMalfunction || ""; |
| | | processInfo.equipmentDisposal = editProcess.equipmentDisposal || ""; |
| | | processInfo.id = editProcess.id || ""; |
| | | processInfo.processExplained = editProcess.processExplained || ""; |
| | | // å¤çæä»¶ |
| | | if (editProcess.fileList) { |
| | | processInfo.files = editProcess.fileList.map(file => ({ |
| | | name: file.fileName, |
| | | url: file.fileUrl, |
| | | uid: file.id, |
| | | })); |
| | | } |
| | | // å¤çBOMä¿¡æ¯ |
| | | if (editProcess.productionProductRouteItemParamDtoList) { |
| | | editProcess.productionProductRouteItemParamDtoList.forEach( |
| | | param => { |
| | | if (param.bomId) { |
| | | // 使ç¨bomIdä½ä¸ºkeyï¼å 为getProcessStructuresè¿åçitem.idæ¯bomId |
| | | processInfo.consumables[param.bomId] = |
| | | param.productValue || 0; |
| | | } |
| | | } |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // å¦ææ²¡æåæ°ç»ï¼æ·»å ä¸ä¸ªé»è®¤åæ°ç» |
| | | if (form.paramGroups[processId].length === 0) { |
| | | const defaultGroup = {}; |
| | | for (const param of params.value) { |
| | | for (const param of params.value[processId]) { |
| | | defaultGroup[param.id] = param.standardValue || ""; |
| | | // 妿æ¯åå
¸ç±»ååæ°ï¼è·ååå
¸æ°æ® |
| | | if (param.paramType == "3" && param.paramFormat) { |
| | |
| | | |
| | | // æå»ºè¯·æ±åæ° |
| | | const order = orderList.value.find(item => item.id === form.orderId); |
| | | console.log(order, "order"); |
| | | const submitParams = { |
| | | productOrderId: form.orderId, |
| | | productId: order ? order.productId : null, |
| | |
| | | const processInfo = getProcessInfo(process.processId); |
| | | const paramGroups = form.paramGroups[process.processId] || []; |
| | | const productionProductRouteItemParamDtoList = []; |
| | | |
| | | // æ·»å åæ°ç» |
| | | paramGroups.forEach((group, index) => { |
| | | Object.entries(group).forEach(([paramId, value]) => { |
| | |
| | | ) |
| | | : null; |
| | | if (param) { |
| | | console.log(param, "param"); |
| | | productionProductRouteItemParamDtoList.push({ |
| | | id: parseInt(paramId), |
| | | standardValue: param.standardValue, |
| | | minValue: param.minValue, |
| | | maxValue: param.maxValue, |
| | | // standardValue: param.standardValue, |
| | | // minValue: param.minValue, |
| | | // maxValue: param.maxValue, |
| | | productId: param.productId, |
| | | productValue: value, |
| | | paramValue: value, |
| | | // productValue: value, |
| | | sourceSort: index + 1, |
| | | unit: param.unit, |
| | | isRequired: param.isRequired, |
| | | // isRequired: param.isRequired, |
| | | }); |
| | | } |
| | | }); |
| | |
| | | |
| | | // æ·»å BOMä¿¡æ¯ |
| | | const structures = getProcessStructures(process.processId); |
| | | console.log(structures, "structures"); |
| | | structures.forEach(structure => { |
| | | const consumableValue = getConsumableValue( |
| | | process.processId, |
| | | structure.id |
| | | structure.bomId |
| | | ); |
| | | if (consumableValue > 0) { |
| | | productionProductRouteItemParamDtoList.push({ |
| | |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | const fileIds = []; |
| | | processInfo.files.forEach(file => { |
| | | if (file.tempId) { |
| | | fileIds.push(file.tempId); |
| | | } |
| | | }); |
| | | console.log(processInfo, "processInfo"); |
| | | return { |
| | | postName: processInfo.postName, |
| | | id: processInfo.id, |
| | | equipmentMalfunction: processInfo.equipmentMalfunction, |
| | | equipmentDisposal: processInfo.equipmentDisposal, |
| | | processExplained: processInfo.processExplained, |
| | | processId: process.processId, |
| | | delFileIds: [...(processInfo.delFileIds || [])], |
| | | productionProductRouteItemParamDtoList, |
| | | files: processInfo.files.map(file => file.tempId || file.uid), |
| | | // files: processInfo.files.map(file => file.tempId || file.uid), |
| | | files: fileIds, |
| | | }; |
| | | }), |
| | | }; |
| | | console.log(submitParams, "submitParams"); |
| | | isSubmitting.value = false; |
| | | // è°ç¨APIè¿è¡æäº¤ |
| | | productionRecordAddSubmit(submitParams) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | ElMessage.success(data.id ? "ä¿®æ¹æå" : "æ°å¢æå"); |
| | | router.back(); |
| | | } else { |
| | | ElMessage.error(res.msg || "æäº¤å¤±è´¥"); |
| | | } |
| | | }) |
| | | .catch(error => { |
| | | ElMessage.error("æäº¤å¤±è´¥ï¼è¯·ç¨åéè¯"); |
| | | console.error("æäº¤é误:", error); |
| | | }) |
| | | .finally(() => { |
| | | isSubmitting.value = false; |
| | | }); |
| | | if (form.type === "edit") { |
| | | submitParams.productMainId = form.id; |
| | | productionRecordEditSubmit(submitParams) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | ElMessage.success(form.type === "edit" ? "ä¿®æ¹æå" : "æ°å¢æå"); |
| | | router.back(); |
| | | } else { |
| | | ElMessage.error(res.msg || "æäº¤å¤±è´¥"); |
| | | } |
| | | }) |
| | | .catch(error => { |
| | | ElMessage.error("æäº¤å¤±è´¥ï¼è¯·ç¨åéè¯"); |
| | | console.error("æäº¤é误:", error); |
| | | }) |
| | | .finally(() => { |
| | | isSubmitting.value = false; |
| | | }); |
| | | } else { |
| | | productionRecordAddSubmit(submitParams) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | ElMessage.success(form.type === "edit" ? "ä¿®æ¹æå" : "æ°å¢æå"); |
| | | router.back(); |
| | | } else { |
| | | ElMessage.error(res.msg || "æäº¤å¤±è´¥"); |
| | | } |
| | | }) |
| | | .catch(error => { |
| | | ElMessage.error("æäº¤å¤±è´¥ï¼è¯·ç¨åéè¯"); |
| | | console.error("æäº¤é误:", error); |
| | | }) |
| | | .finally(() => { |
| | | isSubmitting.value = false; |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }; |
| | |
| | | loadUsers(); |
| | | getCurrentUser(); |
| | | |
| | | if (data.id) { |
| | | if (form.type === "edit") { |
| | | // ç¼è¾æ¶è®¾ç½®è¡¨åæ°æ® |
| | | Object.assign(form, data); |
| | | // 设置orderId |
| | | orderId.value = data.orderId || ""; |
| | | orderId.value = form.orderId || ""; |
| | | // 妿æè®¢åIDï¼å 载工åºååæ° |
| | | if (data.orderId) { |
| | | if (form.orderId) { |
| | | // 模æéæ©è®¢åçæä½ï¼è§¦åæ°æ®å è½½ |
| | | setTimeout(() => { |
| | | handleOrderChange(data.orderId); |
| | | handleOrderChange(form.orderId); |
| | | }, 100); |
| | | } |
| | | } else { |