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,21 +105,21 @@ export default { ...@@ -105,21 +105,21 @@ 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')
return label return label
} }
} }
return label return label
}, },
...@@ -156,46 +156,54 @@ export default { ...@@ -156,46 +156,54 @@ 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)
} }
}) })
if (list.length > 0) { if (list.length > 0) {
if (list.length === 1) { if (list.length === 1) {
last.index = list[0] last.index = list[0]
last.needNumber = this.tableList[list[0]].needNumber last.needNumber = this.tableList[list[0]].needNumber
return last return last
} }
if (list.length > 1) { if (list.length > 1) {
// 是否能从储存中找到location // 是否能从储存中找到location
if (this.storeList.find(Litem => Litem.location === search)) { if (this.storeList.find(Litem => Litem.location === search)) {
var index = this.storeList.findIndex(Litem => Litem.location === search) var index = this.storeList.findIndex(Litem => Litem.location === 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]
last.needNumber = this.tableList[this.storeList[index].list[this.storeList[index].frequency]].needNumber last.needNumber = this.tableList[this.storeList[index].list[this.storeList[index].frequency]].needNumber
return last return last
} else { } else {
return null return null
} }
} else { } else {
var objT= { var objT = {
location: search, location: search,
list: list, list: list,
frequency: 0 frequency: 0
} }
this.storeList.push(objT) this.storeList.push(objT)
last.index = list[0] last.index = list[0]
last.needNumber = this.tableList[list[0]].needNumber last.needNumber = this.tableList[list[0]].needNumber
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()
}
})
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()
}
})
this.searchForm.search = null
return null
} }
console.log('判断tableList中location和search相同的元素个数',obj.list.length) 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
})
} }
} }
} }
......
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<script> <script>
import { import {
batchAddIncomeWmsBox, getJcCode, queryPass batchAddIncomeWmsBox, checkIsZero, getJcCode, queryPass
} from '@/api/incomeWmsBox' } from '@/api/incomeWmsBox'
import { findByLocation, updateIncomeWmsLabel } from '@/api/incomeWmsLabel' import { findByLocation, updateIncomeWmsLabel } from '@/api/incomeWmsLabel'
import { getInfo } from '@/api/login' import { getInfo } from '@/api/login'
...@@ -126,8 +126,20 @@ export default { ...@@ -126,8 +126,20 @@ export default {
this.focusing() this.focusing()
this.getOrderCode() this.getOrderCode()
this.getLoginUser() this.getLoginUser()
this.getcheckIsZero()
}, },
methods: { methods: {
getcheckIsZero() {
const obj = {
whId: '0'
}
checkIsZero(obj).then(res => {
if (res.code === 200) {
console.log(res)
}
})
},
/** /**
* @description: 获取数据字典 * @description: 获取数据字典
* @author: gaoyu * @author: gaoyu
...@@ -136,7 +148,7 @@ export default { ...@@ -136,7 +148,7 @@ export default {
**/ **/
getDictData() { getDictData() {
// 获取仓库的数据字段 // 获取仓库的数据字段
getDict('WAREHOUSE').then(res => { getDict('SYSTEM_CONFIG').then(res => {
console.log('仓库数据字典', res) console.log('仓库数据字典', res)
this.warehouseList = res.data this.warehouseList = res.data
const whId = res.data[0].dictValue const whId = res.data[0].dictValue
...@@ -261,7 +273,15 @@ export default { ...@@ -261,7 +273,15 @@ export default {
} }
this.$refs.queryForm.validateField('value1', (error) => { this.$refs.queryForm.validateField('value1', (error) => {
if (error) { if (error) {
this.$message.error('输入值不符合格式要求,请重新输入') const errorSound = new Audio(require('../../assets/audio/y1840.mp3'))
errorSound.play()
this.$message.error({
message: '输入值不符合格式要求,请重新输入',
duration: 2000,
onClose: () => {
errorSound.pause()
}
}, () => {})
} else { } else {
const inputValues = this.queryForm.value1.split(',') const inputValues = this.queryForm.value1.split(',')
console.log('inputValues', inputValues.length) console.log('inputValues', inputValues.length)
...@@ -291,7 +311,18 @@ export default { ...@@ -291,7 +311,18 @@ export default {
}) })
} }
} else { } else {
this.$message.error('数据库中无对应数据') const errorSound = new Audio(require('../../assets/audio/y1840.mp3'))
errorSound.play()
this.$message.error({
message: '数据库中无对应数据location:' + this.queryForm.location,
duration: 2000,
onClose: () => {
errorSound.pause()
}
}, () => {
})
this.queryForm.value1 = ''
this.queryForm.location = ''
this.incomeWmsLabelList.pn = '' this.incomeWmsLabelList.pn = ''
this.queryForm.value2 = '' this.queryForm.value2 = ''
} }
...@@ -332,15 +363,34 @@ export default { ...@@ -332,15 +363,34 @@ export default {
}) })
} }
} else { } else {
this.$message.error('数据库中无对应数据') const errorSound = new Audio(require('../../assets/audio/y1840.mp3'))
errorSound.play()
this.$message.error({
message: '数据库中无对应数据location:' + this.queryForm.location,
duration: 2000,
onClose: () => {
errorSound.pause()
}
})
this.queryForm.value1 = ''
this.queryForm.location = ''
this.incomeWmsLabelList.pn = '' this.incomeWmsLabelList.pn = ''
this.queryForm.value2 = '' this.queryForm.value2 = ''
} }
} }
}) })
} else { } else {
const errorSound = new Audio(require('../../assets/audio/y1840.mp3'))
errorSound.play()
// 输入值不符合格式要求,进行报错处理 // 输入值不符合格式要求,进行报错处理
this.$message.error('输入值不符合格式要求,请重新输入') this.$message.error({
message: '输入值不符合格式要求,请重新输入',
duration: 2000,
onClose: () => {
errorSound.pause()
}
})
this.queryForm.value1 = ''
} }
} }
} }
...@@ -366,7 +416,10 @@ export default { ...@@ -366,7 +416,10 @@ export default {
addList() { addList() {
this.$refs.queryForm.validateField('value2', (error) => { this.$refs.queryForm.validateField('value2', (error) => {
if (error) { if (error) {
this.$message.error('输入值不符合格式要求,请重新输入') this.$message.error({
message: '输入值不符合格式要求,请重新输入',
duration: 2000
})
} else { } else {
const values = this.queryForm.value2.split(':') const values = this.queryForm.value2.split(':')
// 校验第三个值是否为整数 // 校验第三个值是否为整数
...@@ -385,7 +438,15 @@ export default { ...@@ -385,7 +438,15 @@ export default {
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 !== this.incomeWmsLabelList.pn) { if (obj.pn !== this.incomeWmsLabelList.pn) {
this.$message.error('输入的pn值与数据库中不匹配,请重新输入') const errorSound = new Audio(require('../../assets/audio/y1840.mp3'))
errorSound.play()
this.$message.error({
message: '输入的pn值:' + obj.pn + '与数据库中pn值:' + this.incomeWmsLabelList.pn + '不匹配,请重新输入',
duration: 2000,
onClose: () => {
errorSound.pause()
}
})
// this.incomeWmsBoxList.pn = obj.pn // this.incomeWmsBoxList.pn = obj.pn
} else { } else {
let isLegalLot = false let isLegalLot = false
...@@ -400,26 +461,84 @@ export default { ...@@ -400,26 +461,84 @@ export default {
this.incomeWmsBoxList.pn = obj.pn this.incomeWmsBoxList.pn = obj.pn
this.queryForm.value2 = '' this.queryForm.value2 = ''
} else { } else {
this.$message.error('与下方列表的pn值不匹配') const errorSound = new Audio(require('../../assets/audio/y1840.mp3'))
errorSound.play()
this.$message.error({
message: '与下方列表的pn:' + this.enterTable[0].pn + '不匹配',
duration: 2000,
onClose: () => {
errorSound.pause()
}
})
} }
} else { } else {
queryPass(obj.lot).then(lotResponse => { const Zbj = {
if (lotResponse.code === 200 && lotResponse.data > 0) { whId: this.queryForm.whId
if (this.enterTable.length > 0) { }
if (this.enterTable[0].pn === obj.pn) { checkIsZero(Zbj).then(res => {
if (res.code === 200) {
if (res.data) {
if (this.enterTable.length > 0) {
if (this.enterTable[0].pn === obj.pn) {
this.enterTable.push(obj)
this.incomeWmsBoxList.pn = obj.pn
this.queryForm.value2 = ''
} else {
const errorSound = new Audio(require('../../assets/audio/y1840.mp3'))
errorSound.play()
this.$message.error({
message: '与下方列表的pn:' + this.enterTable[0].pn + '不匹配',
duration: 2000,
onClose: () => {
errorSound.pause()
}
})
}
} else {
this.enterTable.push(obj) this.enterTable.push(obj)
this.incomeWmsBoxList.pn = obj.pn this.incomeWmsBoxList.pn = obj.pn
this.queryForm.value2 = '' this.queryForm.value2 = ''
} else {
this.$message.error('与下方列表的pn值不匹配')
} }
} else { } else {
this.enterTable.push(obj) queryPass(obj.lot).then(lotResponse => {
this.incomeWmsBoxList.pn = obj.pn if (lotResponse.code === 200 && lotResponse.data > 0) {
this.queryForm.value2 = '' if (this.enterTable.length > 0) {
if (this.enterTable[0].pn === obj.pn) {
this.enterTable.push(obj)
this.incomeWmsBoxList.pn = obj.pn
this.queryForm.value2 = ''
} else {
const errorSound = new Audio(require('../../assets/audio/y1840.mp3'))
errorSound.play()
this.$message.error({
message: '与下方列表的pn:' + this.enterTable[0].pn + '不匹配',
duration: 2000,
onClose: () => {
errorSound.pause()
}
})
}
} else {
this.enterTable.push(obj)
this.incomeWmsBoxList.pn = obj.pn
this.queryForm.value2 = ''
}
} else {
// 创建一个新的音频元素
const successSound = new Audio(require('../../assets/audio/y1840.mp3'))
successSound.play()
this.$message.error({
message: '该LOT值' + obj.lot + '未被检查!',
duration: 2000,
onClose: () => {
// 当消息提示框关闭时停止播放声音
successSound.pause()
}
}, () => {
})
}
})
} }
} else {
this.$message.error('该LOT值未被检查!')
} }
}) })
} }
...@@ -442,37 +561,112 @@ export default { ...@@ -442,37 +561,112 @@ export default {
this.incomeWmsBoxList.pn = obj.pn this.incomeWmsBoxList.pn = obj.pn
this.queryForm.value2 = '' this.queryForm.value2 = ''
} else { } else {
this.$message.error('与下方列表的pn值不匹配') const errorSound = new Audio(require('../../assets/audio/y1840.mp3'))
errorSound.play()
this.$message.error({
message: '与下方列表的pn值' + this.enterTable[0].pn + '不匹配',
duration: 2000,
onClose: () => {
errorSound.pause()
}
})
} }
} else { } else {
queryPass(obj.lot).then(lotResponse => { const Zbj = {
if (lotResponse.code === 200 && lotResponse.data > 0) { whId: this.queryForm.whId
if (this.enterTable.length > 0) { }
if (this.enterTable[0].pn === obj.pn) { checkIsZero(Zbj).then(res => {
if (res.code === 200) {
if (res.data) {
if (this.enterTable.length > 0) {
if (this.enterTable[0].pn === obj.pn) {
this.enterTable.push(obj)
this.incomeWmsBoxList.pn = obj.pn
this.queryForm.value2 = ''
} else {
const errorSound = new Audio(require('../../assets/audio/y1840.mp3'))
errorSound.play()
this.$message.error({
message: '与下方列表的pn值' + this.enterTable[0].pn + '不匹配',
duration: 2000,
onClose: () => {
errorSound.pause()
}
})
}
} else {
this.enterTable.push(obj) this.enterTable.push(obj)
this.incomeWmsBoxList.pn = obj.pn this.incomeWmsBoxList.pn = obj.pn
this.queryForm.value2 = '' this.queryForm.value2 = ''
} else {
this.$message.error('与下方列表的pn值不匹配')
} }
} else { } else {
this.enterTable.push(obj) queryPass(obj.lot).then(lotResponse => {
this.incomeWmsBoxList.pn = obj.pn if (lotResponse.code === 200 && lotResponse.data > 0) {
this.queryForm.value2 = '' if (this.enterTable.length > 0) {
if (this.enterTable[0].pn === obj.pn) {
this.enterTable.push(obj)
this.incomeWmsBoxList.pn = obj.pn
this.queryForm.value2 = ''
} else {
const errorSound = new Audio(require('../../assets/audio/y1840.mp3'))
errorSound.play()
this.$message.error({
message: '与下方列表的pn值' + this.enterTable[0].pn + '不匹配',
duration: 2000,
onClose: () => {
errorSound.pause()
}
})
}
} else {
this.enterTable.push(obj)
this.incomeWmsBoxList.pn = obj.pn
this.queryForm.value2 = ''
}
} else {
// 创建一个新的音频元素
const successSound = new Audio(require('../../assets/audio/y1840.mp3'))
successSound.play()
this.$message.error({
message: '该LOT值' + obj.lot + '未被检查!',
duration: 2000,
onClose: () => {
// 当消息提示框关闭时停止播放声音
successSound.pause()
}
}, () => {
})
}
})
} }
} else {
this.$message.error('该LOT值未被检查')
} }
}) })
} }
} else { } else {
this.$message.error('请输入有效的location值') const errorSound = new Audio(require('../../assets/audio/y1840.mp3'))
errorSound.play()
this.$message.error({
message: '该location的值' + this.queryForm.location + '无效' + '请输入有效的location值',
duration: 2000,
onClose: () => {
errorSound.pause()
}
})
this.queryForm.location = ''
} }
} }
}) })
} }
} else { } else {
this.$message.error('输入格式不符合要求,请重新输入') const errorSound = new Audio(require('../../assets/audio/y1840.mp3'))
errorSound.play()
this.$message.error({
message: '输入格式不符合要求,请重新输入',
duration: 2500,
onClose: () => {
errorSound.pause()
}
})
} }
// } // }
// else { // else {
......
...@@ -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