qingyiay
2023-04-19 3fd84886a15713ece1ba34954f49fd1e075ef7be
改变称重监听,增加发运详情,修复电子提煤单错误
8个文件已修改
1个文件已添加
246 ■■■■■ 已修改文件
pages.json 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/customer-page/customer-index/fayunPlanDetails/fayunPlanDetails.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue 78 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/driver-page/driver-index/bill-of-lading-details/coal-pick-up-bill/coal-pick-up-bill.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/public-page/faYunstatisticsDetails/faYunstatisticsDetails.vue 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/tabbar-page/index-tabbar/index-tabbar.vue 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
store/index.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json
@@ -211,6 +211,15 @@
                }
                
                }
                ,{
                    "path" : "faYunstatisticsDetails/faYunstatisticsDetails",
                    "style" :
                {
                    "navigationBarTitleText": "",
                    "enablePullDownRefresh": false
                }
                }
            ]
        }, {
            "root": "pages/driver-page/appointment",
pages/customer-page/customer-index/fayunPlanDetails/fayunPlanDetails.vue
@@ -45,7 +45,7 @@
                    <view class="label-title">余量</view>
                    <view class="label-value">{{ item.allowance || 0 }}</view>
                </view>
                <view class="more-button"><u-button type="success" text="更多" @click="showMore(index)"></u-button></view>
                <view class="more-button"><u-button type="success" text="详情" @click="showMore(index)"></u-button></view>
            </view>
        </view>
    </view>
pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue
@@ -4,7 +4,7 @@
            <view class="content-statistics">
                <view class="content-text">发运统计</view>
                <view class="content-text">共{{ totalLength }}车</view>
                <view class="content-text">共{{ totalTon }}吨</view>
                <view class="content-text">共{{ totalTon.toFixed(2) }}吨</view>
            </view>
        </view>
        <view class="collapse-main">
@@ -119,6 +119,24 @@
                                </view>
                            </view>
                        </view>
                        <view class="filter-body" v-if="roleType == 2">
                            <view class="condition-name">车牌号:</view>
                            <view class="filter-name">
                                <view class="filter-button" v-for="(item, index) in carNoList" :key="index" @click="filterCondition(6, index, item.condition)">
                                    <u-button shape="circle" :text="item.condition" :type="item.active ? 'success' : ''" size="small"></u-button>
                                </view>
                                <view class="toggle-button">
                                    <u-button
                                        shape="circle"
                                        :text="carNoShow < carNoTotal ? '查看更多' : '收起'"
                                        type="primary"
                                        size="small"
                                        @click="toggle(6)"
                                        v-if="carNoTotal > 3"
                                    ></u-button>
                                </view>
                            </view>
                        </view>
                        <view class="filter-body">
                            <view class="condition-name">日期:</view>
                            <view class="filter-name">
@@ -156,10 +174,10 @@
                    </view>
                </view>
                <view class="card-main" v-for="(value, i) in item.taskCoalList" :key="i">
                    <view class="arrow-right"><u-icon name="arrow-right" size="50"></u-icon></view>
                    <view class="arrow-right" @click="faYunDetail(value.id)"><u-icon name="arrow-right" size="50"></u-icon></view>
                    <view class="main-body">
                        <view class="coal-name">煤种:{{ value.coalName || '' }}</view>
                        <view class="clean">执行量:{{ value.clean || 0 }}</view>
                        <view class="clean">执行量:{{ value.clean.toFixed(2) || 0 }}</view>
                        <view class="out-time">出场时间:{{ value.outTime || '' }}</view>
                        <view class="car-number">车牌号:{{ value.carNo || '' }}</view>
                        <view class="filedName">矿场:{{ value.filedName || '' }}</view>
@@ -181,6 +199,7 @@
            forwarderList: [],
            fleetList: [],
            filedList: [],
            carNoList: [],
            isactive: false,
            info: {
                lunar: false,
@@ -201,12 +220,18 @@
            forwarderShow: 3,
            fleetShow: 3,
            filedShow: 3,
            carNoShow: 3,
            coalToggeleState: false,
            typeToggeleState: false,
            customerToggeleState: false,
            forwarderToggeleState: false,
            fleetToggeleState: false,
            filedToggeleState: false
            filedToggeleState: false,
            carNoToggeleState: false,
            // 点击右箭头详情弹窗
            faYunDetailobj: {},
            modalShow: false,
            coalStatus: ['领取', '预约', '签到', '入场', '称皮', '称毛', '离场', '入磅房', '出磅房', '入煤场', '出煤仓']
        };
    },
    onShow() {
@@ -283,6 +308,14 @@
                            active: false
                        };
                    });
                this.carNoList = res.data
                    .filter(v => v.conditionType == 6)
                    .map(item => {
                        return {
                            ...item,
                            active: false
                        };
                    });
            });
        },
        // 获取数据
@@ -328,6 +361,9 @@
                case 5:
                    this.filedList[i].active = !this.filedList[i].active;
                    break;
                case 6:
                    this.carNoList[i].active = !this.carNoList[i].active;
                    break;
            }
            const validateFn = key => (v, arr) => {
@@ -343,7 +379,8 @@
                customerName: this.customerList.filter(v => v.active == true).map(item => item.condition),
                xsUser2Name: this.forwarderList.filter(v => v.active == true).map(item => item.condition),
                fleetName: this.fleetList.filter(v => v.active == true).map(item => item.condition),
                filedName: this.filedList.filter(v => v.active == true).map(item => item.condition)
                filedName: this.filedList.filter(v => v.active == true).map(item => item.condition),
                carNo: this.carNoList.filter(v => v.active == true).map(item => item.condition)
            };
            const mapping = {
@@ -352,7 +389,8 @@
                customerName: validateFn('customerName'),
                xsUser2Name: validateFn('xsUser2Name'),
                fleetName: validateFn('fleetName'),
                filedName: validateFn('filedName')
                filedName: validateFn('filedName'),
                carNo: validateFn('carNo')
            };
            this.filterList = this.taskList.map(val => {
                return {
@@ -439,7 +477,25 @@
                        this.filedToggeleState = false;
                    }
                    break;
                case 6:
                    if (!this.carNoToggeleState) {
                        this.carNoShow = this.carNoTotal;
                        this.carNoToggeleState = true;
                    } else {
                        this.carNoShow = 3;
                        this.carNoToggeleState = false;
            }
                    break;
            }
        },
        // 跳转发运详情
        faYunDetail(takeCoalId) {
            uni.navigateTo({
                url: `/pages/public-page/faYunstatisticsDetails/faYunstatisticsDetails?id=${takeCoalId}`
            });
        },
        confirm() {
            this.modalShow = false;
        }
    },
    computed: {
@@ -469,6 +525,9 @@
        },
        filedTotal() {
            return this.filedList.length;
        },
        carNoTotal() {
            return this.carNoList.length;
        }
    },
    watch: {
@@ -513,7 +572,7 @@
            justify-content: space-between;
            align-items: center;
            .content-text {
                width: vww(80);
                width: 33.3%;
                height: vww(30);
                font-size: vww(20);
                color: #393a3c;
@@ -560,7 +619,10 @@
                        }
                    }
                    .toggle-button {
                        margin-top: vww(12);
                        margin: vww(12) auto;
                        position: relative;
                        left: -10%;
                        transform: translateX(-50%);
                    }
                }
            }
pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue
@@ -100,7 +100,8 @@
                sceneId: '',
                gateCameraId: '',
                equipmentCode: '',
                weigh: 0
                weigh: 0,
                sceneInOut: ''
            },
            // 原发信息
            primarySkin: null,
@@ -254,13 +255,14 @@
                    this.weighData.sceneId = res.data.id;
                    this.weighData.gateCameraId = res.data.lastEquipmentId;
                    this.weighData.equipmentCode = res.data.lastEquipmentCode;
                    this.weighData.sceneInOut = res.data.sceneInOut;
                    this.weighHouseCode = res.data.code;
                    uni.navigateTo({
                        url: `/pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice?takeCoalId=${this.orderPlanId}&sceneId=${
                            res.data.id
                        }&gateCameraId=${res.data.lastEquipmentId}&gateCameraCode=${res.data.lastEquipmentCode}&weighHouseCode=${res.data.code}&primarySkin=${
                            this.primarySkin
                        }&primaryHair=${this.primaryHair}&primaryClean=${this.primaryClean}`
                        }&primaryHair=${this.primaryHair}&psrimaryClean=${this.primaryClean}&sceneInOut=${res.data.sceneInOut}`
                    });
                } else {
                    this.$u.toast('未在磅房,请前往磅房后再试!!');
pages/driver-page/driver-index/bill-of-lading-details/coal-pick-up-bill/coal-pick-up-bill.vue
@@ -43,7 +43,7 @@
            this.$reqGet('getTakeCoal', { takeCoalId: this.orderPlanId }).then(res => {
                console.log('获取提煤单详情', res);
                if (res.code == 0) {
                    this.coalData = res.data[0];
                    this.coalData = res.data;
                } else {
                    this.$u.toast('加载失败');
                }
pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue
@@ -72,13 +72,13 @@
let socket = null;
import { webSocketUrl } from '@/api/request.js';
import { mapState, mapMutations } from 'vuex';
import toast from '../../../../../uni_modules/uview-ui/libs/config/props/toast';
export default {
    onLoad(params) {
        this.takeCoalId = params.takeCoalId;
        this.weighData.sceneId = params.sceneId;
        this.weighData.gateCameraId = params.gateCameraId;
        this.weighData.equipmentCode = params.gateCameraCode;
        this.weighData.sceneInOut = params.sceneInOut;
        this.weighHouseCode = params.weighHouseCode;
        this.primarySkin = params.primarySkin;
        this.primaryHair = params.primaryHair;
@@ -96,7 +96,8 @@
                gateCameraId: '',
                equipmentCode: '',
                weigh: 0,
                tmCode: ''
                tmCode: '',
                sceneInOut: ''
            },
            takeCoalId: null,
            weighHouseCode: '',
@@ -154,8 +155,13 @@
            }
        },
        // 监听重量变化
        globalweigh(v) {
        globalweigh: {
            handler(v) {
            this.weighData.weigh = this.realTimeWeigh = v;
                console.log(this.realTimeWeigh, '真实重量改变了');
            },
            immediate: true,
            deep: true
        }
    },
    onShow() {
pages/public-page/faYunstatisticsDetails/faYunstatisticsDetails.vue
New file
@@ -0,0 +1,100 @@
<template>
    <view>
        <combined-title title="发运详情"></combined-title>
        <view class="compDetails">
            <uni-table border stripe emptyText="暂无更多数据">
                <uni-tr>
                    <uni-th align="left">提煤单编号</uni-th>
                    <uni-td align="left">{{ faYunDetailobj.code || '' }}</uni-td>
                </uni-tr>
                <uni-tr>
                    <uni-th align="left">提煤单状态</uni-th>
                    <uni-td align="left">{{ coalStatus[faYunDetailobj.status] }}</uni-td>
                </uni-tr>
                <uni-tr>
                    <uni-th align="left">车牌号</uni-th>
                    <uni-td align="left">{{ faYunDetailobj.carNo || '' }}</uni-td>
                </uni-tr>
                <uni-tr>
                    <uni-th align="left">入场时间</uni-th>
                    <uni-td align="left">{{ faYunDetailobj.inTime || '' }}</uni-td>
                </uni-tr>
                <uni-tr>
                    <uni-th align="left">出场时间</uni-th>
                    <uni-td align="left">{{ faYunDetailobj.outTime || '' }}</uni-td>
                </uni-tr>
                <uni-tr>
                    <uni-th align="left">皮重</uni-th>
                    <uni-td align="left">{{ faYunDetailobj.skin || 0 }}</uni-td>
                </uni-tr>
                <uni-tr>
                    <uni-th align="left">毛重</uni-th>
                    <uni-td align="left">{{ faYunDetailobj.hair || 0 }}</uni-td>
                </uni-tr>
                <uni-tr>
                    <uni-th align="left">净重</uni-th>
                    <uni-td align="left">{{ faYunDetailobj.clean || 0 }}</uni-td>
                </uni-tr>
                <uni-tr>
                    <uni-th align="left">订单编号</uni-th>
                    <uni-td align="left">{{ faYunDetailobj.orderCode || '' }}</uni-td>
                </uni-tr>
                <uni-tr>
                    <uni-th align="left">订单剩余量</uni-th>
                    <uni-td align="left">{{ faYunDetailobj.allowance || 0 }}</uni-td>
                </uni-tr>
            </uni-table>
        </view>
    </view>
</template>
<script>
export default {
    data() {
        return {
            id: '',
            faYunDetailobj: {},
            coalStatus: ['领取', '预约', '签到', '入场', '称皮', '称毛', '离场', '入磅房', '出磅房', '入煤场', '出煤仓']
        };
    },
    methods: {},
    onLoad(params) {
        this.id = params.id;
    },
    onShow() {
        this.$reqGet('getTakeCoal', { takeCoalId: this.id }).then(res => {
            if (res.code == 0) {
                this.faYunDetailobj = res.data;
            } else {
                this.$u.toast('获取数据失败');
            }
        });
    }
};
</script>
<style scoped lang="scss">
.uni-table {
    .uni-table-tr {
        padding: 0;
        border: vww(1) solid #c6c6c6;
        .uni-table-th {
            font-size: vww(14);
            height: vww(30);
            line-height: vww(30);
            padding: vww(5) vww(10);
            color: #111111;
            font-weight: 500;
            background: #e2e2e2;
        }
        .uni-table-td {
            font-size: vww(14);
            font-weight: 400;
            height: vww(30);
            line-height: vww(30);
            padding: vww(5) vww(10);
            color: #111111;
        }
    }
}
</style>
pages/tabbar-page/index-tabbar/index-tabbar.vue
@@ -13,7 +13,9 @@
        <driver-index v-if="roleType == 3" ref="driverIndexRef" :indexdriverBillOfLoadingData="indexdriverBillOfLoadingData"></driver-index>
        <tab-bar :current="0"></tab-bar>
        <!-- 推送消息弹窗 -->
        <u-modal :show="messagePushShow" :title="messageList.title" :content="messageList.content" @confirm="messageconfirm"></u-modal>
        <u-modal :show="messagePushShow" :title="messageList.title" @confirm="messageconfirm">
            <view class="slot-content"><rich-text :nodes="messageList.content"></rich-text></view>
        </u-modal>
    </view>
</template>
@@ -122,6 +124,17 @@
        }
        this.userAuthorization();
    },
    onHide() {
        console.log('页面隐藏');
        if (!this.isconnect) {
            this.initWebsocket();
        }
    },
    onUnload() {
        console.log('页面卸载');
        socket.close();
        clearInterval(this.intervalId);
    },
    methods: {
        ...mapMutations(['pushMessage', 'changeWeigh', 'changeinfraredStatus']),
        messagePage() {
@@ -208,10 +221,19 @@
            });
            socket.onOpen(() => {
                console.log('onOpen');
                this.intervalId = setInterval(() => {
                    socket.send({
                        data: JSON.stringify({ type: 'ping' }),
                        success(e) {
                            console.log(e, '发送心跳成功');
                        }
            });
                }, 30000);
            });
            // 获取服务器传来的数据,做相应处理
            socket.onMessage(res => {
                console.log('socketWeigh', res);
                console.log('message', res);
                if (res.data.startsWith('weigh')) {
                    let nowWeighObj = JSON.parse(res.data.slice(7));
                    if (this.globalweighHouseCode && nowWeighObj.eqCode == this.globalweighHouseCode) {
@@ -223,13 +245,16 @@
                            this.changeWeigh(nowWeighObj.weigh);
                        }
                    }
                } else {
                } else if (res.data.startsWith('msg')) {
                    this.messageList = JSON.parse(res.data.slice(5));
                    this.messagePushShow = true;
                } else {
                    console.log('websocket还在活着');
                }
            });
            socket.onClose(() => {
                console.log('webSocketClose');
            socket.onClose(e => {
                console.log('webSocketClose', e);
                this.$u.toast('连接已断开,请重新进入该页面,重试!!');
                this.isconnect = false;
            });
            socket.onError(err => {
store/index.js
@@ -67,7 +67,7 @@
        // 改变重量
        changeWeigh(state, payload) {
            state.globalweigh = payload
            console.log(state.globalweigh, '重量改变了')
            console.log(state.globalweigh, '全局重量改变了')
        },
        // 消息推送
        pushMessage(state, payload) {