Commit 381515da authored by Hagsn3's avatar Hagsn3

修改声音

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