1
chenhaozhe
2 天以前 0187cbec681fffcd6a77190b5ed35d185d5bcfcb
1
6个文件已添加
15个文件已修改
1648 ■■■■■ 已修改文件
.gitignore 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
App.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manifest.json 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/MJGL/Sb_EquipMaintainBill/Sb_EquipMaintainBill.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/MJGL/mujubaoyangjiludan/Sc_MouldMaintainBill.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/MJGL/mujudianjianjiludan/Sc_MouldDotCheckBill.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/ZLGL/AanDengHujiao/OA_ErrMsgBackBill/OA_ErrMsgBackBill.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/ZLGL/AanDengHujiao/OA_ErrMsgBackCheckBill/OA_ErrMsgBackCheckBill.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/ZLGL/AanDengHujiao/OA_ErrMsgBackHandleBill/OA_ErrMsgBackHandleBill.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/ZLGL/AanDengHujiao/OA_ErrMsgBackReceiveBill/OA_ErrMsgBackReceiveBill.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/ZLGL/AanDengHujiao/OA_ErrMsgBackSignBill/OA_ErrMsgBackSignBill.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/ZLGL/OA_WorkLink/OA_WorkLinkBill.vue 474 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/ZLGL/OA_WorkLink/OA_WorkLinkBillList.vue 483 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/ZLGL/style/MJBillStyle.scss 310 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/ZLGL/style/MJListStyle.scss 193 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/index/login.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/index/tab4.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/BasicInfo.js 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/WebSocketServices.js 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/common.js 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.gitignore
@@ -5,3 +5,4 @@
node_modules
/package-lock.json
/unpackage
App.vue
@@ -11,6 +11,15 @@
        },
        onShow: function() {
            console.log('App Show')
            // let content = "您有一条新的消息!";
            // let options = {
            // title: "通知标题",
            // cover: false, // 是否覆盖上一次的通知
            // when: new Date() // 通知显示时间
            // };
            // let payload = JSON.stringify({ id: "123", key: "value" });
            // plus.push.createMessage(content, payload, options);
        },
        onHide: function() {
            console.log('App Hide')
manifest.json
@@ -2,8 +2,8 @@
    "name" : "智云LMES",
    "appid" : "__UNI__B002F49",
    "description" : "",
    "versionName" : "2.0.46",
    "versionCode" : 246,
    "versionName" : "2.0.52",
    "versionCode" : 252,
    "transformPx" : false,
    /* 5+App特有相关 */
    "app-plus" : {
@@ -21,7 +21,8 @@
            "Camera" : {},
            "Contacts" : {},
            "Bluetooth" : {},
            "Barcode" : {}
            "Barcode" : {},
            "Push" : {}
        },
        /* 应用发布信息 */
        "distribute" : {
@@ -57,7 +58,8 @@
            },
            /* SDK配置 */
            "sdkConfigs" : {
                "ad" : {}
                "ad" : {},
                "push" : {}
            },
            "icons" : {
                "android" : {
pages.json
@@ -1548,6 +1548,20 @@
            {
                "navigationBarTitleText" : "器具维修验收单缓存"
            }
        },
        {
            "path" : "pages/ZLGL/OA_WorkLink/OA_WorkLinkBill",
            "style" :
            {
                "navigationBarTitleText" : "工作联系单"
            }
        },
        {
            "path" : "pages/ZLGL/OA_WorkLink/OA_WorkLinkBillList",
            "style" :
            {
                "navigationBarTitleText" : "工作联系单列表"
            }
        }
    ],
pages/MJGL/Sb_EquipMaintainBill/Sb_EquipMaintainBill.vue
@@ -424,9 +424,6 @@
                        message: err
                    })
                }
            },
            toCheckFile() {
                if (this.hform.HEquipID == 0) {
pages/MJGL/mujubaoyangjiludan/Sc_MouldMaintainBill.vue
@@ -273,7 +273,6 @@
    import {
        MpaasScan
    } from "@/utils/mpaasScan.js"
    import "@/pages/MJGL/style/MJBillStyle.scss"
    import {
        getUserInfo
    } from "../../../utils/auth";
@@ -869,4 +868,5 @@
</script>
<style lang="scss">
    @import "@/pages/MJGL/style/MJBillStyle.scss"
</style>
pages/MJGL/mujudianjianjiludan/Sc_MouldDotCheckBill.vue
@@ -309,7 +309,6 @@
    import {
        MpaasScan
    } from "@/utils/mpaasScan.js"
    import "@/pages/MJGL/style/MJBillStyle.scss"
    import {
        getUserInfo
    } from "../../../utils/auth";
@@ -951,4 +950,5 @@
</script>
<style lang="scss">
    @import "@/pages/MJGL/style/MJBillStyle.scss"
</style>
pages/ZLGL/AanDengHujiao/OA_ErrMsgBackBill/OA_ErrMsgBackBill.vue
@@ -277,7 +277,6 @@
    import {CommonUtils} from "@/utils/common";
    import getDateTime from '@/utils/getdateTime.js';
    import {getUserInfo} from "../../../../utils/auth";
    import "@/pages/ZLGL/AanDengHujiao/style/OA_ErrMsgStyle.scss"
    export default {
        data() {
            return {
@@ -1040,4 +1039,5 @@
</script>
<style lang="scss">
    @import "@/pages/ZLGL/AanDengHujiao/style/OA_ErrMsgStyle.scss"
</style>
pages/ZLGL/AanDengHujiao/OA_ErrMsgBackCheckBill/OA_ErrMsgBackCheckBill.vue
@@ -232,7 +232,6 @@
    import {
        getUserInfo
    } from "../../../../utils/auth";
    import "@/pages/ZLGL/AanDengHujiao/style/OA_ErrMsgStyle.scss"
    export default {
        data() {
            return {
@@ -1020,4 +1019,5 @@
</script>
<style lang="scss">
    @import "@/pages/ZLGL/AanDengHujiao/style/OA_ErrMsgStyle.scss"
</style>
pages/ZLGL/AanDengHujiao/OA_ErrMsgBackHandleBill/OA_ErrMsgBackHandleBill.vue
@@ -239,7 +239,6 @@
    import {
        getUserInfo
    } from "../../../../utils/auth";
    import "@/pages/ZLGL/AanDengHujiao/style/OA_ErrMsgStyle.scss"
    export default {
        data() {
            return {
@@ -1044,4 +1043,5 @@
</script>
<style lang="scss">
    @import "@/pages/ZLGL/AanDengHujiao/style/OA_ErrMsgStyle.scss"
</style>
pages/ZLGL/AanDengHujiao/OA_ErrMsgBackReceiveBill/OA_ErrMsgBackReceiveBill.vue
@@ -240,7 +240,6 @@
    import {
        getUserInfo
    } from "../../../../utils/auth";
    import "@/pages/ZLGL/AanDengHujiao/style/OA_ErrMsgStyle.scss"
    export default {
        data() {
            return {
@@ -905,4 +904,5 @@
</script>
<style lang="scss">
    @import "@/pages/ZLGL/AanDengHujiao/style/OA_ErrMsgStyle.scss"
</style>
pages/ZLGL/AanDengHujiao/OA_ErrMsgBackSignBill/OA_ErrMsgBackSignBill.vue
@@ -227,7 +227,6 @@
    import {
        getUserInfo
    } from "../../../../utils/auth";
    import "@/pages/ZLGL/AanDengHujiao/style/OA_ErrMsgStyle.scss"
    export default {
        data() {
            return {
@@ -986,4 +985,5 @@
</script>
<style lang="scss">
    @import "@/pages/ZLGL/AanDengHujiao/style/OA_ErrMsgStyle.scss"
</style>
pages/ZLGL/OA_WorkLink/OA_WorkLinkBill.vue
New file
@@ -0,0 +1,474 @@
<template>
    <view>
        <view class="tabs" id="tabs">
            <view :class="tabs == 0 ? 'on':''" @tap="tabs = 0">基本信息</view>
            <!-- <view :class="tabs == 1 ? 'on':''" @tap="tabs = 1">明细信息</view> -->
            <view :class="tabs == 2 ? 'on':''" @tap="tabs = 2">其他信息</view>
            <!-- <view :class="tabs == 3 ? 'on':''" @tap="tabs = 3">附件信息</view> -->
        </view>
        <!-- 基本信息 -->
        <template v-if="tabs == 0">
            <view class="form" :style="{
                height: containerHeight + 'px',
                overflow: 'auto'
            }">
                <view class="form-item">
                    <view class="title">主题:</view>
                    <view class="right">
                        <input type="text" v-model="hform.HContext" placeholder="请输入主题..." />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">发送人:</view>
                    <zxz-uni-data-select class="right" :localdata="HEmpList" dataKey="HName" dataValue="HName"
                        v-model="hform.HSendMan" :filterable="true">
                    </zxz-uni-data-select>
                    <!-- <input disabled v-model="hform.HDeptName" placeholder="请选择部门" /> -->
                </view>
                <view class="form-item">
                    <view class="title">接收人:</view>
                    <zxz-uni-data-select class="right" :localdata="HEmpList" dataKey="HName" dataValue="HName"
                        v-model="hform.HReceiveMan" :filterable="true">
                    </zxz-uni-data-select>
                    <!-- <input disabled v-model="hform.HDeptName" placeholder="请选择部门" /> -->
                </view>
                <view class="form-item">
                    <view class="title">紧急类型:</view>
                    <zxz-uni-data-select class="right" :localdata="[
                        {value: '普通'},
                        {value: '紧急'}
                        ]" dataKey="value" dataValue="value" v-model="hform.HLevel">
                    </zxz-uni-data-select>
                    <!-- <input disabled v-model="hform.HDeptName" placeholder="请选择部门" /> -->
                </view>
                <view class="form-item">
                    <view class="title">发送类型:</view>
                    <zxz-uni-data-select class="right" :localdata="[
                        {value: '公共'},
                        {value: '个人'}
                    ]" dataKey="value" dataValue="value" v-model="hform.HSendType">
                    </zxz-uni-data-select>
                    <!-- <input disabled v-model="hform.HDeptName" placeholder="请选择部门" /> -->
                </view>
                <view class="form-item">
                    <view class="title">抄送人:</view>
                    <zxz-uni-data-select class="right" :localdata="HEmpList" dataKey="HName" dataValue="HName"
                        :filterable="true"
                        :multiple="true" placeholder="请选择抄送人..."
                         @input="HCopyManChange">
                    </zxz-uni-data-select>
                    <!-- <input disabled v-model="hform.HDeptName" placeholder="请选择部门" /> -->
                </view>
                <view class="form-item">
                    <view class="title">单据号:</view>
                    <view class="righton">
                        <input disabled v-model="hform.HBillNo" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">单据日期:</view>
                    <view class="righton">
                        <input disabled v-model="hform.HDate" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">推荐完成日期:</view>
                    <view class="right">
                        <uni-datetime-picker type="date" :clear-icon="false" v-model="hform.HCommDate">
                            <input :value="hform.HCommDate" />
                        </uni-datetime-picker>
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">发送部门:</view>
                    <zxz-uni-data-select class="right" :localdata="HDeptList" dataKey="部门名称" dataValue="HItemID"
                        v-model="hform.HDeptID" :filterable="true">
                    </zxz-uni-data-select>
                    <!-- <input disabled v-model="hform.HDeptName" placeholder="请选择部门" /> -->
                </view>
                <view class="form-item">
                    <view class="title">详细内容:</view>
                    <view class="right">
                        <textarea v-model="hform.HDescription" placeholder="请输入详细内容" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">备注:</view>
                    <view class="right">
                        <textarea v-model="hform.HRemark" placeholder="请输入备注" />
                    </view>
                </view>
            </view>
        </template>
        <!-- 其他信息 -->
        <template v-if="tabs == 2">
            <view class="form" :style="{
                height: containerHeight + 'px',
                overflow: 'auto'
            }">
                <view class="form-item">
                    <view class="title">创建人:</view>
                    <view class="righton">
                        <input v-model="hform.HMaker" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">创建日期:</view>
                    <view class="righton">
                        <input v-model="hform.HMakeDate" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">修改人:</view>
                    <view class="righton">
                        <input v-model="hform.HUpDater" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">修改日期:</view>
                    <view class="righton">
                        <input v-model="hform.HUpDateDate" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">审核人:</view>
                    <view class="righton">
                        <input v-model="hform.HChecker" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">审核时间:</view>
                    <view class="righton">
                        <input v-model="hform.HCheckDate" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">作废人:</view>
                    <view class="righton">
                        <input v-model="hform.HDeleteMan" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">作废日期:</view>
                    <view class="righton">
                        <input v-model="hform.HDeleteDate" />
                    </view>
                </view>
            </view>
        </template>
        <!-- 操作按钮 -->
        <view class="buttons" id="buttons">
            <button class="btn-a" size="mini" @tap="submit">提交</button>
            <view style="flex: 1;"></view>
            <button class="btn-a" size="mini" @tap="addNew">新增</button>
            <button class="btn-c" size="mini" @tap="goBack">退出</button>
        </view>
    </view>
</template>
<script>
    import dayjs from "dayjs";
    import {
        CommonUtils
    } from "@/utils/common";
    import {
        MpaasScan
    } from "@/utils/mpaasScan.js"
    import {
        getUserInfo
    } from "../../../utils/auth";
    import {
        getEmpList
    } from "@/utils/BasicInfo.js"
    export default {
        name: 'OA_WorkLinkBill',
        data() {
            return {
                tabs: 0,
                HMainSourceBillType: "",
                btnTop: 0,
                tabsBottom: 0,
                HModName: "OA_WorkLinkBill",
                HBillType: '4501',
                operationType: 1,
                refSav: 'Add', // 执行提交的操作类型,与operationType类似
                enableEdit: true,
                uploadOptions: {},
                HEmpList: [],
                HDeptList: [],
                HShiftsList: [],
                HCheckFileList: [],
                attachmentInfo: [],
                hform: {
                    HBarCode: "",
                    HBillNo: "",
                    HInterID: "",
                    HEntryID: "",
                    HDate: dayjs(new Date()).format("YYYY-MM-DD"),
                    HContext: "",
                    HSendMan: getUserInfo()["HEmpName"],
                    HReceiveMan: "",
                    HLevel: "普通",
                    HSendType: "公共",
                    HCopyMan: "",
                    HDescription: "",
                    HRemark: "",
                    HCommDate: "",
                    HEvaluateStatusName: "",
                    HEvaluateStatusID: "0",
                    HRelationBillNo: "",
                    HRelationInterID: "0",
                    HRelationEntryID: "0",
                    HRelationBillType: "",
                    HDeptName: "",
                    HDeptID: "0",
                    HHasten: "0",
                    HMaker: getUserInfo()['Czymc'],
                    HMakeDate: dayjs(new Date()).format("YYYY-MM-DD"),
                    HUpDater: "",
                    HUpDateDate: "",
                    HChecker: "",
                    HCheckDate: "",
                    HDeleteMan: "",
                    HDeleteDate: "",
                }
            };
        },
        computed: {
            containerHeight: {
                get() {
                    return this.btnTop - this.tabsBottom - 5
                }
            },
            calcHLastResult: {
                get() {
                    if (this.HCheckFileList.length == 0) {
                        return 'OK'
                    } else {
                        let okCount = this.HCheckFileList.reduce((acc, item) => {
                            if (item.HMaintainResult) {
                                return acc + 1
                            }
                            return acc
                        }, 0)
                        if (okCount == this.HCheckFileList.length) {
                            return 'OK'
                        }
                        return 'NG'
                    }
                }
            }
        },
        methods: {
            // 抄送人修改
            HCopyManChange(e) {
                this.hform.HCopyMan = e.join(',')
            },
            ValidCheck() {
                if (this.hform.HContext == "") {
                    return {
                        Message: "未录入主题,请先录入主题!",
                        state: false
                    }
                }
                if (this.hform.HSendMan == "") {
                    return {
                        Message: "未录入主题,请先录入主题!",
                        state: false
                    }
                }
                if (this.hform.HReceiveMan == "") {
                    return {
                        Message: "未选择接收人,请先选择接收人!",
                        state: false
                    }
                }
                if (this.hform.HDeptID == 0) {
                    return {
                        Message: "未选择发送部门,请先选择发送部门",
                        state: false
                    }
                }
                return {
                    Message: "",
                    state: true
                }
            },
            addNew() {
                uni.redirectTo({
                    url: './OA_WorkLinkBill?operationType=1'
                })
            },
            goBack() {
                uni.navigateBack()
            },
            //获取使用部门数据
            async getHDeptList() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: '/Gy_Department/list',
                        data: {
                            sWhere: "",
                            user: uni.getStorageSync('HUserName'),
                            Organization: uni.getStorageSync('Organization')
                        }
                    })
                    let {
                        data,
                        count,
                        Message
                    } = res.data
                    if (count == 1) {
                        this.HDeptList = data
                    } else {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: Message
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: '温馨提示',
                        message: err
                    })
                }
            },
            async getMaxNum() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: "/Web/GetMAXNum",
                        data: {
                            "HBillType": this.HBillType
                        }
                    })
                    let {
                        count,
                        data,
                        Message
                    } = res.data
                    console.log('data: ', data);
                    this.hform.HInterID = 0
                    this.hform.HBillNo = data[0]["HBillNo"]
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: "获取单据信息异常: " + err
                    })
                }
            },
            async submit() {
                let valid = this.ValidCheck()
                if (!valid.state) {
                    return CommonUtils.showTips({
                        message: valid.Message
                    })
                }
                try {
                    let oMain = JSON.stringify(this.hform);
                    let sMainSub = oMain + ';' + getUserInfo()['Czymc'] + ';' + this.refSav;
                    let res = await CommonUtils.doRequest2Sync({
                        url: "/Sc_MESTransFerWorkBill/SaveOA_WorkLinkBill",
                        data: {
                            "msg": sMainSub
                        },
                        method: "POST"
                    })
                    if (!res) {
                        return
                    }
                    let {
                        count,
                        Message
                    } = res.data
                    if (count == 1) {
                        uni.showModal({
                            title: '提示',
                            content: res.data.Message + '。是否继续新增?(点击取消返回上级页面)',
                            success: (res) => {
                                if (res.confirm) {
                                    console.log('用户点击确定');
                                    uni.redirectTo({
                                        url: './OA_WorkLinkBill?operationType=1'
                                    })
                                } else if (res.cancel) {
                                    console.log('用户点击取消');
                                    setTimeout(() => {
                                        uni.navigateBack();
                                    }, 50)
                                }
                            }
                        });
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: "提交单据失败: " + Message
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: "提交单据失败: " + err
                    })
                }
            }
        },
        async onLoad(e) {
            console.log('e: ', e);
            if (!e.operationType) {
                this.operationType = 1
            } else {
                this.operationType = e.operationType
            }
            if (this.operationType == 1) {
                // 新增
                this.getMaxNum()
            } else if (this.operationType == 2) {
                // 复制
            } else if (this.operationType == 3) {
                // 编辑
            } else if (this.operationType == 4) {
                // 浏览
            }
            this.getHDeptList()
            try {
                this.HEmpList = await getEmpList()
            } catch (err) {
            }
        },
        onReady() {
            const query = uni.createSelectorQuery().in(this)
            query.select("#buttons")
                .boundingClientRect()
                .select("#tabs")
                .boundingClientRect()
                .exec(res => {
                    this.btnTop = Math.floor(res[0].top)
                    this.tabsBottom = Math.ceil(res[1].bottom)
                })
        }
    }
</script>
<style lang="scss" scoped>
    @import "@/pages/ZLGL/style/MJBillStyle.scss"
</style>
pages/ZLGL/OA_WorkLink/OA_WorkLinkBillList.vue
New file
@@ -0,0 +1,483 @@
<template>
    <view class="content">
        <view class="form">
            <view class="form-item">
                <view class="title">开始时间:</view>
                <view class="right">
                    <uni-datetime-picker type="date" :clear-icon="false" v-model="hform.HBeginDate">
                        <input :value="hform.HBeginDate" />
                    </uni-datetime-picker>
                </view>
            </view>
            <view class="form-item">
                <view class="title">结束时间:</view>
                <view class="right">
                    <uni-datetime-picker type="date" :clear-icon="false" v-model="hform.HEndDate">
                        <input :value="hform.HEndDate" />
                    </uni-datetime-picker>
                </view>
            </view>
            <view v-if="showmore">
                <view class="form-item">
                    <view class="title">单据号:</view>
                    <view class="right">
                        <input v-model="hform.HBillNo" placeholder="请输入单据号" />
                    </view>
                </view>
            </view>
            <view class="other">
                <view v-if="!showmore" @tap="changeShowMore">
                    展开其他条件<uni-icons color="#1890FF" style="margin-left: 8rpx;" type="bottom"></uni-icons>
                </view>
                <view v-if="showmore" @tap="changeShowMore">
                    折叠其他条件<uni-icons color="#1890FF" style="margin-left: 8rpx;" type="top"></uni-icons>
                </view>
            </view>
            <view class="buttons">
                <button class="btn-a" size="mini" type="default" @tap="clear">重置</button>
                <button class="btn-b" size="mini" type="default" @tap="add">新增</button>
                <button class="btn-c" size="mini" type="default" @tap="search">查询</button>
            </view>
        </view>
        <view id="divide" style="width: 100%;height: 16rpx;background-color: #e5e5e5;"></view>
        <view :style="{
            height: calcContentHeight + 'px',
            overflowY: 'auto'
        }">
            <view class="list" v-for="(item,index) in showList" :key="index" v-if="tabs==0">
                <uni-card :title="item.制单日期.substr(0,10)" :extra="item.单据号" style="margin: 10px;"
                    @tap="showDetail = showDetail==index?-1:index">
                    <view class="card-detail">
                        <view class="detail" v-if="item.主题">
                            <text>主题:</text>{{item.主题}}
                        </view>
                        <view class="detail" v-if="item.紧急程度">
                            <text>紧急程度:</text>{{item.紧急程度}}
                        </view>
                        <view class="detail" v-if="item.发送类型">
                            <text>发送类型:</text>{{item.发送类型}}
                        </view>
                        <view class="detail" v-if="item.制单人">
                            <text>制单人:</text>{{item.制单人}}
                        </view>
                        <view class="detail" v-if="item.阅读状态">
                            <text>阅读状态:</text>{{item.阅读状态}}
                        </view>
                        <view class="detail" v-if="item.发送部门">
                            <text>发送部门:</text>{{item.发送部门}}
                        </view>
                        <view class="detail" v-if="item.发送人">
                            <text>发送人:</text>{{item.发送人}}
                        </view>
                        <view class="detail" v-if="item.接收人">
                            <text>接收人:</text>{{item.接收人}}
                        </view>
                        <view class="detail" v-if="item.抄送接收人">
                            <text>抄送接收人:</text>{{item.抄送接收人}}
                        </view>
                        <view class="detail" v-if="item.所有抄送人">
                            <text>所有抄送人:</text>{{item.所有抄送人}}
                        </view>
                        <view class="card-detail" v-if="showDetail == index">
                            <view class="detail" v-if="item.内容">
                                <text>内容:</text>{{item.内容}}
                            </view>
                            <view class="detail" v-if="item.表头备注">
                                <text>表头备注:</text>{{item.表头备注}}
                            </view>
                            <view class="detail" v-if="item.建议完成日期">
                                <text>建议完成日期:</text>{{dayjs(item.建议完成日期).format("YYYY-MM-DD HH:mm:DD")}}
                            </view>
                            <view class="detail" v-if="item.催促次数">
                                <text>催促次数:</text>{{item.催促次数}}
                            </view>
                            <view class="detail" v-if="item.hmainid">
                                <text>内部单据号:</text>{{item.hmainid}}
                            </view>
                        </view>
                    </view>
                    <view class="more" v-if="showDetail == index && operations != index">
                        <view class="part" style="border-right: 1px solid #eee;">
                            <uni-icons type="top" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>收起
                        </view>
                        <view class="part" @tap.stop="operations = operations==index?-1:index">
                            <uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;"
                                size="14"></uni-icons>操作
                        </view>
                    </view>
                    <view class="more" v-if="showDetail != index && operations != index">
                        <view class="part" style="border-right: 1px solid #eee;">
                            <uni-icons type="bottom" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>更多信息
                        </view>
                        <view class="part" @tap.stop="operations = operations==index?-1:index">
                            <uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;"
                                size="14"></uni-icons>操作
                        </view>
                    </view>
                    <view class="op" v-if="operations == index">
                        <!-- <button class="op3" size="mini" plain @tap.stop="edit(item)">编辑</button> -->
                        <!-- <button class="op4" size="mini" plain @tap.stop="del(item)">删除</button> -->
                        <button class="op5" size="mini" plain @tap.stop="operations = -1">取消操作</button>
                    </view>
                </uni-card>
            </view>
        </view>
        <view class="pagination-zone" id="pagination-zone">
            <uni-pagination show-icon :page-size="size" :total="dataLength" :current="page"
                @change="onPaginationChangeHandler"></uni-pagination>
        </view>
        <BarCodePopupVue ref="barcodePopup"></BarCodePopupVue>
    </view>
</template>
<script>
    import {
        getUserInfo
    } from "@/utils/auth.js";
    import BarCodePopupVue from "@/components/BarCodePopup/BarCodePopup.vue";
    import {
        CommonUtils
    } from "../../../utils/common";
    import dayjs from "dayjs";
    export default {
        data() {
            return {
                dayjs,
                userInfo: getUserInfo(),
                serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
                tabs: 0,
                urls: '/Sc_MESTransFerWorkBill/GetOA_WorkLinkBillListPage',
                MvarReportTitle: '设备维修派工单缓存',
                hform: {
                    HBillNo: '',
                    HSourceBillNo: '',
                    HBillType: 3909,
                    user: uni.getStorageSync('HUserName'),
                    HStockOrgID: uni.getStorageSync('OrganizationID'),
                    sWhere: "",
                    HBeginDate: dayjs(new Date()).subtract(30, 'day').format("YYYY-MM-DD"),
                    HEndDate: dayjs(new Date()).format("YYYY-MM-DD"),
                },
                sWhere: '',
                listData: [],
                showList: [],
                showDetail: -1,
                operations: -1,
                page: 1,
                size: 20,
                dataLength: 0,
                divideBottom: 0,
                paginationTop: 0,
                showmore: false,
            }
        },
        computed: {
            calcContentHeight: {
                get() {
                    return this.paginationTop - this.divideBottom
                }
            }
        },
        onShow() {
            //用户模块权限判断
            this.CheckModRight()
            this.changeTab(0)
            console.log(this.userInfo, uni.getStorageSync('HUserName'))
        },
        components: {
            BarCodePopupVue
        },
        onPullDownRefresh: function() {
            this.clear()
            setTimeout(() => {
                uni.stopPullDownRefresh();
            }, 1000);
        },
        onReady() {
            this.getCalcHeight()
        },
        methods: {
            changeShowMore() {
                this.showmore = !this.showmore
                this.$nextTick(() => {
                    // 重新计算内容视口高度
                    this.getCalcHeight()
                })
            },
            getCalcHeight() {
                let query = uni.createSelectorQuery().in(this)
                query
                    .select("#divide")
                    .boundingClientRect()
                    .select("#pagination-zone")
                    .boundingClientRect()
                    .exec(res => {
                        this.divideBottom = Math.ceil(res[0].bottom)
                        this.paginationTop = Math.floor(res[1].top)
                    })
            },
            async qrCodeDisplay(item) {
                this.$refs.barcodePopup.setCodeInfo(item.HBillNo)
                await this.$nextTick()
                this.$refs.barcodePopup.open()
            },
            CheckModRight() {
                uni.request({
                    url: this.serverUrl + '/WEBSController/CheckModRight_Json',
                    data: {
                        ModRightName: 'CE_OtherOut',
                        HUserName: uni.getStorageSync('HUserName')
                    },
                    success: (res) => {
                        if (res.data.count == 1) {} else {
                            uni.showToast({
                                title: res.data.Message,
                                icon: 'none'
                            })
                        }
                    },
                    fail: (res) => {
                        console.log(res);
                        uni.showToast({
                            title: '接口请求失败',
                            icon: 'none'
                        })
                    },
                });
            },
            onPaginationChangeHandler({
                current
            }) {
                this.page = current
                // this.showList = this.getPage(current, this.size, this.listData)
                this.getList()
            },
            getPage(page, size, list) {
                let sindex = (parseInt(page) - 1) * size
                let eindex = parseInt(page) * size
                let newList = list.slice(sindex, eindex)
                return newList
            },
            changeTab(e) {
                this.tabs = e
                this.page = 1
                this.showList = []
                if (this.tabs == 0) {
                    this.urls = '/Sc_MESTransFerWorkBill/GetOA_WorkLinkBillListPage'
                }
                // if (this.tabs == 1) {
                //     this.urls = '/WEBSController/GetKf_ICStockBillQueryList_User_Json'
                // }
                this.search()
            },
            async getList() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: this.urls,
                        data: {
                            sWhere: this.hform.sWhere,
                            user: this.hform.user,
                            page: this.page,
                            size: this.size
                        }
                    })
                    let {
                        count,
                        data,
                        Message
                    } = res.data
                    if (count > 0) {
                        if (data == null) {
                            data = []
                        }
                        this.listData = data
                        console.log('data: ', data);
                        this.showList = data
                        this.dataLength = count
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `获取设备点检记录单失败: ${Message}`
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: `获取设备点检记录单失败: ${err}`
                    })
                }
            },
            search() {
                this.hform.sWhere = ''
                this.listData = []
                this.page = 1
                this.showList = []
                console.log(this.hform)
                if (this.hform.HBillNo) {
                    this.hform.sWhere += " and 单据号 like '%" + this.hform.HBillNo + "%'";
                }
                if (this.hform.HBeginDate && this.hform.HEndDate) {
                    this.hform.sWhere +=
                        ` and convert(date,日期) between convert(date, '${this.hform.HBeginDate}') and convert(date, '${this.hform.HEndDate}')`;
                }
                this.getList()
            },
            clear() {
                this.listData = []
                this.page = 1
                this.showList = []
                this.sWhere = ''
                this.hform = {
                    HBillNo: '',
                    HSourceBillNo: '',
                    HBillType: 3909,
                    user: uni.getStorageSync('HUserName'),
                    HStockOrgID: uni.getStorageSync('OrganizationID'),
                    sWhere: "",
                    HBeginDate: dayjs(new Date()).subtract(30, 'day').format("YYYY-MM-DD"),
                    HEndDate: dayjs(new Date()).format("YYYY-MM-DD"),
                }
                this.search()
            },
            add() {
                uni.navigateTo({
                    url: '/pages/ZLGL/OA_WorkLink/OA_WorkLinkBill?operationType=1'
                })
            },
            //编辑
            edit(item) {
                console.log(item)
                uni.request({
                    url: this.serverUrl + '/WEBSController/TempList_Modify_Json',
                    data: {
                        "HInterID": item.HInterID,
                        "HBillNo": item.单据号,
                        "HBillType": this.hform.HBillType
                    },
                    success: (res) => {
                        console.log(1, res);
                        if (res.data.count == 1) {
                            uni.navigateTo({
                                url: './OtherOutBill?OperationType=2&HInterID=' + item.HInterID
                            })
                        } else {
                            uni.showToast({
                                title: res.data.Message,
                                icon: 'none'
                            })
                        }
                    },
                    fail: (res) => {
                        console.log(res);
                        uni.hideLoading()
                        uni.showToast({
                            title: '接口请求失败',
                            icon: 'none'
                        })
                    },
                })
            },
            //删除
            del(item) {
                // console.log(item.hmainid,uni.getStorageSync('HUserName'))
                uni.showModal({
                    title: '提示',
                    content: '确认要删除记录?删除后不能恢复',
                    success: (res) => {
                        if (res.confirm) {
                            console.log('用户点击确定');
                            uni.request({
                                url: this.serverUrl +
                                    '/Sb_EquipRepairSendWorkBill/DeleteWorkBill',
                                data: {
                                    HInterID: item.hmainid,
                                    user: uni.getStorageSync('HUserName'),
                                },
                                success: (res) => {
                                    console.log(1, res);
                                    if (res.data.count == 1) {
                                        this.clear()
                                    }
                                    uni.showToast({
                                        title: res.data.Message,
                                        icon: 'none'
                                    })
                                },
                                fail: (res) => {
                                    console.log(res);
                                    uni.hideLoading()
                                    uni.showToast({
                                        title: '接口请求失败',
                                        icon: 'none'
                                    })
                                },
                            });
                        } else if (res.cancel) {
                            console.log('用户点击取消');
                        }
                    }
                });
            },
            //撤销
            revoke(item) {
                // console.log(item.hmainid,uni.getStorageSync('HUserName'))
                uni.showModal({
                    title: '提示',
                    content: '是否确认撤销',
                    success: (res) => {
                        if (res.confirm) {
                            console.log('用户点击确定');
                            uni.request({
                                url: this.serverUrl +
                                    '/WEBSController/set_DeleteICStockBillAndWMS_Json',
                                data: {
                                    HInterID: item.HInterID,
                                    HBillNo: item.单据号,
                                    HBillType: this.hform.HBillType,
                                    HMaker: uni.getStorageSync('HUserName'),
                                    MvarReportTitle: this.MvarReportTitle,
                                },
                                success: (res) => {
                                    console.log(1, res);
                                    if (res.data.count == 1) {
                                        this.clear()
                                    }
                                    uni.showToast({
                                        title: res.data.Message,
                                        icon: 'none'
                                    })
                                },
                                fail: (res) => {
                                    console.log(res);
                                    uni.hideLoading()
                                    uni.showToast({
                                        title: '接口请求失败',
                                        icon: 'none'
                                    })
                                },
                            });
                        } else if (res.cancel) {
                            console.log('用户点击取消');
                        }
                    }
                });
            },
        }
    }
</script>
<style lang="scss" scoped>
    @import "@/pages/ZLGL/style/MJListStyle.scss"
</style>
pages/ZLGL/style/MJBillStyle.scss
New file
@@ -0,0 +1,310 @@
.buttons {
    box-sizing: border-box;
    width: 100%;
    height: 120rpx;
    position: fixed;
    bottom: 0;
    left: 0;
    background-color: #fff;
    box-shadow: 0 2rpx 10rpx 2rpx rgba(0, 0, 0, 0.4);
    padding: 30rpx 40rpx 40rpx 40rpx;
    display: flex;
    flex-direction: row;
    gap: 10rpx;
    button {
        border-radius: 50rpx;
        width: 180rpx;
        height: 66rpx;
        line-height: 66rpx;
        font-size: 28rpx;
    }
    .btn-a {
        background-color: #3a78ff;
        color: #fff;
    }
    .btn-b {
        background-color: #41a863;
        color: #fff;
    }
    .btn-c {
        background-color: #acacac;
        color: #fff;
        // position: absolute;
        // right: 120rpx;
    }
    .btn-d {
        background-color: #ff8901;
        color: #fff;
    }
    .placeholder-view {
        flex: 1;
    }
}
.tabs {
    width: 100%;
    display: flex;
    border-bottom: 1px solid #ddd;
    view {
        width: 25%;
        font-size: 30rpx;
        color: #555;
        text-align: center;
        padding: 16rpx 0;
    }
    .on {
        color: #3a78ff;
        font-weight: bold;
        border-bottom: 3px solid #3a78ff;
    }
}
.form {
    display: flex;
    flex-direction: column;
    gap: 10rpx;
    box-sizing: border-box;
    padding: 20rpx 40rpx;
}
.form-item {
    display: flex;
    align-items: center;
    font-size: 30rpx;
    padding: 6rpx 0;
    gap: 12rpx;
    .title {
        width: 208rpx;
        flex-shrink: 0;
        text {
            color: red;
            font-weight: bold;
        }
    }
    .required::after{
          content: "*";
          color: red;
          margin-left: 4px;
          font-weight: bold;
    }
    .right {
        // width: 450rpx;
        flex: 1;
        border-radius: 22rpx;
        border: 1px solid #acacac;
        position: relative;
        display: flex;
        picker {
            width: 100%;
        }
        .uni-combox {
            width: 100%
        }
    }
    .righton {
        width: 450rpx;
        border-radius: 22rpx;
        border: 1px solid #e4e4e4;
        background-color: #e4e4e4;
    }
    input {
        width: 100%;
        padding: 8rpx 20rpx;
        font-size: 30rpx;
    }
    textarea {
        width: 98%;
        height: 6em;
        padding: 8rpx 20rpx;
        font-size: 30rpx;
    }
    .icon-wrapper {
        background-color: #3A78FF;
        width: 52rpx;
        height: 52rpx;
        border-radius: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
        .uni-icons {
            color: #fff !important;
        }
    }
    .icon-wrapper[disabled] {
        background-color: rgba(228, 228, 228, 1);
        pointer-events: none;
        touch-action: none;
    }
}
.none-border {
    border: none !important;
}
.radio_Container {
    display: flex;
    flex-direction: row;
    gap: 30rpx;
}
 .list {
        width: 100%;
        .card-detail {
            width: 100%;
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            line-height: 120%;
            .detail {
                // width: 50%;
                font-size: 26rpx;
                margin-bottom: 12rpx;
                color: #555;
                margin-right: 20rpx;
                text {
                    color: #999;
                    font-size: 26rpx;
                }
            }
        }
        .more {
            color: #888;
            font-size: 24rpx;
            display: flex;
            border-top: 1px solid #eee;
            padding-top: 20rpx;
            .part {
                width: 50%;
                text-align: center;
            }
        }
    }
.card-item-wrapper {
        display: flex;
        flex-direction: column;
        justify-content: center;
        box-sizing: border-box;
        padding: 20rpx 20rpx;
        .card-detail {
            width: 100%;
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            line-height: 120%;
            .detail {
                // width: 50%;
                font-size: 26rpx;
                margin-bottom: 12rpx;
                color: #555;
                margin-right: 20rpx;
                text {
                    color: #999;
                    font-size: 26rpx;
                }
            }
            .operation {
                display: flex;
                align-items: center;
                gap: 10rpx;
                .btn-a {
                    background-color: #3A78FF;
                    color: #fff;
                }
                .btn-b {
                    background-color: rgb(255, 87, 34);
                    color: #fff;
                }
                uni-button {}
            }
        }
        .more {
            color: #888;
            font-size: 24rpx;
            display: flex;
            border-top: 1px solid #eee;
            padding-top: 20rpx;
            .part {
                width: 50%;
                text-align: center;
            }
        }
    }
    .attachment-btns {
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        gap: 6rpx;
    }
    .card-buttons {
        padding: 8rpx;
        display: flex;
        flex-direction: row;
        gap: 20rpx;
        justify-content: center;
        align-items: flex-start;
        button {
            border-radius: 10rpx;
            width: 180rpx;
            height: 66rpx;
            line-height: 66rpx;
            font-size: 28rpx;
        }
        .btn-a {
            background-color: #3a78ff;
            color: #fff;
        }
        .btn-b {
            background-color: #41a863;
            color: #fff;
        }
        .btn-c {
            background-color: #acacac;
            color: #fff;
            // position: absolute;
            // right: 120rpx;
        }
        .btn-d {
            background-color: #ff8901;
            color: #fff;
        }
        .placeholder {
            flex: 1
        }
    }
pages/ZLGL/style/MJListStyle.scss
New file
@@ -0,0 +1,193 @@
    .form {
        padding: 20rpx;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .other {
        margin-top: 8rpx;
        text-align: center;
        font-size: 28rpx;
        padding: 4rpx 18rpx;
        color: #1890FF;
    }
    .tabs {
        width: 100%;
        position: fixed;
        left: 0;
        z-index: 9;
        display: flex;
        background-color: #e5e5e5;
        view {
            width: 50%;
            font-size: 30rpx;
            color: #333;
            text-align: center;
            padding: 16rpx 0;
        }
        .on {
            color: #3a78ff;
            font-weight: bold;
            border-bottom: 3px solid #3a78ff;
        }
    }
    .buttons {
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: 20rpx;
        button {
            border-radius: 50rpx;
            width: 180rpx;
            height: 66rpx;
            line-height: 66rpx;
            font-size: 28rpx;
        }
        .btn-a {
            background-color: #acacac;
            color: #fff;
        }
        .btn-b {
            background-color: #41a863;
            color: #fff;
        }
        .btn-c {
            background-color: #3a78ff;
            color: #fff;
        }
    }
    .form-item {
        display: flex;
        align-items: center;
        font-size: 28rpx;
        padding: 6rpx 0;
        .title {
            width: 180rpx;
            text {
                color: red;
                font-weight: bold;
            }
        }
        .right {
            width: 450rpx;
            border-radius: 22rpx;
            border: 1px solid #acacac;
        }
        .righton {
            width: 450rpx;
            border-radius: 22rpx;
            border: 1px solid #e4e4e4;
            background-color: #e4e4e4;
        }
        input {
            width: 100%;
            padding: 8rpx 20rpx;
            font-size: 30rpx;
        }
    }
    .list {
        width: 100%;
        .card-detail {
            width: 100%;
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            line-height: 120%;
            .detail {
                // width: 50%;
                font-size: 26rpx;
                color: #555;
                padding-bottom: 20rpx;
                text {
                    color: #999;
                    font-size: 26rpx;
                }
            }
        }
        .more {
            color: #888;
            font-size: 26rpx;
            display: flex;
            border-top: 1px solid #eee;
            padding-top: 20rpx;
            .part {
                width: 50%;
                display: flex;
                align-items: center;
                justify-content: center;
            }
        }
        .op {
            display: flex;
            justify-content: space-around;
            margin-top: 20rpx;
            button {
                padding: 0;
                width: 150rpx;
                font-size: 25rpx;
            }
            .op1 {
                border: 1px solid #41a863;
                color: #41a863;
            }
            .op2 {
                border: 1px solid #d98d00;
                color: #d98d00;
            }
            .op3 {
                border: 1px solid #3a78ff;
                color: #3a78ff;
            }
            .op4 {
                border: 1px solid #da0000;
                color: #da0000;
            }
            .op5 {
                border: 1px solid #888;
                color: #888;
            }
        }
    }
    .pagination-zone {
        position: fixed;
        bottom: 0;
        box-sizing: border-box;
        background-color: #fff;
        box-shadow: 0 2rpx 10rpx 2rpx rgba(0, 0, 0, 0.4);
        padding: 20rpx 40rpx 20rpx 40rpx;
        display: flex;
        flex-direction: column;
        gap: 20rpx;
        justify-content: space-between;
        width: 100%;
    }
pages/index/login.vue
@@ -82,6 +82,7 @@
        CommonUtils
    } from "../../utils/common";
import { getLanguagePackJson } from "../../utils/i18n";
    import WebSocketServices from "../../utils/WebSocketServices";
    export default {
        components: {
            hFormAlert
@@ -91,6 +92,7 @@
        },
        data() {
            return {
                WebSocketServices,
                CommonUtils,
                arrayDataBases: [],
                DataBases: '',
@@ -115,7 +117,8 @@
                    "宁波四维尔-内网": "http://192.168.0.236:9010/API/",
                    "宁波四维尔-外网": "http://220.189.218.155:9010/API/",
                    // 锦隆
                    "锦隆-智能家居": "http://192.168.1.11/API/"
                    "锦隆-智能家居": "http://192.168.1.11/API/",
                    "锦隆-智能家居-外网": "http://61.174.29.234:8880/API/"
                },
                serverUrlName: '浙江智云迈思',
@@ -328,6 +331,7 @@
                                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)
                                uni.reLaunch({
                                    url: '/pages/index/index'
                                })
pages/index/tab4.vue
@@ -154,6 +154,20 @@
                        "id": 15,
                        "hidden": false
                    },
                    {
                        "img": "../../static/icon/icon15.png",
                        "text": "工作联系单",
                        "url": "/pages/ZLGL/OA_WorkLink/OA_WorkLinkBill?OperationType=1",
                        "id": 16,
                        "hidden": false
                    },
                    {
                        "img": "../../static/icon/icon15.png",
                        "text": "工作联系单列表",
                        "url": "/pages/ZLGL/OA_WorkLink/OA_WorkLinkBillList?OperationType=1",
                        "id": 16,
                        "hidden": false
                    },
                ]
            }
utils/BasicInfo.js
New file
@@ -0,0 +1,37 @@
import { CommonUtils } from "./common"
export async function getEmpList() {
    return new Promise(async (resolve, reject) => {
        // 获取职员数据
        try {
            let res = await CommonUtils.doRequest2Async({
                url: '/PublicPageMethod/UserList',
                data: {
                    sWhere: " where 1=1",
                }
            })
            let {
                data,
                count,
                Message
            } = res.data
            if (count == 1) {
                resolve(data)
            } else {
                CommonUtils.showTips({
                    title: '温馨提示',
                    message: Message
                })
                reject()
            }
        } catch (err) {
            CommonUtils.showTips({
                title: '温馨提示',
                message: err
            })
            reject()
        }
    })
}
utils/WebSocketServices.js
New file
@@ -0,0 +1,65 @@
import { CommonUtils } from "@/utils/common.js";
class WebSocketServices {
    constructor() {
        this.wsInstance = null; // WebSocket 实例
        this.isConnecting = false; // 避免并发重连
        this.isConnected = false; // 避免并发重连
        this.wsUrl = CommonUtils.httpFormatWs()
    }
    // 建立WebSocket连接
    createConnect(userId) { // 使用用户标识 作为后端连接的凭据
        if(this.isConnecting || !userId || this.isConnected) {
            return
        }
        console.log('wsUrl: ',this.wsUrl);
        console.log('userId: ',userId);
        this.wsInstance = uni.connectSocket({
            url: this.wsUrl,
            header: {
                "X-User-Id": userId
            },
            success() {
                this.isConnecting = true
            }
        })
        // 监听套接字连接建立
        uni.onSocketOpen((res) => {
            console.log('[webSocket]: 套接字连接建立成功');
            this.isConnecting = false
            this.isConnected = true
            console.log('res: ',res);
            this.wsInstance = res.socketTask
        })
    }
    // 重连
    reConnect(reCount = 1, limit = 3) {
        if(reCount > limit) {
            uni.showToast({
                icon: 'none',
                title: `超出最大重连次数。已退出连接`
            })
            this.isConnecting = false
            return
        }
        uni.showToast({
            icon: 'none',
            title: `正在尝试重连,重连次数 ${reCount}`
        })
        reConnect(reCount+1, limit)
        uni.hideToast()
    }
    // 连接注销
    disConnect() {
    }
}
export default new WebSocketServices()
utils/common.js
@@ -494,6 +494,21 @@
            return item[e.ColmCols]
        })
    }
    httpFormatWs(httpUrl=this.serverUrl) {
        console.log('httpUrl: ',httpUrl);
        if(httpUrl.indexOf("http://") === 0){
            httpUrl = httpUrl.replace("http://", "")
            httpUrl = "ws://" + httpUrl.split(":")[0]+":18080/WS"
        }else if(httpUrl.indexOf("https://") === 0) {
            httpUrl = httpUrl.replace("https://", "")
            httpUrl = "wss://" + httpUrl.split(":")[0]+":18080/WS"
        }else{
            // 提示传入连接错误
        }
        return httpUrl
    }
}
export const CommonUtils = new commonUtils()