fix(PdiList): 修改顺序号生成逻辑,改为基于前一条记录+1

移除自动生成的批次编号和顺序号逻辑,改为在前一条记录的顺序号基础上+1
This commit is contained in:
砂糖
2026-04-10 08:22:24 +08:00
parent 27f01f478f
commit 742802d7db

View File

@@ -362,20 +362,24 @@ export default {
this.form.coilid = newCoilid this.form.coilid = newCoilid
} }
} }
// 批次编号:如果是新批次则使用自动生成的,否则+1 // 顺序号自动+1
if (nextNums.rollprogramnb) { if (lastRecord.sequencenb) {
this.form.rollprogramnb = nextNums.rollprogramnb this.form.sequencenb = lastRecord.sequencenb + 1
} }
// 批次编号:如果是新批次则使用自动生成的,否则+1
// if (nextNums.rollprogramnb) {
// this.form.rollprogramnb = nextNums.rollprogramnb
// }
// 顺序号:使用自动生成的顺序号 // 顺序号:使用自动生成的顺序号
this.form.sequencenb = nextNums.sequencenb // this.form.sequencenb = nextNums.sequencenb
} else { } else {
this.form = EMPTY() this.form = EMPTY()
// 批次编号:使用自动生成的批次编号 // 批次编号:使用自动生成的批次编号
if (nextNums.rollprogramnb) { // if (nextNums.rollprogramnb) {
this.form.rollprogramnb = nextNums.rollprogramnb // this.form.rollprogramnb = nextNums.rollprogramnb
} // }
// 顺序号默认为1 // 顺序号默认为1
this.form.sequencenb = nextNums.sequencenb // this.form.sequencenb = nextNums.sequencenb
} }
this.dialogVisible = true this.dialogVisible = true
this.$nextTick(() => this.$refs.pdiForm && this.$refs.pdiForm.clearValidate()) this.$nextTick(() => this.$refs.pdiForm && this.$refs.pdiForm.clearValidate())
@@ -426,7 +430,7 @@ export default {
if (this.config.quickAdd) { if (this.config.quickAdd) {
// 不关闭弹窗,继续新增下一个 // 不关闭弹窗,继续新增下一个
// 获取下一个批次编号和顺序号 // 获取下一个批次编号和顺序号
const nextNums = await this.loadNextNumbers() // const nextNums = await this.loadNextNumbers()
// 卷号自动+1 // 卷号自动+1
if (this.form.coilid) { if (this.form.coilid) {
const coilid = this.form.coilid const coilid = this.form.coilid
@@ -438,11 +442,15 @@ export default {
this.form.coilid = newCoilid this.form.coilid = newCoilid
} }
} }
// 批次编号和顺序号使用自动生成的 // 顺序号自动+1
if (nextNums.rollprogramnb) { if (this.form.sequencenb) {
this.form.rollprogramnb = nextNums.rollprogramnb this.form.sequencenb = this.form.sequencenb + 1
} }
this.form.sequencenb = nextNums.sequencenb // 批次编号和顺序号使用自动生成的
// if (nextNums.rollprogramnb) {
// this.form.rollprogramnb = nextNums.rollprogramnb
// }
// this.form.sequencenb = nextNums.sequencenb
// 清空表单验证 // 清空表单验证
this.$nextTick(() => this.$refs.pdiForm && this.$refs.pdiForm.clearValidate()) this.$nextTick(() => this.$refs.pdiForm && this.$refs.pdiForm.clearValidate())
} else { } else {