Commit cedeae8a authored by liwei's avatar liwei

Revert "去空格问题"

This reverts commit e74405dd
parent 55a6cf7b
......@@ -214,6 +214,6 @@ export function customUpperCase(sourceStr) {
return sourceStr && sourceStr !== '' ? sourceStr.toUpperCase() : sourceStr
}
export function trimAndUpperCaseStr(sourceStr) {
return sourceStr && sourceStr !== '' ? sourceStr.trim().toUpperCase() : sourceStr
export function UpperCaseStr(sourceStr) {
return sourceStr && sourceStr !== '' ? sourceStr.replace(/\s+/g, '').toUpperCase() : sourceStr
}
......@@ -64,7 +64,7 @@
import { handleOutWarehouse, persistOut } from '@/api/setup/applicationTable'
import { getDict } from '@/api/system/dict/data'
import { playAudio, successAudio, trimAndUpperCaseStr } from '@/utils/common'
import { playAudio, successAudio, UpperCaseStr } from '@/utils/common'
import { customUpperCase } from '@/utils/common'
export default {
name: 'Dispose',
......@@ -167,10 +167,9 @@ export default {
for (let i = 0; i < this.tableList.length; i++) {
const tableObj = this.tableList[i]
// 1. 匹配成功
if (trimAndUpperCaseStr(tableObj.location) === trimAndUpperCaseStr(location) &&
trimAndUpperCaseStr(tableObj.lot) === trimAndUpperCaseStr(lot) &&
this.formatCheBzq(tableObj.cheBzq) === this.formatCheBzq(cheBzq)) {
console.log('56565', cheBzq)
if (UpperCaseStr(tableObj.location) === UpperCaseStr(location) &&
UpperCaseStr(tableObj.lot) === UpperCaseStr(lot) &&
this.formatCheBzq(tableObj.cheBzq) === customUpperCase(cheBzq)) {
matchFlag = true
matchObj = tableObj
matchIndex = i
......@@ -221,7 +220,7 @@ export default {
judgePush(data) {
let isLegalLocation = false
this.tableList.forEach(item => {
if (trimAndUpperCaseStr(item.location) === trimAndUpperCaseStr(data)) {
if (UpperCaseStr(item.location) === UpperCaseStr(data)) {
isLegalLocation = true
}
})
......@@ -272,7 +271,7 @@ export default {
cj_name: values[5]
}
// 1. pn 校验
if (trimAndUpperCaseStr(obj.pn) !== trimAndUpperCaseStr(this.form.pn)) {
if (UpperCaseStr(obj.pn) !== UpperCaseStr(this.form.pn)) {
playAudio(true)
this.$message.error({
message: 'PN值不符合要求请重新输入!',
......@@ -332,8 +331,7 @@ export default {
}
},
formatCheBzq(date) {
const NewDate = date.trim()
return NewDate ? NewDate.split(' ')[0].replace(/-/g, '/') : ''
return date ? date.split(' ')[0].replace(/-/g, '/') : ''
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment