| | |
| | | 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="参数列表" |
| | |
| | | width="100"> |
| | | <template #default="scope"> |
| | | {{scope.row.isQuality ? "是" : "否"}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="是否生产" |
| | | prop="isProduction" |
| | | width="100"> |
| | | <template #default="scope"> |
| | | {{scope.row.isProduction ? "是" : "否"}} |
| | | </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"> |
| | |
| | | <el-tag type="primary" |
| | | class="product-tag" |
| | | v-if="item.isQuality">质检</el-tag> |
| | | <el-tag type="primary" |
| | | class="product-tag" |
| | | :style="item.isQuality?'margin-left:8px':''" |
| | | v-if="item.isProduction">生产</el-tag> |
| | | </div> |
| | | <div v-else |
| | | class="product-info empty">暂无产品信息</div> |
| | |
| | | :default-expand-all="true" |
| | | style="width: 100%"> |
| | | <el-table-column type="expand"> |
| | | <template #default="props"> |
| | | <el-form ref="form" |
| | | <template #default> |
| | | <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" /> |
| | | <!-- 新增/编辑弹窗 --> |
| | |
| | | <el-select v-model="form.technologyOperationId" |
| | | placeholder="请选择工序" |
| | | clearable |
| | | @change="processChange" |
| | | style="width: 100%"> |
| | | <el-option v-for="process in processOptions" |
| | | :key="process.id" |
| | |
| | | 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" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | |
| | | <!-- 参数列表对话框 --> |
| | | <!-- :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" |
| | |
| | | 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, |
| | |
| | | import { listProcessBom } from "@/api/productionManagement/productionOrder.js"; |
| | | import { |
| | | queryList, |
| | | queryList2, |
| | | 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); |
| | |
| | | model: "", |
| | | unit: "", |
| | | isQuality: false, |
| | | isProduction: false, |
| | | }); |
| | | |
| | | const rules = { |
| | |
| | | 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(() => {}); |
| | | }; |
| | |
| | | model: row.model || "", |
| | | unit: row.unit || "", |
| | | isQuality: row.isQuality, |
| | | isProduction: row.isProduction, |
| | | }; |
| | | dialogVisible.value = true; |
| | | }; |
| | |
| | | |
| | | // 产品选择 |
| | | 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"); |
| | | } |
| | | }; |
| | | |
| | |
| | | |
| | | const addPromise = isOrderPage |
| | | ? addRouteItem({ |
| | | productOrderId: orderId.value, |
| | | productRouteId: routeId.value, |
| | | productOrderId: Number(orderId.value), |
| | | productRouteId: Number(routeId.value), |
| | | technologyOperationId: form.value.technologyOperationId, |
| | | productModelId: form.value.productModelId, |
| | | isQuality: form.value.isQuality, |
| | | isProduction: form.value.isProduction, |
| | | dragSort, |
| | | }) |
| | | : addOrUpdateProcessRouteItem({ |
| | |
| | | technologyOperationId: form.value.technologyOperationId, |
| | | productModelId: form.value.productModelId, |
| | | isQuality: form.value.isQuality, |
| | | isProduction: form.value.isProduction, |
| | | dragSort, |
| | | }); |
| | | |
| | |
| | | technologyOperationId: form.value.technologyOperationId, |
| | | productModelId: form.value.productModelId, |
| | | isQuality: form.value.isQuality, |
| | | isProduction: form.value.isProduction, |
| | | }) |
| | | : addOrUpdateProcessRouteItem1({ |
| | | technologyRoutingId: Number(routeId.value), |
| | |
| | | productModelId: form.value.productModelId, |
| | | id: form.value.id, |
| | | isQuality: form.value.isQuality, |
| | | isProduction: form.value.isProduction, |
| | | }); |
| | | |
| | | updatePromise |
| | |
| | | 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 = |
| | |
| | | } |
| | | }); |
| | | }; |
| | | const processChange = value => { |
| | | processOptions.value.forEach(item => { |
| | | if (item.id == value) { |
| | | form.value.isQuality = item.isQuality; |
| | | form.value.isProduction = item.isProduction; |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | const handleBomProcessChange = (row, value) => { |
| | | row.processId = value || ""; |
| | |
| | | |
| | | 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) { |
| | |
| | | |
| | | 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(() => { |