From 3f300e05e9a6849b282e4d7b8ff19df26460a92c Mon Sep 17 00:00:00 2001
From: 86156 <823267011@qq.com>
Date: Sun, 19 Apr 2026 14:27:05 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E8=A7=84=E7=A8=8B?=
=?UTF-8?q?=E7=AE=A1=E7=90=86sql?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
script/sql/mysql/spec.sql | 83 +++++++++++++++++++++++++++++++++++++++
1 file changed, 83 insertions(+)
create mode 100644 script/sql/mysql/spec.sql
diff --git a/script/sql/mysql/spec.sql b/script/sql/mysql/spec.sql
new file mode 100644
index 00000000..6edb883b
--- /dev/null
+++ b/script/sql/mysql/spec.sql
@@ -0,0 +1,83 @@
+create table wms_process_spec
+(
+ spec_id bigint auto_increment comment '规程ID'
+ primary key,
+ spec_code varchar(50) not null comment '规程编号',
+ spec_name varchar(100) not null comment '规程名称',
+ spec_type varchar(20) not null comment '规程类型(PROCESS=工艺规程,STANDARD=工艺标准)',
+ line_id bigint not null comment '产线ID',
+ product_type varchar(50) null comment '产品类型(如HB)',
+ is_enabled tinyint(1) default 1 not null comment '是否启用',
+ remark varchar(255) null comment '备注',
+ create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
+ create_by varchar(50) null comment '创建人',
+ update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间',
+ update_by varchar(50) null comment '更新人',
+ constraint uk_spec_code
+ unique (spec_code)
+)
+ comment '规程/工艺标准主表'
+ engine = InnoDB
+ row_format = DYNAMIC;
+
+
+create table wms_process_spec_version
+(
+ version_id bigint auto_increment comment '版本ID'
+ primary key,
+ spec_id bigint not null comment '规程ID',
+ version_code varchar(50) not null comment '版本号',
+ is_active tinyint(1) default 0 not null comment '是否当前生效版本',
+ status tinyint(1) default 1 not null comment '状态(0=禁用,1=启用)',
+ remark varchar(255) null comment '备注',
+ create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
+ create_by varchar(50) null comment '创建人',
+ update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间',
+ update_by varchar(50) null comment '更新人',
+ constraint uk_spec_version
+ unique (spec_id, version_code)
+)
+ comment '规程版本表'
+ engine = InnoDB
+ row_format = DYNAMIC;
+
+
+create table wms_process_plan
+(
+ plan_id bigint auto_increment comment '方案ID'
+ primary key,
+ version_id bigint not null comment '版本ID',
+ segment_type varchar(50) not null comment '段类型(入口段/工艺段/出口段)',
+ segment_name varchar(100) not null comment '段名称',
+ point_name varchar(100) not null comment '点位名称',
+ point_code varchar(100) null comment '点位编码',
+ actual_point_id bigint null comment '实际点位ID(设备点位)',
+ unit varchar(20) null comment '单位',
+ remark varchar(255) null comment '备注',
+ create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
+ create_by varchar(50) null comment '创建人',
+ update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间',
+ update_by varchar(50) null comment '更新人'
+)
+ comment '方案详情(段+点位)'
+ engine = InnoDB
+ row_format = DYNAMIC;
+
+create table wms_process_plan_param
+(
+ param_id bigint auto_increment comment '参数ID'
+ primary key,
+ plan_id bigint not null comment '方案ID',
+ param_name varchar(100) not null comment '参数名称(如L1设定值)',
+ target_value decimal(18, 4) null comment '设定值',
+ lower_limit decimal(18, 4) null comment '下限',
+ upper_limit decimal(18, 4) null comment '上限',
+ unit varchar(20) null comment '单位',
+ create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
+ create_by varchar(50) null comment '创建人',
+ update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间',
+ update_by varchar(50) null comment '更新人'
+)
+ comment '方案参数配置'
+ engine = InnoDB
+ row_format = DYNAMIC;
From cdcf5e24282ff0a2ea1c87ec7069481eb733d143 Mon Sep 17 00:00:00 2001
From: 86156 <823267011@qq.com>
Date: Sun, 19 Apr 2026 14:29:57 +0800
Subject: [PATCH 2/3] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E8=A7=84=E7=A8=8B?=
=?UTF-8?q?=E7=AE=A1=E7=90=86sql?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
script/sql/mysql/spec.sql | 50 +++++++++++++++++++++++----------------
1 file changed, 30 insertions(+), 20 deletions(-)
diff --git a/script/sql/mysql/spec.sql b/script/sql/mysql/spec.sql
index 6edb883b..7f632341 100644
--- a/script/sql/mysql/spec.sql
+++ b/script/sql/mysql/spec.sql
@@ -7,7 +7,8 @@ create table wms_process_spec
spec_type varchar(20) not null comment '规程类型(PROCESS=工艺规程,STANDARD=工艺标准)',
line_id bigint not null comment '产线ID',
product_type varchar(50) null comment '产品类型(如HB)',
- is_enabled tinyint(1) default 1 not null comment '是否启用',
+ is_enabled tinyint(1) default 1 not null comment '是否启用(0=否,1=是)',
+ del_flag tinyint(1) default 0 not null comment '删除标志(0=未删除,1=已删除)',
remark varchar(255) null comment '备注',
create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
create_by varchar(50) null comment '创建人',
@@ -27,8 +28,9 @@ create table wms_process_spec_version
primary key,
spec_id bigint not null comment '规程ID',
version_code varchar(50) not null comment '版本号',
- is_active tinyint(1) default 0 not null comment '是否当前生效版本',
+ is_active tinyint(1) default 0 not null comment '是否当前生效版本(1=是)',
status tinyint(1) default 1 not null comment '状态(0=禁用,1=启用)',
+ del_flag tinyint(1) default 0 not null comment '删除标志',
remark varchar(255) null comment '备注',
create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
create_by varchar(50) null comment '创建人',
@@ -41,25 +43,27 @@ create table wms_process_spec_version
engine = InnoDB
row_format = DYNAMIC;
-
create table wms_process_plan
(
- plan_id bigint auto_increment comment '方案ID'
+ plan_id bigint auto_increment comment '方案ID'
primary key,
- version_id bigint not null comment '版本ID',
- segment_type varchar(50) not null comment '段类型(入口段/工艺段/出口段)',
- segment_name varchar(100) not null comment '段名称',
- point_name varchar(100) not null comment '点位名称',
- point_code varchar(100) null comment '点位编码',
- actual_point_id bigint null comment '实际点位ID(设备点位)',
- unit varchar(20) null comment '单位',
- remark varchar(255) null comment '备注',
- create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
- create_by varchar(50) null comment '创建人',
- update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间',
- update_by varchar(50) null comment '更新人'
+ version_id bigint not null comment '版本ID',
+ segment_type varchar(50) not null comment '段类型(INLET/PROCESS/OUTLET)',
+ segment_name varchar(100) not null comment '段名称',
+ point_name varchar(100) not null comment '点位名称',
+ point_code varchar(100) null comment '点位编码',
+ actual_point_id bigint null comment '实际点位ID(设备点位)',
+ sort_order int default 0 not null comment '排序',
+ del_flag tinyint(1) default 0 not null comment '删除标志',
+ remark varchar(255) null comment '备注',
+ create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
+ create_by varchar(50) null comment '创建人',
+ update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间',
+ update_by varchar(50) null comment '更新人',
+
+ index idx_version_id (version_id)
)
- comment '方案详情(段+点位)'
+ comment '方案点位表'
engine = InnoDB
row_format = DYNAMIC;
@@ -68,16 +72,22 @@ create table wms_process_plan_param
param_id bigint auto_increment comment '参数ID'
primary key,
plan_id bigint not null comment '方案ID',
- param_name varchar(100) not null comment '参数名称(如L1设定值)',
+ param_code varchar(50) not null comment '参数编码(TEMP/PRESS等)',
+ param_name varchar(100) not null comment '参数名称',
target_value decimal(18, 4) null comment '设定值',
lower_limit decimal(18, 4) null comment '下限',
upper_limit decimal(18, 4) null comment '上限',
unit varchar(20) null comment '单位',
+ sort_order int default 0 not null comment '排序',
+ del_flag tinyint(1) default 0 not null comment '删除标志',
+ remark varchar(255) null comment '备注',
create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
create_by varchar(50) null comment '创建人',
update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间',
- update_by varchar(50) null comment '更新人'
+ update_by varchar(50) null comment '更新人',
+
+ index idx_plan_id (plan_id)
)
- comment '方案参数配置'
+ comment '方案参数表'
engine = InnoDB
row_format = DYNAMIC;
From 4fefc68bbcf40fb6539410d73446b9ec1c60b964 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= <2178503051@qq.com>
Date: Mon, 20 Apr 2026 11:04:14 +0800
Subject: [PATCH 3/3] =?UTF-8?q?fix(wms):=20=E4=BF=AE=E5=A4=8D=E5=90=88?=
=?UTF-8?q?=E5=90=8CID=E4=B8=BA=E7=A9=BA=E6=97=B6=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E5=90=88=E5=90=8C=E5=85=B3=E7=B3=BB=E7=9A=84=E9=94=99=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
在合并、分条和批量分条操作中,当合同ID为空时不再尝试添加合同关系
同时优化批量分条时的合同关系添加逻辑,先过滤掉空合同ID
---
klp-ui/src/views/wms/coil/merge.vue | 10 ++++++----
klp-ui/src/views/wms/coil/panels/stepSplit.vue | 10 ++++++----
klp-ui/src/views/wms/coil/split.vue | 13 ++++++++-----
.../src/views/wms/report/template/comprehensive.vue | 4 ++--
4 files changed, 22 insertions(+), 15 deletions(-)
diff --git a/klp-ui/src/views/wms/coil/merge.vue b/klp-ui/src/views/wms/coil/merge.vue
index 41503338..1f6df764 100644
--- a/klp-ui/src/views/wms/coil/merge.vue
+++ b/klp-ui/src/views/wms/coil/merge.vue
@@ -766,10 +766,12 @@ export default {
const coilId = response.data;
- addCoilContractRel({
- coilId: coilId,
- contractId: this.targetCoil.contractId,
- })
+ if (this.targetCoil.contractId) {
+ addCoilContractRel({
+ coilId: coilId,
+ contractId: this.targetCoil.contractId,
+ })
+ }
this.$message.success('合卷保存成功');
// 延迟返回,让用户看到成功提示
diff --git a/klp-ui/src/views/wms/coil/panels/stepSplit.vue b/klp-ui/src/views/wms/coil/panels/stepSplit.vue
index cb9fdc68..c2c1a0ef 100644
--- a/klp-ui/src/views/wms/coil/panels/stepSplit.vue
+++ b/klp-ui/src/views/wms/coil/panels/stepSplit.vue
@@ -675,10 +675,12 @@ export default {
// 新增分条:调用创建接口
res = await createSpecialChild(this.coilId, this.actionId, splitData)
// 新增分条后,需要添加分条的合同关系
- addCoilContractRel({
- coilId: res.data.coilId,
- contractId: this.splitForm.contractId,
- })
+ if (this.splitForm.contractId) {
+ addCoilContractRel({
+ coilId: res.data.coilId,
+ contractId: this.splitForm.contractId,
+ })
+ }
}
this.$message.success(this.splitForm.coilId ? '编辑分条成功' : '新增分条成功')
diff --git a/klp-ui/src/views/wms/coil/split.vue b/klp-ui/src/views/wms/coil/split.vue
index ae430500..17871357 100644
--- a/klp-ui/src/views/wms/coil/split.vue
+++ b/klp-ui/src/views/wms/coil/split.vue
@@ -684,12 +684,15 @@ export default {
// 拿到多个子卷的coilId
const newCoilIds = response.msg.split(',');
+ // 先构建所有的请求体,并移除合同为空为空的项
+ const requests = newCoilIds.map((coilId, index) => ({
+ coilId,
+ contractId: this.splitList[index].contractId
+ }))
+ .filter(req => req.contractId);
// 为每个子卷添加合同关联
- Promise.all(newCoilIds.map(async (coilId, index) => {
- addCoilContractRel({
- coilId,
- contractId: this.splitList[index].contractId
- });
+ Promise.all(requests.map(async (req, index) => {
+ addCoilContractRel(req);
}));
// 如果是从待操作列表进来的,标记操作为完成
diff --git a/klp-ui/src/views/wms/report/template/comprehensive.vue b/klp-ui/src/views/wms/report/template/comprehensive.vue
index 04e7748b..d2b61d38 100644
--- a/klp-ui/src/views/wms/report/template/comprehensive.vue
+++ b/klp-ui/src/views/wms/report/template/comprehensive.vue
@@ -26,10 +26,10 @@
+ type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择开始日期">
至
+ type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择结束日期">