数量盘点入库-优化
This commit is contained in:
parent
a2cc2bb7c6
commit
e5cf171d6d
|
|
@ -229,18 +229,18 @@
|
||||||
<el-input
|
<el-input
|
||||||
v-model="codeForm.codeSuffixStart"
|
v-model="codeForm.codeSuffixStart"
|
||||||
clearable
|
clearable
|
||||||
placeholder="请输入后缀范围"
|
placeholder="请输入后缀范围起始值"
|
||||||
style="width: 185px"
|
style="width: 185px"
|
||||||
@input="changeInput(codeForm.codeSuffixStart)"
|
@change="changeSuffixStart(codeForm.codeSuffixStart)"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="~" label-width="auto" prop="codeSuffixEnd" v-if="!isNumCheck">
|
<el-form-item label="~" label-width="auto" prop="codeSuffixEnd" v-if="!isNumCheck">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="codeForm.codeSuffixEnd"
|
v-model="codeForm.codeSuffixEnd"
|
||||||
clearable
|
clearable
|
||||||
placeholder="请输入后缀范围"
|
placeholder="请输入后缀范围结束值"
|
||||||
style="width: 185px"
|
style="width: 185px"
|
||||||
@input="changeInput(codeForm.codeSuffixEnd)"
|
@change="changeSuffixEnd"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
@ -734,7 +734,11 @@ export default {
|
||||||
// 根据this.codeForm.num的数量, 往this.codeTableList中添加this.codeForm的数据
|
// 根据this.codeForm.num的数量, 往this.codeTableList中添加this.codeForm的数据
|
||||||
for (let i = 0; i < this.codeForm.num; i++) {
|
for (let i = 0; i < this.codeForm.num; i++) {
|
||||||
// 设备编码: 前缀 拼接 后缀
|
// 设备编码: 前缀 拼接 后缀
|
||||||
let suffix = (parseInt(this.codeForm.codeSuffixStart) + i).toString().padStart(this.codeForm.codeSuffixStart?.length, '0')
|
let suffix = parseInt(this.codeForm.codeSuffixStart) + i
|
||||||
|
if (suffix > parseInt(this.codeForm.codeSuffixEnd)) {
|
||||||
|
suffix = parseInt(this.codeForm.codeSuffixEnd)
|
||||||
|
}
|
||||||
|
suffix = suffix.toString().padStart(this.codeForm.codeSuffixStart?.length, '0')
|
||||||
// console.log('🚀 ~ fillCodeForm ~ suffix:', suffix);
|
// console.log('🚀 ~ fillCodeForm ~ suffix:', suffix);
|
||||||
suffix = isNaN(suffix) ? '' : suffix
|
suffix = isNaN(suffix) ? '' : suffix
|
||||||
const maCode = `${this.codeForm.codePrefix || ''}${suffix}`
|
const maCode = `${this.codeForm.codePrefix || ''}${suffix}`
|
||||||
|
|
@ -761,11 +765,28 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/** 输入框改变 */
|
/** 输入框改变 */
|
||||||
changeInput(num) {
|
changeSuffixStart(num) {
|
||||||
if (isNaN(num)) {
|
if (isNaN(num)) {
|
||||||
this.$message.error('请输入数字类型')
|
this.$message.error('后缀范围请输入数字类型')
|
||||||
this.codeForm.codeSuffixStart = this.codeForm.codeSuffixStart.replace(/[^\d]/g, '')
|
this.codeForm.codeSuffixStart = this.codeForm.codeSuffixStart.replace(/[^\d]/g, '')
|
||||||
}
|
}
|
||||||
|
if (!this.codeForm.codeSuffixStart) {
|
||||||
|
this.codeForm.codeSuffixEnd = ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
changeSuffixEnd() {
|
||||||
|
if (!this.codeForm.codeSuffixStart) {
|
||||||
|
this.$message.error('请输入后缀范围起始值')
|
||||||
|
this.codeForm.codeSuffixEnd = ''
|
||||||
|
} else if (isNaN(this.codeForm.codeSuffixEnd)) {
|
||||||
|
this.$message.error('后缀范围请输入数字类型')
|
||||||
|
this.codeForm.codeSuffixEnd = this.codeForm.codeSuffixStart.replace(/[^\d]/g, '')
|
||||||
|
} else {
|
||||||
|
if (parseInt(this.codeForm.codeSuffixStart) > parseInt(this.codeForm.codeSuffixEnd)) {
|
||||||
|
this.$message.error('后缀结束值不能小于起始值')
|
||||||
|
this.codeForm.codeSuffixEnd = +this.codeForm.codeSuffixStart + 1
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
handleResetRow(row) {
|
handleResetRow(row) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue