zrg
3 天以前 58179e90a2fc73ca32ac906444b36c58e9cf70db
Merge branch 'Dev' of http://101.37.171.70:10101/r/~jhz/STUWMS into Dev
1个文件已添加
7个文件已修改
414 ■■■■ 已修改文件
App.vue 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manifest.json 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/ZLGL/checkFlowList/QC_CheckBillflowList.vue 140 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/index/login.vue 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/index/mine.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/tiaomachaima/tiaomachaima2.vue 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/WebSocketServices.js 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/getuiUtils.js 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
App.vue
@@ -7,6 +7,7 @@
        getToken,
        getUserInfo
    } from "./utils/auth";
    import getuiUtils from "./utils/getuiUtils";
    export default {
        onLaunch: function() {
            console.log('App Launch')
@@ -38,6 +39,36 @@
            //     });
            // }
            // #endif
            // #ifdef APP-PLUS || APP
            // 监听 App 启动时的推送参数(冷启动:App 关闭后点击通知启动)
            const launchOpts = plus.runtime.launchArguments;
            if (launchOpts && launchOpts.payload) {
                this.handlePushJump(launchOpts.payload); // 处理跳转
            }
            // 监听通知点击事件(热启动:App 后台运行时点击通知)
            plus.push.addEventListener("click", (msg) => {
                let payload = {};
                console.log('msg: ', msg);
                // 兼容不同格式的 payload(本地推送 vs 远程推送)
                if (typeof msg.payload === "string") {
                    payload = JSON.parse(msg.payload); // 远程推送可能是字符串,需解析
                } else {
                    payload = msg.payload; // 本地推送是对象
                }
                this.handlePushJump(payload); // 处理跳转
            });
            // 个推v1版本只能通过透传传参
            plus.push.addEventListener('receive', (msg) => {
                console.log('收到 V1 版本透传消息:', msg);
                // 仅透传模板需要(通知模板无需处理)
                if (msg.payload) {
                    this.handlePushJump(msg.payload);
                }
            }, false);
            // #endif
        },
        onShow: function() {
            console.log('App Show')
@@ -45,6 +76,29 @@
        },
        onHide: function() {
            console.log('App Hide')
        },
        methods: {
            // 处理通知跳转逻辑
            handlePushJump(payload) {
                console.log('payload-enter: ', payload);
                if (!payload || !payload.pagePath) return;
                // 确保 App 处于前台
                // plus.runtime.foreground();
                // 跳转到指定页面
                setTimeout(() => {
                    uni.navigateTo({
                        url: `${payload.pagePath}?itemId=${payload.itemId}`, // 携带参数
                        fail: (err) => {
                            // 若页面栈满(最多10层),使用 redirectTo 替换当前页面
                            uni.redirectTo({
                                url: `${payload.pagePath}?itemId=${payload.itemId}`,
                            });
                        }
                    });
                }, 300)
            }
        }
    }
</script>
manifest.json
@@ -52,10 +52,24 @@
                    "<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
                    "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
                    "<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>",
                    "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>"
                    "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
                    "<uses-permission android:name=\"android.permission.INTERNET\"/>",
                    "<uses-permission android:name=\"android.permission.RECEIVE_BOOT_COMPLETED\"/>",
                    "<uses-permission android:name=\"android.permission.GET_TASKS\"/>",
                    "<uses-permission android:name=\"android.permission.BLUETOOTH\"/>",
                    "<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>",
                    "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
                    "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
                    "<uses-permission android:name=\"android.permission.BROADCAST_PACKAGE_ADDED\"/>",
                    "<uses-permission android:name=\"android.permission.BROADCAST_PACKAGE_CHANGED\"/>",
                    "<uses-permission android:name=\"android.permission.BROADCAST_PACKAGE_INSTALL\"/>",
                    "<uses-permission android:name=\"android.permission.BROADCAST_PACKAGE_REPLACED\"/>",
                    "<uses-permission android:name=\"android.permission.RESTART_PACKAGES\"/>",
                    "<uses-permission android:name=\"android.permission.REQUEST_INSTALL_PACKAGES\"/>"
                ],
                "abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
                "minSdkVersion" : 23
                "minSdkVersion" : 23,
                "excludePermissions" : []
            },
            /* ios打包配置 */
            "ios" : {
@@ -63,7 +77,20 @@
            },
            /* SDK配置 */
            "sdkConfigs" : {
                "ad" : {}
                "ad" : {},
                "push" : {
                    "unipush" : {
                        "icons" : {
                            "small" : {
                                "ldpi" : "static/logo_icon.png",
                                "mdpi" : "static/logo_icon.png",
                                "hdpi" : "static/logo_icon.png",
                                "xhdpi" : "static/logo_icon.png",
                                "xxhdpi" : "static/logo_icon.png"
                            }
                        }
                    }
                }
            },
            "icons" : {
                "android" : {
@@ -132,7 +159,7 @@
                    }
                }
            }
            }
        }
    },
    /* 快应用特有相关 */
    "quickapp" : {},
@@ -160,3 +187,6 @@
    "locale" : "zh-Hans",
    "fallbackLocale" : "zh-Hans"
}
//docs.getui.com/getui/question/sdk/ -->
/* ios打包配置 *//* SDK配置 */
pages/ZLGL/checkFlowList/QC_CheckBillflowList.vue
@@ -69,7 +69,8 @@
                <view class="op" v-if="operations == index">
                    <button class="op3" size="mini" plain @tap.stop="audit(item, 0)">审核</button>
                    <button class="op3" size="mini" plain @tap.stop="audit(item, 1)">反审核</button>
                    <button class="op3" size="mini" plain @tap.stop="fileUpload()">文件上传</button>
                    <button class="op3" size="mini" plain @tap.stop="fileUpload(item)">文件上传</button>
                    <button class="op3" size="mini" plain @tap.stop="getImage(item)">预览图片</button>
                    <!-- <button class="op3" size="mini" plain @tap.stop="Reject(item)">驳回</button> -->
                    <button class="op5" size="mini" plain @tap.stop="operations = -1">取消操作</button>
                </view>
@@ -98,8 +99,17 @@
            return {
                showDetail: -1,
                operations : -1,
                serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
                //上传参数
                uploadOptions: {},
                uploadOptions: {
                    url: CommonUtils.getServerUrl() + "/LMES/UploadFile",
                    formData: {
                        HBillNo:"",
                        HRemark: "",
                        HUserName: getUserInfo()["Czymc"]
                    }
                },
                hform: {
                    HSourceBillType:'8505',
                    HSourceBillTypeName: "首件检验单",
@@ -255,9 +265,13 @@
                    let {count, data, Message} = res.data
                    
                    if(count == 1) {
                        CommonUtils.showTips({
                            message: `审核成功`
                        })
                        if(mode==1){
                            this.showDialog(item["hmainid"]);
                        }
                        this.$forceUpdate()
                        setTimeout(() => {
                            this.cmdSearch()
@@ -337,7 +351,127 @@
                })
            },
            //反审核提交意见
            showDialog(HInterID) {
              uni.showModal({
                title: '请提交反审核意见',
                editable: true,
                placeholderText: '请输入内容',
                success: (result) => {
                  if (result.confirm) {
                    try {
                        let res = CommonUtils.doRequest2Sync({
                            url: '/LMES/AuditFlowOpinion',
                            data: {
                                "sWhere": result.content,
                                "billType":this.hform.HSourceBillType,
                                "HInterID":HInterID,
                                "type":1,
                                "user": getUserInfo()["Czymc"]
                            },
                        })
                        if (!res) {
                            return
                        }
                        let {
                            data,
                            count,
                            Message
                        } = res.data
                        if (count > 0) {
                            uni.showToast({
                                icon: 'none',
                                title: Message
                            })
                        } else {
                            uni.showToast({
                                icon: 'none',
                                title: Message
                            })
                        }
                    } catch (err) {
                        console.warn(err);
                        uni.showToast({
                            title: '接口请求失败:' + err,
                            icon: 'none'
                        })
                    }
                  }
                }
              })
            },
            // 上传文件
            fileUpload(item) {
                this.uploadOptions.formData.HBillNo = item.单据号
                this.$refs.XeUpload.upload('image', {});// image, video, file
            },
            handleUploadCallback(e) { // 文件上传回调
                console.log('file: ', e);
                if (['choose', 'success'].includes(e.type)) {
                  // 根据接口返回修改对应的response相关的逻辑
                  const tmpFiles = (e.data || []).map(({ response, tempFilePath, name, fileType }) => {
                    if(response.code=="1"){
                        CommonUtils.showTips({
                            message: "上传成功"
                        })
                    }else{
                        CommonUtils.showTips({
                            message: "上传失败"+response.Message
                        })
                    }
                  });
                }
            },
            async getImage(item) {//预览图片
                try {
                    let res = await CommonUtils.doRequest2Sync({
                        url: '/LMES/Filelist',
                        data: {
                            "HBillNo": item.单据号,
                        },
                    })
                    if (!res) {
                        return
                    }
                    let {
                        data,
                        count,
                        Message
                    } = res.data
                    if (count > 0) {
                        if(data.length>0){
                            const imageUrl = res.data.data[0]["url"];
                            //正则表达式获取服务器路径倒数第二个内容
                            const regex = /^(.*\/)[^\/]+\/[^\/]*\/?$/;
                            const match = this.serverUrl.match(regex);
                            console.log(match[1],imageUrl)
                            // 或者直接预览图片
                            uni.previewImage({
                                urls: [match[1]+imageUrl]
                            })
                        }else{
                            CommonUtils.showTips({
                                message: "无图片请先上传图片"
                            })
                        }
                    } else {
                        uni.showToast({
                            icon: 'none',
                            title: Message
                        })
                    }
                } catch (err) {
                    console.warn(err);
                    uni.showToast({
                        title: '接口请求失败:' + err,
                        icon: 'none'
                    })
                }
            }
        },
        onShow() {
            this.$nextTick(() => {
pages/index/login.vue
@@ -81,8 +81,11 @@
    import {
        CommonUtils
    } from "../../utils/common";
    import { getLanguagePackJson } from "../../utils/i18n";
    import {
        getLanguagePackJson
    } from "../../utils/i18n";
    import WebSocketServices from "@/utils/WebSocketServices";
    import getuiUtils from "../../utils/getuiUtils";
    export default {
        components: {
            hFormAlert
@@ -107,7 +110,7 @@
                    "杭州凯贝奈特外网": 'http://erp.hzcabinet.cn:9090/API/',
                    "翁涛涛本地测试": 'http://localhost:81/API/',
                    "陈镐哲本地测试": 'http://192.168.0.121:81/API/',
                    "陈镐哲本地测试2": 'http://192.168.255.35:81/API/',
                    "陈镐哲本地测试2": 'http://192.168.0.102:81/API/',
                    "张瑞广本地测试": 'http://localhost:8082/API/',
                    "余思杰本地测试": 'http://localhost:8082/LuBaoAPI/',
                    // 小卫内外网
@@ -119,12 +122,12 @@
                    // 锦隆
                    "锦隆-智能家居": "http://192.168.1.11/API/",
                    "锦隆-智能家居-外网": "http://61.174.29.234:8880/API/",
                    // 华舟包装
                    "宁波华舟包装1": "http://192.168.110.222:8082/API_NW/",
                    // 华舟包装
                    "宁波华舟包装1": "http://192.168.110.222:8082/API_NW/",
                    "宁波华舟包装2": "http://192.168.88.167:8082/API_NW/",
                    "宁波华舟包装": "http://61.164.64.222:8082/API_WW/",
                    "宁波华舟包装": "http://61.164.64.222:8082/API_WW/",
                },
                serverUrlName:uni.getStorageSync('serverUrlName') || '浙江智云迈思',
                serverUrlName: uni.getStorageSync('serverUrlName') || '浙江智云迈思',
                arrayOrganization: [],
                Organization: '',
@@ -197,7 +200,7 @@
                let url = this.serverUrlandName[this.serverUrlName];
                if (url != undefined) {
                    uni.setStorageSync('serverUrl', url)
                    uni.setStorageSync('serverUrlName', this.serverUrlName)
                    uni.setStorageSync('serverUrlName', this.serverUrlName)
                    this.serverUrl = url
                    this.changeApi = false
                    this.getOrganization()
@@ -322,21 +325,23 @@
                                uni.setStorageSync('login', "login");
                                uni.setStorageSync('Organization', this.Organization);
                                uni.setStorageSync('OrganizationID', this.HOrgName);
                                //存储部门 职员 仓库 等信息
                                uni.setStorageSync('HDeptID', res.data.data[0].HDeptID); //部门
                                uni.setStorageSync('HDeptName', res.data.data[0].HDeptName);
                                uni.setStorageSync('HEmpID', res.data.data[0].HEmpID); //职员
                                uni.setStorageSync('HEmpName', res.data.data[0].HEmpName);
                                uni.setStorageSync('HSCWHID', res.data.data[0].HSCWHID); //调入仓库
                                uni.setStorageSync('HSCWHName', res.data.data[0].HSCWHName);
                                uni.setStorageSync('HWhID', res.data.data[0].HWhID);//对应仓库
                                uni.setStorageSync('HWhName', res.data.data[0].HWhName);
                                uni.setStorageSync('HWorkCenterID', res.data.data[0].HWorkCenterID);//工作中心
                                uni.setStorageSync('HWorkCenterName', res.data.data[0].HWorkCenterName);
                                uni.setStorageSync('HSecManagerID', res.data.data[0].HSecManagerID); //对应验收
                                uni.setStorageSync('HSecManagerName', res.data.data[0].HSecManagerName);
                                //存储部门 职员 仓库 等信息
                                uni.setStorageSync('HDeptID', res.data.data[0].HDeptID); //部门
                                uni.setStorageSync('HDeptName', res.data.data[0].HDeptName);
                                uni.setStorageSync('HEmpID', res.data.data[0].HEmpID); //职员
                                uni.setStorageSync('HEmpName', res.data.data[0].HEmpName);
                                uni.setStorageSync('HSCWHID', res.data.data[0].HSCWHID); //调入仓库
                                uni.setStorageSync('HSCWHName', res.data.data[0].HSCWHName);
                                uni.setStorageSync('HWhID', res.data.data[0].HWhID); //对应仓库
                                uni.setStorageSync('HWhName', res.data.data[0].HWhName);
                                uni.setStorageSync('HWorkCenterID', res.data.data[0].HWorkCenterID); //工作中心
                                uni.setStorageSync('HWorkCenterName', res.data.data[0].HWorkCenterName);
                                uni.setStorageSync('HSecManagerID', res.data.data[0].HSecManagerID); //对应验收
                                uni.setStorageSync('HSecManagerName', res.data.data[0].HSecManagerName);
                                this.CommonUtils.setServerUrl(this.serverUrl)
                                // this.WebSocketServices.createConnect(res.data.data[0].Czybm,res.data.data[0].Czymc);
                                // getuiUtils.getClientID()
                                getuiUtils.getClientID(res.data.data[0].Czybm,res.data.data[0].Czymc)
                                uni.reLaunch({
                                    url: '/pages/index/index'
                                })
pages/index/mine.vue
@@ -103,7 +103,7 @@
                            // 断开Socket连接
                            // WebSocketServices.closeSocket();
                            // 销毁 userInfo 缓存
                            uni.removeStorageSync("userinfo")
                            // uni.removeStorageSync("userinfo")
                            uni.reLaunch({
                                url:'/pages/index/login'
                            })
pages/tiaomachaima/tiaomachaima2.vue
@@ -257,53 +257,7 @@
                    }
                )
            },
            //红外扫条码
            getCode(HBarCode) {
                if (!HBarCode) {
                    CommonUtils.playSound(0)
                    this.refreshBarCodeState()
                    uni.showToast({
                        title: '条码不能为空',
                        icon: 'none'
                    })
                } else {
                    uni.request({
                        url: this.serverUrl + '/Gy_BarCodeBillList/page',
                        data: {
                            sWhere: ` and 条码编号=''${this.barCodeInfoMeta.barCodeNo}''`,
                            user: this.userInfo.HEmpName,
                            page: 1,
                            size: 1
                        },
                        success: (res) => {
                            console.log('扫码返回', res.data.data);
                            if (res.data.count == 1) {
                                CommonUtils.playSound(1)
                                this.barCodeInfo = res.data.data[0]
                                this.barCodeSplitInfo = []
                                // 扫描条码后重置按钮状态
                                this.resetButtonState();
                            } else {
                                CommonUtils.playSound(0)
                                this.refreshBarCodeState()
                                uni.showToast({
                                    title: res.data.Message,
                                    icon: 'none'
                                })
                            }
                        },
                        fail: (res) => {
                            CommonUtils.playSound(0)
                            this.refreshBarCodeState()
                            console.log(res);
                            uni.showToast({
                                title: '接口请求失败',
                                icon: 'none'
                            })
                        },
                    });
                }
            },
            dialogInputConfirm(val) {
                this.itemCache["HSplitNum"] = val
utils/WebSocketServices.js
@@ -11,7 +11,7 @@
        this.wsUrl = CommonUtils.httpFormatWs(); // WebSocket 基础地址
        // 超时校验配置
        this.businessMessageInterval = 5 * 60 * 1000;
        this.businessMessageInterval = 5 * 60 * 1000;
        this.noMessageTimeout = this.businessMessageInterval + 2 * 60 * 1000;
        this.noMessageTimer = null; // 无消息超时定时器
@@ -96,10 +96,22 @@
                this.resetNoMessageTimer();
                // 处理业务消息
                if (message.Type === "Message") {
                if (message.Type === "MessageUnRead") { // 未读消息
                    let payload = {
                        pagePath: "/pages/ZLGL/OA_WorkLink/OA_WorkLinkBillList",
                        itemId: 0
                    }
                    const content = JSON.parse(message.Content);
                    this.showTaskTip(`您有${content.length}条消息需要处理!`);
                    this.showTaskTip(`您有${content.length}条消息需要处理!`, payload);
                    // this.emit("message", content); // 支持外部监听
                } else if (message.Type === "Message") {
                    const content = JSON.parse(message.Content)
                    let payload = {
                        pagePath: "/pages/ZLGL/OA_WorkLink/OA_WorkLinkBillList",
                        itemId: 0
                    }
                    this.showTaskTip(content[0]["内容"], payload, content[0]["主题"]);
                }
            } catch (error) {
                console.error("[WebSocket] 消息解析失败", error, res.data);
@@ -213,16 +225,19 @@
    }
    showTaskTip(Content) {
    showTaskTip(Content, payloads, Title = "重要通知") {
        // #ifdef APP-PLUS || APP
        let content = Content;
        let options = {
            title: "重要通知",
            title: Title,
            cover: true, // 是否覆盖上一次的通知
            when: new Date() // 通知显示时间
            when: new Date(), // 通知显示时间
            icon: "../static/logo.png",
            largeIcon: "../static/logo.png"
        };
        // TODO 跳转到指定页
        let payload = JSON.stringify({});
        let payload = JSON.stringify(payloads);
        console.log('payload: ', payload);
        plus.push.createMessage(content, payload, options);
        // #endif
utils/getuiUtils.js
New file
@@ -0,0 +1,58 @@
import {
    CommonUtils
} from "./common";
class getuiInstance {
    constructor() {
        this.cid = ""
    }
    getClientID(Userbm, UserName) {
        // #ifdef APP-PLUS
        const info = plus.push.getClientInfo()
        this.cid = info["clientid"]
        console.log('cid: ', this.cid);
        this.setUserClientIDRelative(Userbm, UserName, this.cid, 1)
        // #endif
    };
    async setUserClientIDRelative(Userbm, UserName, ClientID, Online) {
        try {
            let res = await CommonUtils.doRequest2Async({
                url: "/Web/SetGy_UserClientIdConnection",
                method: "POST",
                data: {
                    HUserbm: Userbm,
                    HUserName: UserName,
                    HClientID: ClientID,
                    HOnline: Online
                }
            })
            let {
                data,
                count,
                Message
            } = res.data
            if(count != 1) {
                CommonUtils.showTips({
                    title: "温馨提示",
                    message: Message
                })
            }
        }catch(err) {
            CommonUtils.showTips({
                title: "温馨提示",
                message: err
            })
        }
    }
}
export default new getuiInstance()