Commit 374e85e7 authored by Hagsn3's avatar Hagsn3

修改代码

parent c53c9ce9
......@@ -93,3 +93,13 @@ export function batchAddIncomeWmsBox(data) {
}
})
}
export function checkIsZero(data) {
return request({
url: 'incomewmsbox/checkIsZero',
method: 'post',
data,
headers: {
'Content-Type': 'application/json;charset=UTF-8' // 接口修改传参类型
}
})
}
......@@ -55,7 +55,7 @@
<script>
import { handleOutWarehouse, persistOut } from '@/api/setup/applicationTable'
import {getDict} from "@/api/system/dict/data";
import { getDict } from '@/api/system/dict/data'
export default {
name: 'Dispose',
......@@ -105,21 +105,21 @@ export default {
})
},
getAllDict() {
getDict("APPLICATION_TYPE").then(res=> {
getDict('APPLICATION_TYPE').then(res => {
if (res.code === 200) {
console.log('res',res)
console.log('res', res)
this.typeList = res.data
}
})
},
getDictLabelByValue(list,value) {
getDictLabelByValue(list, value) {
let label = '-'
if (list &&list.length> 0 && value) {
if (list.find(item => item.dictValue === value)) {
label = list.find(item => item.dictValue === value).dictLabel
console.log('111')
return label
}
if (list && list.length > 0 && value) {
if (list.find(item => item.dictValue === value)) {
label = list.find(item => item.dictValue === value).dictLabel
console.log('111')
return label
}
}
return label
},
......@@ -156,46 +156,54 @@ export default {
if (this.storeList.length > 0) {
var list = []
// 判断tableList中location和search相同的元素个数
this.tableList.forEach((item,index) => {
this.tableList.forEach((item, index) => {
if (item.location === search) {
list.push(index)
}
})
if (list.length > 0) {
if (list.length === 1) {
last.index = list[0]
last.needNumber = this.tableList[list[0]].needNumber
return last
}
if (list.length > 1) {
// 是否能从储存中找到location
if (this.storeList.find(Litem => Litem.location === search)) {
var index = this.storeList.findIndex(Litem => Litem.location === 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]
last.needNumber = this.tableList[this.storeList[index].list[this.storeList[index].frequency]].needNumber
return last
} else {
return null
}
} else {
var objT= {
location: search,
list: list,
frequency: 0
}
this.storeList.push(objT)
last.index = list[0]
last.needNumber = this.tableList[list[0]].needNumber
return last
}
}
if (list.length === 1) {
last.index = list[0]
last.needNumber = this.tableList[list[0]].needNumber
return last
}
if (list.length > 1) {
// 是否能从储存中找到location
if (this.storeList.find(Litem => Litem.location === search)) {
var index = this.storeList.findIndex(Litem => Litem.location === 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]
last.needNumber = this.tableList[this.storeList[index].list[this.storeList[index].frequency]].needNumber
return last
} else {
return null
}
} else {
var objT = {
location: search,
list: list,
frequency: 0
}
this.storeList.push(objT)
last.index = list[0]
last.needNumber = this.tableList[list[0]].needNumber
return last
}
}
} else {
this.$message.error("请输入正确的地址")
return null;
const errorSound = new Audio(require('../../assets/audio/y1840.mp3'))
errorSound.play()
this.$message.error({
message: '输入的位置' + this.searchForm.search + '不正确请重新输入',
duration: 3000,
onClose: () => {
errorSound.pause()
}
})
this.searchForm.search = null
return null
}
} else {
// 向储存列表加数据
var obj = {
......@@ -204,13 +212,14 @@ export default {
frequency: 0
}
// 判断tableList中location和search相同的元素个数
this.tableList.forEach((item,index) => {
this.tableList.forEach((item, index) => {
if (item.location === search) {
obj.list.push(index)
}
})
if (obj.list.length > 0) {
if (obj.list.length === 1) {
this.storeList.push(obj)
last.index = obj.list[0]
last.needNumber = this.tableList[obj.list[0]].needNumber
return last
......@@ -223,16 +232,25 @@ export default {
return last
}
} else {
this.$message.error("请输入正确的地址")
return null;
const errorSound = new Audio(require('../../assets/audio/y1840.mp3'))
errorSound.play()
this.$message.error({
message: '输入的位置' + this.searchForm.search + '不正确请重新输入',
duration: 3000,
onClose: () => {
errorSound.pause()
}
})
this.searchForm.search = null
return null
}
console.log('判断tableList中location和search相同的元素个数',obj.list.length)
console.log('判断tableList中location和search相同的元素个数', obj.list.length)
}
},
// 查询回
handleSearch() {
var search = ''
if (this.searchForm.search && this.searchForm.search !== '' ) {
if (this.searchForm.search && this.searchForm.search !== '') {
if (this.searchForm.search.includes(',')) {
search = this.searchForm.search.split(',')[0]
} else {
......@@ -240,7 +258,7 @@ export default {
}
const obj = this.getIndexAndNeedNumber(search)
if (obj) {
const {index,needNumber} = obj
const { index, needNumber } = obj
if (!this.rowIndexList.includes(index)) {
this.rowIndexList.push(index)
}
......@@ -248,6 +266,12 @@ export default {
this.searchForm.search = ''
}
}
// this.tableList.forEach((item, index) => {
// if (item.location === this.searchForm.search) {
// this.rowIndexList.push(index)
// this.total = this.total + item.needNumber
// }
// })
},
// handleSearch() {
......@@ -290,10 +314,17 @@ export default {
this.$router.push({
path: '/setup/applicationTable'
})
this.$message.success({
message: '出库成功!',
duration: 2500
})
}
})
} else {
this.$message.warning('您所选择的库存数量小于您申请的数量')
this.$message.warning({
message: '您所选择的库存数量' + this.form.qty + '小于您申请的数量' + this.total,
duration: 2000
})
}
}
}
......
This diff is collapsed.
......@@ -210,7 +210,16 @@ export default {
that.$refs['input' + index].focus()
})
} else {
this.$message.error('location不匹配,请重新输入')
const errorSound = new Audio(require('../../assets/audio/y1840.mp3'))
errorSound.play()
this.$message.error({
message: '数据库中无对应' + location + '请重新输入',
duration: 2000,
onClose: () => {
errorSound.pause()
}
})
this.form.value1 = null
this.responsePn = null
this.form.location = null
this.form.labelId = null
......@@ -220,7 +229,15 @@ export default {
}
})
} else {
return this.$message.error('输入值不符合格式要求,请重新输入')
const errorSound = new Audio(require('../../assets/audio/y1840.mp3'))
errorSound.play()
return this.$message.error({
message: '输入值不符合格式要求,请重新输入',
duration: 2000,
onClose: () => {
errorSound.pause()
}
})
}
},
/**
......@@ -238,7 +255,16 @@ export default {
console.log('formPn', this.form.pn)
console.log('responsePn', this.responsePn)
if (this.form.pn !== this.responsePn) {
this.$message.error('您输入的pn与返回pn的不一样')
const errorSound = new Audio(require('../../assets/audio/y1840.mp3'))
errorSound.play()
this.$message.error({
message: '您输入的pn' + this.form.pn + '与返回pn' + this.responsePn + '的不一样',
duration: 2000,
onClose: () => {
errorSound.pause()
}
})
this.form.pn = ''
this.confirmTheSubmission = false
} else {
const obj = {
......@@ -289,7 +315,16 @@ export default {
if (valid) {
if (this.responsePn && this.responsePn !== '') {
if (this.form.pn !== this.responsePn) {
this.$message.error('您输入的pn与返回pn的不一样')
const errorSound = new Audio(require('../../assets/audio/y1840.mp3'))
errorSound.play()
this.$message.error({
message: '您输入的pn' + this.form.pn + '与返回pn' + this.responsePn + '的不一样',
duration: 2000,
onClose: () => {
errorSound.pause()
}
})
this.form.pn = ''
} else {
addIncomeWmsBox(this.form).then(res => {
if (res.code === 200) {
......
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