Commit cda88459 authored by 高宇's avatar 高宇

1.默认将小写字母换成大写字母

parent 1b859f58
......@@ -209,3 +209,8 @@ export function successAudio(start) {
}
}
// 自定义转换成大写的
export function customUpperCase(sourceStr) {
return sourceStr && sourceStr !== ''? sourceStr.toUpperCase : sourceStr
}
......@@ -79,7 +79,7 @@
<script>
import manufacturer from "@/data/jsonData";
import { handleOutWarehouse, persistOut } from '@/api/outcomeWmsJbapplyTemp'
import { getDict } from '@/api/system/dict/data'
import {customUpperCase} from "@/utils/common";
import { playAudio, successAudio } from '@/utils/common'
export default {
......@@ -137,6 +137,7 @@ export default {
this.getDetail()
},
methods: {
customUpperCase,
getLabelByCj(value) {
const obj = manufacturer.find(item => item.value === value)
return obj ? obj.label : null
......@@ -186,7 +187,7 @@ export default {
var list = []
// 判断tableList中location和search及lot相同的元素个数
this.tableList.forEach((item, index) => {
if (item.location.toUpperCase() === search.toUpperCase() && item.lot.toUpperCase() === lot.toUpperCase()) {
if (customUpperCase(item.location) === customUpperCase(search) && customUpperCase(item.lot)=== customUpperCase(lot)()) {
list.push(index)
}
})
......@@ -199,8 +200,8 @@ export default {
}
if (list.length > 1) {
// 是否能从储存中找到location
if (this.storeList.find(Litem => Litem.location.toUpperCase() === search.toUpperCase() && Litem.lot.toUpperCase() === lot.toUpperCase())) {
var index = this.storeList.findIndex(Litem => Litem.location.toUpperCase() === search.toUpperCase() && Litem.lot.toUpperCase() === lot.toUpperCase())
if (this.storeList.find(Litem => customUpperCase(Litem.location) === customUpperCase(search) && customUpperCase(Litem.lot) === customUpperCase(lot))) {
var index = this.storeList.findIndex(Litem => customUpperCase(Litem.location)=== customUpperCase(search)&& customUpperCase(Litem.lot)=== customUpperCase(lot))
this.storeList[index].frequency = this.storeList[index].frequency + 1
if (this.storeList[index].frequency < this.storeList[index].list.length) {
last.index = this.storeList[index].list[this.storeList[index].frequency]
......@@ -251,12 +252,12 @@ export default {
let oneLot = ''
let twoLot = ''
if (item.lot && item.lot !== '') {
oneLot = item.lot.toUpperCase()
oneLot = customUpperCase(item.lot)
}
if (lot && lot !== '') {
twoLot = lot.toUpperCase()
twoLot = customUpperCase(lot)
}
if (item.location.toUpperCase() === search.toUpperCase() && oneLot === twoLot) {
if (customUpperCase(item.location) === customUpperCase(search) && oneLot === twoLot) {
obj.list.push(index)
}
})
......@@ -321,7 +322,7 @@ export default {
judgePush(data) {
let isLegalLocation = false
this.tableList.forEach(item => {
if (item.location.toUpperCase() === data.toUpperCase()) {
if (customUpperCase(item.location) === customUpperCase(data)) {
isLegalLocation = true
}
})
......@@ -365,7 +366,7 @@ export default {
}
/** ptyp为1的时候*/
if (this.form.ptype === '1') {
if (obj.pn.toUpperCase() !== this.form.pn.toUpperCase() || obj.lot.toUpperCase() !== this.form.lot.toUpperCase() || obj.rank.toUpperCase() !== this.form.rank.toUpperCase()) {
if (customUpperCase(obj.pn) !== customUpperCase(this.form.pn) || customUpperCase(obj.lot) !== customUpperCase(this.form.lot)|| customUpperCase(obj.rank) !== customUpperCase(this.form.rank)) {
playAudio(true)
this.$message.error({
message: '输入不符合要求请重新输入!',
......@@ -400,7 +401,7 @@ export default {
}
} else {
// ptype不为1的时候
if (obj.pn.toUpperCase() !== this.form.pn.toUpperCase() || obj.lot.toUpperCase() !== this.form.lot.toUpperCase()) {
if (customUpperCase(obj.pn) !== customUpperCase(this.form.pn) || customUpperCase(obj.lot) !== customUpperCase(this.form.lot)) {
playAudio(true)
this.$message.error({
message: '输入不符合要求请重新输入!',
......
......@@ -57,7 +57,7 @@
import { handleOutWarehouse, persistOut } from '@/api/setup/applicationTable'
import { getDict } from '@/api/system/dict/data'
import {playAudio, successAudio} from '@/utils/common'
import {customUpperCase} from "@/utils/common";
export default {
name: 'Dispose',
data() {
......@@ -94,6 +94,7 @@ export default {
this.getDetail()
},
methods: {
customUpperCase,
/**
* @description: 一开始将焦点聚焦到第一个输入框下
* @author: gaoyu
......@@ -158,7 +159,7 @@ export default {
var list = []
// 判断tableList中location和search相同的元素个数
this.tableList.forEach((item, index) => {
if (item.location.toUpperCase() === search.toUpperCase()) {
if (customUpperCase(item.location) === customUpperCase(search)) {
list.push(index)
}
})
......@@ -170,8 +171,8 @@ export default {
}
if (list.length > 1) {
// 是否能从储存中找到location
if (this.storeList.find(Litem => Litem.location.toUpperCase() === search.toUpperCase())) {
var index = this.storeList.findIndex(Litem => Litem.location.toUpperCase() === search.toUpperCase())
if (this.storeList.find(Litem => customUpperCase(Litem.location) === customUpperCase(search))) {
var index = this.storeList.findIndex(Litem => customUpperCase(Litem.location) === customUpperCase(search))
this.storeList[index].frequency = this.storeList[index].frequency + 1
if (this.storeList[index].frequency < this.storeList[index].list.length) {
last.index = this.storeList[index].list[this.storeList[index].frequency]
......@@ -213,7 +214,7 @@ export default {
}
// 判断tableList中location和search相同的元素个数
this.tableList.forEach((item, index) => {
if (item.location.toUpperCase() === search.toUpperCase()) {
if (customUpperCase(item.location) === customUpperCase(search)) {
obj.list.push(index)
}
})
......
......@@ -92,13 +92,13 @@
<script>
import manufacturer from "@/data/jsonData";
import {
batchAddIncomeWmsBox, checkIsZero, getJcCode, queryPass
batchAddIncomeWmsBox, checkIsZero, getJcCode
} from '@/api/incomeWmsBox'
import { findByLocation, updateIncomeWmsLabel } from '@/api/incomeWmsLabel'
import { findByLocation } from '@/api/incomeWmsLabel'
import { getInfo } from '@/api/login'
import { getDict } from '@/api/system/dict/data'
import { playAudio, successAudio } from '@/utils/common'
import {customUpperCase} from "@/utils/common";
export default {
name: 'EnterBound',
data() {
......@@ -153,6 +153,7 @@ export default {
this.queryForm.cj = this.manufacturer[0].value
},
methods: {
customUpperCase,
/**
* @description: 获取数据字典
* @author: gaoyu
......@@ -458,7 +459,7 @@ export default {
// this.incomeWmsBoxList.pn = values[1]
if (obj.labelId !== null && obj.labelId !== '' && obj.labelId !== undefined) {
if (this.incomeWmsLabelList.pn && this.incomeWmsLabelList.pn !== '' && this.incomeWmsLabelList.pn !== undefined) {
if (obj.pn.toUpperCase() !== this.incomeWmsLabelList.pn.toUpperCase()) {
if (customUpperCase(obj.pn)!== customUpperCase( this.incomeWmsLabelList.pn)) {
playAudio(true)
this.$message.error({
message: '输入的pn值:' + obj.pn + '与数据库中pn值:' + this.incomeWmsLabelList.pn + '不匹配,请重新输入',
......@@ -472,12 +473,12 @@ export default {
} else {
let isLegalLot = false
this.enterTable.forEach(item => {
if (item.lot.toUpperCase() === obj.lot.toUpperCase() ) {
if (customUpperCase(item.lot) === customUpperCase(obj.lot) ) {
isLegalLot = true
}
})
if (isLegalLot) {
if (this.enterTable[0].pn.toUpperCase() === obj.pn.toUpperCase()) {
if (customUpperCase(this.enterTable[0].pn) === customUpperCase(obj.pn)) {
successAudio(true)
this.enterTable.push(obj)
this.incomeWmsBoxList.pn = obj.pn
......@@ -501,7 +502,7 @@ export default {
if (res.code === 200) {
if (res.data) {
if (this.enterTable.length > 0) {
if (this.enterTable[0].pn.toUpperCase() === obj.pn.toUpperCase()) {
if (customUpperCase(this.enterTable[0].pn) === customUpperCase(obj.pn)) {
successAudio(true)
this.enterTable.push(obj)
this.incomeWmsBoxList.pn = obj.pn
......@@ -549,12 +550,12 @@ export default {
if (res.data != null) {
let isLegalLot = false
this.enterTable.forEach(item => {
if (item.lot.toUpperCase() === obj.lot.toUpperCase() ) {
if (customUpperCase(item.lot) === customUpperCase(obj.lot) ) {
isLegalLot = true
}
})
if (isLegalLot) {
if (this.enterTable[0].pn.toUpperCase() === obj.pn.toUpperCase()) {
if (customUpperCase(this.enterTable[0].pn) === customUpperCase(obj.pn)) {
successAudio(true)
this.enterTable.push(obj)
this.incomeWmsBoxList.pn = obj.pn
......@@ -578,7 +579,7 @@ export default {
if (res.code === 200) {
if (res.data) {
if (this.enterTable.length > 0) {
if (this.enterTable[0].pn.toUpperCase() === obj.pn.toUpperCase() ) {
if (customUpperCase(this.enterTable[0].pn) === customUpperCase(obj.pn) ) {
successAudio(true)
this.enterTable.push(obj)
this.incomeWmsBoxList.pn = obj.pn
......
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