feat: 生产管理初步重构

This commit is contained in:
砂糖
2025-08-25 18:06:32 +08:00
parent 781c7f8bac
commit 49cca6281d
31 changed files with 3981 additions and 990 deletions

View File

@@ -19,24 +19,6 @@
<el-tab-pane label="生产任务管理" name="batch">
<BatchPanel :planId="planId" v-if="activeTab === 'batch'" />
</el-tab-pane>
<!-- <el-tab-pane label="计划明细" name="detail">
<el-button type="primary" size="mini" style="float:right" @click="openDetailDialog()">新增明细</el-button>
<el-table :data="detailList" v-loading="loading" style="width: 100%" v-if="activeTab === 'detail'">
<el-table-column prop="detailId" label="明细ID" align="center" />
<el-table-column prop="lineName" label="产线名称" align="center" />
<el-table-column prop="batchNo" label="批次号" align="center" />
<el-table-column prop="quantity" label="排产数量" align="center" />
<el-table-column prop="startDate" label="开始日期" align="center" />
<el-table-column prop="endDate" label="结束日期" align="center" />
<el-table-column prop="remark" label="备注" align="center" />
<el-table-column label="操作" align="center" width="120">
<template slot-scope="scope">
<el-button size="mini" type="text" @click="openDetailDialog(scope.row)">编辑</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane> -->
</el-tabs>
<el-dialog :title="detailDialogTitle" :visible.sync="detailDialogVisible" width="700px"

View File

@@ -1,34 +1,29 @@
<template>
<div class="app-container">
<el-row style="margin-bottom: 20px; padding: 0 10px;">
<!-- 任务列表容器 -->
<div class="task-list-container">
<!-- 单个任务项 -->
<div v-for="(item, index) in taskList"
:key="index"
class="task-item"
:style="{marginBottom: index === taskList.length - 1 ? '0' : '20px'}">
<!-- 产品信息区域 -->
<div class="product-info-wrapper">
<ProductInfo :productId="item && item[0] && item[0].productId" />
</div>
<!-- 工艺流程区域 -->
<div class="process-flow-container">
<div v-for="(process, pIndex) in item"
:key="process.processId"
class="process-item"
:style="{
marginRight: pIndex !== item.length - 1 ? '15px' : '0',
// 最后一个工艺项不加右侧间距
}">
<CraftInfo :craftId="process.processId" />
<el-row>
<!-- 任务列表容器 -->
<div class="task-list-container">
<!-- 单个任务项 -->
<div v-for="(item, index) in taskList" :key="index" class="task-item"
:style="{ marginBottom: index === taskList.length - 1 ? '0' : '20px' }">
<!-- 产品信息区域 -->
<div class="product-info-wrapper">
<ProductInfo :productId="item && item[0] && item[0].productId" />
</div>
<!-- 工艺流程区域 -->
<div class="process-flow-container">
<div v-for="(process, pIndex) in item" :key="process.processId" class="process-item" :style="{
marginRight: pIndex !== item.length - 1 ? '15px' : '0',
// 最后一个工艺项不加右侧间距
}">
<CraftInfo :craftId="process.processId" />
</div>
</div>
</div>
</div>
</div>
</div>
</el-row>
</el-row>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
@@ -63,7 +58,8 @@
<el-table-column label="生产任务总数量" align="center" prop="totalQuantity" />
<el-table-column label="合并来源" align="center" prop="mergeSource">
<template slot-scope="scope">
<div v-for="item in scope.row.mergeSource.split(',')" style="display: flex; align-items: center; justify-content: center; gap: 10px;" :key="item">
<div v-for="item in scope.row.mergeSource.split(',')"
style="display: flex; align-items: center; justify-content: center; gap: 10px;" :key="item">
<ProductInfo :productId="getTaskInfo(item).productId" />
<CraftInfo :craftId="getTaskInfo(item).processId" />
</div>
@@ -106,12 +102,8 @@
<el-input v-model="form.totalQuantity" placeholder="请输入批次总数量" />
</el-form-item> -->
<el-form-item label="合并来源" prop="mergeSource">
<merge-source-selector
v-model="form.mergeSource"
:unmerged-tasks="unmergedTaskList"
:all-tasks="allTasks"
@change="handleMergeSourceChange"
/>
<merge-source-selector v-model="form.mergeSource" :unmerged-tasks="unmergedTaskList" :all-tasks="allTasks"
@change="handleMergeSourceChange" />
<!-- <el-input v-model="form.mergeSource" type="textarea" placeholder="请输入内容" /> -->
</el-form-item>
<el-form-item label="预计开始时间" prop="estimatedStartTime">
@@ -457,9 +449,11 @@ export default {
/* 产品信息容器 */
.product-info-wrapper {
min-width: 180px; /* 固定产品信息宽度,保证对齐 */
min-width: 180px;
/* 固定产品信息宽度,保证对齐 */
padding: 8px 0;
border-right: 1px dashed #e5e7eb; /* 分隔线 */
border-right: 1px dashed #e5e7eb;
/* 分隔线 */
margin-right: 15px;
}
@@ -467,23 +461,22 @@ export default {
.process-flow-container {
display: flex;
flex-wrap: wrap;
gap: 12px; /* 工艺项之间的间距 */
gap: 12px;
/* 工艺项之间的间距 */
padding: 8px 0;
flex: 1; /* 占满剩余空间 */
flex: 1;
/* 占满剩余空间 */
}
/* 单个工艺项样式 */
.process-item {
flex: 0 0 auto; /* 不自动拉伸 */
padding: 8px 12px;
border-radius: 4px;
flex: 0 0 auto;
background-color: #fff;
border: 1px solid #eee;
transition: border-color 0.2s ease;
}
.process-item:hover {
border-color: #409eff; /* 高亮边框 */
border-color: #409eff;
/* 高亮边框 */
}
</style>