| | |
| | | prop="technologyOperationId" |
| | | width="200"> |
| | | <template #default="scope"> |
| | | {{ getProcessName(scope.row.technologyOperationId) || '-' }} |
| | | {{ scope.row.technologyOperationName || scope.row.operationName || '-' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="参数列表" |
| | |
| | | <!-- 序号圆圈 --> |
| | | <div class="card-header"> |
| | | <div class="card-number">{{ index + 1 }}</div> |
| | | <div class="card-process-name">{{ getProcessName(item.technologyOperationId) || '-' }}</div> |
| | | <div class="card-process-name">{{ item.technologyOperationName || item.operationName || '-' }}</div> |
| | | </div> |
| | | <!-- 产品信息 --> |
| | | <div class="card-content"> |
| | |
| | | <div class="section-header" |
| | | style="margin-top: 20px;"> |
| | | <div class="section-title">BOM 结构</div> |
| | | <div class="section-actions" |
| | | <!-- <div class="section-actions" |
| | | v-if="pageType === 'order'"> |
| | | <el-button v-if="!bomDataValue.isEdit" |
| | | type="primary" |
| | |
| | | :loading="bomDataValue.loading"> |
| | | 保存BOM |
| | | </el-button> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | <el-table :data="bomTableData" |
| | | border |
| | |
| | | :rules="rules" |
| | | label-width="120px"> |
| | | <el-form-item label="工序" |
| | | v-if="operationType === 'add' || pageType === 'route'" |
| | | prop="technologyOperationId"> |
| | | <el-select v-model="form.technologyOperationId" |
| | | placeholder="请选择工序" |
| | |
| | | :value="process.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="工序" |
| | | v-else> |
| | | <span>{{ getProcessName(form.technologyOperationId) }}</span> |
| | | </el-form-item> |
| | | <el-form-item label="产品名称" |
| | | v-if="operationType === 'add' || pageType === 'route'" |
| | | prop="productModelId"> |
| | | <el-button type="primary" |
| | | @click="showProductSelectDialog = true"> |
| | |
| | | : '选择产品' }} |
| | | </el-button> |
| | | </el-form-item> |
| | | <el-form-item label="产品名称" |
| | | v-else> |
| | | <span>{{ form.productName }}{{ form.model ? ' - ' + form.model : '' }}</span> |
| | | </el-form-item> |
| | | <el-form-item label="单位" |
| | | v-if="operationType === 'add' || pageType === 'route'" |
| | | prop="unit"> |
| | | <el-input v-model="form.unit" |
| | | :placeholder="form.productModelId ? '根据选择的产品自动带出' : '请先选择产品'" |
| | | clearable |
| | | :disabled="true" /> |
| | | </el-form-item> |
| | | <el-form-item label="单位" |
| | | v-else> |
| | | <span>{{ form.unit }}</span> |
| | | </el-form-item> |
| | | <el-form-item label="是否质检" |
| | | prop="isQuality"> |
| | |
| | | <!-- 参数列表对话框 --> |
| | | <!-- :editable="!routeInfo.status" --> |
| | | <ProcessParamListDialog v-model="showParamListDialog" |
| | | :title="`${currentProcess ? (currentProcess.processName || getProcessName(currentProcess.technologyOperationId)) : ''} - 参数列表`" |
| | | :title="`${currentProcess ? (currentProcess.processName || currentProcess.technologyOperationName || currentProcess.operationName) : ''} - 参数列表`" |
| | | :route-id="routeId" |
| | | :order-id="orderId" |
| | | :process="currentProcess" |
| | |
| | | import { listProcessBom } from "@/api/productionManagement/productionOrder.js"; |
| | | import { |
| | | queryList, |
| | | queryList2, |
| | | addBomDetail, |
| | | } from "@/api/productionManagement/productStructure.js"; |
| | | |
| | |
| | | |
| | | const addPromise = isOrderPage |
| | | ? addRouteItem({ |
| | | productOrderId: orderId.value, |
| | | productRouteId: routeId.value, |
| | | productionOrderId: Number(orderId.value), |
| | | orderRoutingId: Number(routeId.value), |
| | | technologyOperationId: form.value.technologyOperationId, |
| | | technologyRoutingId: Number(routeId.value), |
| | | operationName: getProcessName(form.value.technologyOperationId), |
| | | productModelId: form.value.productModelId, |
| | | isQuality: form.value.isQuality, |
| | | isProduction: form.value.isProduction, |
| | |
| | | ? addOrUpdateProductProcessRouteItem({ |
| | | id: form.value.id, |
| | | technologyOperationId: form.value.technologyOperationId, |
| | | operationName: getProcessName(form.value.technologyOperationId), |
| | | productModelId: form.value.productModelId, |
| | | isQuality: form.value.isQuality, |
| | | isProduction: form.value.isProduction, |
| | |
| | | }); |
| | | |
| | | const syncProcessOperationFields = item => { |
| | | const processId = item.processId ?? item.operationId ?? ""; |
| | | const processId = |
| | | item.processId ?? item.operationId ?? item.technologyOperationId ?? ""; |
| | | if (!processId) { |
| | | item.processId = ""; |
| | | return; |
| | |
| | | option?.name || item.processName || item.operationName || ""; |
| | | |
| | | item.processId = processId; |
| | | item.operationId = processId; |
| | | if (pageType.value === "order") { |
| | | item.technologyOperationId = processId; |
| | | } else { |
| | | item.operationId = processId; |
| | | } |
| | | item.processName = processName; |
| | | item.operationName = processName; |
| | | }; |
| | |
| | | |
| | | const fetchBomData = async () => { |
| | | try { |
| | | const { data } = await queryList(routeInfo.value.bomId); |
| | | const isOrderPage = pageType.value === "order"; |
| | | const { data } = await (isOrderPage ? queryList2 : queryList)( |
| | | routeInfo.value.bomId |
| | | ); |
| | | bomDataValue.value.dataList = data || []; |
| | | normalizeTreeData(bomDataValue.value.dataList); |
| | | } catch (err) { |
| | |
| | | productModelId: undefined, |
| | | processId: "", |
| | | processName: "", |
| | | operationId: "", |
| | | [pageType.value === "order" ? "technologyOperationId" : "operationId"]: |
| | | "", |
| | | operationName: "", |
| | | unitQuantity: 1, |
| | | demandedQuantity: 0, |
| | |
| | | productModelId: undefined, |
| | | processId: "", |
| | | processName: "", |
| | | operationId: "", |
| | | [pageType.value === "order" ? "technologyOperationId" : "operationId"]: |
| | | "", |
| | | operationName: "", |
| | | unitQuantity: 1, |
| | | demandedQuantity: 0, |
| | |
| | | |
| | | const handleSaveBom = () => { |
| | | bomDataValue.value.loading = true; |
| | | console.log(bomDataValue.value.dataList, "bomDataValue.value.dataList"); |
| | | |
| | | normalizeTreeData(bomDataValue.value.dataList); |
| | | |
| | | const valid = validateAllBom(); |
| | | if (valid) { |
| | | addBomDetail({ |
| | | bomId: routeInfo.value.bomId, |
| | | bomId: Number(routeInfo.value.bomId), |
| | | children: buildSubmitTree(bomDataValue.value.dataList || []), |
| | | }) |
| | | .then(() => { |