qingyiay
2023-08-08 40a7d8db73f81ad10de03684dc9f6720e18cc315
pages/public-page/forward/forward.vue
@@ -3,49 +3,67 @@
   <view class="forward">
      <view class="forward-banner">
         <view class="banner-block">
            <view class="arrow-left" @click="back"><u-icon name="arrow-left" size="40" color="#ffffff"></u-icon></view>
            <view class="arrow-left"
               @click="back"><u-icon name="arrow-left"
                  size="40"
                  color="#ffffff"></u-icon></view>
            <view class="forward-text">转发</view>
         </view>
      </view>
      <view v-if="roleType == 1" class="notice-bar">
         <u-notice-bar :text="text" :fontSize="30"></u-notice-bar>
         <view
            class="notice-icon"
            style="background: url('https://mx.jzeg.cn:9095/appimg/image/banner/notice.png') no-repeat;background-size: cover; width: 42rpx;height: 42rpx;"
         ></view>
      <view v-if="roleType == 1"
         class="notice-bar">
         <u-notice-bar :text="text"
            :fontSize="30"></u-notice-bar>
         <view class="notice-icon"
            style="background: url('https://mx.jzeg.cn:9095/appimg/image/banner/notice.png') no-repeat;background-size: cover; width: 42rpx;height: 42rpx;">
      </view>
      <view v-else-if="roleType == 2" class="notice-bar"><u-notice-bar :text="text1" :fontSize="30"></u-notice-bar></view>
      </view>
      <view v-else-if="roleType == 2"
         class="notice-bar"><u-notice-bar :text="text1"
            :fontSize="30"></u-notice-bar></view>
      <view class="card-main">
         <view class="card-block">
            <u-swipe-action>
               <u-swipe-action-item :options="options1" v-for="(val, index) in jhOrderPlanForwardList" :key="val.vid" :name="val.vid" @click="deleteGroup(index, val)">
               <u-swipe-action-item :options="options1"
                  v-for="(val, index) in jhOrderPlanForwardList"
                  :key="val.vid"
                  :name="val.vid"
                  @click="deleteGroup(index, val)">
                  <view class="forward-card">
                     <view class="card-content">
                        <u--form labelPosition="left" :model="forwardForm" ref="form1">
                           <u-form-item label="转发对象" labelWidth="21%" ref="item1" @click="forwardObjectClick(index)">
                              <u--input v-model="val.name" placeholder="点击选择转发对象" :readonly="true" border="bottom"></u--input>
                        <u--form labelPosition="left"
                           :model="forwardForm"
                           ref="form1">
                           <u-form-item label="转发对象"
                              labelWidth="21%"
                              ref="item1"
                              @click="forwardObjectClick(index)">
                              <u--input v-model="val.name"
                                 placeholder="点击选择转发对象"
                                 :readonly="true"
                                 border="bottom"></u--input>
                           </u-form-item>
                           <u-form-item label="输入数量" ref="item2" labelWidth="21%">
                           <u-form-item label="输入数量"
                              ref="item2"
                              labelWidth="21%">
                              <view class="forward-card-amount">
                                 <view class="forward-card-amount-input">
                                    <u--input
                                       v-model="val.carNum"
                                    <u--input v-model="val.carNum"
                                       placeholder="请输入转发数量"
                                       @input="debouncecarNumInput(index, val.carNum)"
                                       @blur="blurInput(index, val.carNum)"
                                       border="bottom"
                                    ></u--input>
                                       border="bottom"></u--input>
                                 </view>
                                 <u-checkbox-group v-model="val.checkboxValue1" placement="column" @change="v => checkboxChange(v, index, val)">
                                    <u-checkbox
                                       size="30"
                                 <u-checkbox-group v-model="val.checkboxValue1"
                                    placement="column"
                                    @change="v => checkboxChange(v, index, val)">
                                    <u-checkbox size="30"
                                       shape="circle"
                                       labelSize="30"
                                       label="全部转发"
                                       name="全部转发"
                                       :disabled="val.ischecked"
                                       :checked="val.isSelected"
                                    ></u-checkbox>
                                       :checked="val.isSelected"></u-checkbox>
                                 </u-checkbox-group>
                              </view>
                           </u-form-item>
@@ -59,31 +77,56 @@
      <view class="utils-buttonGroup">
         <!-- 添加按钮 -->
         <view class="AdddBtn"><u-button text="添加" :hairline="false" @click.stop="addForm" :disabled="whetherClick"></u-button></view>
         <view class="AdddBtn"><u-button text="添加"
               :hairline="false"
               @click.stop="addForm"
               :disabled="whetherClick"></u-button></view>
         <!-- 提交按钮 -->
         <view class="forwardBtn"><u-button text="提交" :hairline="false" type="warning" @click.stop="submitForm" :disabled="whetherClick1"></u-button></view>
         <view class="forwardBtn"><u-button text="提交"
               :hairline="false"
               type="warning"
               @click.stop="submitForm"
               :disabled="whetherClick1"></u-button></view>
      </view>
      <!-- 增加按钮 -->
      <!-- 选择货代或车队弹出框 -->
      <view class="selectHuoDaiOrFleet-container">
         <u-popup :show="selectPopupShow" mode="bottom" @close="selectPopupClose" @open="selectPopupOpen">
         <u-popup :show="selectPopupShow"
            mode="bottom"
            @close="selectPopupClose"
            @open="selectPopupOpen">
            <view class="selectHuoDaiOrFleet-container-box">
               <u-tabs :list="list1" @click="tabClick"></u-tabs>
               <view class="" v-if="!tabHuoDai">
               <u-tabs :list="list1"
                  @click="tabClick"></u-tabs>
               <view class=""
                  v-if="!tabHuoDai">
                  <u-cell-group>
                     <u-cell v-for="(item, index) in fleetData" :key="index" :title="item.name">
                        <view class="cell-util" slot="value">
                           <u-button @click="forwardFleetObjectSelect(item, index)" text="选择" type="primary" size="mini"></u-button>
                     <u-cell v-for="(item, index) in fleetData"
                        :key="index"
                        :title="item.name">
                        <view class="cell-util"
                           slot="value">
                           <u-button @click="forwardFleetObjectSelect(item, index)"
                              text="选择"
                              type="primary"
                              size="mini"></u-button>
                        </view>
                     </u-cell>
                  </u-cell-group>
               </view>
               <view class="" v-else-if="tabHuoDai">
               <view class=""
                  v-else-if="tabHuoDai">
                  <u-cell-group>
                     <u-cell v-for="(item, index) in huoDaiData" :key="index" :title="item.name">
                        <view class="cell-util" slot="value">
                           <u-button @click="forwardHuoDaiObjectSelect(item, index)" text="选择" type="primary" size="mini"></u-button>
                     <u-cell v-for="(item, index) in huoDaiData"
                        :key="index"
                        :title="item.name">
                        <view class="cell-util"
                           slot="value">
                           <u-button @click="forwardHuoDaiObjectSelect(item, index)"
                              text="选择"
                              type="primary"
                              size="mini"></u-button>
                        </view>
                     </u-cell>
                  </u-cell-group>
@@ -114,10 +157,10 @@
               return {
                  id: item.id,
                  orderPlanId: item.orderPlanId,
                  name: item.xsUserName === null ? item.fleetName : item.xsUserName,
                     name: item.xsUserName === '' ? item.fleetName : item.xsUserName,
                  carNum: item.carNum,
                  xsUserId: item.xsUserId === null ? 0 : item.xsUserId,
                  fleetId: item.fleetId === null ? 0 : item.fleetId,
                     xsUserId: item.xsUserId === '' ? 0 : item.xsUserId,
                     fleetId: item.fleetId === '' ? 0 : item.fleetId,
                  checkboxValue1: '',
                  vid: `${new Date().getTime()}${index}${item.id}`
               };
@@ -129,8 +172,8 @@
                  orderPlanId: item.orderPlanId,
                  name: item.fleetName,
                  carNum: item.carNum,
                  xsUserId: item.xsUserId === null ? 0 : item.xsUserId,
                  fleetId: item.fleetId === null ? 0 : item.fleetId,
                     xsUserId: item.xsUserId === '' ? 0 : item.xsUserId,
                     fleetId: item.fleetId === '' ? 0 : item.fleetId,
                  checkboxValue1: '',
                  vid: `${new Date().getTime()}${index}${item.id}`
               };
@@ -156,8 +199,7 @@
         fleetData: [],
         // 日计划id
         orderPlanId: '',
         jhOrderPlanForwardList: [
            {
            jhOrderPlanForwardList: [{
               orderPlanId: '',
               name: '',
               carNum: null,
@@ -165,8 +207,7 @@
               fleetId: 0,
               checkboxValue1: '',
               isSelected: false
            }
         ],
            }],
         // 索引,利用索引正确显示
         index: '',
         checkboxValue1: '',
@@ -184,14 +225,12 @@
         whetherClick: false,
         whetherClick1: false,
         // 滑动单元格配置
         options1: [
            {
            options1: [{
               text: '删除',
               style: {
                  backgroundColor: '#FB0101'
               }
            }
         ]
            }]
      };
   },
   onShow() {
@@ -259,11 +298,13 @@
         });
         if (value.length != 0) {
            if (this.roleType == 1) {
               this.jhOrderPlanForwardList[index].carNum = this.allrelay(this.carNumSurplus1, this.jhOrderPlanForwardList[index].carNum);
                  this.jhOrderPlanForwardList[index].carNum = this.allrelay(this.carNumSurplus1, this
                     .jhOrderPlanForwardList[index].carNum);
               this.calculate(this.jhOrderPlanForwardList);
            }
            if (this.roleType == 2) {
               this.jhOrderPlanForwardList[index].carNum = this.allrelay(this.carNumSurplusHuodai, this.jhOrderPlanForwardList[index].carNum);
                  this.jhOrderPlanForwardList[index].carNum = this.allrelay(this.carNumSurplusHuodai, this
                     .jhOrderPlanForwardList[index].carNum);
               this.calculate(this.jhOrderPlanForwardList);
            }
            // 选择一个后其余禁止复选
@@ -369,7 +410,8 @@
               time = setTimeout(() => {
                  that.calculate(that.jhOrderPlanForwardList);
                  if (that.roleType == 1) {
                     if (that.jhOrderPlanForwardList[index].carNum < Number(that.carNumSurplus1)) {
                        if (that.jhOrderPlanForwardList[index].carNum < Number(that
                           .carNumSurplus1)) {
                        that.$set(that.jhOrderPlanForwardList[index], 'checkboxValue1', '');
                        that.jhOrderPlanForwardList.forEach((v, i) => {
                           if (index != i) {
@@ -380,7 +422,8 @@
                  }
                  if (that.roleType == 2) {
                     if (that.jhOrderPlanForwardList[index].carNum < Number(that.carNumSurplusHuodai)) {
                        if (that.jhOrderPlanForwardList[index].carNum < Number(that
                              .carNumSurplusHuodai)) {
                        that.$set(that.jhOrderPlanForwardList[index], 'checkboxValue1', '');
                        that.jhOrderPlanForwardList.forEach((v, i) => {
                           if (index != i) {
@@ -490,16 +533,19 @@
};
</script>
<style lang="scss" scoped>
<style lang="scss"
   scoped>
@mixin flex {
   display: flex;
   justify-content: space-between;
   align-items: center;
}
/deep/ .u-notice-bar {
   background: rgba(255, 255, 255, 0.3) !important;
   box-shadow: 0rpx 0rpx 5rpx 0rpx rgba(27, 103, 255, 0);
   border-radius: 28rpx;
   .u-notice__content {
      text {
         text-shadow: 3rpx 3rpx 8rpx #4784fe;
@@ -509,13 +555,16 @@
      }
   }
}
/deep/ .u-input {
   border-bottom: 1px solid #c4c4c4;
   width: 458rpx;
}
::v-deep.forward {
   width: 100%;
   margin: 0 auto;
   .forward-banner {
      width: 100%;
      height: 430rpx;
@@ -523,12 +572,14 @@
      @include flex;
      justify-content: flex-start;
      overflow: hidden;
      .banner-block {
         width: 50%;
         @include flex;
         position: relative;
         top: -75rpx;
         left: 32rpx;
         .forward-text {
            width: 80rpx;
            font-size: 40rpx;
@@ -538,6 +589,7 @@
         }
      }
   }
   .notice-bar {
      width: 688rpx;
      height: 56rpx;
@@ -545,12 +597,14 @@
      position: relative;
      top: -200rpx;
      background: transparent;
      .notice-icon {
         position: absolute;
         top: 21rpx;
         left: 7rpx;
      }
   }
   .card-main {
      width: 100%;
      @include flex;
@@ -559,10 +613,12 @@
      top: -100rpx;
      z-index: 1;
      margin-bottom: vww(40);
      .card-block {
         width: 690rpx;
         @include flex;
         flex-direction: column;
         .forward-card {
            margin-top: vww(10);
            width: 690rpx;
@@ -570,10 +626,12 @@
            background: #ffffff;
            box-shadow: 4rpx 6rpx 25rpx 0rpx rgba(73, 120, 240, 0.15);
            border-radius: 20rpx;
            .card-content {
               width: 612rpx;
               margin-left: 48rpx;
               margin-top: 24rpx;
               // margin: 56rpx 30rpx 70rpx 48rpx;
               .u-form {
                  .u-form-item {
@@ -587,6 +645,7 @@
                              }
                           }
                        }
                        .u-form-item__body__right {
                           .u-form-item__body__right__content {
                              .u-form-item__body__right__content__slot {
@@ -594,15 +653,18 @@
                                    display: flex;
                                    justify-content: space-between;
                                    align-items: flex-end;
                                    .forward-card-amount-input {
                                       .u-input {
                                          width: 263rpx;
                                       }
                                    }
                                    .u-checkbox-group {
                                       position: relative;
                                       top: vww(8);
                                       left: vww(4);
                                       .u-checkbox {
                                          .u-checkbox__icon-wrap {
                                             border-color: rgba(42, 97, 255, 1) !important;
@@ -620,6 +682,7 @@
         }
      }
   }
   .utils-buttonGroup {
      width: 610rpx;
      @include flex;
@@ -627,10 +690,12 @@
      bottom: vww(30);
      left: vww(30);
      z-index: 3;
      .AdddBtn,
      .forwardBtn {
         width: 290rpx;
      }
      .AdddBtn {
         .u-button {
            height: 74rpx;
@@ -640,6 +705,7 @@
            color: #3b56eb;
         }
      }
      .forwardBtn {
         .u-button {
            height: 74rpx;
@@ -650,6 +716,7 @@
         }
      }
   }
   .selectHuoDaiOrFleet-container {
      .u-popup {
         .u-transition {
@@ -657,6 +724,7 @@
            .u-popup__content {
               overflow: scroll !important;
               .selectHuoDaiOrFleet-container-box {
                  width: 90%;
                  margin: 0 auto;