| | |
| | | style="width: 100%"> |
| | | <el-table-column type="expand"> |
| | | <template #default> |
| | | <el-form ref="form" |
| | | <el-form ref="bomFormRef" |
| | | :model="bomDataValue"> |
| | | <el-table :data="bomDataValue.dataList" |
| | | row-key="tempId" |
| | |
| | | prop="model" /> |
| | | </el-table> |
| | | <ProductSelectDialog v-if="bomDataValue.showProductDialog" |
| | | v-model:model-value="bomDataValue.showProductDialog" |
| | | v-model="bomDataValue.showProductDialog" |
| | | :single="true" |
| | | @confirm="handleBomProduct" /> |
| | | <!-- 新增/编辑弹窗 --> |
| | |
| | | prop="productModelId"> |
| | | <el-button type="primary" |
| | | @click="showProductSelectDialog = true"> |
| | | {{ form.productName && form.model |
| | | ? `${form.productName} - ${form.model}` |
| | | {{ form.productName |
| | | ? (form.model ? `${form.productName} - ${form.model}` : form.productName) |
| | | : '选择产品' }} |
| | | </el-button> |
| | | </el-form-item> |
| | |
| | | prop="isQuality"> |
| | | <el-switch v-model="form.isQuality" |
| | | :active-value="true" |
| | | inactive-value="false" /> |
| | | :inactive-value="false" /> |
| | | </el-form-item> |
| | | <el-form-item label="是否生产" |
| | | prop="isProduction"> |
| | | <el-switch v-model="form.isProduction" |
| | | :active-value="true" |
| | | inactive-value="false" /> |
| | | :inactive-value="false" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | |
| | | batchDeleteProcessRouteItem, |
| | | getProcessParamList, |
| | | } from "@/api/productionManagement/processRouteItem.js"; |
| | | import { syncProcessParamItem } from "@/api/productionManagement/processRouteItem.js"; |
| | | import { |
| | | syncProcessParamItem, |
| | | syncProcessParamItemOrder, |
| | | } from "@/api/productionManagement/processRouteItem.js"; |
| | | import { |
| | | findProductProcessRouteItemList, |
| | | deleteRouteItem, |
| | |
| | | queryList, |
| | | addBomDetail, |
| | | } from "@/api/productionManagement/productStructure.js"; |
| | | |
| | | import { useRoute } from "vue-router"; |
| | | import { ElMessageBox, ElMessage } from "element-plus"; |
| | | import Sortable from "sortablejs"; |
| | |
| | | const dialogVisible = ref(false); |
| | | const operationType = ref("add"); // add | edit |
| | | const formRef = ref(null); |
| | | const bomFormRef = ref(null); |
| | | const submitLoading = ref(false); |
| | | const cardsContainer = ref(null); |
| | | const tableRef = ref(null); |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | syncProcessParamItem({ |
| | | replaceExisting: true, |
| | | technologyRoutingOperationId: currentProcess.value.id, |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | ElMessage.success("同步成功"); |
| | | refreshParamList(); |
| | | } else { |
| | | ElMessage.error(res.msg || "同步失败"); |
| | | } |
| | | }); |
| | | if (pageType.value === "order") { |
| | | syncProcessParamItemOrder({ |
| | | replaceExisting: true, |
| | | technologyRoutingOperationId: currentProcess.value.id, |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | ElMessage.success("同步成功"); |
| | | refreshParamList(); |
| | | } else { |
| | | ElMessage.error(res.msg || "同步失败"); |
| | | } |
| | | }); |
| | | } else { |
| | | syncProcessParamItem({ |
| | | replaceExisting: true, |
| | | technologyRoutingOperationId: currentProcess.value.id, |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | ElMessage.success("同步成功"); |
| | | refreshParamList(); |
| | | } else { |
| | | ElMessage.error(res.msg || "同步失败"); |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | |
| | | |
| | | // 产品选择 |
| | | const handleProductSelect = products => { |
| | | console.log(products, "===products==="); |
| | | if (products && products.length > 0) { |
| | | const product = products[0]; |
| | | form.value.productModelId = product.id; |
| | | form.value.productName = product.productName; |
| | | form.value.model = product.model; |
| | | form.value.unit = product.unit || ""; |
| | | console.log(product, "product"); |
| | | form.value = { |
| | | ...form.value, |
| | | productModelId: product.id, |
| | | productName: product.productName, |
| | | model: product.model, |
| | | unit: product.unit || "", |
| | | }; |
| | | showProductSelectDialog.value = false; |
| | | // 触发表单验证 |
| | | formRef.value?.validateField("productModelId"); |
| | | // formRef.value?.validateField("productModelId"); |
| | | } |
| | | }; |
| | | |
| | |
| | | productName: "", |
| | | model: "", |
| | | unit: "", |
| | | isQuality: false, |
| | | isProduction: false, |
| | | }; |
| | | formRef.value?.resetFields(); |
| | | }; |
| | |
| | | currentProcess.value = row; |
| | | const query = { |
| | | technologyRoutingOperationId: row.id, |
| | | orderId: orderId.value, |
| | | productionOrderId: orderId.value, |
| | | }; |
| | | |
| | | const apiPromise = |