qingyiay
2023-10-07 21fb37c7162d5b47a14d6438870377c85fcc0b52
修改装卸员页面 调整websocket逻辑
12个文件已修改
306 ■■■■■ 已修改文件
pages.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/customer-page/customer-index/fayunPlanDetails/fayunPlanDetails.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/customer-page/customer-index/fayunPlanDetails/fayunPlanMore/fayunPlanMore.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue 116 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue 93 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/driver-page/driver-index/driver-index.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/loadUnload-page/loadUnload-detail/loadUnload-detail.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/loadUnload-page/selectTarget/selectTarget.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/public-page/faYunstatisticsDetails/faYunstatisticsDetails.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/tabbar-page/index-tabbar/index-tabbar.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
store/index.js 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json
@@ -94,7 +94,7 @@
            "path": "pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details",
            "style": {
                "navigationBarTitleText": "提煤单详情",
                "enablePullDownRefresh": false
                "enablePullDownRefresh": true
            }
        },
        // {
pages/customer-page/customer-index/fayunPlanDetails/fayunPlanDetails.vue
@@ -123,7 +123,7 @@
                orderCode: null,
                orderPlanDetail: {},
                coalStatus: ['领取', '预约', '签到', '入场', '称皮', '称毛', '离场', '入磅房', '出磅房', '入煤仓', '出煤仓', '放空', '作废', '入场申请',
                    '进入场院', '异常审核中'
                    '进入场院', '异常审核中', '返回加减吨', '超时', '打印中', '打印中'
                ],
                yyDailyList: [],
                // 领取数量
pages/customer-page/customer-index/fayunPlanDetails/fayunPlanMore/fayunPlanMore.vue
@@ -102,7 +102,7 @@
                yyDailyList: {},
                orderPlanDetail: {},
                coalStatus: ['领取', '预约', '签到', '入场', '称皮', '称毛', '离场', '入磅房', '出磅房', '入煤仓', '出煤仓', '放空', '作废', '入场申请',
                    '进入场院', '异常审核中'
                    '进入场院', '异常审核中', '返回加减吨', '超时', '打印中', '打印中'
                ],
                index: ''
            };
pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue
@@ -331,7 +331,7 @@
                faYunDetailobj: {},
                modalShow: false,
                coalStatus: ['领取', '预约', '签到', '入场', '称皮', '称毛', '离场', '入磅房', '出磅房', '入煤仓', '出煤仓', '放空', '作废', '入场申请',
                    '进入场院', '异常审核中'
                    '进入场院', '异常审核中', '返回加减吨', '超时', '打印中', '打印中'
                ]
            };
        },
pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue
@@ -2,6 +2,9 @@
    <view class="bill-of-lading-details">
        <view class="top-banner"
            style="background: url('https://mx.jzeg.cn:9095/appimg/image/banner/loadingbanner.png') no-repeat;background-size: cover;">
            <u-notice-bar :text="originInfoNotice"
                v-if="originInfoVisible"
                fontSize='36'></u-notice-bar>
            <view class="top-information">
                <view class="cutomer-name"
                    v-if="orderType == '转入' || orderType == '转出'">煤场:{{ coalDetailsData.toFiledName || '' }}</view>
@@ -22,7 +25,7 @@
                        <view class="status-button"
                            style="background: url('https://mx.jzeg.cn:9095/appimg/image/banner/statusbutton.png') no-repeat;
                                        background-size: cover;">
                            {{ coalStatus[coalDetailsData.status] || '' }}
                            {{coalStatus[correctStatus]}}
                        </view>
                    </view>
                    <view class="time">
@@ -63,6 +66,7 @@
                <view class="origin-info_content">
                    <view class="first-line"><combined-title title="原发信息"></combined-title></view>
                    <u-form :model="originInfoForm"
                        :rules="rules"
                        label-position="top"
                        label-width="160"
                        :label-style="{'marginLeft':'9px'}"
@@ -168,7 +172,7 @@
                        plain
                        @click="rcsqClick"
                        shape="circle"
                        :disabled="coalDetailsData.status === 3"></u-button>
                        :disabled="correctStatus>= 3"></u-button>
                </view>
                <view class="bottom-button">
                    <u-button text="放空"
@@ -260,6 +264,10 @@
        components: {
            combinedTitle
        },
        onPullDownRefresh() {
            this.getTakeCoal(); //获取提煤单详情
            uni.stopPullDownRefresh();
        },
        onLoad(value) {
            this.orderPlanId = value.orderPlanId;
            this.yyId = value.yyId;
@@ -275,6 +283,7 @@
                this.getTakeCoal(); //获取提煤单详情
            }
            this.init(); //获取日志
            this.getgetService(); //获取客服
        },
        onShow() {
            this.coalDayPage(); //获取日志 定时任务
@@ -327,7 +336,7 @@
                    serviecePhone: ''
                },
                coalStatus: ['领取', '预约', '签到', '入场', '称皮', '称毛', '离场', '入磅房', '出磅房', '入煤仓', '出煤仓', '放空', '作废', '入场申请',
                    '进入场院', '异常审核中'
                    '进入场院', '异常审核中', '返回加减吨', '超时', '打印中', '打印中'
                ], // 状态
                weighHouseCode: '',
                // 放空弹窗控制变量
@@ -382,29 +391,11 @@
                originInfoVisible: false,
                fileList1: [], //图片列表
                deletable: true,
                rules: {
                    contactPicture: {
                        type: 'string',
                        required: true,
                        message: '请上传原发磅单图片',
                        trigger: ['blur', 'change']
                    },
                    coalContactHair: {
                        type: 'string',
                        required: true,
                        message: '请输入毛重',
                        trigger: ['blur', 'change']
                    },
                    coalContactSkin: {
                        type: 'string',
                        required: true,
                        message: '请输入皮重',
                        trigger: ['blur', 'change']
                    }
                },
                rules: {},
                timeout: '0',
                wsgShow: false
                wsgShow: false,
                timeLineStatus: null,
                originInfoNotice: '填写原发信息后可上磅计量'
            };
        },
        watch: {
@@ -438,7 +429,7 @@
                return this.coalDetailsData.hair !== 0 || this.coalDetailsData.skin !== 0;
            },
            isapproach() {
                return this.currentPageCoalStatus !== 3;
                return this.correctStatus !== 3
            },
            coalContactClean() {
                let xx = BigNumber(this.originInfoForm.coalContactHair ? this.originInfoForm.coalContactHair : 0)
@@ -454,6 +445,10 @@
                let minutes = ("0" + currentDate.getMinutes()).slice(-2);
                let formattedDate = year + "-" + month + "-" + date + " " + hours + ":" + minutes;
                return formattedDate
            },
            correctStatus() {
                return this.currentPageCoalStatus === this.timeLineStatus ? this.currentPageCoalStatus : this
                    .timeLineStatus
            }
        },
        methods: {
@@ -461,7 +456,7 @@
            init() {
                this.$reqGet('coalDayPage', { id: this.orderPlanId, timeout: this.timeout }).then(res => {
                    if (res.code == 0) {
                        // this.dayRZ = res.data;
                        this.timeLineStatus = res.data[0].taskStatus
                        this.dayRZ = res.data.map(v => {
                            let slicedate = v.taskStatusDes.slice(0, 10);
                            if (slicedate == this.currentDate) {
@@ -490,7 +485,7 @@
                        uni.setStorageSync('customeropenId', this.serviceInfoObj.openId);
                        uni.setStorageSync('customerName', this.serviceInfoObj.openName);
                    }
                });
                })
            },
            // 获取提煤单详情
            getTakeCoal() {
@@ -534,9 +529,10 @@
                        // 原发信息回显以及控制是否可修改
                        this.haveInputOrigin = !this.coalDetailsData.skinTwo && this.coalDetailsData.orderType ===
                            '外购'
                        this.deletable = this.isModifyoriginInfo = this.coalDetailsData.status > 3
                        this.deletable = this.coalDetailsData.status > 3
                        this.originInfoForm.coalContactSkin = this.coalDetailsData.skinTwo;
                        this.originInfoForm.coalContactHair = this.coalDetailsData.hairTwo;
                        this.originInfoForm.contactPicture = this.coalDetailsData.contactPicture
                        if (this.coalDetailsData.contactPicture) {
                            this.fileList1 = this.coalDetailsData.contactPicture.split(',').map(v => {
                                return {
@@ -567,8 +563,6 @@
                        }
                    }
                }).then(() => {
                    this.getgetService(); //获取客服
                }).then(() => {
                    // 判断当前时间是否超出预约时间
                    setTimeout(() => {
                        let endTime = this.coalDetailsData.yuYueSection.slice(0, 10) + ' ' + this
@@ -586,6 +580,7 @@
                this.interval = setInterval(() => {
                    this.$reqGet('coalDayPage', { id: this.orderPlanId, timeout: this.timeout }).then(res => {
                        if (res.code == 0) {
                            this.timeLineStatus = res.data[0].taskStatus
                            this.dayRZ = res.data.map(v => {
                                let slicedate = v.taskStatusDes.slice(0, 10);
                                if (slicedate == this.currentDate) {
@@ -694,6 +689,13 @@
                        this.weighData.gateCameraId = res.data.lastEquipmentId;
                        this.weighData.equipmentCode = res.data.lastEquipmentCode;
                        this.weighData.sceneInOut = res.data.sceneInOut;
                        let form = {
                            sceneId: this.weighData.sceneId,
                            gateCameraId: this.weighData.gateCameraId,
                            equipmentCode: this.weighData.equipmentCode,
                            sceneInOut: this.weighData.sceneInOut,
                        }
                        uni.setStorageSync('WeighHouseForm', JSON.stringify(form))
                        this.weighHouseCode = res.data.code;
                        uni.navigateTo({
                            url: `/pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice?takeCoalId=${this.orderPlanId}&sceneId=${
@@ -750,24 +752,33 @@
                    title: '正在打印中,请稍后'
                })
                this.enterLoading = true
                this.$reqGet('printer', { type: 2, tmId: this.coalDetailsData.id }).then(res => {
                    uni.hideLoading()
                    this.enterLoading = false
                    console.log(res);
                    if (res.code === 0) {
                        this.$u.toast('打印成功')
                    } else {
                        this.$u.toast(res.msg ? res.msg : '打印失败')
                    }
                })
                this.$reqGet('printer', { type: 2, tmId: this.coalDetailsData.id, weighingNumber: 1 }).then(
                    res => {
                        uni.hideLoading()
                        this.enterLoading = false
                        console.log(res);
                        if (res.code === 0) {
                            this.$u.toast('打印成功')
                        } else {
                            this.$u.toast(res.msg ? res.msg : '打印失败')
                        }
                    })
            },
            // 打印出门证
            printExitPermit() {
                uni.showLoading({
                    title: '正在打印中,请稍后'
                })
                let form = {
                    deptId: this.getWeightHouseObj.deptId,
                    tmId: this.getWeightHouseObj.tmId,
                    carNo: uni.getStorageSync('carNo'),
                    type: 3,
                    weighingNumber: 2
                }
                this.outLoading = true
                this.$reqGet('printer', { type: 3, tmId: this.coalDetailsData.id }).then(res => {
                this.$reqPost('printer', Object.assign(form, JSON.parse(uni.getStorageSync('WeighHouseForm'))),
                    'json').then(res => {
                    uni.hideLoading()
                    this.outLoading = false
                    if (res.code === 0) {
@@ -794,7 +805,8 @@
                this.isfocus2 = false;
            },
            inputChange() {
                if (Number(this.originInfoForm.coalContactHair) > 0 && Number(this.originInfoForm.coalContactSkin > 0)) {
                if (Number(this.originInfoForm.coalContactHair) > 0 && Number(this.originInfoForm.coalContactSkin >
                        0)) {
                    this.isInputOrigin = true;
                }
            },
@@ -836,7 +848,8 @@
                        name: 'file',
                        success: res => {
                            if (num == 1) {
                                this.originInfoForm.contactPicture = JSON.parse(res.data).data.url;
                                this.originInfoForm.contactPicture = JSON.parse(res.data)
                                    .data.url;
                                resolve(`${BaseUrl}${JSON.parse(res.data).data.url}`);
                            }
                        }
@@ -856,18 +869,25 @@
                    taskCoalCode: this.coalDetailsData.code,
                    carNo: this.coalDetailsData.carNo,
                }
                this.$refs.originInfoRef.validate().then(res => {
                if (this.originInfoForm.coalContactSkin && this.originInfoForm.coalContactHair && this
                    .originInfoForm
                    .contactPicture) {
                    this.$reqPost('appSaveContact', form, 'json').then(res => {
                        if (res.code === 0) {
                            this.$u.toast('提交成功')
                            this.getTakeCoal()
                        } else {
                            this.isModifyoriginInfo = true
                            this.$u.toast(res.msg ? res.msg : '提交失败')
                        }
                    }).then(() => {
                        setTimeout(() => {
                            this.getTakeCoal()
                        }, 1000)
                    })
                }).catch(errors => {
                } else {
                    uni.$u.toast('请填写完整原发信息')
                })
                }
            }
        }
    };
pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue
@@ -204,16 +204,20 @@
                :disabled="addAndSubtractCoalDisabled"
                @click="addAndSubtractCoal"
                class="jiajian"
                v-if="outBuy"></u-button>
                v-if="outBuy||!isSkinWeigh"></u-button>
        </view>
        <view class="four">
        <view v-show="isConfirmWeighLoading"
            style="color: #ff6363;width: auto;margin: 0 auto;">
            超出毛重,磅房人员确认中,请勿离开此页面
        </view>
        <!-- <view class="four">
            <u-button type="primary"
                text="刷新"
                @click.stop="RefreshHandle"
                icon="reload"
                throttle-time="800"
                :loading="refreshLoading"></u-button>
        </view>
        </view> -->
        <!-- 放空弹窗 -->
        <view class="evacuationModal">
            <u-modal :show="evacuationModalShow"
@@ -229,7 +233,6 @@
                title="异常原因"
                :showCancelButton="true"
                @confirm="abnormalConfirm"
                @cancel="abnormalCancel"
                confirmText="提交">
                <view class="slot-content">
                    <u--form labelPosition="top"
@@ -249,11 +252,17 @@
                </view>
            </u-modal>
        </view>
        <!-- 确认后称重提示弹窗 -->
        <view class="">
            <u-modal :show="confirmWeighVisiable"
                title="提示"
                :content="confirmWeighContent"
                @confirm="confirmWeighConfirm"></u-modal>
        </view>
    </view>
</template>
<script>
    let socket = null;
    import { webSocketUrl } from '@/api/request.js';
    import { mapState, mapMutations } from 'vuex';
    import combinedTitle from '@/components/combined-title/combined-title.vue';
@@ -277,6 +286,23 @@
            this.changeWeigh('')
            this.realTimeWeigh = 0
        },
        onShow() {
            this.timer = setTimeout(() => {
                if (!this.globalweigh) {
                    console.log('称重时自动重连');
                    this.socketTask.close();
                    this.changesocketTask(null);
                    this.changereconnectNum({ connectNum: 1, isWeigh: true })
                    this.$store.dispatch('websocketInit');
                }
            }, 3000)
        },
        onHide() {
            clearTimeout(this.timer)
        },
        onUnload() {
            clearTimeout(this.timer)
        },
        components: {
            combinedTitle
        },
@@ -296,7 +322,8 @@
                    coalContactClean: 0,
                    coalContactHair: 0,
                    coalContactSkin: 0,
                    isMerge: 0 //1是 0不是  默认0  是否合卡
                    isMerge: '0', //1是 0不是  默认0  是否合卡
                    isBackground: '0'
                },
                takeCoalId: null,
                weighHouseCode: '',
@@ -360,7 +387,8 @@
                mergeStateShow: false, //合卡弹窗
                checkboxValue1: [],
                isExceedOrigin: false, //是否超出原发毛重
                refreshLoading: false
                refreshLoading: false,
                timer: null
            };
        },
        watch: {
@@ -373,7 +401,8 @@
                        .orderType ==
                        '转出') {
                        if (this.weighList.skin == 0) {
                            this.isSkinWeigh = true
                            this.isSkinWeigh = true //称皮没有返回装卸
                            this.outBuy = false //称皮没有返回装卸
                            this.temporaryWeighObj.skin = newV;
                            let xx = new BigNumber(this.avgSkin)
                            let yy = new BigNumber(newV)
@@ -381,6 +410,7 @@
                                this.avgSkin !== 0
                        } else {
                            this.isSkinWeigh = false;
                            this.outBuy = true;
                            this.temporaryWeighObj.hair = newV;
                            this.temporaryWeighObj.clean = (this.temporaryWeighObj.hair - this.weighList.skin).toFixed(
                                2);
@@ -394,17 +424,20 @@
                        .orderType == '转入') {
                        if (this.weighList.hair == 0) {
                            this.isSkinWeigh = false;
                            this.outBuy = true;
                            this.temporaryWeighObj.hair = newV;
                            if (this.weighList.orderType == '外购') {
                                let xx = new BigNumber(newV)
                                let yy = new BigNumber(this.weighList.hairTwo)
                                if (xx.minus(yy) > 0.3) {
                                    this.$u.toast('超出原发信息毛重,请等待管理人员处理')
                                    this.isExceedOrigin = true
                                }
                            }
                            // if (this.weighList.orderType == '外购') {
                            //     let xx = new BigNumber(newV)
                            //     let yy = new BigNumber(this.weighList.hairTwo)
                            //     if (xx.minus(yy) > 0.3) {
                            //         this.$u.toast('超出原发信息毛重,请等待管理人员处理')
                            //         this.isExceedOrigin = true
                            //         this.saveWeigh()
                            //     }
                            // }
                        } else {
                            this.isSkinWeigh = true;
                            this.isSkinWeigh = true; //称皮没有返回装卸
                            this.outBuy = false //称皮没有返回装卸
                            this.temporaryWeighObj.skin = newV;
                            let xx = new BigNumber(this.avgSkin)
                            let yy = new BigNumber(newV)
@@ -420,11 +453,16 @@
                        }
                    }
                }
            },
            confirmWeighVisiable(v) {
                if (v) {
                    uni.hideLoading()
                }
            }
        },
        computed: {
            ...mapState(['globalweigh', 'globalinfraredStatus', 'globalisconnect', 'globalisUploadimg', 'globalisLogin',
                'is_open_socket'
                'is_open_socket', 'socketTask', 'confirmWeighVisiable', 'confirmWeighContent'
            ]),
            coalContactClean() {
                let xx = BigNumber(this.weighData.coalContactHair)
@@ -455,7 +493,9 @@
        },
        methods: {
            ...mapMutations(['changeweighHouseCode', 'changeisLogin', 'changeWeigh']),
            ...mapMutations(['changeweighHouseCode', 'changeisLogin', 'changeWeigh', 'changeconfirmWeighVisiable',
                'changesocketTask', 'changereconnectNum'
            ]),
            RefreshHandle() {
                if (this.globalisconnect) return this.$u.toast('已连接,无需刷新')
                this.refreshLoading = true
@@ -542,7 +582,6 @@
            // 确认称重接口
            saveWeigh() {
                this.weighData.coalContactClean = this.coalContactClean;
                console.log(this.weighData);
                this.$reqPost('saveWeigh', this.weighData, 'json')
                    .then(res => {
                        console.log(res, '称重接口');
@@ -554,6 +593,10 @@
                                });
                                this.isConfirmWeighLoading = false;
                            }, 1000);
                        } else if (res.code === 3) {
                            uni.showLoading({
                                title: '磅房人员确认中',
                            })
                        } else {
                            this.$u.toast(res.msg ? res.msg : '称重失败,请稍后重试');
                            this.isConfirmWeighLoading = false
@@ -678,6 +721,16 @@
                    this.orderSurplusLess = true
                }
            },
            confirmWeighConfirm() {
                this.changeconfirmWeighVisiable(false)
                this.isConfirmWeighLoading = false
                setTimeout(() => {
                    this.$u.toast('即将返回上一页'),
                        uni.navigateBack({
                            delta: 1
                        })
                }, 800)
            }
        }
    };
</script>
pages/driver-page/driver-index/driver-index.vue
@@ -299,7 +299,8 @@
                xsUserId: '',
                customerId: '',
                isFirstLogin: true, //是否是第一次登录
                phone: ""
                phone: "",
                isFirstTime: false //是否是登录进入首页,还是别的页面返回 false是登录 true是别的页面
            };
        },
        onShow() {
@@ -316,7 +317,9 @@
            },
            init() {
                this.qiangDanList();
                this.getLogOn()
                if (!this.isFirstTime) {
                    this.getLogOn()
                }
            },
            // 司机首页列表
            qiangDanList() {
@@ -393,6 +396,7 @@
                this.$refs.previewImage.open('https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj1.png')
            },
            getLogOn() {
                this.isFirstTime = true
                this.$reqGet('getUserEntity').then(res => {
                    this.phone = res.data.phone
                }).then(() => {
pages/loadUnload-page/loadUnload-detail/loadUnload-detail.vue
@@ -77,7 +77,7 @@
                loading: false,
                id: "",
                coalStatus: ['领取', '预约', '签到', '入场', '称皮', '称毛', '离场', '入磅房', '出磅房', '入煤仓', '出煤仓', '放空', '作废', '入场申请',
                    '进入场院', '异常审核中',
                    '进入场院', '异常审核中', '返回加减吨', '超时', '打印中', '打印中'
                ], // 状态
            }
        },
@@ -121,7 +121,9 @@
                    this.loading = false;
                    if (res.code === 0) {
                        this.$u.toast('装卸成功')
                        this.init()
                        setTimeout(() => {
                            this.init()
                        }, 1000)
                    } else {
                        this.$u.toast(res.msg ? res.msg : '装卸失败')
                    }
pages/loadUnload-page/selectTarget/selectTarget.vue
@@ -33,7 +33,7 @@
        <view class="coal-name"
            v-show="coalList.length!==0">
            <u-checkbox-group v-model="checkedCoal"
                placement="row"
                placement="column"
                @change="checkboxChange"
                size="30">
                <u-checkbox :customStyle="{marginBottom: '8px',fontSize:'20px'}"
@@ -145,13 +145,13 @@
                        checked: false
                    }
                })
                console.log(this.coalList);
            },
            checkboxChange(e) {
                this.selectedCoal = e
            },
            formHandle() {
                if (!this.dataForm.firstClass || !this.dataForm.secondClass) return this.$u.toast('请选择煤场或者煤仓')
                if (this.selectedCoal.length === 0) return this.$u.toast('请选择煤种')
                this.$reqPost('updateUser', Object.assign(this.userInfo, {
                    responsibilityCoal: this.selectedCoal.join(),
                    filedId: this
pages/public-page/faYunstatisticsDetails/faYunstatisticsDetails.vue
@@ -94,7 +94,7 @@
                id: '',
                faYunDetailobj: {},
                coalStatus: ['领取', '预约', '签到', '入场', '称皮', '称毛', '离场', '入磅房', '出磅房', '入煤仓', '出煤仓', '放空', '作废', '入场申请',
                    '进入场院', '异常审核中'
                    '进入场院', '异常审核中', '打印中', '打印中'
                ]
            };
        },
pages/tabbar-page/index-tabbar/index-tabbar.vue
@@ -191,17 +191,20 @@
                    }
                } else if (v.startsWith('wsg')) {
                    let wsgObj = JSON.parse(v.slice(5));
                    console.log(uni.getStorageSync('carNo'), wsgObj.carNo);
                    if (uni.getStorageSync('carNo') === wsgObj.carNo) {
                    if (uni.getStorageSync('carNo') === wsgObj.carNo && !wsgObj.peopleWeigh) {
                        this.changewsgVisiable(true)
                        this.changewsgContent(wsgObj.content)
                    }
                    if (uni.getStorageSync('carNo') === wsgObj.carNo && wsgObj.peopleWeigh === 2) {
                        this.changeconfirmWeighVisiable(true)
                        this.changeconfirmWeighContent(wsgObj.content)
                    }
                }
            }
        },
        methods: {
            ...mapMutations(['pushMessage', 'changeWeigh', 'changeinfraredStatus', 'changeisconnect', 'websocketInit',
                'changewsgVisiable', 'changewsgContent'
                'changewsgVisiable', 'changewsgContent', 'changeconfirmWeighVisiable', 'changeconfirmWeighContent'
            ]),
            messagePage() {
                uni.navigateTo({
store/index.js
@@ -145,7 +145,9 @@
        ],
        wsgVisiable: false, //磅房忙碌弹窗控制
        wsgContent: '',
        globalIsFirstWeighing: 1 //是否是第一次上磅
        globalIsFirstWeighing: 1, //是否是第一次上磅
        confirmWeighVisiable: false, //磅房管理确认称重完成提示弹窗
        confirmWeighContent: ''
    },
    mutations: {
        lengthchange(state, payload) {
@@ -189,6 +191,9 @@
        changeuserInfo(state, payload) {
            state.globaluserInfo = payload
        },
        changesocketTask(state, payload) {
            state.socketTask = payload
        },
        // 改版全局websocket状态
        changeisconnect(state, payload) {
            state.globalisconnect = payload
@@ -209,10 +214,14 @@
        },
        // 改变重连次数
        changereconnectNum(state, payload) {
            if (state.connectNum < 6) {
                state.connectNum += payload
            if (payload.isWeigh) {
                state.connectNum = payload.connectNum
            } else {
                state.connectNum = payload
                if (state.connectNum < 6) {
                    state.connectNum += payload.connectNum
                } else {
                    state.connectNum = payload.connectNum
                }
            }
        },
        changeablePrintInduction(state, payload) {
@@ -229,12 +238,18 @@
        },
        changeglobalIsFirstWeighing(state, payload) {
            state.globalIsFirstWeighing = payload
        },
        changeconfirmWeighVisiable(state, payload) {
            state.confirmWeighVisiable = payload
        },
        changeconfirmWeighContent(state, payload) {
            state.confirmWeighContent = payload
        }
    },
    actions: {
        websocketInit({ state, dispatch, commit }) {
            let wsUrl = `${webSocketUrl}?access_token=${uni.getStorageSync('token')}`
            state.socketTast = uni.connectSocket({
            state.socketTask = uni.connectSocket({
                url: wsUrl,
                header: { CLIENT_TOC: 'Y' },
                success: res => {
@@ -252,17 +267,17 @@
                    commit('changeisconnect', false)
                }
            })
            state.socketTast.onOpen(() => dispatch('websocketOnOpen'))
            state.socketTast.onMessage(result => dispatch('websocketOnMessage', result.data))
            state.socketTast.onClose(e => dispatch('websocketOnClose', e))
            state.socketTast.onError(e => dispatch('websocketOnError', e))
            state.socketTask.onOpen(() => dispatch('websocketOnOpen'))
            state.socketTask.onMessage(result => dispatch('websocketOnMessage', result.data))
            state.socketTask.onClose(e => dispatch('websocketOnClose', e))
            state.socketTask.onError(e => dispatch('websocketOnError', e))
        },
        websocketOnOpen({ state, commit }) {
            console.log('ws打开')
            clearInterval(state.reconnectTimeOut)
            clearInterval(state.globalIntervalId)
            state.globalIntervalId = setInterval(() => {
                state.socketTast.send({
                state.socketTask.send({
                    data: JSON.stringify({ type: 'ping' }),
                    success(e) {
                        console.log(e, '发送心跳成功')
@@ -271,24 +286,25 @@
            }, 30000)
        },
        websocketOnClose({ state, commit, dispatch }, e) {
            if (!state.socketTast) return
            if (!state.socketTask) return
            console.log('ws关闭', e)
            state.socketTast.close(e => {
            state.socketTask.close(e => {
                commit('changeisconnect', false)
            })
            clearInterval(state.globalIntervalId)
            clearInterval(state.reconnectTimeOut)
            state.socketTast = null
            state.socketTask = null
            commit('changereconnectState', false)
            if (state.connectNum < 6 && state.globalisLogin) {
            console.log(state.connectNum, state.connectNum.connectNum, '链接数');
            if (state.connectNum < 6 || state.connectNum.connectNum < 6 && state.globalisLogin) {
                uni.showToast({
                    title: `连接失败,正在尝试第${state.connectNum}次连接`,
                    title: '连接失败,正在尝试重新连接',
                    icon: 'none'
                })
                commit('changereconnectNum', 1)
                commit('changereconnectNum', { connectNum: 1, isWeigh: false })
                dispatch('reconnect')
            } else if (state.connectNum >= 6 && state.globalisLogin) {
                commit('changereconnectNum', 1)
                commit('changereconnectNum', { connectNum: 1, isWeigh: false })
                uni.showToast({
                    title: '网络异常,请稍后重试',
                    icon: 'none'
@@ -302,17 +318,17 @@
            console.log('ws报错', e)
            clearInterval(state.globalIntervalId)
            clearInterval(state.reconnectTimeOut)
            state.socketTast = null
            state.socketTask = null
            commit('changereconnectState', false)
            if (state.connectNum < 6 && state.globalisLogin) {
            if (state.connectNum < 6 || state.connectNum.connectNum < 6 && state.globalisLogin) {
                uni.showToast({
                    title: `连接失败,正在尝试第${state.connectNum}次连接`,
                    title: '连接失败,正在尝试重新连接',
                    icon: 'none'
                })
                commit('changereconnectNum', 1)
                commit('changereconnectNum', { connectNum: 1, isWeigh: false })
                dispatch('reconnect')
            } else if (state.connectNum > 6 && state.globalisLogin) {
                commit('changereconnectNum', 1)
                commit('changereconnectNum', { connectNum: 1, isWeigh: false })
                uni.showToast({
                    title: '网络异常,请稍后重试',
                    icon: 'none'