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,16 +105,16 @@ 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 && list.length > 0 && value) {
if (list.find(item => item.dictValue === value)) {
label = list.find(item => item.dictValue === value).dictLabel
console.log('111')
......@@ -156,7 +156,7 @@ 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)
}
......@@ -180,7 +180,7 @@ export default {
return null
}
} else {
var objT= {
var objT = {
location: search,
list: list,
frequency: 0
......@@ -192,10 +192,18 @@ export default {
}
}
} 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()
}
console.log('判断tableList中location和search相同的元素个数',obj.list.length)
})
this.searchForm.search = null
return null
}
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
})
}
}
}
......
......@@ -77,7 +77,7 @@
<script>
import {
batchAddIncomeWmsBox, getJcCode, queryPass
batchAddIncomeWmsBox, checkIsZero, getJcCode, queryPass
} from '@/api/incomeWmsBox'
import { findByLocation, updateIncomeWmsLabel } from '@/api/incomeWmsLabel'
import { getInfo } from '@/api/login'
......@@ -126,8 +126,20 @@ export default {
this.focusing()
this.getOrderCode()
this.getLoginUser()
this.getcheckIsZero()
},
methods: {
getcheckIsZero() {
const obj = {
whId: '0'
}
checkIsZero(obj).then(res => {
if (res.code === 200) {
console.log(res)
}
})
},
/**
* @description: 获取数据字典
* @author: gaoyu
......@@ -136,7 +148,7 @@ export default {
**/
getDictData() {
// 获取仓库的数据字段
getDict('WAREHOUSE').then(res => {
getDict('SYSTEM_CONFIG').then(res => {
console.log('仓库数据字典', res)
this.warehouseList = res.data
const whId = res.data[0].dictValue
......@@ -261,7 +273,15 @@ export default {
}
this.$refs.queryForm.validateField('value1', (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 {
const inputValues = this.queryForm.value1.split(',')
console.log('inputValues', inputValues.length)
......@@ -291,7 +311,18 @@ export default {
})
}
} 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.queryForm.value2 = ''
}
......@@ -332,15 +363,34 @@ export default {
})
}
} 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.queryForm.value2 = ''
}
}
})
} 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 {
addList() {
this.$refs.queryForm.validateField('value2', (error) => {
if (error) {
this.$message.error('输入值不符合格式要求,请重新输入')
this.$message.error({
message: '输入值不符合格式要求,请重新输入',
duration: 2000
})
} else {
const values = this.queryForm.value2.split(':')
// 校验第三个值是否为整数
......@@ -385,7 +438,15 @@ export default {
if (obj.labelId !== null && obj.labelId !== '' && obj.labelId !== undefined) {
if (this.incomeWmsLabelList.pn && this.incomeWmsLabelList.pn !== '' && this.incomeWmsLabelList.pn !== undefined) {
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
} else {
let isLegalLot = false
......@@ -400,7 +461,43 @@ export default {
this.incomeWmsBoxList.pn = obj.pn
this.queryForm.value2 = ''
} 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 {
const Zbj = {
whId: this.queryForm.whId
}
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.incomeWmsBoxList.pn = obj.pn
this.queryForm.value2 = ''
}
} else {
queryPass(obj.lot).then(lotResponse => {
......@@ -411,7 +508,15 @@ export default {
this.incomeWmsBoxList.pn = obj.pn
this.queryForm.value2 = ''
} 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 {
this.enterTable.push(obj)
......@@ -419,7 +524,21 @@ export default {
this.queryForm.value2 = ''
}
} else {
this.$message.error('该LOT值未被检查!')
// 创建一个新的音频元素
const successSound = new Audio(require('../../assets/audio/y1840.mp3'))
successSound.play()
this.$message.error({
message: '该LOT值' + obj.lot + '未被检查!',
duration: 2000,
onClose: () => {
// 当消息提示框关闭时停止播放声音
successSound.pause()
}
}, () => {
})
}
})
}
}
})
}
......@@ -442,7 +561,43 @@ export default {
this.incomeWmsBoxList.pn = obj.pn
this.queryForm.value2 = ''
} 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 {
const Zbj = {
whId: this.queryForm.whId
}
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.incomeWmsBoxList.pn = obj.pn
this.queryForm.value2 = ''
}
} else {
queryPass(obj.lot).then(lotResponse => {
......@@ -453,7 +608,15 @@ export default {
this.incomeWmsBoxList.pn = obj.pn
this.queryForm.value2 = ''
} 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 {
this.enterTable.push(obj)
......@@ -461,18 +624,49 @@ export default {
this.queryForm.value2 = ''
}
} else {
this.$message.error('该LOT值未被检查')
// 创建一个新的音频元素
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('请输入有效的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 {
this.$message.error('输入格式不符合要求,请重新输入')
const errorSound = new Audio(require('../../assets/audio/y1840.mp3'))
errorSound.play()
this.$message.error({
message: '输入格式不符合要求,请重新输入',
duration: 2500,
onClose: () => {
errorSound.pause()
}
})
}
// }
// else {
......
......@@ -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