| | |
| | | </div> |
| | | <div class="info-item"> |
| | | <div class="info-label-wrapper"> |
| | | <span class="info-label">产品名称</span> |
| | | <span class="info-label">产品类型</span> |
| | | </div> |
| | | <div class="info-value-wrapper"> |
| | | <span class="info-value">{{ routeInfo.productName || '-' }}</span> |
| | | </div> |
| | | </div> |
| | | <div class="info-item"> |
| | | <div class="info-label-wrapper"> |
| | | <span class="info-label">规格名称</span> |
| | | </div> |
| | | <div class="info-value-wrapper"> |
| | | <span class="info-value">{{ routeInfo.model || '-' }}</span> |
| | | <span class="info-value">{{ routeInfo.dictLabel || '-' }}</span> |
| | | </div> |
| | | </div> |
| | | <div class="info-item"> |
| | |
| | | :data="tableData" |
| | | :header-cell-style="{ background: '#F0F1F5', color: '#333333' }" |
| | | row-key="id" |
| | | height="350" |
| | | tooltip-effect="dark" |
| | | style="margin-bottom: 20px;" |
| | | class="lims-table"> |
| | | <el-table-column align="center" |
| | | label="序号" |
| | |
| | | {{ getProcessName(scope.row.processId) || '-' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="产品名称" |
| | | prop="productName" |
| | | min-width="160" /> |
| | | <el-table-column label="规格名称" |
| | | prop="model" |
| | | min-width="140" /> |
| | | <el-table-column label="参数列表" |
| | | min-width="160"> |
| | | <template #default="scope"> |
| | |
| | | @click="handleViewParams(scope.row)">参数列表</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="单位" |
| | | prop="unit" |
| | | width="100" /> |
| | | <el-table-column label="是否质检" |
| | | prop="isQuality" |
| | | width="100"> |
| | | prop="isQuality"> |
| | | <template #default="scope"> |
| | | {{scope.row.isQuality ? "是" : "否"}} |
| | | <el-tag :type="scope.row.isQuality ? 'success' : 'danger'"> |
| | | {{scope.row.isQuality ? '是' : '否' }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" |
| | |
| | | size="small" |
| | | @click="handleEdit(scope.row)" |
| | | :disabled="scope.row.isComplete">编辑</el-button> |
| | | <!-- <el-button type="info" |
| | | link |
| | | size="small" |
| | | @click="handleViewParams(scope.row)">参数列表</el-button> --> |
| | | <el-button type="danger" |
| | | link |
| | | size="small" |
| | |
| | | </div> |
| | | <!-- 产品信息 --> |
| | | <div class="card-content"> |
| | | <div v-if="item.productName" |
| | | class="product-info"> |
| | | <div class="product-name">{{ item.productName }}</div> |
| | | <div v-if="item.model" |
| | | class="product-model"> |
| | | {{ item.model }} |
| | | <!-- <span v-if="item.unit" class="product-unit">{{ item.unit }}</span> --> |
| | | </div> |
| | | <el-tag type="primary" |
| | | class="product-tag" |
| | | v-if="item.isQuality">质检</el-tag> |
| | | </div> |
| | | <div v-else |
| | | class="product-info empty">暂无产品信息</div> |
| | | </div> |
| | | <!-- 操作按钮 --> |
| | | <div class="card-footer"> |
| | |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <div class="section-BOM"> |
| | | <div class="section-header"> |
| | | <div class="section-title">BOM</div> |
| | | </div> |
| | | <div> |
| | | <!-- BOM表格 --> |
| | | <el-table :data="bomTableData" |
| | | border |
| | | :preserve-expanded-content="false" |
| | | :default-expand-all="true" |
| | | style="width: 100%"> |
| | | <el-table-column type="expand"> |
| | | <template #default="props"> |
| | | <el-table :data="props.row.bomList" |
| | | row-key="id" |
| | | default-expand-all |
| | | :tree-props="{children: 'children', hasChildren: 'hasChildren'}" |
| | | style="width: 100%"> |
| | | <el-table-column prop="productName" |
| | | label="产品" /> |
| | | <el-table-column prop="model" |
| | | label="规格" /> |
| | | <el-table-column prop="processName" |
| | | label="消耗工序" /> |
| | | <el-table-column prop="unitQuantity" |
| | | label="单位产出所需数量" /> |
| | | <el-table-column prop="unit" |
| | | label="单位" /> |
| | | </el-table> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="BOM编号" |
| | | prop="bomNo" /> |
| | | <el-table-column label="产品类型" |
| | | prop="dictLabel" /> |
| | | <!-- <el-table-column label="产品编码" |
| | | prop="productCode" /> |
| | | <el-table-column label="产品名称" |
| | | prop="productName" /> |
| | | <el-table-column label="规格型号" |
| | | prop="model" /> --> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | | <!-- 新增/编辑弹窗 --> |
| | | <el-dialog v-model="dialogVisible" |
| | | :title="operationType === 'add' ? '新增工艺路线项目' : '编辑工艺路线项目'" |
| | |
| | | :label="process.name" |
| | | :value="process.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="产品名称" |
| | | prop="productModelId"> |
| | | <el-button type="primary" |
| | | @click="showProductSelectDialog = true"> |
| | | {{ form.productName && form.model |
| | | ? `${form.productName} - ${form.model}` |
| | | : '选择产品' }} |
| | | </el-button> |
| | | </el-form-item> |
| | | <el-form-item label="单位" |
| | | prop="unit"> |
| | | <el-input v-model="form.unit" |
| | | :placeholder="form.productModelId ? '根据选择的产品自动带出' : '请先选择产品'" |
| | | clearable |
| | | :disabled="true" /> |
| | | </el-form-item> |
| | | <el-form-item label="是否质检" |
| | | prop="isQuality"> |
| | |
| | | sortRouteItem, |
| | | } from "@/api/productionManagement/productProcessRoute.js"; |
| | | import { processList } from "@/api/productionManagement/productionProcess.js"; |
| | | import { queryList } from "@/api/productionManagement/productStructure.js"; |
| | | import { useRoute } from "vue-router"; |
| | | import { ElMessageBox, ElMessage } from "element-plus"; |
| | | import Sortable from "sortablejs"; |
| | |
| | | productName: "", |
| | | model: "", |
| | | bomNo: "", |
| | | dictLabel: "", |
| | | bomId: null, |
| | | description: "", |
| | | }); |
| | |
| | | const showParamListDialog = ref(false); |
| | | const currentProcess = ref(null); |
| | | const paramList = ref([]); |
| | | const bomTableData = ref([]); |
| | | let tableSortable = null; |
| | | let cardSortable = null; |
| | | |
| | |
| | | |
| | | const rules = { |
| | | processId: [{ required: true, message: "请选择工序", trigger: "change" }], |
| | | productModelId: [ |
| | | { required: true, message: "请选择产品", trigger: "change" }, |
| | | ], |
| | | }; |
| | | |
| | | // 根据工序ID获取工序名称 |
| | |
| | | productName: route.query.productName || "", |
| | | model: route.query.model || "", |
| | | bomNo: route.query.bomNo || "", |
| | | dictLabel: route.query.dictLabel || "", |
| | | bomId: route.query.bomId || null, |
| | | description: route.query.description || "", |
| | | }; |
| | | |
| | | // 如果有bomId,获取BOM数据 |
| | | if (routeInfo.value.bomId) { |
| | | queryList(routeInfo.value.bomId) |
| | | .then(res => { |
| | | if (res.data) { |
| | | bomTableData.value = [ |
| | | { |
| | | bomNo: routeInfo.value.bomNo, |
| | | dictLabel: routeInfo.value.dictLabel, |
| | | productCode: "", |
| | | productName: routeInfo.value.productName, |
| | | model: routeInfo.value.model, |
| | | bomList: res.data, |
| | | }, |
| | | ]; |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | console.error("获取BOM数据失败:", err); |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | // 新增 |
| | |
| | | <style scoped> |
| | | .card-container { |
| | | padding: 20px 0; |
| | | /* height: 350px; */ |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .cards-wrapper { |
| | |
| | | opacity: 0.8; |
| | | } |
| | | |
| | | /* 表格视图样式 */ |
| | | :deep(.el-table__row) { |
| | | /* 表格视图样式 - 仅应用于项目列表 */ |
| | | :deep(.lims-table .el-table__row) { |
| | | transition: background-color 0.2s; |
| | | cursor: move; |
| | | } |
| | | |
| | | :deep(.el-table__row:hover) { |
| | | :deep(.lims-table .el-table__row:hover) { |
| | | background-color: #f9fafc !important; |
| | | } |
| | | |
| | |
| | | |
| | | .route-info { |
| | | display: grid; |
| | | grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); |
| | | grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); |
| | | gap: 16px; |
| | | padding: 4px; |
| | | } |