qingyiay
2023-03-29 82af85eae92790fc125ca42d1a800046fe0bd916
pages/public-page/forward/forward.vue
@@ -69,12 +69,24 @@
      }
      this.orderPlanId = params.orderPlanId;
      this.$reqGet('forwardList', { OrderPlanId: params.orderPlanId }).then(res => {
         if (res.data.length !== 0) {
         if (res.data.length !== 0 && this.roleType == 1) {
            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: ''
               };
            });
         } else if (res.data.length !== 0 && this.roleType == 2) {
            this.jhOrderPlanForwardList = res.data.map(item => {
               return {
                  id: item.id,
                  orderPlanId: item.orderPlanId,
                  name: item.fleetName,
                  carNum: item.carNum,
                  xsUserId: item.xsUserId === null ? 0 : item.xsUserId,
                  fleetId: item.fleetId === null ? 0 : item.fleetId,
@@ -226,15 +238,19 @@
      },
      // 删除一组表单
      deleteGroup(index, v) {
         if (v.id) {
         let tempcarNum = v.carNum;
         if (v.id && this.jhOrderPlanForwardList[index].carNum !== tempcarNum) {
            this.$reqPost('deleteForward', { id: v.id }, 'params').then(res => {
               if (res.code === 0) {
                  this.jhOrderPlanForwardList.splice(index, 1);
                  this.$u.toast('删除成功');
               } else if (res.code === 1) {
                  this.$u.toast(res.msg);
               }
            });
         } else {
            this.jhOrderPlanForwardList.splice(index, 1);
            this.$u.toast('删除成功');
         }
      },
      // 提交
@@ -245,22 +261,27 @@
               this.$u.toast('请输入合法数字');
               isPass = false;
               return isPass;
            } else if (Number(v.carNum) > Number(this.forwardSurplus)) {
               this.$u.toast('超过最大订单剩余量');
               isPass = false;
               return isPass;
            } else {
            }
            // 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 => {
               console.log(res, 'zh');
               if (res.code == 0) {
                  this.$u.toast('提交成功');
                  setTimeout(() => {
                     uni.navigateBack({ delta: 1 });
                  }, 1000);
               } else {
                  this.$u.toast(res.msg);
               }
            });
         }