| | |
| | | :label="`${item.productName} ${item.model}`" |
| | | class="form-item"> |
| | | <div class="consumable-input-group"> |
| | | <el-input-number v-model="getProcessInfo(parseInt(activeProcessId)).consumables[item.bomId]" |
| | | <el-input-number v-model="getProcessInfo(parseInt(activeProcessId)).consumables[item.productModelId]" |
| | | :min="0" |
| | | :model-value="getConsumableValue(parseInt(activeProcessId), item.bomId)" |
| | | @change="val => getProcessInfo(parseInt(activeProcessId)).consumables[item.bomId] = val" |
| | | :model-value="getConsumableValue(parseInt(activeProcessId), item.productModelId)" |
| | | @change="val => getProcessInfo(parseInt(activeProcessId)).consumables[item.productModelId] = val" |
| | | class="consumable-input" /> |
| | | <span class="consumable-unit">{{ item.unit }}</span> |
| | | </div> |
| | |
| | | }; |
| | | |
| | | // 获取消耗品数量,默认为0 |
| | | const getConsumableValue = (processId, bomId) => { |
| | | const getConsumableValue = (processId, productModelId) => { |
| | | const processInfo = getProcessInfo(processId); |
| | | if (!processInfo.consumables[bomId]) { |
| | | processInfo.consumables[bomId] = 0; |
| | | if (!processInfo.consumables[productModelId]) { |
| | | processInfo.consumables[productModelId] = 0; |
| | | } |
| | | return processInfo.consumables[bomId]; |
| | | return processInfo.consumables[productModelId]; |
| | | }; |
| | | |
| | | // 处理文件预览 |
| | |
| | | if (editProcess.productionProductRouteItemParamDtoList) { |
| | | editProcess.productionProductRouteItemParamDtoList.forEach( |
| | | param => { |
| | | // console.log(form.processStructures[processId], "========"); |
| | | if (param.bomId) { |
| | | // 使用bomId作为key,因为getProcessStructures返回的item.id是bomId |
| | | processInfo.consumables[param.bomId] = |
| | | form.processStructures[processId].forEach(item => { |
| | | if (item.productModelId == param.productId) { |
| | | processInfo.consumables[param.productId] = |
| | | param.productValue || 0; |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | ); |
| | |
| | | structures.forEach(structure => { |
| | | const consumableValue = getConsumableValue( |
| | | process.processId, |
| | | structure.bomId |
| | | structure.productModelId |
| | | ); |
| | | if (consumableValue > 0) { |
| | | productionProductRouteItemParamDtoList.push({ |