feat(退火操作): 新增退火操作事件记录功能

添加退火操作事件API及页面,实现退火炉操作记录功能
在计划管理页面增加操作事件记录,包括入炉、完成、添加和解绑操作
This commit is contained in:
2026-04-16 17:12:08 +08:00
parent 28622a2b16
commit edcbf7a5f1
4 changed files with 506 additions and 8 deletions

View File

@@ -67,8 +67,8 @@
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click.stop="handleUpdate(scope.row)">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click.stop="handleDelete(scope.row)">删除</el-button>
<el-button size="mini" type="text" icon="el-icon-s-operation"
@click.stop="openStatusDialog(scope.row)">状态</el-button>
<!-- <el-button size="mini" type="text" icon="el-icon-s-operation"
@click.stop="openStatusDialog(scope.row)">状态</el-button> -->
<!-- <el-button v-if="scope.row.status === 0" size="mini" type="text" icon="el-icon-s-flag"
:disabled="!scope.row.coilCount" @click.stop="handleInFurnace(scope.row)">入炉</el-button> -->
<el-button v-if="scope.row.status === 2" size="mini" type="text" icon="el-icon-check"
@@ -153,6 +153,12 @@
</div> -->
</div>
<el-table :data="coilList" v-loading="coilLoading" class="light-table">
<el-table-column label="钢卷层级" align="center" width="80">
<template slot-scope="scope">
<el-input v-model="scope.row.furnaceLevel" placeholder="请输入钢卷层级"
@change="handlePLanCoilChange(scope.row)" />
</template>
</el-table-column>
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo" />
<el-table-column label="创建时间" align="center" prop="createTime">
<template slot-scope="scope">
@@ -166,7 +172,7 @@
</el-table-column>
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleUnbind(scope.row)">
<el-button v-if="currentPlan.status === 0" size="mini" type="text" icon="el-icon-delete" @click="handleUnbind(scope.row)">
{{ unbindLabel(currentPlan.status) }}
</el-button>
</template>
@@ -208,13 +214,13 @@
:value="item.furnaceId" />
</el-select>
</el-form-item>
<el-form-item label="状态" prop="status">
<!-- <el-form-item label="状态" prop="status">
<el-select v-model="form.status" placeholder="请选择">
<el-option label="未开始" :value="0" />
<el-option label="进行中" :value="2" />
<el-option label="已完成" :value="3" />
</el-select>
</el-form-item>
</el-form-item> -->
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
</el-form-item>
@@ -226,7 +232,7 @@
</el-dialog>
<el-dialog title="更新状态" :visible.sync="statusOpen" width="360px" append-to-body>
<el-form label-width="90px">
<!-- <el-form label-width="90px">
<el-form-item label="状态">
<el-select v-model="statusForm.status" placeholder="请选择">
<el-option label="未开始" :value="0" />
@@ -234,7 +240,7 @@
<el-option label="已完成" :value="3" />
</el-select>
</el-form-item>
</el-form>
</el-form> -->
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitStatus"> </el-button>
<el-button @click="statusOpen = false"> </el-button>
@@ -244,10 +250,11 @@
</template>
<script>
import { listAnnealPlan, getAnnealPlan, addAnnealPlan, updateAnnealPlan, delAnnealPlan, changeAnnealPlanStatus, inFurnace, completeAnnealPlan, listAnnealPlanCoils, bindAnnealPlanCoils, unbindAnnealPlanCoil } from "@/api/wms/annealPlan";
import { listAnnealPlan, getAnnealPlan, updateAnnealPlanCoil ,addAnnealPlan, updateAnnealPlan, delAnnealPlan, changeAnnealPlanStatus, inFurnace, completeAnnealPlan, listAnnealPlanCoils, bindAnnealPlanCoils, unbindAnnealPlanCoil } from "@/api/wms/annealPlan";
import { listAnnealFurnace } from "@/api/wms/annealFurnace";
import { listMaterialCoil } from "@/api/wms/coil";
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
import { addAnnealOperateEvent } from "@/api/wms/annealOperateEvent";
export default {
name: "AnnealPlan",
@@ -344,6 +351,13 @@ export default {
this.resetMaterialForm();
this.handleMaterialQuery();
},
handlePLanCoilChange(row) {
updateAnnealPlanCoil(row).then(() => {
this.$message.success('已更新');
}).finally(() => {
this.loadPlanCoils();
});
},
openCompleteDialog() {
if (!this.currentPlan.planId) {
this.$message.warning('请先选择计划');
@@ -382,7 +396,15 @@ export default {
coilId: item.coilId
}).then(() => {
this.$message.success('已加入计划');
// 查找对应id退火炉的名称
const targetFurnaceName = this.furnaceOptions.find(item => item.furnaceId === this.currentPlan.targetFurnaceId)?.furnaceName || '';
// anneal-todo: 新增操作事件
addAnnealOperateEvent({
annealFurnaceId: this.currentPlan.targetFurnaceId,
operateType: 'ADD',
operateContent: '钢卷号' + item.enterCoilNo + '加入退火炉' + targetFurnaceName,
coilId: item.coilId,
})
this.loadPlanCoils();
}).finally(() => {
this.coilLoading = false;
@@ -560,7 +582,15 @@ export default {
});
}).then(() => {
this.$message.success('解绑成功');
// 查找对应id退火炉的名称
const targetFurnaceName = this.furnaceOptions.find(item => item.furnaceId === this.currentPlan.targetFurnaceId)?.furnaceName || '';
// anneal-todo: 新增操作事件
addAnnealOperateEvent({
annealFurnaceId: this.currentPlan.targetFurnaceId,
operateType: 'UNBIND',
operateContent: '钢卷号' + row.enterCoilNo + '解绑退火炉' + targetFurnaceName,
coilId: row.coilId,
})
this.loadPlanCoils();
});
},