付延余
2023-03-16 b6eaf843294b8a438dad42efda2be6bd24d2e926
客户,货代订单转发数量的判断
3个文件已修改
42 ■■■■■ 已修改文件
pages/customer-page/customer-index/customer-index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/freight-forwarder-page/freightForwarder-index/freightForwarder-index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/public-page/forward/forward.vue 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/customer-page/customer-index/customer-index.vue
@@ -154,7 +154,7 @@
        // 转发
        forwardClick(obj) {
            uni.navigateTo({
                url: `/pages/public-page/forward/forward?orderPlanId=${obj.id}&carNum=${obj.cars2}`
                url: `/pages/public-page/forward/forward?orderPlanId=${obj.id}&carNumSurplus1=${obj.carNumSurplus1}`
            });
        }
    }
pages/freight-forwarder-page/freightForwarder-index/freightForwarder-index.vue
@@ -8,7 +8,7 @@
                        <text>{{ item.carNum }}</text>
                        张
                    </view>
                    <view class="card-left__utils"><u-button text="转发" type="primary" @tap.stop="forwardClick(item.id)" shape="circle"></u-button></view>
                    <view class="card-left__utils"><u-button text="转发" type="primary" @tap.stop="forwardClick(item)" shape="circle"></u-button></view>
                </template>
                <template v-slot:right-top>
                    <view class="right-top">
@@ -62,9 +62,9 @@
            });
        },
        // 转发
        forwardClick(id) {
        forwardClick(value) {
            uni.navigateTo({
                url: `/pages/public-page/forward/forward?orderPlanId=${id}`
                url: `/pages/public-page/forward/forward?orderPlanId=${value.id}&carNumSurplusHuodai=${value.carNumSurplusHuodai}`
            });
        }
    }
pages/public-page/forward/forward.vue
@@ -48,15 +48,21 @@
export default {
    onLoad(params) {
        console.log('转发的提煤单id', params.orderPlanId, params.carNum);
        if (params.carNumSurplus1 || params.carNumSurplusHuodai) {
            if (params.carNumSurplus1 != 0) {
                this.forwardSurplus = params.carNumSurplus1;
            } else if (params.carNumSurplusHuodai != 0) {
                this.forwardSurplus = params.carNumSurplusHuodai;
            }
        }
        this.forwardForm.orderPlanId = params.orderPlanId;
        this.carNumTatal = params.carNum;
    },
    data() {
        return {
            forwardSurplus: 0,
            paramsName: {},
            huoDaiData: [],
            fleetData: [],
            carNumTatal: null,
            name: '',
            forwardForm: {
                orderPlanId: null,
@@ -107,7 +113,7 @@
        checkboxChange(value) {
            console.log('复选框变化', value);
            if (value.length != 0) {
                this.forwardForm.nums = this.carNumTatal;
                this.forwardForm.nums = this.forwardSurplus;
            } else {
                this.forwardForm.nums = null;
            }
@@ -156,14 +162,20 @@
        },
        // 提交
        submitForm() {
            this.$reqPost('forward', this.forwardForm, 'params').then(res => {
                if (res.code == 0) {
                    this.$u.toast('提交成功');
                    setTimeout(() => {
                        uni.navigateBack({ delta: 1 });
                    }, 1000);
                }
            });
            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 => {
                    if (res.code == 0) {
                        this.$u.toast('提交成功');
                        setTimeout(() => {
                            uni.navigateBack({ delta: 1 });
                        }, 1000);
                    }
                });
            }
        },
        tabClick(item) {
            console.log('tab点击', item);