Commit 381515da authored by Hagsn3's avatar Hagsn3

修改声音

parent dd10b3c0
......@@ -186,6 +186,7 @@ export function includePermission(accessName) {
// 控制音频启用状态
export const isAudioAble = true
const errorSound = new Audio(require('../assets/audio/y1840.mp3'))
const successSound = new Audio(require('../assets/audio/8858.mp3'))
export function playAudio(start) {
if (!isAudioAble) {
return
......@@ -198,4 +199,11 @@ export function playAudio(start) {
errorSound.pause()
}
}
export function successAudio(start) {
if (start) {
successSound.play()
} else {
successSound.pause()
}
}
......@@ -56,7 +56,7 @@
import { handleOutWarehouse, persistOut } from '@/api/setup/applicationTable'
import { getDict } from '@/api/system/dict/data'
import { playAudio } from '@/utils/common'
import {playAudio, successAudio} from '@/utils/common'
export default {
name: 'Dispose',
......@@ -196,7 +196,7 @@ export default {
playAudio(true)
this.$message.error({
message: '输入的位置' + this.searchForm.search + '不正确请重新输入',
duration: 5000,
duration: 2000,
onClose: () => {
playAudio(false)
}
......@@ -235,7 +235,7 @@ export default {
playAudio(true)
this.$message.error({
message: '输入的位置' + this.searchForm.search + '不正确请重新输入',
duration: 5000,
duration: 2000,
onClose: () => {
playAudio(false)
}
......@@ -259,6 +259,7 @@ export default {
if (obj) {
const { index, needNumber } = obj
if (!this.rowIndexList.includes(index)) {
successAudio(true)
this.rowIndexList.push(index)
}
this.total = this.total + needNumber
......
......@@ -82,7 +82,7 @@ import {
import { findByLocation, updateIncomeWmsLabel } from '@/api/incomeWmsLabel'
import { getInfo } from '@/api/login'
import { getDict } from '@/api/system/dict/data'
import { playAudio } from '@/utils/common'
import { playAudio, successAudio } from '@/utils/common'
export default {
name: 'EnterBound',
......@@ -266,7 +266,7 @@ export default {
playAudio(true)
this.$message.error({
message: '输入值不符合格式要求,请重新输入',
duration: 5000,
duration: 2000,
onClose: () => {
playAudio(false)
}
......@@ -286,12 +286,14 @@ export default {
if (res.data.pn !== null && res.data.pn !== '') {
this.incomeWmsLabelList = res.data
// this.getOrderCode()
successAudio(true)
that.$nextTick(() => {
e.target.blur()
const index = i + 1
that.$refs['input' + index].focus()
})
} else {
successAudio(true)
this.incomeWmsLabelList = res.data
that.$nextTick(() => {
e.target.blur()
......@@ -303,7 +305,7 @@ export default {
playAudio(true)
this.$message.error({
message: '数据库中无对应数据location:' + this.queryForm.location,
duration: 5000,
duration: 2000,
onClose: () => {
playAudio(false)
}
......@@ -327,6 +329,7 @@ export default {
if (res.data != null) {
if (res.data.pn !== null && res.data.pn !== '') {
if (res.data.pn !== this.queryForm.pn) {
successAudio(true)
this.incomeWmsLabelList = res.data
that.$nextTick(() => {
e.target.blur()
......@@ -334,6 +337,7 @@ export default {
that.$refs['input' + index].focus()
})
} else {
successAudio(true)
this.incomeWmsLabelList = res.data
// this.getOrderCode()
that.$nextTick(() => {
......@@ -343,6 +347,7 @@ export default {
})
}
} else {
successAudio(true)
this.incomeWmsLabelList = res.data
that.$nextTick(() => {
e.target.blur()
......@@ -354,7 +359,7 @@ export default {
playAudio(true)
this.$message.error({
message: '数据库中无对应数据location:' + this.queryForm.location,
duration: 5000,
duration: 2000,
onClose: () => {
playAudio(false)
}
......@@ -371,7 +376,7 @@ export default {
// 输入值不符合格式要求,进行报错处理
this.$message.error({
message: '输入值不符合格式要求,请重新输入',
duration: 5000,
duration: 2000,
onClose: () => {
playAudio(false)
}
......@@ -405,7 +410,7 @@ export default {
playAudio(true)
this.$message.error({
message: '输入值不符合格式要求,请重新输入',
duration: 5000,
duration: 2000,
onClose: () => {
playAudio(false)
}
......@@ -432,7 +437,7 @@ export default {
playAudio(true)
this.$message.error({
message: '输入的pn值:' + obj.pn + '与数据库中pn值:' + this.incomeWmsLabelList.pn + '不匹配,请重新输入',
duration: 5000,
duration: 2000,
onClose: () => {
playAudio(false)
}
......@@ -448,6 +453,7 @@ export default {
})
if (isLegalLot) {
if (this.enterTable[0].pn === obj.pn) {
successAudio(true)
this.enterTable.push(obj)
this.incomeWmsBoxList.pn = obj.pn
this.queryForm.value2 = ''
......@@ -455,7 +461,7 @@ export default {
playAudio(true)
this.$message.error({
message: '与下方列表的pn:' + this.enterTable[0].pn + '不匹配',
duration: 5000,
duration: 2000,
onClose: () => {
playAudio(false)
}
......@@ -471,6 +477,7 @@ export default {
if (res.data) {
if (this.enterTable.length > 0) {
if (this.enterTable[0].pn === obj.pn) {
successAudio(true)
this.enterTable.push(obj)
this.incomeWmsBoxList.pn = obj.pn
this.queryForm.value2 = ''
......@@ -478,7 +485,7 @@ export default {
playAudio(true)
this.$message.error({
message: '与下方列表的pn:' + this.enterTable[0].pn + '不匹配',
duration: 5000,
duration: 2000,
onClose: () => {
playAudio(false)
}
......@@ -486,6 +493,7 @@ export default {
this.queryForm.value2 = null
}
} else {
successAudio(true)
this.enterTable.push(obj)
this.incomeWmsBoxList.pn = obj.pn
this.queryForm.value2 = ''
......@@ -495,7 +503,7 @@ export default {
playAudio(true)
this.$message.error({
message: '该LOT值' + obj.lot + '未被检查!',
duration: 5000,
duration: 2000,
onClose: () => {
// 当消息提示框关闭时停止播放声音
playAudio(false)
......@@ -522,6 +530,7 @@ export default {
})
if (isLegalLot) {
if (this.enterTable[0].pn === obj.pn) {
successAudio(true)
this.enterTable.push(obj)
this.incomeWmsBoxList.pn = obj.pn
this.queryForm.value2 = ''
......@@ -529,7 +538,7 @@ export default {
playAudio(true)
this.$message.error({
message: '与下方列表的pn值' + this.enterTable[0].pn + '不匹配',
duration: 5000,
duration: 2000,
onClose: () => {
playAudio(false)
}
......@@ -545,6 +554,7 @@ export default {
if (res.data) {
if (this.enterTable.length > 0) {
if (this.enterTable[0].pn === obj.pn) {
successAudio(true)
this.enterTable.push(obj)
this.incomeWmsBoxList.pn = obj.pn
this.queryForm.value2 = ''
......@@ -552,7 +562,7 @@ export default {
playAudio(true)
this.$message.error({
message: '与下方列表的pn值' + this.enterTable[0].pn + '不匹配',
duration: 5000,
duration: 2000,
onClose: () => {
playAudio(false)
}
......@@ -560,6 +570,7 @@ export default {
this.queryForm.value2 = null
}
} else {
successAudio(true)
this.enterTable.push(obj)
this.incomeWmsBoxList.pn = obj.pn
this.queryForm.value2 = ''
......@@ -568,7 +579,7 @@ export default {
playAudio(true)
this.$message.error({
message: '该LOT值' + obj.lot + '未被检查!',
duration: 5000,
duration: 2000,
onClose: () => {
// 当消息提示框关闭时停止播放声音
playAudio(false)
......@@ -584,7 +595,7 @@ export default {
playAudio(true)
this.$message.error({
message: '该location的值' + this.queryForm.location + '无效' + '请输入有效的location值',
duration: 5000,
duration: 2000,
onClose: () => {
playAudio(false)
}
......@@ -598,7 +609,7 @@ export default {
playAudio(true)
this.$message.error({
message: '输入格式不符合要求,请重新输入',
duration: 5000,
duration: 2000,
onClose: () => {
playAudio(false)
}
......
......@@ -56,7 +56,7 @@ import { getDict } from '@/api/system/dict/data'
import { addIncomeWmsBox, getJcCode } from '@/api/incomeWmsBox'
import { findByLocation } from '@/api/incomeWmsLabel'
import { queryByPnAndType } from '@/api/income_mat_baseinfo'
import { playAudio } from '@/utils/common'
import {playAudio, successAudio} from '@/utils/common'
export default {
name: 'EnterboundTwo',
......@@ -205,6 +205,7 @@ export default {
if (res.data.location) {
this.form.location = res.data.location
}
successAudio(true)
that.$nextTick(() => {
e.target.blur()
const index = i + 1
......@@ -214,7 +215,7 @@ export default {
playAudio(true)
this.$message.error({
message: '数据库中无对应' + location + '请重新输入',
duration: 5000,
duration: 2000,
onClose: () => {
playAudio(false)
}
......@@ -232,7 +233,7 @@ export default {
playAudio(true)
return this.$message.error({
message: '输入值不符合格式要求,请重新输入',
duration: 5000,
duration: 2000,
onClose: () => {
playAudio(false)
}
......@@ -251,13 +252,11 @@ export default {
* form.pn:表格pn
*/
if (this.responsePn && this.responsePn !== '' && this.responsePn !== undefined) {
console.log('formPn', this.form.pn)
console.log('responsePn', this.responsePn)
if (this.form.pn !== this.responsePn) {
playAudio(true)
this.$message.error({
message: '您输入的pn' + this.form.pn + '与返回pn' + this.responsePn + '的不一样',
duration: 5000,
duration: 2000,
onClose: () => {
playAudio(false)
}
......@@ -274,6 +273,7 @@ export default {
console.log(response)
this.form.qty = response.data.qty
}
successAudio(true)
this.$nextTick().then(() => {
this.$refs.input3.focus()
})
......@@ -289,11 +289,13 @@ export default {
if (response.code === 200 && response.data) {
console.log(response)
this.form.qty = response.data.qty
successAudio(true)
this.$nextTick().then(() => {
this.$refs.input3.focus()
})
this.confirmTheSubmission = true
} else {
successAudio(true)
this.$nextTick().then(() => {
this.$refs.input3.focus()
})
......@@ -316,7 +318,7 @@ export default {
playAudio(true)
this.$message.error({
message: '您输入的pn' + this.form.pn + '与返回pn' + this.responsePn + '的不一样',
duration: 5000,
duration: 2000,
onClose: () => {
playAudio(false)
}
......
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