Commit 374e85e7 authored by Hagsn3's avatar Hagsn3

修改代码

parent c53c9ce9
...@@ -93,3 +93,13 @@ export function batchAddIncomeWmsBox(data) { ...@@ -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 @@ ...@@ -55,7 +55,7 @@
<script> <script>
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'
export default { export default {
name: 'Dispose', name: 'Dispose',
...@@ -105,16 +105,16 @@ export default { ...@@ -105,16 +105,16 @@ export default {
}) })
}, },
getAllDict() { getAllDict() {
getDict("APPLICATION_TYPE").then(res=> { getDict('APPLICATION_TYPE').then(res => {
if (res.code === 200) { if (res.code === 200) {
console.log('res',res) console.log('res', res)
this.typeList = res.data this.typeList = res.data
} }
}) })
}, },
getDictLabelByValue(list,value) { getDictLabelByValue(list, value) {
let label = '-' let label = '-'
if (list &&list.length> 0 && value) { if (list && list.length > 0 && value) {
if (list.find(item => item.dictValue === value)) { if (list.find(item => item.dictValue === value)) {
label = list.find(item => item.dictValue === value).dictLabel label = list.find(item => item.dictValue === value).dictLabel
console.log('111') console.log('111')
...@@ -156,7 +156,7 @@ export default { ...@@ -156,7 +156,7 @@ export default {
if (this.storeList.length > 0) { if (this.storeList.length > 0) {
var list = [] var list = []
// 判断tableList中location和search相同的元素个数 // 判断tableList中location和search相同的元素个数
this.tableList.forEach((item,index) => { this.tableList.forEach((item, index) => {
if (item.location === search) { if (item.location === search) {
list.push(index) list.push(index)
} }
...@@ -180,7 +180,7 @@ export default { ...@@ -180,7 +180,7 @@ export default {
return null return null
} }
} else { } else {
var objT= { var objT = {
location: search, location: search,
list: list, list: list,
frequency: 0 frequency: 0
...@@ -192,10 +192,18 @@ export default { ...@@ -192,10 +192,18 @@ export default {
} }
} }
} else { } else {
this.$message.error("请输入正确的地址") const errorSound = new Audio(require('../../assets/audio/y1840.mp3'))
return null; errorSound.play()
this.$message.error({
message: '输入的位置' + this.searchForm.search + '不正确请重新输入',
duration: 3000,
onClose: () => {
errorSound.pause()
}
})
this.searchForm.search = null
return null
} }
} else { } else {
// 向储存列表加数据 // 向储存列表加数据
var obj = { var obj = {
...@@ -204,13 +212,14 @@ export default { ...@@ -204,13 +212,14 @@ export default {
frequency: 0 frequency: 0
} }
// 判断tableList中location和search相同的元素个数 // 判断tableList中location和search相同的元素个数
this.tableList.forEach((item,index) => { this.tableList.forEach((item, index) => {
if (item.location === search) { if (item.location === search) {
obj.list.push(index) obj.list.push(index)
} }
}) })
if (obj.list.length > 0) { if (obj.list.length > 0) {
if (obj.list.length === 1) { if (obj.list.length === 1) {
this.storeList.push(obj)
last.index = obj.list[0] last.index = obj.list[0]
last.needNumber = this.tableList[obj.list[0]].needNumber last.needNumber = this.tableList[obj.list[0]].needNumber
return last return last
...@@ -223,16 +232,25 @@ export default { ...@@ -223,16 +232,25 @@ export default {
return last return last
} }
} else { } else {
this.$message.error("请输入正确的地址") const errorSound = new Audio(require('../../assets/audio/y1840.mp3'))
return null; errorSound.play()
this.$message.error({
message: '输入的位置' + this.searchForm.search + '不正确请重新输入',
duration: 3000,
onClose: () => {
errorSound.pause()
} }
console.log('判断tableList中location和search相同的元素个数',obj.list.length) })
this.searchForm.search = null
return null
}
console.log('判断tableList中location和search相同的元素个数', obj.list.length)
} }
}, },
// 查询回 // 查询回
handleSearch() { handleSearch() {
var search = '' var search = ''
if (this.searchForm.search && this.searchForm.search !== '' ) { if (this.searchForm.search && this.searchForm.search !== '') {
if (this.searchForm.search.includes(',')) { if (this.searchForm.search.includes(',')) {
search = this.searchForm.search.split(',')[0] search = this.searchForm.search.split(',')[0]
} else { } else {
...@@ -240,7 +258,7 @@ export default { ...@@ -240,7 +258,7 @@ export default {
} }
const obj = this.getIndexAndNeedNumber(search) const obj = this.getIndexAndNeedNumber(search)
if (obj) { if (obj) {
const {index,needNumber} = obj const { index, needNumber } = obj
if (!this.rowIndexList.includes(index)) { if (!this.rowIndexList.includes(index)) {
this.rowIndexList.push(index) this.rowIndexList.push(index)
} }
...@@ -248,6 +266,12 @@ export default { ...@@ -248,6 +266,12 @@ export default {
this.searchForm.search = '' 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() { // handleSearch() {
...@@ -290,10 +314,17 @@ export default { ...@@ -290,10 +314,17 @@ export default {
this.$router.push({ this.$router.push({
path: '/setup/applicationTable' path: '/setup/applicationTable'
}) })
this.$message.success({
message: '出库成功!',
duration: 2500
})
} }
}) })
} else { } 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 { ...@@ -210,7 +210,16 @@ export default {
that.$refs['input' + index].focus() that.$refs['input' + index].focus()
}) })
} else { } 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.responsePn = null
this.form.location = null this.form.location = null
this.form.labelId = null this.form.labelId = null
...@@ -220,7 +229,15 @@ export default { ...@@ -220,7 +229,15 @@ export default {
} }
}) })
} else { } 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 { ...@@ -238,7 +255,16 @@ export default {
console.log('formPn', this.form.pn) console.log('formPn', this.form.pn)
console.log('responsePn', this.responsePn) console.log('responsePn', this.responsePn)
if (this.form.pn !== 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 this.confirmTheSubmission = false
} else { } else {
const obj = { const obj = {
...@@ -289,7 +315,16 @@ export default { ...@@ -289,7 +315,16 @@ export default {
if (valid) { if (valid) {
if (this.responsePn && this.responsePn !== '') { if (this.responsePn && this.responsePn !== '') {
if (this.form.pn !== 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 { } else {
addIncomeWmsBox(this.form).then(res => { addIncomeWmsBox(this.form).then(res => {
if (res.code === 200) { 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