Commit a33fafb6 authored by 高宇's avatar 高宇

1.阻止表单的默认上传行为

parent 16c9408a
......@@ -32,7 +32,7 @@
<hr class="disposeHr">
<div class="disposeTable">
<div class="searchInput">
<el-form ref="formRef" :model="searchForm" :rules="rules" label-width="80px" class="formClass" label-position="right">
<el-form @submit.native.prevent ref="formRef" :model="searchForm" :rules="rules" label-width="80px" class="formClass" label-position="right">
<el-form-item label="位置" prop="search">
<el-input ref="input1" v-model="searchForm.search" clearable @keyup.enter.native="handleSearch" />
</el-form-item>
......@@ -174,7 +174,7 @@ export default {
var list = []
// 判断tableList中location和search及lot相同的元素个数
this.tableList.forEach((item, index) => {
if (item.location === search && item.lot === lot) {
if (item.location.toUpperCase() === search.toUpperCase() && item.lot.toUpperCase() === lot.toUpperCase()) {
list.push(index)
}
})
......@@ -187,8 +187,8 @@ export default {
}
if (list.length > 1) {
// 是否能从储存中找到location
if (this.storeList.find(Litem => Litem.location === search && Litem.lot === lot)) {
var index = this.storeList.findIndex(Litem => Litem.location === search && Litem.lot === lot)
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())
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]
......@@ -233,9 +233,10 @@ export default {
list: [],
frequency: 0
}
// 判断tableList中location和search相同的元素个数
this.tableList.forEach((item, index) => {
if (item.location === search && item.lot === lot) {
if (item.location.toUpperCase() === search.toUpperCase() && item.lot === lot) {
obj.list.push(index)
}
})
......@@ -302,7 +303,7 @@ export default {
judgePush(data) {
let isLegalLocation = false
this.tableList.forEach(item => {
if (item.location === data) {
if (item.location.toUpperCase() === data.toUpperCase()) {
isLegalLocation = true
}
})
......@@ -344,10 +345,9 @@ export default {
qty: parseInt(values[3]),
rank: values[2]
}
console.log(obj)
/** ptyp为1的时候*/
if (this.form.ptype === '1') {
if (obj.pn !== this.form.pn || obj.lot !== this.form.lot || obj.rank !== this.form.rank) {
if (obj.pn.toUpperCase() !== this.form.pn.toUpperCase() || obj.lot.toUpperCase() !== this.form.lot.toUpperCase() || obj.rank.toUpperCase() !== this.form.rank.toUpperCase()) {
playAudio(true)
this.$message.error({
message: '输入不符合要求请重新输入!',
......@@ -382,7 +382,7 @@ export default {
}
} else {
// ptype不为1的时候
if (obj.pn !== this.form.pn || obj.lot !== this.form.lot) {
if (obj.pn.toUpperCase() !== this.form.pn.toUpperCase() || obj.lot.toUpperCase() !== this.form.lot.toUpperCase()) {
playAudio(true)
this.$message.error({
message: '输入不符合要求请重新输入!',
......
......@@ -21,7 +21,7 @@
<hr class="disposeHr">
<div class="disposeTable">
<div class="searchInput">
<el-form ref="formRef" :model="searchForm" :rules="rules" label-width="80px" class="formClass" label-position="right">
<el-form @submit.native.prevent ref="formRef" :model="searchForm" :rules="rules" label-width="80px" class="formClass" label-position="right">
<el-form-item label="位置">
<el-input ref="input1" v-model="searchForm.search" clearable @keyup.enter.native="handleSearch" />
</el-form-item>
......@@ -158,7 +158,7 @@ export default {
var list = []
// 判断tableList中location和search相同的元素个数
this.tableList.forEach((item, index) => {
if (item.location === search) {
if (item.location.toUpperCase() === search.toUpperCase()) {
list.push(index)
}
})
......@@ -170,8 +170,8 @@ export default {
}
if (list.length > 1) {
// 是否能从储存中找到location
if (this.storeList.find(Litem => Litem.location === search)) {
var index = this.storeList.findIndex(Litem => Litem.location === search)
if (this.storeList.find(Litem => Litem.location.toUpperCase() === search.toUpperCase())) {
var index = this.storeList.findIndex(Litem => Litem.location.toUpperCase() === search.toUpperCase())
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 +213,7 @@ export default {
}
// 判断tableList中location和search相同的元素个数
this.tableList.forEach((item, index) => {
if (item.location === search) {
if (item.location.toUpperCase() === search.toUpperCase()) {
obj.list.push(index)
}
})
......
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