feat(wms): 退火计划选择合同提前
- 在退火计划表格中添加合同号选择功能,支持远程搜索和下拉选择 - 更新数据库表结构,在wms_furnace_plan_coil表中新增contract_id字段 - 修改后端实体类将contractNo改为contractId,并更新相关映射配置 - 调整前端页面布局,将左右两列比例从12:12调整为10:14 - 优化退火完成验证逻辑,要求所有钢卷必须绑定合同后才能完成操作 - 修复材料网格布局样式,改为固定2列显示 - 添加订单列表加载和搜索功能,支持按关键词过滤 - 更新完成退火对话框提示文案,明确合同绑定要求
This commit is contained in:
@@ -36,6 +36,9 @@ CREATE TABLE IF NOT EXISTS wms_furnace_plan_coil (
|
|||||||
plan_coil_id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
plan_coil_id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
||||||
plan_id BIGINT NOT NULL COMMENT '计划ID',
|
plan_id BIGINT NOT NULL COMMENT '计划ID',
|
||||||
coil_id BIGINT NOT NULL COMMENT '钢卷ID',
|
coil_id BIGINT NOT NULL COMMENT '钢卷ID',
|
||||||
|
logic_warehouse_id BIGINT NULL COMMENT '逻辑库区去向(钢卷退火后目标逻辑库区)',
|
||||||
|
furnace_level TINYINT(1) NULL COMMENT '炉火层级(1=一层,2=二层,3=三层)',
|
||||||
|
contract_id BIGINT NULL COMMENT '合同ID',
|
||||||
del_flag TINYINT DEFAULT 0 COMMENT '删除标记(0正常 1删除)',
|
del_flag TINYINT DEFAULT 0 COMMENT '删除标记(0正常 1删除)',
|
||||||
create_by VARCHAR(64) NULL,
|
create_by VARCHAR(64) NULL,
|
||||||
update_by VARCHAR(64) NULL,
|
update_by VARCHAR(64) NULL,
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
@pagination="getList" />
|
@pagination="getList" />
|
||||||
|
|
||||||
<el-row :gutter="20" class="mt16">
|
<el-row :gutter="20" class="mt16">
|
||||||
<el-col :span="12">
|
<el-col :span="10">
|
||||||
<div class="custom-panel">
|
<div class="custom-panel">
|
||||||
<div class="panel-header">
|
<div class="panel-header">
|
||||||
<span class="panel-title">领料列表</span>
|
<span class="panel-title">领料列表</span>
|
||||||
@@ -102,7 +102,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="14">
|
||||||
<div class="custom-panel">
|
<div class="custom-panel">
|
||||||
<div class="panel-header">
|
<div class="panel-header">
|
||||||
<span class="panel-title">退火计划</span>
|
<span class="panel-title">退火计划</span>
|
||||||
@@ -136,8 +136,33 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="入场卷号" align="center" prop="enterCoilNo" />
|
<el-table-column label="入场卷号" align="center" prop="enterCoilNo" />
|
||||||
<el-table-column label="当前卷号" align="center" prop="coil.currentCoilNo" />
|
<el-table-column label="当前卷号" align="center" prop="coil.currentCoilNo" />
|
||||||
|
<el-table-column label="合同号" align="center" prop="contractId" width="200">
|
||||||
<el-table-column label="创建时间" align="center" prop="action" width="200">
|
<template slot-scope="scope">
|
||||||
|
<el-select
|
||||||
|
v-model="scope.row.contractId"
|
||||||
|
placeholder="搜索"
|
||||||
|
filterable
|
||||||
|
remote
|
||||||
|
:remote-method="(q) => remoteSearchOrders(q)"
|
||||||
|
:loading="orderLoading"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
@change="handleContractIdChange(scope.row)"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in orderList"
|
||||||
|
:key="item.orderId"
|
||||||
|
:label="`${item.contractCode} - ${item.companyName}`"
|
||||||
|
:value="item.orderId"
|
||||||
|
>
|
||||||
|
<span style="font-weight:bold">{{ item.contractCode }}</span>
|
||||||
|
<span style="color:#8492a6;font-size:13px;margin-left:8px">{{ item.companyName }}</span>
|
||||||
|
<span style="color:#c0c4cc;font-size:12px;float:right">{{ item.salesman }}</span>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="创建时间" align="center" prop="action">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-date-picker style="width: 185px" v-model="scope.row.createTime" type="datetime"
|
<el-date-picker style="width: 185px" v-model="scope.row.createTime" type="datetime"
|
||||||
value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择创建时间" @change="handlePLanCoilChange(scope.row)" />
|
value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择创建时间" @change="handlePLanCoilChange(scope.row)" />
|
||||||
@@ -159,7 +184,7 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-dialog title="完成退火" :visible.sync="completeOpen" width="800px" append-to-body>
|
<el-dialog title="完成退火" :visible.sync="completeOpen" width="800px" append-to-body>
|
||||||
<div class="complete-tip">请为每条钢卷分配逻辑库区去向和关联合同,未分配将无法完成。</div>
|
<div class="complete-tip">请确认每条钢卷的逻辑库区去向,所有钢卷须已在明细中绑定合同。</div>
|
||||||
<el-table :data="completeCoils" v-loading="completeLoading" height="360px">
|
<el-table :data="completeCoils" v-loading="completeLoading" height="360px">
|
||||||
<el-table-column label="入场钢卷号" prop="enterCoilNo" align="center" />
|
<el-table-column label="入场钢卷号" prop="enterCoilNo" align="center" />
|
||||||
<el-table-column label="钢卷去向" align="center" width="270">
|
<el-table-column label="钢卷去向" align="center" width="270">
|
||||||
@@ -170,11 +195,9 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="关联合同" align="center" width="270">
|
<el-table-column label="合同" align="center" width="140">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div style="width: 100%; display: flex; align-items: center;">
|
<span>{{ scope.row.contractCode || '-' }}</span>
|
||||||
<ContractSelect v-model="scope.row.contractId" placeholder="请选择合同" />
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -238,6 +261,7 @@
|
|||||||
import { listAnnealPlan, updateAnnealPlanCoil, getAnnealPlan, addAnnealPlan, updateAnnealPlan, delAnnealPlan, changeAnnealPlanStatus, inFurnace, completeAnnealPlan, listAnnealPlanCoils, bindAnnealPlanCoils, unbindAnnealPlanCoil } from "@/api/wms/annealPlan";
|
import { listAnnealPlan, updateAnnealPlanCoil, getAnnealPlan, addAnnealPlan, updateAnnealPlan, delAnnealPlan, changeAnnealPlanStatus, inFurnace, completeAnnealPlan, listAnnealPlanCoils, bindAnnealPlanCoils, unbindAnnealPlanCoil } from "@/api/wms/annealPlan";
|
||||||
import { listAnnealFurnace } from "@/api/wms/annealFurnace";
|
import { listAnnealFurnace } from "@/api/wms/annealFurnace";
|
||||||
import { listMaterialCoil } from "@/api/wms/coil";
|
import { listMaterialCoil } from "@/api/wms/coil";
|
||||||
|
import { listOrder } from "@/api/crm/order";
|
||||||
import { listCoilContractRel } from '@/api/wms/coilContractRel';
|
import { listCoilContractRel } from '@/api/wms/coilContractRel';
|
||||||
import { listWarehouse } from '@/api/wms/warehouse'
|
import { listWarehouse } from '@/api/wms/warehouse'
|
||||||
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||||
@@ -279,6 +303,8 @@ export default {
|
|||||||
},
|
},
|
||||||
currentPlan: {},
|
currentPlan: {},
|
||||||
coilList: [],
|
coilList: [],
|
||||||
|
orderList: [],
|
||||||
|
orderLoading: false,
|
||||||
materialLoading: false,
|
materialLoading: false,
|
||||||
materialTotal: 0,
|
materialTotal: 0,
|
||||||
materialList: [],
|
materialList: [],
|
||||||
@@ -303,6 +329,7 @@ export default {
|
|||||||
floatLayerConfig: {
|
floatLayerConfig: {
|
||||||
columns: [
|
columns: [
|
||||||
{ label: '入场钢卷号', prop: 'enterCoilNo' },
|
{ label: '入场钢卷号', prop: 'enterCoilNo' },
|
||||||
|
{ label: '合同号', prop: 'contractId' },
|
||||||
{ label: '当前钢卷号', prop: 'coil.currentCoilNo' },
|
{ label: '当前钢卷号', prop: 'coil.currentCoilNo' },
|
||||||
{ label: '厂家卷号', prop: 'coil.supplierCoilNo' },
|
{ label: '厂家卷号', prop: 'coil.supplierCoilNo' },
|
||||||
{ label: '逻辑库位', prop: 'coil.warehouseName' },
|
{ label: '逻辑库位', prop: 'coil.warehouseName' },
|
||||||
@@ -332,6 +359,7 @@ export default {
|
|||||||
this.loadFurnaces();
|
this.loadFurnaces();
|
||||||
this.getMaterialCoils();
|
this.getMaterialCoils();
|
||||||
this.loadWarehouses();
|
this.loadWarehouses();
|
||||||
|
this.loadOrderList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getList() {
|
getList() {
|
||||||
@@ -363,6 +391,33 @@ export default {
|
|||||||
this.loadPlanCoils();
|
this.loadPlanCoils();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
handleContractIdChange(row) {
|
||||||
|
updateAnnealPlanCoil(row).then(() => {
|
||||||
|
this.$message.success('合同号已更新');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
loadOrderList() {
|
||||||
|
this.orderLoading = true;
|
||||||
|
listOrder({ pageNum: 1, pageSize: 100 }).then(response => {
|
||||||
|
this.orderList = response.rows || [];
|
||||||
|
this.orderLoading = false;
|
||||||
|
}).catch(() => {
|
||||||
|
this.orderLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
remoteSearchOrders(query) {
|
||||||
|
if (query) {
|
||||||
|
this.orderLoading = true;
|
||||||
|
listOrder({ pageNum: 1, pageSize: 20, keyword: query }).then(response => {
|
||||||
|
this.orderList = response.rows || [];
|
||||||
|
this.orderLoading = false;
|
||||||
|
}).catch(() => {
|
||||||
|
this.orderLoading = false;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.loadOrderList();
|
||||||
|
}
|
||||||
|
},
|
||||||
getMaterialCoils() {
|
getMaterialCoils() {
|
||||||
this.materialLoading = true;
|
this.materialLoading = true;
|
||||||
listMaterialCoil(this.materialQueryParams).then(response => {
|
listMaterialCoil(this.materialQueryParams).then(response => {
|
||||||
@@ -397,17 +452,10 @@ export default {
|
|||||||
...item,
|
...item,
|
||||||
coilId: item.coilId,
|
coilId: item.coilId,
|
||||||
enterCoilNo: item.enterCoilNo,
|
enterCoilNo: item.enterCoilNo,
|
||||||
warehouseId: item.logicWarehouseId || null
|
warehouseId: item.logicWarehouseId || null,
|
||||||
|
contractId: item.contractId || null,
|
||||||
|
contractCode: (this.orderList.find(o => o.orderId === item.contractId) || {}).contractCode || null,
|
||||||
}));
|
}));
|
||||||
// 查询每个钢卷绑定的合同号作为默认值
|
|
||||||
for (const coil of this.completeCoils) {
|
|
||||||
listCoilContractRel({ coilId: coil.coilId }).then(res => {
|
|
||||||
const rows = res.rows || []
|
|
||||||
if (rows.length > 0 && rows[0].contractId) {
|
|
||||||
this.$set(coil, 'contractId', rows[0].contractId)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
this.completeLoading = false;
|
this.completeLoading = false;
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.completeLoading = false;
|
this.completeLoading = false;
|
||||||
@@ -585,9 +633,14 @@ export default {
|
|||||||
warehouseId: item.warehouseId,
|
warehouseId: item.warehouseId,
|
||||||
contractId: item.contractId,
|
contractId: item.contractId,
|
||||||
}));
|
}));
|
||||||
const missing = locations.filter(item => !item.warehouseId || !item.contractId);
|
const missingWarehouse = locations.filter(item => !item.warehouseId);
|
||||||
if (missing.length > 0) {
|
if (missingWarehouse.length > 0) {
|
||||||
this.$message.warning('请先为所有钢卷分配实际库位和关联合同');
|
this.$message.warning('请先为所有钢卷分配实际库位');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const missingContract = locations.filter(item => !item.contractId);
|
||||||
|
if (missingContract.length > 0) {
|
||||||
|
this.$message.warning('请先在明细中为所有钢卷绑定合同后再完成退火');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.completeLoading = true;
|
this.completeLoading = true;
|
||||||
@@ -703,8 +756,7 @@ export default {
|
|||||||
/* ========== 修复在这里 ========== */
|
/* ========== 修复在这里 ========== */
|
||||||
.material-grid {
|
.material-grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
/* 核心修复:去掉固定 4 列,改用自动填充,实现真正自适应 */
|
grid-template-columns: repeat(2, 1fr);
|
||||||
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
|
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
min-height: 120px;
|
min-height: 120px;
|
||||||
/* 必须加,让 grid 不受父级弹性压缩影响 */
|
/* 必须加,让 grid 不受父级弹性压缩影响 */
|
||||||
@@ -712,15 +764,6 @@ export default {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 媒体查询只需要控制最小宽度即可,不用写死列数 */
|
|
||||||
@media (max-width: 768px) {
|
|
||||||
.material-grid {
|
|
||||||
grid-template-columns: 1fr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* =============================== */
|
|
||||||
|
|
||||||
.material-card {
|
.material-card {
|
||||||
border: 1px solid #e9ecf2;
|
border: 1px solid #e9ecf2;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
@@ -806,3 +849,6 @@ export default {
|
|||||||
padding-bottom: 40px;
|
padding-bottom: 40px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<style>
|
||||||
|
html { overflow-y: scroll; }
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -47,9 +47,9 @@ public class WmsFurnacePlanCoil extends BaseEntity {
|
|||||||
private Integer furnaceLevel;
|
private Integer furnaceLevel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 合同号
|
* 合同ID
|
||||||
*/
|
*/
|
||||||
private String contractNo;
|
private Long contractId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除标志(0=正常,1=已删除)
|
* 删除标志(0=正常,1=已删除)
|
||||||
|
|||||||
@@ -43,9 +43,9 @@ public class WmsFurnacePlanCoilBo extends BaseEntity {
|
|||||||
private Integer furnaceLevel;
|
private Integer furnaceLevel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 合同号
|
* 合同ID
|
||||||
*/
|
*/
|
||||||
private String contractNo;
|
private Long contractId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 钢卷ID列表(逗号分隔)
|
* 钢卷ID列表(逗号分隔)
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ public class WmsFurnacePlanCoilVo {
|
|||||||
@ExcelProperty(value = "炉火层级")
|
@ExcelProperty(value = "炉火层级")
|
||||||
private Integer furnaceLevel;
|
private Integer furnaceLevel;
|
||||||
|
|
||||||
@ExcelProperty(value = "合同号")
|
@ExcelProperty(value = "合同ID")
|
||||||
private String contractNo;
|
private Long contractId;
|
||||||
|
|
||||||
@ExcelProperty(value = "入场钢卷号")
|
@ExcelProperty(value = "入场钢卷号")
|
||||||
private String enterCoilNo;
|
private String enterCoilNo;
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public class WmsFurnacePlanCoilServiceImpl implements IWmsFurnacePlanCoilService
|
|||||||
lqw.eq(bo.getCoilId() != null, WmsFurnacePlanCoil::getCoilId, bo.getCoilId());
|
lqw.eq(bo.getCoilId() != null, WmsFurnacePlanCoil::getCoilId, bo.getCoilId());
|
||||||
lqw.eq(bo.getLogicWarehouseId() != null, WmsFurnacePlanCoil::getLogicWarehouseId, bo.getLogicWarehouseId());
|
lqw.eq(bo.getLogicWarehouseId() != null, WmsFurnacePlanCoil::getLogicWarehouseId, bo.getLogicWarehouseId());
|
||||||
lqw.eq(bo.getFurnaceLevel() != null, WmsFurnacePlanCoil::getFurnaceLevel, bo.getFurnaceLevel());
|
lqw.eq(bo.getFurnaceLevel() != null, WmsFurnacePlanCoil::getFurnaceLevel, bo.getFurnaceLevel());
|
||||||
lqw.eq(bo.getContractNo() != null, WmsFurnacePlanCoil::getContractNo, bo.getContractNo());
|
lqw.eq(bo.getContractId() != null, WmsFurnacePlanCoil::getContractId, bo.getContractId());
|
||||||
return lqw;
|
return lqw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -392,6 +392,11 @@ public class WmsFurnacePlanServiceImpl implements IWmsFurnacePlanService {
|
|||||||
if (targetLocation == null) {
|
if (targetLocation == null) {
|
||||||
throw new ServiceException("钢卷" + coil.getEnterCoilNo() + "未分配库位");
|
throw new ServiceException("钢卷" + coil.getEnterCoilNo() + "未分配库位");
|
||||||
}
|
}
|
||||||
|
// 校验合同ID:必须所有钢卷都已绑定合同
|
||||||
|
Long contractId = contractIdMap.get(coil.getCoilId());
|
||||||
|
if (contractId == null) {
|
||||||
|
throw new ServiceException("钢卷" + coil.getEnterCoilNo() + "未绑定合同,请先在明细中设置合同");
|
||||||
|
}
|
||||||
|
|
||||||
WmsMaterialCoil oldCoil = materialCoilMapper.selectById(coil.getCoilId());
|
WmsMaterialCoil oldCoil = materialCoilMapper.selectById(coil.getCoilId());
|
||||||
if (oldCoil == null) {
|
if (oldCoil == null) {
|
||||||
@@ -414,7 +419,7 @@ public class WmsFurnacePlanServiceImpl implements IWmsFurnacePlanService {
|
|||||||
updateBo.setStatus(0);
|
updateBo.setStatus(0);
|
||||||
updateBo.setExportBy(null);
|
updateBo.setExportBy(null);
|
||||||
updateBo.setExportTime(null);
|
updateBo.setExportTime(null);
|
||||||
updateBo.setContractId(contractIdMap.get(coil.getCoilId()));
|
updateBo.setContractId(contractId);
|
||||||
|
|
||||||
materialCoilService.updateByBo(updateBo, "annealing");
|
materialCoilService.updateByBo(updateBo, "annealing");
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<result property="coilId" column="coil_id"/>
|
<result property="coilId" column="coil_id"/>
|
||||||
<result property="logicWarehouseId" column="logic_warehouse_id"/>
|
<result property="logicWarehouseId" column="logic_warehouse_id"/>
|
||||||
<result property="furnaceLevel" column="furnace_level"/>
|
<result property="furnaceLevel" column="furnace_level"/>
|
||||||
<result property="contractNo" column="contract_no"/>
|
<result property="contractId" column="contract_id"/>
|
||||||
<result property="delFlag" column="del_flag"/>
|
<result property="delFlag" column="del_flag"/>
|
||||||
<result property="createBy" column="create_by"/>
|
<result property="createBy" column="create_by"/>
|
||||||
<result property="updateBy" column="update_by"/>
|
<result property="updateBy" column="update_by"/>
|
||||||
|
|||||||
@@ -3976,6 +3976,7 @@ CREATE TABLE `wms_furnace_plan_coil` (
|
|||||||
`coil_id` bigint NOT NULL COMMENT '钢卷ID',
|
`coil_id` bigint NOT NULL COMMENT '钢卷ID',
|
||||||
`logic_warehouse_id` bigint NULL DEFAULT NULL COMMENT '逻辑库区去向(钢卷退火后目标逻辑库区)',
|
`logic_warehouse_id` bigint NULL DEFAULT NULL COMMENT '逻辑库区去向(钢卷退火后目标逻辑库区)',
|
||||||
`furnace_level` tinyint(1) NULL DEFAULT NULL COMMENT '炉火层级(1=一层,2=二层,3=三层)',
|
`furnace_level` tinyint(1) NULL DEFAULT NULL COMMENT '炉火层级(1=一层,2=二层,3=三层)',
|
||||||
|
`contract_id` bigint NULL DEFAULT NULL COMMENT '合同ID',
|
||||||
`del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标记(0正常 1删除)',
|
`del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标记(0正常 1删除)',
|
||||||
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
|
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
|
||||||
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
|
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
|
||||||
|
|||||||
Reference in New Issue
Block a user