wk
2024-08-05 76543a9506a9b43476e750c79c5ff595aa4bae36
pages/customer-page/customer-index/customer-index.vue
@@ -2,9 +2,22 @@
   <view class="">
      <view class="customer-index">
         <view class="customer-index-body">
            <!-- 待领取和转发提煤单 -->
            <!-- 待领取和转发收发单 -->
            <view class="wait-collection"
               style="background: url('https://mx.jzeg.cn:9095/appimg/image/banner/customerbanner.png') no-repeat;background-size:contain">
               style="background: url('https://mx.jzeg.cn:9096/appimg/image/banner/customerbanner.png') no-repeat;background-size:contain">
            </view>
               <!-- 自主配送界面 -->
            <view class="self-deliver" v-if="personnelType === 1">
               <view class="self-deliver_text">
                  创建日计划订单
               </view>
               <view class="self-deliver_btn">
                  <u-button text="去创建"
                     type="primary"
                     shape="cirle"
                     @click="selfDeliver"></u-button>
               </view>
            </view>
            <view style="position: relative;top: -120px;">
               <u-empty mode="data"
@@ -30,18 +43,26 @@
                        <text>/{{ item.carNum }}</text>
                     </view>
                  </view>
                  <view class="second-line"
                     style="width: 94%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"
                     v-if="item.orderType==='内销'||item.orderType==='外购' || item.orderType==='外购退'">
                     {{item.customerName}}
                  </view>
                  <view class="second-line">
                     <view class="coal-name">
                        <view class="">{{ item.coalName }}</view>
                        <view class="">{{ item.productNames || item.productName }}</view>
                        <view class="black-bar"></view>
                        <view class="coal-type"
                           v-if="item.orderType">{{ item.orderType }}</view>
                     </view>
                  </view>
                  <view class="second-line">
                     {{item.orderCode}}
                  </view>
                  <view class="third-line">
                     <view class="time-icon">
                        <view
                           style="width: 24rpx;height: 24rpx;li ne-height: 24rpx;background: url('https://mx.jzeg.cn:9095/appimg/image/banner/clock.png') no-repeat;background-size: cover">
                           style="width: 24rpx;height: 24rpx;li ne-height: 24rpx;background: url('https://mx.jzeg.cn:9096/appimg/image/banner/clock.png') no-repeat;background-size: cover">
                        </view>
                     </view>
                     <view class="send-date">{{ item.sendDate }}</view>
@@ -59,9 +80,9 @@
               </view>
            </view>
            <!-- 历史提煤单 -->
            <!-- 历史收发单 -->
            <view class="history-numbers">
               <combined-title title="历史提煤单"></combined-title>
               <combined-title title="历史收发单"></combined-title>
               <scroll-view :scroll-top="scrollTop"
                  scroll-y="true"
                  class="scroll-Y"
@@ -83,7 +104,7 @@
                              size="40"></u-icon></view>
                     </view>
                     <view class="second">
                        <view class="coal-name">{{ item.coalName || '' }}</view>
                        <view class="coal-name">{{  item.productNames || item.productName }}</view>
                        <view class="order-type">{{ item.orderType || '' }}</view>
                     </view>
                     <view class="third">
@@ -99,14 +120,14 @@
                              v-else-if="roleType == 2">{{ item.carNumSurplus }}</view>
                        </view>
                        <view class="third-line">
                           <view class="third-line_text">提煤单个数:</view>
                           <view class="third-line_text">收发单个数:</view>
                           <view class="third-line_num">{{ item.tmCount }}</view>
                        </view>
                     </view>
                     <view class="fourth">
                        <view class="fourth-icon">
                           <view
                              style="width: 24rpx;height: 24rpx;line-height: 24rpx;background: url('https://mx.jzeg.cn:9095/appimg/image/banner/clock.png') no-repeat;background-size: cover">
                              style="width: 24rpx;height: 24rpx;line-height: 24rpx;background: url('https://mx.jzeg.cn:9096/appimg/image/banner/clock.png') no-repeat;background-size: cover">
                           </view>
                        </view>
                        <view class="senddate">{{ item.sendDate }}</view>
@@ -114,7 +135,7 @@
                     <view class="fourth">
                        <view class="fourth-icon">
                           <view
                              style="width: 26rpx;height: 26rpx;line-height: 26rpx;background: url('https://mx.jzeg.cn:9095/appimg/image/banner/carnNUm.png') no-repeat;background-size: cover;">
                              style="width: 26rpx;height: 26rpx;line-height: 26rpx;background: url('https://mx.jzeg.cn:9096/appimg/image/banner/carnNUm.png') no-repeat;background-size: cover;">
                           </view>
                        </view>
                        <view class="senddate">{{ item.orderCode }}</view>
@@ -151,9 +172,7 @@
</template>
<script>
   import card from '@/components/card/card.vue';
   import combinedTitle from '@/components/combined-title/combined-title.vue';
   import { customerId } from '@/utils/status';
   export default {
      props: {
         orderPlanDataStore: {
@@ -162,7 +181,6 @@
         }
      },
      components: {
         card,
         combinedTitle
      },
      watch: {
@@ -182,7 +200,8 @@
      data() {
         return {
            orderPlanData: [],
            show: false, // 领取提煤单弹出框
            personnelType:'', // 用户类型
            show: false, // 领取收发单弹出框
            receiveNum: null,
            getOrderNum: {
               num: '',
@@ -200,9 +219,9 @@
            total: 0,
            // 是否显示更多数据
            showMoreData: false,
            cars2: "",
            carNum: "",
            // 剩余的提煤单数量
            cars2: "",  //领取日计划的车数
            carNum: "",  //日计划的总车数
            // 剩余的收发单数量
            carNumSurplus: '',
            canClick: false,
            popupDetermineClickLoading: false
@@ -215,6 +234,7 @@
         init() {
            this.GetOrderPlan();
            this.getJhOrderPlanDataPage();
            this.getType();
         },
         // 获取发运计划列表
         GetOrderPlan() {
@@ -226,7 +246,7 @@
               }
            });
         },
         // 获取历史提煤单
         // 获取历史收发单
         getJhOrderPlanDataPage() {
            uni.showLoading({
               title: '加载中'
@@ -251,7 +271,7 @@
            this.pageCurrent++;
            this.getJhOrderPlanDataPage();
         },
         //fix 点击提煤单返回会增加重复数据
         //fix 点击收发单返回会增加重复数据
         ArrSet(Arr, id) {
            var obj = {};
            const arrays = Arr.reduce((setArr, item) => {
@@ -260,6 +280,7 @@
            }, []);
            return arrays;
         },
      //领取弹框
         popupDetermineClick() {
            if (this.receiveNum > 0) {
               this.popupDetermineClickLoading = true;
@@ -302,7 +323,7 @@
          */
         receiveClick(item) {
            this.show = true;
            this.getOrderNum.id = item.id; // 获取领取提煤单的id
            this.getOrderNum.id = item.id; // 获取领取收发单的id
            this.cars2 = item.cars2
            this.carNum = item.carNum
         },
@@ -315,18 +336,18 @@
            console.log('输入框', e);
            this.canClick = e > (this.carNum - this.cars2)
            if (this.canClick) {
               this.$u.toast('已超过当前日计划提煤单数量,请重新输入')
               this.$u.toast('已超过当前日计划收发单数量,请重新输入')
            }
         },
         // 提煤单详情
         // (顶部)发运计划详情
         cardBodyClick(v) {
            uni
               .navigateTo({ url: `/pages/customer-page/customer-index/fayunPlanDetails/fayunPlanDetails?orderPlanId=${v.id}&code=${v.code}&cars2=${v.cars2}` });
               .navigateTo({ url: `/subPages/fayunPlanDetails/fayunPlanDetails?orderPlanId=${v.id}&code=${v.code}&cars2=${v.cars2}` });
         },
         // 点击历史提煤单获取详情
         // 点击历史收发单获取详情
         faYundetail(v) {
            uni.navigateTo({
               url: `/pages/customer-page/customer-index/fayunPlanDetails/fayunPlanDetails?orderPlanId=${v.id}&cars2=${v.cars2}&coalName=${v.coalName}&deptName=${v.deptName}`
               url: `/subPages/fayunPlanDetails/fayunPlanDetails?orderPlanId=${v.id}&cars2=${v.cars2}&productNames=${v.productNames || v.productName}&deptName=${v.deptName}`
            });
         },
         // 转发
@@ -334,6 +355,23 @@
            if (obj.cars2 == 0) return this.$u.toast('请先领取后再转发');
            uni
               .navigateTo({ url: `/pages/public-page/forward/forward?orderPlanId=${obj.id}&carNumSurplus1=${obj.carNumSurplus1}&carNum=${obj.carNum}&cars2=${obj.cars2}` });
         },
         // 自主配送
         selfDeliver() {
            uni.navigateTo({
               url: '/subPages/addDailyPlan/addDailyPlan'
            })
         },
         //获取用户标识
         getType(){
            this.$reqGetId('getPersonnelType',uni.getStorageSync('customerId')).then(res=>{
               console.log(res,'ressss')
               if(res.code === 0){
                 this.personnelType = res.data.personnelType;
               }else{
                  this.personnelType = '';
               }
            })
         }
      }
   };
@@ -341,11 +379,40 @@
<style lang="scss"
   scoped>
   @mixin flex {
      display: flex;
      justify-content: space-between;
      align-items: center;
   }
   // 自主配送
         .self-deliver {
            position: relative;
            top: vww(-150);
            width: 88%;
            height: vww(50);
            margin: vww(8) auto;
            padding: 0 vww(8);
            background: #ffffff;
            box-shadow: 0rpx 0rpx 14rpx 0rpx rgba(73, 120, 240, 0.14), 0rpx 7rpx 45rpx 0rpx rgba(73, 120, 240, 0.12);
            border-radius: 20rpx;
            @include flex;
         }
            /deep/.u-button {
               width: 100%;
               height: 28px !important;
               line-height: 40px;
               padding: 0 12px;
               font-size: 28rpx;
               font-weight: 300;
               color: #ffffff;
               background: #497bfb !important;
               letter-spacing: 4rpx;
               border-radius: 37rpx 37rpx 37rpx 37rpx !important;
               box-shadow: 2rpx 3rpx 13rpx 0rpx rgba(43, 98, 239, 0.5), 0rpx 0rpx 9rpx 0rpx rgba(247, 250, 253, 0.29);
            }
   .wait-collection {
      width: 100%;
@@ -481,7 +548,7 @@
            .collection-form-item {
               width: 690rpx;
               height: 300rpx;
               height: 370rpx;
               background: #ffffff;
               box-shadow: 4rpx 6rpx 25rpx 0rpx rgba(73, 120, 240, 0.15);
               border-radius: 20rpx;
@@ -684,4 +751,4 @@
         }
      }
   }
</style>
</style>