| | |
| | | <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"> |
| | |
| | | |
| | | const addPromise = isOrderPage |
| | | ? addRouteItem({ |
| | | productOrderId: Number(orderId.value), |
| | | productRouteId: Number(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; |
| | | }; |
| | |
| | | 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, |