qingyiay
2023-03-22 8e095c1fd6164fafc7d5cfd144528a0d67afef7c
转发页面修改
4个文件已修改
232 ■■■■ 已修改文件
api/globalApi.js 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/customer-page/customer-index/customer-index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/login/userPassword.vue 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/public-page/forward/forward.vue 160 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/globalApi.js
@@ -1,10 +1,10 @@
export const globalApi = {
    // 绑定微信
    wxBind:{
        url:'/wrzs/social/bind',
        method:"POST"
    wxBind: {
        url: '/wrzs/social/bind',
        method: "POST"
    },
    //    提煤单
    //    获取发运计划列表
    GetOrderPlan: {
@@ -39,10 +39,23 @@
     * @转发修改
     */
    forward: {
        url: "/wrzs/userOperation/forward",
        url: "/wrzs/userOperation/forwardList",
        method: "POST"
    },
    /**
     * @description 转发修改回显
     */
    forwardList: {
        url: "/wrzs/userOperation/forwardListData",
        method: "GET"
    },
    /**
     * @description 删除一组转发
     */
    deleteForward: {
        url: "/wrzs/userOperation/deleteForward",
        method: "POST"
    },
    // 货代首页列表
    // huoDaiList: {
    //     url: "/wrzs/wx/huoDaiList",
@@ -52,7 +65,7 @@
     * @货代首页列表修改
     */
    huoDaiList: {
        url: "/wrzs/userOperation/huoDaiList",
        url: "/wrzs/userOperation/huoDaiList    ",
        method: "GET"
    },
@@ -235,14 +248,14 @@
        method: 'GET'
    },
    // 加减煤
    addAndSubtractCoal:{
        url:'/wrzs/jcgatestate/repeatCheck',
        method:'POST'
    addAndSubtractCoal: {
        url: '/wrzs/jcgatestate/repeatCheck',
        method: 'POST'
    },
    // 获取所在磅房
    getWeighHouse:{
        url:"/wrzs/jccoalweighhouse/getWeighHouse",
        method:'GET'
    getWeighHouse: {
        url: "/wrzs/jccoalweighhouse/getWeighHouse",
        method: 'GET'
    },
    // 提煤单日志查询
pages/customer-page/customer-index/customer-index.vue
@@ -147,7 +147,7 @@
        // 转发
        forwardClick(obj) {
            uni.navigateTo({
                url: `/pages/public-page/forward/forward?orderPlanId=${obj.id}&carNumSurplus1=${obj.carNumSurplus1}`
                url: `/pages/public-page/forward/forward?orderPlanId=${obj.id}&carNumSurplus1=${obj.carNumSurplus1}&carNum=${obj.carNum}&cars2=${obj.cars2}`
            });
        }
    }
pages/login/userPassword.vue
@@ -43,9 +43,8 @@
    },
    data() {
        return {
            // username: '12222222222',// 客户
            username: 'appuser', // 客户
            // username: '18805080506',// 王楠(司机)
            username: '13333333332',// driver
            password: '123456',
            remember: true,
            baseUrl: ''
@@ -85,20 +84,22 @@
                            setRefreshToken(res.refresh_token);
                            setUsernameKey(res.username);
                            //查询用户详细信息并储存
                            this.$reqGet('getUserEntity').then(res => {
                                this.$u.toast('恭喜您,登录成功!');
                                this.setUserTabbar(res.data.type);
                                uni.setStorageSync('roleType', res.data.type);
                                setCustomerId(res.data.customerid);
                                uni.hideLoading();
                                //跳转页面
                                this.$nextTick(() => {
                                    redirectHome();
                            this.$reqGet('getUserEntity')
                                .then(res => {
                                    this.$u.toast('恭喜您,登录成功!');
                                    this.setUserTabbar(res.data.type);
                                    uni.setStorageSync('roleType', res.data.type);
                                    setCustomerId(res.data.customerid);
                                    uni.hideLoading();
                                    //跳转页面
                                    this.$nextTick(() => {
                                        redirectHome();
                                    });
                                })
                                .catch(err => {
                                    this.$u.toast('登录异常!');
                                    console.log(err);
                                });
                            }).catch(err=>{
                                this.$u.toast('登录异常!');
                                console.log(err);
                            });
                        } else {
                            uni.hideLoading();
                            this.$u.toast(res.msg);
pages/public-page/forward/forward.vue
@@ -1,21 +1,27 @@
<template>
    <!-- 转发 -->
    <view class="forward">
        <view class="forward-card">
        <view><u-notice-bar :text="text" :fontSize="30" mode="link"></u-notice-bar></view>
        <view class="forward-card" v-for="(val, index) in jhOrderPlanForwardList">
            <u--form labelPosition="top" :model="forwardForm" ref="form1">
                <u-form-item label="转发对象" labelWidth="20%" ref="item1" @click="forwardObjectClick"><u--input v-model="name" placeholder="点击选择转发对象"></u--input></u-form-item>
                <u-form-item label="转发对象" labelWidth="20%" ref="item1" @click="forwardObjectClick(index)">
                    <u--input v-model="val.name" placeholder="点击选择转发对象"></u--input>
                </u-form-item>
                <u-form-item label="输入数量" labelWidth="20%" ref="item1">
                    <view class="forward-card-amount">
                        <view class="forward-card-amount-input"><u--input v-model="forwardForm.nums" placeholder="请输入转发数量"></u--input></view>
                        <u-checkbox-group v-model="checkboxValue1" placement="column" @change="checkboxChange">
                        <view class="forward-card-amount-input"><u--input v-model="val.carNum" placeholder="请输入转发数量"></u--input></view>
                        <u-checkbox-group v-model="val.checkboxValue1" placement="column" @change="v => checkboxChange(v, index)">
                            <u-checkbox :customStyle="{ marginBottom: '8px' }" size="30" labelSize="30" label="全部转发" name="全部转发"></u-checkbox>
                        </u-checkbox-group>
                    </view>
                </u-form-item>
                <u-form-item><u-button text="删除本组" :hairline="false" type="error" @click="deleteGroup(index, val)"></u-button></u-form-item>
            </u--form>
        </view>
        <!-- 增加按钮 -->
        <view class="AdddBtn"><u-button text="添加" :hairline="false" type="primary" :customStyle="{ marginBottom: '8px' }" @click="addForm"></u-button></view>
        <!-- 按钮 -->
        <view class="forwardBtn"><u-button text="提交" :hairline="false" type="primary" @click="submitForm"></u-button></view>
        <view class="forwardBtn"><u-button text="提交" :hairline="false" type="warning" @click="submitForm"></u-button></view>
        <!-- 选择货代或车队弹出框 -->
        <view class="selectHuoDaiOrFleet-container">
@@ -47,7 +53,8 @@
export default {
    onLoad(params) {
        console.log('转发的提煤单id', params.orderPlanId, params.carNum);
        this.cars2 = Number(params.cars2);
        this.carNumSurplus1 = Number(params.carNumSurplus1);
        if (params.carNumSurplus1 || params.carNumSurplusHuodai) {
            if (params.carNumSurplus1 != 0) {
                this.forwardSurplus = params.carNumSurplus1;
@@ -55,7 +62,32 @@
                this.forwardSurplus = params.carNumSurplusHuodai;
            }
        }
        this.forwardForm.orderPlanId = params.orderPlanId;
        this.orderPlanId = params.orderPlanId;
        this.$reqGet('forwardList', { OrderPlanId: params.orderPlanId }).then(res => {
            if (res.data) {
                this.jhOrderPlanForwardList = res.data.map(item => {
                    return {
                        id: item.id,
                        orderPlanId: item.orderPlanId,
                        name: item.xsUserName === null ? item.fleetName : item.xsUserName,
                        carNum: item.carNum,
                        xsUserId: item.xsUserId === null ? 0 : item.xsUserId,
                        fleetId: item.fleetId === null ? 0 : item.fleetId,
                        checkboxValue1: ''
                    };
                });
                console.log(this.jhOrderPlanForwardList, '列表');
            } else {
                this.jhOrderPlanForwardList = this.jhOrderPlanForwardList.map(v => {
                    if (!v.orderPlanId) {
                        return {
                            ...v,
                            orderPlanId: params.orderPlanId
                        };
                    }
                });
            }
        });
    },
    data() {
        return {
@@ -63,13 +95,20 @@
            paramsName: {},
            huoDaiData: [],
            fleetData: [],
            name: '',
            forwardForm: {
                orderPlanId: null,
                nums: null,
                userId: 0,
                fleetId: 0
            },
            // 日计划id
            orderPlanId: '',
            jhOrderPlanForwardList: [
                {
                    orderPlanId: '',
                    name: '',
                    carNum: null,
                    xsUserId: 0,
                    fleetId: 0,
                    checkboxValue1: ''
                }
            ],
            // 索引,利用索引正确显示
            index: '',
            checkboxValue1: '',
            selectPopupShow: false,
            list1: [
@@ -80,7 +119,10 @@
                    name: '货代'
                }
            ],
            tabHuoDai: false
            tabHuoDai: false,
            carNumSurplus1: '',
            cars2: '',
            formNum: 1
        };
    },
    onShow() {
@@ -93,6 +135,9 @@
    computed: {
        roleType() {
            return uni.getStorageSync('roleType');
        },
        text() {
            return `已领取${this.cars2}张日计划单,剩余${this.carNumSurplus1}张日计划单`;
        }
    },
    methods: {
@@ -110,12 +155,12 @@
                    break;
            }
        },
        checkboxChange(value) {
            console.log('复选框变化', value);
        checkboxChange(value, index) {
            console.log('复选框变化', value, index);
            if (value.length != 0) {
                this.forwardForm.nums = this.forwardSurplus;
                this.jhOrderPlanForwardList[index].carNum = this.forwardSurplus;
            } else {
                this.forwardForm.nums = null;
                this.jhOrderPlanForwardList[index].carNum = null;
            }
        },
        // 获取货代列表
@@ -133,9 +178,9 @@
            });
        },
        // 转发
        forwardObjectClick() {
            console.log('hahah');
        forwardObjectClick(index) {
            this.selectPopupShow = true;
            this.index = index;
            console.log(this.huoDaiData, this.fleetData, '转发');
        },
        selectPopupClose() {
@@ -147,27 +192,61 @@
        // 转发选择货代
        forwardHuoDaiObjectSelect(item) {
            this.selectPopupShow = false;
            this.forwardForm.userId = item.userId;
            this.name = item.name;
            this.forwardForm.fleetId = 0;
            console.log('货代选择', this.forwardForm);
            this.jhOrderPlanForwardList[this.index].xsUserId = item.userId;
            this.jhOrderPlanForwardList[this.index].name = item.name;
            this.jhOrderPlanForwardList[this.index].fleetId = 0;
            console.log('货代选择', this.jhOrderPlanForwardList[this.index]);
        },
        // 转发选择车队
        forwardFleetObjectSelect(item) {
            this.selectPopupShow = false;
            this.forwardForm.fleetId = item.id;
            this.name = item.name;
            this.forwardForm.userId = 0;
            console.log('车队选择', this.forwardForm);
            this.jhOrderPlanForwardList[this.index].fleetId = item.id;
            this.jhOrderPlanForwardList[this.index].name = item.name;
            this.jhOrderPlanForwardList[this.index].xsUserId = 0;
            console.log('车队选择', this.jhOrderPlanForwardList[this.index]);
        },
        addForm() {
            this.jhOrderPlanForwardList.push({
                orderPlanId: this.orderPlanId,
                name: '',
                carNum: 0,
                xsUserId: 0,
                fleetId: 0,
                checkboxValue1: ''
            });
        },
        // 删除一组表单
        deleteGroup(index, v) {
            if (v.id) {
                this.$reqPost('deleteForward', { id: v.id }, 'params').then(res => {
                    if (res.code === 0) {
                        this.jhOrderPlanForwardList.splice(index, 1);
                        this.$u.toast('删除成功');
                    }
                });
            } else {
                this.jhOrderPlanForwardList.splice(index, 1);
            }
        },
        // 提交
        submitForm() {
            if (isNaN(Number(this.forwardForm.nums)) || Number(this.forwardForm.nums) <= 0) {
                this.$u.toast('请输入合法数字');
            } else if (Number(this.forwardForm.nums) > Number(this.forwardSurplus)) {
                this.$u.toast('超过最大订单剩余量');
            } else {
                this.$reqPost('forward', this.forwardForm, 'params').then(res => {
            let isPass = false;
            this.jhOrderPlanForwardList.forEach(v => {
                if (isNaN(Number(v.carNum)) || Number(v.carNum) <= 0) {
                    this.$u.toast('请输入合法数字');
                    isPass = false;
                    return isPass;
                } else if (Number(v.carNum) > Number(this.forwardSurplus)) {
                    this.$u.toast('超过最大订单剩余量');
                    isPass = false;
                    return isPass;
                } else {
                    isPass = true;
                    return isPass;
                }
            });
            if (isPass) {
                this.$reqPost('forward', this.jhOrderPlanForwardList, 'json').then(res => {
                    if (res.code == 0) {
                        this.$u.toast('提交成功');
                        setTimeout(() => {
@@ -196,8 +275,11 @@
    // 卡片
    .forward-card {
        margin-top: vww(24);
        margin-top: vww(10);
        .notice-bar {
            width: 100%;
            height: vww(24);
        }
        .u-form {
            .u-form-item {
                .u-form-item__body {
@@ -227,8 +309,8 @@
    }
    .forwardBtn {
        width: 90%;
        position: fixed;
        width: 100%;
        // position: fixed;
        bottom: vww(50);
    }