diff --git a/src/views/modules/part/bomManagement.vue b/src/views/modules/part/bomManagement.vue index 12761d6..a24bc9d 100644 --- a/src/views/modules/part/bomManagement.vue +++ b/src/views/modules/part/bomManagement.vue @@ -4531,19 +4531,26 @@ export default { }) }, + normalizeComponentPartInput () { + const normalizedComponentPart = (this.componentData.componentPart || '').toString().trim().toUpperCase() + this.componentData.componentPart = normalizedComponentPart + return normalizedComponentPart + }, + // 子物料编码失焦事件 componentPartBlur () { - if (this.componentData.componentPart != null && this.componentData.componentPart !== '') { - this.tryAutoFillWidthByPartNo(this.componentData.componentPart) + const normalizedComponentPart = this.normalizeComponentPartInput() + if (normalizedComponentPart !== '') { + this.tryAutoFillWidthByPartNo(normalizedComponentPart) this.componentPartData.limit = this.pageSize3 this.componentPartData.page = this.pageIndex3 - this.componentPartData.ifsPartNo = this.componentData.componentPart + this.componentPartData.ifsPartNo = normalizedComponentPart queryPartListAll(this.componentPartData).then(({data}) => { if (data && data.code === 0 && data.page.list.length === 1) { this.componentData.componentPartDesc = data.page.list[0].partDesc this.componentData.printUnit = data.page.list[0].printUnit this.componentData.printUnitName = data.page.list[0].printUnitName - this.tryAutoFillWidthByPartNo(this.componentData.componentPart) + this.tryAutoFillWidthByPartNo(normalizedComponentPart) } else { this.componentData.componentPartDesc = '' this.componentData.printUnit = '' @@ -4920,7 +4927,8 @@ export default { this.$message.warning('请填写主记录BOM版本号!') return } - if (this.componentData.componentPart === '' || this.componentData.componentPart == null) { + const normalizedComponentPart = this.normalizeComponentPartInput() + if (normalizedComponentPart === '') { this.$message.warning('请选择子物料编码!') return } diff --git a/src/views/modules/part/recipeManagement.vue b/src/views/modules/part/recipeManagement.vue index 3dda380..842f7d4 100644 --- a/src/views/modules/part/recipeManagement.vue +++ b/src/views/modules/part/recipeManagement.vue @@ -3973,12 +3973,19 @@ export default { }) }, + normalizeComponentPartInput () { + const normalizedComponentPart = (this.componentData.componentPart || '').toString().trim().toUpperCase() + this.componentData.componentPart = normalizedComponentPart + return normalizedComponentPart + }, + // 子物料编码失焦事件 componentPartBlur () { - if (this.componentData.componentPart != null && this.componentData.componentPart !== '') { + const normalizedComponentPart = this.normalizeComponentPartInput() + if (normalizedComponentPart !== '') { this.componentPartData.limit = this.pageSize3 this.componentPartData.page = this.pageIndex3 - this.componentPartData.partNo = this.componentData.componentPart + this.componentPartData.partNo = normalizedComponentPart queryPartListAll(this.componentPartData).then(({data}) => { if (data && data.code === 0) { if (data.page.list.length === 1) { @@ -4210,7 +4217,8 @@ export default { this.$message.warning('请填写主记录Recipe版本号!') return } - if (this.componentData.componentPart === '' || this.componentData.componentPart == null) { + const normalizedComponentPart = this.normalizeComponentPartInput() + if (normalizedComponentPart === '') { this.$message.warning('请选择子物料编码!') return }