yangan
2025-01-13 1b2b99dc4ebf5dd1b40f516d334e02ecb64827cf
pages/public-page/forward/forward.vue
@@ -49,13 +49,13 @@
                                    :readonly="true"
                                    border="bottom"></u--input>
                              </u-form-item>
                              <u-form-item label="输入数量"
                              <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"
                                          placeholder="请输入转发数量"
                                          placeholder="请输入转发车数"
                                          @input="debouncecarNumInput(index, val.carNum,val.xsUserId)"
                                          @blur="blurInput(index, val.carNum,val.xsUserId)"
                                          border="bottom"></u--input>
@@ -75,7 +75,7 @@
                              </u-form-item>
                              
                           </u--form>
                           <view><u-button text="分配日计划吨数" type="primary" :plain="true" @click="todoFenPei"></u-button></view>
                           <view><u-button v-if="fenpeiFlag " text="分配日计划吨数" type="primary" :plain="true" @click="todoFenPei(val)"></u-button></view>
                        </view>
                     </view>
                  </view>
@@ -92,7 +92,7 @@
               :disabled="whetherClick"></u-button></view>
         <!--分享日计划  -->
         <view 
         class="AdddBtn" v-if="isshow && roleType!== 2 "><u-button text="分享日计划"
         class="AdddBtn" v-if="isshow && roleType!== 2  && btnFlag"><u-button text="分享日计划"
               :hairline="false"
               open-type="share"
               :loading='loading'></u-button></view>
@@ -166,6 +166,9 @@
         this.isshow=!reg.test(params.orderType)
         this.productName = params.productName;
         this.customerId = params.customerId;
         this.packingType = params.packingType;
         this.pvcPlanMeasure = params.pvcPlanMeasure;
         this.productId = params.productId;
         // 客户
         this.cars2 = Number(params.cars2);
         this.tempcarNumSurplus1 = this.carNumSurplus1 = Number(params.carNumSurplus1 || 0);
@@ -196,8 +199,11 @@
      data() {
         return {
            isshow:false,
            pvcPlanMeasure:'',
            forwardSurplus: 0,
            paramsName: {},
            packingType:'',
            productId:'',
            productName:'',
            customerId:'',
            huoDaiData: [],
@@ -228,6 +234,7 @@
            formNum: 1,
            // 个人转发数据
            personalForward: {},
            falseProductNames:['1818237609508347905','1818237832536268801','1818211942485995521'],
            whetherClick: false,  //添加按钮
            whetherClick1: false,
            // 滑动单元格配置
@@ -239,6 +246,7 @@
            }],
            loading: false, //提交loading
            originForwardName: '', //原转发对象
            isShow:false,
            laterForwardName: '', //后转发对象
            errorDataList: [], // 错误数据
            isDirectAdd: false, // 是否是在原来有对象的item修改 是的为true
@@ -248,6 +256,7 @@
      onShow() {
         this.init();
         this.getBuild();
         // this.getOrderPlan();
         if (this.roleType == 2) {
            this.list1.splice(1, 1);
            this.tabHuoDai = false;
@@ -262,6 +271,22 @@
         },
         text1() {
            return `已拥有${this.carNum}张收发单,剩余${this.carNumSurplusHuodai}张收发单`;
         },
         fenpeiFlag(){
            console.log(this.productName,this.packingType,'122222222cumped',/聚氯乙烯树脂/.test(this.productName) || (this.packingType &&  this.packingType == '1'))
            if(/聚氯乙烯树脂/.test(this.productName) || (this.packingType &&  this.packingType == '1')){
               return true
            }else{
               return false
            }
         },
         btnFlag(){
            if(this.falseProductNames.includes(this.productId)){
               return false;
            }else{
               return true;
            }
         }
      },
      methods: {
@@ -271,6 +296,12 @@
            })
            this.$reqGet('forwardList', { OrderPlanId: this.orderPlanId }).then(res => {
               uni.hideLoading()
               if(res.data.length){
                  this.isShow = true;
               }else{
                  this.isShow =  false;
               }
               if (res.data.length !== 0 && this.roleType == 1) {
                  this.jhOrderPlanForwardList = res.data.map((item, index) => {
                     return {
@@ -487,6 +518,7 @@
               //    this.selectPopupShow = true;
               // }
               // } else {
               console.log(this.jhOrderPlanForwardList,item,'jhOrderPlanForwardList')
               let isableAdd = this.jhOrderPlanForwardList.filter(v => item.name === v.name);
               if (isableAdd.length > 0) {
                  this.$u.toast('存在重复添加');
@@ -634,6 +666,10 @@
                  this.$u.toast('请输入合法数字');
                  isPass = false;
                  return isPass;
               } else if (!v.name){
                  this.$u.toast('请选择车队');
                  isPass = false;
                  return isPass;
               } else {
                  isPass = true;
                  return isPass;
@@ -645,13 +681,13 @@
               this.$reqPost('forward', this.jhOrderPlanForwardList, 'json').then(res => {
                  console.log(res, 'zh');
                  // res.data.length == 0 提交成功 否则提交失败
                  if (res.data.length == 0) {
                  if (res.code === 0) {
                     this.loading = false
                     this.$u.toast('提交成功');
                     if(/聚氯乙烯树脂/.test(this.productName)){
                     if(this.fenpeiFlag){
                        setTimeout(()=>{
                           uni
               .navigateTo({ url: `/subPages/allocaTetonnage/index?orderPlanId=${this.orderPlanId}&customerId=${this.customerId}&status=${0}`});
               .navigateTo({ url: `/subPages/allocaTetonnage/index?orderPlanId=${this.orderPlanId}&customerId=${this.customerId}&status=${1}&pvcPlanMeasure=${this.pvcPlanMeasure}`});
                        },500)
               
@@ -678,10 +714,11 @@
               this.tabHuoDai = false;
            }
         },
         todoFenPei(){
         todoFenPei(val){
            uni
               .navigateTo({ url: `/subPages/allocaTetonnage/index?orderPlanId=${this.orderPlanId}&customerId=${this.customerId}`});
         }
               .navigateTo({ url: `/subPages/allocaTetonnage/index?orderPlanId=${this.orderPlanId}&customerId=${this.customerId}&fleetId=${val.fleetId}&pvcPlanMeasure=${this.pvcPlanMeasure}`});
         },
      }
   };
</script>