Commit cda88459 authored by 高宇's avatar 高宇

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

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