Commit 49cef197 authored by Hagsn3's avatar Hagsn3

修改代码

parent 051893e9
...@@ -182,3 +182,16 @@ export function includePermission(accessName) { ...@@ -182,3 +182,16 @@ export function includePermission(accessName) {
if (!store.getters.permissions) { return false } if (!store.getters.permissions) { return false }
return (store.getters.permissions.includes(accessName) || store.getters.permissions.includes('*:*:*')) return (store.getters.permissions.includes(accessName) || store.getters.permissions.includes('*:*:*'))
} }
// 控制音频启用状态
export const isAudioAble = true
export function playAudio(isAudioAble) {
const errorSound = new Audio(require('../assets/audio/y1840.mp3'))
if (isAudioAble) {
errorSound.play()
} else {
errorSound.pause()
}
}
...@@ -56,6 +56,7 @@ ...@@ -56,6 +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 {isAudioAble, playAudio} from "@/utils/common";
export default { export default {
name: 'Dispose', name: 'Dispose',
...@@ -192,13 +193,12 @@ export default { ...@@ -192,13 +193,12 @@ export default {
} }
} }
} else { } else {
const errorSound = new Audio(require('../../assets/audio/y1840.mp3')) playAudio(isAudioAble)
errorSound.play()
this.$message.error({ this.$message.error({
message: '输入的位置' + this.searchForm.search + '不正确请重新输入', message: '输入的位置' + this.searchForm.search + '不正确请重新输入',
duration: 3000, duration: 3000,
onClose: () => { onClose: () => {
errorSound.pause() playAudio(isAudioAble)
} }
}) })
this.searchForm.search = null this.searchForm.search = null
...@@ -232,13 +232,12 @@ export default { ...@@ -232,13 +232,12 @@ export default {
return last return last
} }
} else { } else {
const errorSound = new Audio(require('../../assets/audio/y1840.mp3')) playAudio(isAudioAble)
errorSound.play()
this.$message.error({ this.$message.error({
message: '输入的位置' + this.searchForm.search + '不正确请重新输入', message: '输入的位置' + this.searchForm.search + '不正确请重新输入',
duration: 3000, duration: 3000,
onClose: () => { onClose: () => {
errorSound.pause() playAudio(isAudioAble)
} }
}) })
this.searchForm.search = null this.searchForm.search = null
......
This diff is collapsed.
...@@ -56,6 +56,7 @@ import { getDict } from '@/api/system/dict/data' ...@@ -56,6 +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 { isAudioAble, playAudio } from '@/utils/common'
export default { export default {
name: 'EnterboundTwo', name: 'EnterboundTwo',
...@@ -210,13 +211,12 @@ export default { ...@@ -210,13 +211,12 @@ export default {
that.$refs['input' + index].focus() that.$refs['input' + index].focus()
}) })
} else { } else {
const errorSound = new Audio(require('../../assets/audio/y1840.mp3')) playAudio(isAudioAble)
errorSound.play()
this.$message.error({ this.$message.error({
message: '数据库中无对应' + location + '请重新输入', message: '数据库中无对应' + location + '请重新输入',
duration: 2000, duration: 2000,
onClose: () => { onClose: () => {
errorSound.pause() playAudio(!isAudioAble)
} }
}) })
this.form.value1 = null this.form.value1 = null
...@@ -229,13 +229,12 @@ export default { ...@@ -229,13 +229,12 @@ export default {
} }
}) })
} else { } else {
const errorSound = new Audio(require('../../assets/audio/y1840.mp3')) playAudio(isAudioAble)
errorSound.play()
return this.$message.error({ return this.$message.error({
message: '输入值不符合格式要求,请重新输入', message: '输入值不符合格式要求,请重新输入',
duration: 2000, duration: 2000,
onClose: () => { onClose: () => {
errorSound.pause() playAudio(!isAudioAble)
} }
}) })
} }
...@@ -255,13 +254,12 @@ export default { ...@@ -255,13 +254,12 @@ 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) {
const errorSound = new Audio(require('../../assets/audio/y1840.mp3')) playAudio(isAudioAble)
errorSound.play()
this.$message.error({ this.$message.error({
message: '您输入的pn' + this.form.pn + '与返回pn' + this.responsePn + '的不一样', message: '您输入的pn' + this.form.pn + '与返回pn' + this.responsePn + '的不一样',
duration: 2000, duration: 2000,
onClose: () => { onClose: () => {
errorSound.pause() playAudio(!isAudioAble)
} }
}) })
this.form.pn = '' this.form.pn = ''
...@@ -315,13 +313,12 @@ export default { ...@@ -315,13 +313,12 @@ 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) {
const errorSound = new Audio(require('../../assets/audio/y1840.mp3')) playAudio(isAudioAble)
errorSound.play()
this.$message.error({ this.$message.error({
message: '您输入的pn' + this.form.pn + '与返回pn' + this.responsePn + '的不一样', message: '您输入的pn' + this.form.pn + '与返回pn' + this.responsePn + '的不一样',
duration: 2000, duration: 2000,
onClose: () => { onClose: () => {
errorSound.pause() playAudio(!isAudioAble)
} }
}) })
this.form.pn = '' this.form.pn = ''
......
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