qingyiay
2023-05-09 01e96c8855927df67ac8a6831e345b6cb33140d1
pages/public-page/forward/forward.vue
@@ -197,13 +197,16 @@
         if (value.length != 0) {
            let tempforwardSurplus = this.forwardSurplus;
            let tempcarNumSurplus1 = this.carNumSurplus1;
            let jhorderplanforward = () => {
            if (v.id) {
               this.$reqGet('jhorderplanforward', { forwardId: v.id }).then(res => {
                  this.personalForward = res.data;
                  // 计算全部转发数
                  // 客户
                  if (this.roleType == 1) {
                     this.jhOrderPlanForwardList[index].carNum = this.allrelay(this.personalForward.carNum, tempcarNumSurplus1);
                     if (this.jhOrderPlanForwardList[index].carNum == 0) {
                        this.jhOrderPlanForwardList[index].carNum == tempcarNumSurplus1;
                     }
                  }
                  tempcarNumSurplus1 = 0;
                  // 货代
@@ -212,8 +215,18 @@
                  }
                  tempforwardSurplus = 0;
               });
            };
            jhorderplanforward();
            } else {
               if (this.roleType == 1) {
                  this.jhOrderPlanForwardList[index].carNum = this.carNumSurplus1;
                  // this.allrelay(this.jhOrderPlanForwardList[index].carNum, this.carNumSurplus1);
               }
               tempcarNumSurplus1 = 0;
               if (this.roleType == 2) {
                  this.jhOrderPlanForwardList[index].carNum = this.forwardSurplus;
                  // this.allrelay(this.jhOrderPlanForwardList[index].carNum, this.forwardSurplus);
               }
               tempforwardSurplus = 0;
            }
            // 选择一个后其余禁止复选
            this.jhOrderPlanForwardList.forEach((v, i) => {
               if (i !== index) {
@@ -225,14 +238,14 @@
            let tempcarNumSurplus1 = this.carNumSurplus1;
            // 货代
            if (this.roleType == 2) {
               this.jhOrderPlanForwardList[index].carNum = this.allrelayto(this.jhOrderPlanForwardList[index].carNum, this.forwardSurplus);
               this.jhOrderPlanForwardList[index].carNum = 0;
               if (this.jhOrderPlanForwardList[index].carNum <= 0) {
                  this.jhOrderPlanForwardList[index].carNum = 0;
               }
            }
            // 客户
            if (this.roleType == 1) {
               this.jhOrderPlanForwardList[index].carNum = this.allrelayto(this.jhOrderPlanForwardList[index].carNum, this.carNumSurplus1);
               this.jhOrderPlanForwardList[index].carNum = 0;
               if (this.jhOrderPlanForwardList[index].carNum <= 0) {
                  this.jhOrderPlanForwardList[index].carNum = 0;
               }
@@ -339,8 +352,9 @@
         if (this.jhOrderPlanForwardList.length === 0) {
            this.$u.toast('请至少选择一组转发对象');
         }
         let reg = /^[1-9]\d*$/;
         this.jhOrderPlanForwardList.forEach(v => {
            if (isNaN(Number(v.carNum)) || Number(v.carNum) <= 0) {
            if (!reg.test(v.carNum) || Number(v.carNum) <= 0) {
               this.$u.toast('请输入合法数字');
               isPass = false;
               return isPass;