chenhaozhe
2025-07-18 c98e485f44c7d852ed25bac7e01d4f6dd0d1d159
添加音频文件
8个文件已修改
56 ■■■■■ 已修改文件
pages/caigourukujiaoyan/form.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/qitachukujiaoyan/detail.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/qitarukujiaoyan/form.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/shengchanbuliaojiaoyan/form.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/weiwaibuliaojiaoyan/form.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/weiwailingliaojiaoyan/form.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/xiaoshouchukujiaoyan/form.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/common.js 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/caigourukujiaoyan/form.vue
@@ -292,6 +292,7 @@
                    },
                    success: (res) => {
                        if (res.data.count == 1) {
                            CommonUtils.playSound(1);
                            var data = res.data.data
                            console.log('单据信息: ', data)
                            this.hform.HInterID = data.hInterIDField
@@ -306,6 +307,7 @@
                            this.tabs = 2
                            this.DisBillEntryList();
                        } else {
                            CommonUtils.playSound(0);
                            uni.showToast({
                                title: res.data.Message,
                                icon: 'none'
@@ -314,6 +316,7 @@
                        }
                    },
                    fail: (res) => {
                        CommonUtils.playSound(0);
                        console.log(res);
                        uni.showToast({
                            title: '接口请求失败',
@@ -486,6 +489,7 @@
                            console.log('扫码返回', res.data);
                            this.hform.HBarCode = ''
                            if (res.data.count == 1) {
                                CommonUtils.playSound(1);
                                var data = res.data.data
                                if (data.hBarTypeField == '仓库条码') {
                                    this.hform.HWHName = data.hWhNameField
@@ -572,6 +576,7 @@
                                //清空数量
                                this.hform.HQty = ''
                            } else {
                                CommonUtils.playSound(0);
                                uni.showToast({
                                    title: res.data.Message,
                                    icon: 'none'
@@ -579,6 +584,7 @@
                            }
                        },
                        fail: (res) => {
                            CommonUtils.playSound(0);
                            console.log(res);
                            uni.showToast({
                                title: '接口请求失败',
pages/qitachukujiaoyan/detail.vue
@@ -292,6 +292,7 @@
                    },
                    success: (res) => {
                        if (res.data.count == 1) {
                            CommonUtils.playSound(1);
                            var data = res.data.data
                            console.log('单据信息: ', data)
                            this.hform.HInterID = data.hInterIDField
@@ -306,6 +307,7 @@
                            this.tabs = 2
                            this.DisBillEntryList();
                        } else {
                            CommonUtils.playSound(0);
                            uni.showToast({
                                title: res.data.Message,
                                icon: 'none'
@@ -314,6 +316,7 @@
                        }
                    },
                    fail: (res) => {
                        CommonUtils.playSound(0);
                        console.log(res);
                        uni.showToast({
                            title: '接口请求失败',
@@ -435,6 +438,7 @@
                                HBarCode: sBarCode
                            },
                            success: (res) => {
                                CommonUtils.playSound(1);
                                console.log('删除条码', res.data);
                                this.hform.HBarCode = ''
                                if (res.data.count == 1) {
@@ -448,6 +452,7 @@
                                }
                            },
                            fail: (res) => {
                                CommonUtils.playSound(0);
                                console.log(res);
                                uni.showToast({
                                    title: '接口请求失败',
@@ -482,9 +487,11 @@
                            // HCustom2: ""
                        },
                        success: (res) => {
                            console.log('扫码返回', res.data);
                            this.hform.HBarCode = ''
                            if (res.data.count == 1) {
                                CommonUtils.playSound(1);
                                var data = res.data.data
                                if (data.hBarTypeField == '仓库条码') {
                                    this.hform.HWHName = data.hWhNameField
@@ -578,6 +585,7 @@
                            }
                        },
                        fail: (res) => {
                            CommonUtils.playSound(0);
                            console.log(res);
                            uni.showToast({
                                title: '接口请求失败',
pages/qitarukujiaoyan/form.vue
@@ -283,6 +283,7 @@
                    },
                    success: (res) => {
                        if (res.data.count == 1) {
                            CommonUtils.playSound(1);
                            var data = res.data.data
                            console.log('单据信息: ', data)
                            this.hform.HInterID = data.hInterIDField
@@ -297,6 +298,7 @@
                            this.tabs = 2
                            this.DisBillEntryList();
                        } else {
                            CommonUtils.playSound(0);
                            uni.showToast({
                                title: res.data.Message,
                                icon: 'none'
@@ -305,6 +307,7 @@
                        }
                    },
                    fail: (res) => {
                        CommonUtils.playSound(0);
                        console.log(res);
                        uni.showToast({
                            title: '接口请求失败',
@@ -476,6 +479,7 @@
                            console.log('扫码返回', res.data);
                            this.hform.HBarCode = ''
                            if (res.data.count == 1) {
                                CommonUtils.playSound(1);
                                var data = res.data.data
                                if (data.hBarTypeField == '仓库条码') {
                                    this.hform.HWHName = data.hWhNameField
@@ -562,6 +566,7 @@
                                //清空数量
                                this.hform.HQty = ''
                            } else {
                                CommonUtils.playSound(0);
                                uni.showToast({
                                    title: res.data.Message,
                                    icon: 'none'
@@ -569,6 +574,7 @@
                            }
                        },
                        fail: (res) => {
                            CommonUtils.playSound(0);
                            console.log(res);
                            uni.showToast({
                                title: '接口请求失败',
pages/shengchanbuliaojiaoyan/form.vue
@@ -174,6 +174,7 @@
    import {
        getUserInfo
    } from "@/utils/auth.js";
    import { CommonUtils } from "@/utils/common.js"
    export default {
        data() {
            return {
@@ -285,6 +286,7 @@
                    },
                    success: (res) => {
                        if (res.data.count == 1) {
                            CommonUtils.playSound(1)
                            var data = res.data.data
                            console.log('单据信息: ', data)
                            this.hform.HInterID = data.hInterIDField
@@ -299,6 +301,7 @@
                            this.tabs = 2
                            this.DisBillEntryList();
                        } else {
                            CommonUtils.playSound(0)
                            uni.showToast({
                                title: res.data.Message,
                                icon: 'none'
@@ -307,6 +310,7 @@
                        }
                    },
                    fail: (res) => {
                        CommonUtils.playSound(0)
                        console.log(res);
                        uni.showToast({
                            title: '接口请求失败',
@@ -479,6 +483,7 @@
                            console.log('扫码返回', res.data);
                            this.hform.HBarCode = ''
                            if (res.data.count == 1) {
                                CommonUtils.playSound(1)
                                var data = res.data.data
                                if (data.hBarTypeField == '仓库条码') {
                                    this.hform.HWHName = data.hWhNameField
@@ -565,6 +570,7 @@
                                //清空数量
                                this.hform.HQty = ''
                            } else {
                                CommonUtils.playSound(0)
                                uni.showToast({
                                    title: res.data.Message,
                                    icon: 'none'
@@ -572,6 +578,7 @@
                            }
                        },
                        fail: (res) => {
                            CommonUtils.playSound(0)
                            console.log(res);
                            uni.showToast({
                                title: '接口请求失败',
pages/weiwaibuliaojiaoyan/form.vue
@@ -283,6 +283,7 @@
                    },
                    success: (res) => {
                        if (res.data.count == 1) {
                            CommonUtils.playSound(1);
                            var data = res.data.data
                            console.log('单据信息: ', data)
                            this.hform.HInterID = data.hInterIDField
@@ -297,6 +298,7 @@
                            this.tabs = 2
                            this.DisBillEntryList();
                        } else {
                            CommonUtils.playSound(0);
                            uni.showToast({
                                title: res.data.Message,
                                icon: 'none'
@@ -305,6 +307,7 @@
                        }
                    },
                    fail: (res) => {
                        CommonUtils.playSound(0);
                        console.log(res);
                        uni.showToast({
                            title: '接口请求失败',
@@ -476,6 +479,7 @@
                            console.log('扫码返回', res.data);
                            this.hform.HBarCode = ''
                            if (res.data.count == 1) {
                                CommonUtils.playSound(1);
                                var data = res.data.data
                                if (data.hBarTypeField == '仓库条码') {
                                    this.hform.HWHName = data.hWhNameField
@@ -562,6 +566,7 @@
                                //清空数量
                                this.hform.HQty = ''
                            } else {
                                CommonUtils.playSound(0);
                                uni.showToast({
                                    title: res.data.Message,
                                    icon: 'none'
@@ -569,6 +574,7 @@
                            }
                        },
                        fail: (res) => {
                            CommonUtils.playSound(0);
                            console.log(res);
                            uni.showToast({
                                title: '接口请求失败',
pages/weiwailingliaojiaoyan/form.vue
@@ -284,6 +284,7 @@
                    },
                    success: (res) => {
                        if (res.data.count == 1) {
                            CommonUtils.playSound(1);
                            var data = res.data.data
                            console.log('单据信息: ', data)
                            this.hform.HInterID = data.hInterIDField
@@ -298,6 +299,7 @@
                            this.tabs = 2
                            this.DisBillEntryList();
                        } else {
                            CommonUtils.playSound(0);
                            uni.showToast({
                                title: res.data.Message,
                                icon: 'none'
@@ -306,6 +308,7 @@
                        }
                    },
                    fail: (res) => {
                        CommonUtils.playSound(0);
                        console.log(res);
                        uni.showToast({
                            title: '接口请求失败',
@@ -478,6 +481,7 @@
                            console.log('扫码返回', res.data);
                            this.hform.HBarCode = ''
                            if (res.data.count == 1) {
                                CommonUtils.playSound(1);
                                var data = res.data.data
                                if (data.hBarTypeField == '仓库条码') {
                                    this.hform.HWHName = data.hWhNameField
@@ -564,6 +568,7 @@
                                //清空数量
                                this.hform.HQty = ''
                            } else {
                                CommonUtils.playSound(0);
                                uni.showToast({
                                    title: res.data.Message,
                                    icon: 'none'
@@ -571,6 +576,7 @@
                            }
                        },
                        fail: (res) => {
                            CommonUtils.playSound(0);
                            console.log(res);
                            uni.showToast({
                                title: '接口请求失败',
pages/xiaoshouchukujiaoyan/form.vue
@@ -284,6 +284,7 @@
                    },
                    success: (res) => {
                        if (res.data.count == 1) {
                            CommonUtils.playSound(1);
                            var data = res.data.data
                            console.log('单据信息: ', data)
                            this.hform.HInterID = data.hInterIDField
@@ -298,6 +299,7 @@
                            this.tabs = 2
                            this.DisBillEntryList();
                        } else {
                            CommonUtils.playSound(0);
                            uni.showToast({
                                title: res.data.Message,
                                icon: 'none'
@@ -306,6 +308,7 @@
                        }
                    },
                    fail: (res) => {
                        CommonUtils.playSound(0);
                        console.log(res);
                        uni.showToast({
                            title: '接口请求失败',
@@ -477,6 +480,7 @@
                            console.log('扫码返回', res.data);
                            this.hform.HBarCode = ''
                            if (res.data.count == 1) {
                                CommonUtils.playSound(1);
                                var data = res.data.data
                                if (data.hBarTypeField == '仓库条码') {
                                    this.hform.HWHName = data.hWhNameField
@@ -563,6 +567,7 @@
                                //清空数量
                                this.hform.HQty = ''
                            } else {
                                CommonUtils.playSound(0);
                                uni.showToast({
                                    title: res.data.Message,
                                    icon: 'none'
@@ -570,6 +575,7 @@
                            }
                        },
                        fail: (res) => {
                            CommonUtils.playSound(0);
                            console.log(res);
                            uni.showToast({
                                title: '接口请求失败',
utils/common.js
@@ -174,6 +174,17 @@
            }
        })
    }
    // uni-app 播放音频封装
    playSound(e){
        const innerAudioContext = uni.createInnerAudioContext();
        if(e == 1){
            innerAudioContext.src = '/static/success.wav';
        }else{
            innerAudioContext.src = '/static/jingbao.wav';
        }
        innerAudioContext.play(); // 播放音频
    }
}
export const CommonUtils = Object.freeze(new commonUtils());