Commit cedeae8a authored by liwei's avatar liwei

Revert "去空格问题"

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