yangan
2023-11-21 0937a09b807ae3d615e2e13d7b254a952b9f99ce
pages/customer-page/customer-index/customer-index.vue
@@ -2,15 +2,36 @@
   <view class="">
      <view class="customer-index">
         <view class="customer-index-body">
            <!-- 待领取和转发提煤单 -->
            <!-- 待领取和转发通知单 -->
            <view class="wait-collection"
               :style="{ backgroundImage: `url(${onlineurl}/appimg/image/banner/customerbanner.png)`, backgroundSize: 'contain', backgroundRepeat: 'no-repeat' }">
            </view>
            <view style="position: relative;top: -120px;">
            <view style="height: 382rpx;width: 100%;"></view>
            <!-- 引导页 -->
            <view class="noob-tour"
               v-if="roleType===4&&isFirstLogin">
               <combined-title title="操作指引"></combined-title>
               <u-cell-group>
                  <u-cell title="新手指引"
                     name='1'
                     :clickable="true"
                     @click="noobTour">
                     <u-badge type="primary"
                        value="01"
                        slot='icon'></u-badge>
                     <u-icon slot="value"
                        name="arrow-right"
                        size="30"
                        color="#b8b8b8"></u-icon>
                  </u-cell>
               </u-cell-group>
            </view>
            <view style="position: relative;">
               <u-empty mode="data"
                  icon="http://cdn.uviewui.com/uview/empty/data.png"
                  textSize="30"
                  iconSize="1000"
                  text="暂无数据"
                  v-if="orderPlanData.length == 0"></u-empty>
            </view>
            <view class="collection-form">
@@ -37,12 +58,17 @@
                     </view>
                  </view>
                  <view class="third-line">
                     <view class="time-icon">
                     <!-- <view class="time-icon">
                        <view
                           :style="{backgroundImage: `url(${onlineurl}/appimg/image/banner/carNO.png)`,backgroundSize: 'cover',backgroundRepeat: 'no-repeat',width:'24rpx',height:'24rpx',lineHeight:'24rpx'}">
                        </view>
                     </view>
                     <view class="car-num">{{ item.carNos||item.carNo||''}}</view>
                     </view> -->
                     <view class="car-num">{{ item.code||''}}</view>
                  </view>
                  <!-- 添加创建时间 -->
                  <view class="third-line">
                     <text style="font-size: 28rpx;color: #515151" >创建时间:</text>
                     <view  style="font-size: 28rpx;color: #515151">{{ item.createTime }}</view>
                  </view>
                  <view class="third-line">
                     <view class="time-icon">
@@ -72,9 +98,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,6 +109,7 @@
                     icon="http://cdn.uviewui.com/uview/empty/data.png"
                     textSize="30"
                     iconSize="1000"
                     text="暂无数据"
                     v-if="historyCoalData.length == 0"></u-empty>
                  <view class="history-information"
                     v-for="(item, index) in historyCoalData"
@@ -111,10 +138,15 @@
                              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" style="justify-content: start;">
                     <view style="font-size: 28rpx;color: #515151" >创建时间:</view>
                     <view  style="font-size: 28rpx;color: #515151">{{ item.createTime }}</view>
                  </view>
                     <view class="fourth">
                        <view class="fourth-icon">
                           <view
@@ -136,6 +168,14 @@
                     v-if="showMoreData && historyCoalData.length !== 0">没有数据了...</view>
                  <view class="white-block"></view>
               </scroll-view>
            </view>
         </view>
         <!-- 图片预览弹出框 -->
         <view class="previewImage-container">
            <view class="previewImage-container">
               <previewImage ref="previewImage"
                  :imgs="customerTourImgList"
                  :saveBtn='false'></previewImage>
            </view>
         </view>
         <!-- 领取弹出框 -->
@@ -165,6 +205,9 @@
   import { onlineurl } from '@/api/request.js'
   import combinedTitle from '@/components/combined-title/combined-title.vue';
   import { customerId } from '@/utils/status';
   import previewImage from '@/components/kxj-previewImage/kxj-previewImage.vue';
   import { BaseUrl } from '@/api/publicInterface.js'
   import { mapState } from 'vuex'
   export default {
      props: {
         orderPlanDataStore: {
@@ -173,7 +216,8 @@
         }
      },
      components: {
         combinedTitle
         combinedTitle,
         previewImage
      },
      watch: {
         orderPlanDataStore: {
@@ -185,6 +229,7 @@
         }
      },
      computed: {
         ...mapState(['customerTourImgList']),
         roleType() {
            return uni.getStorageSync('roleType');
         },
@@ -192,7 +237,7 @@
      data() {
         return {
            orderPlanData: [],
            show: false, // 领取提煤单弹出框
            show: false, // 领取通知单弹出框
            receiveNum: null,
            getOrderNum: {
               num: '',
@@ -212,21 +257,29 @@
            showMoreData: false,
            cars2: "",
            carNum: "",
            // 剩余的提煤单数量
            // 剩余的通知单数量
            carNumSurplus: '',
            canClick: false,
            onlineurl: ''
            onlineurl,
            previewImageShow: false,
            previewImageSrc: '',
            phone: "",
            isFirstLogin: true
         };
      },
      onLoad() {},
      mounted() {
         this.getLogOn()
      },
      onShow() {
         this.init();
      },
      methods: {
         init() {
            this.GetOrderPlan();
            this.getJhOrderPlanDataPage();
            this.onlineurl = onlineurl;
            // this.getLogOn()
         },
         // 获取发运计划列表
         GetOrderPlan() {
@@ -238,7 +291,7 @@
               }
            });
         },
         // 获取历史提煤单
         // 获取历史通知单
         getJhOrderPlanDataPage() {
            uni.showLoading({
               title: '加载中'
@@ -263,7 +316,7 @@
            this.pageCurrent++;
            this.getJhOrderPlanDataPage();
         },
         //fix 点击提煤单返回会增加重复数据
         //fix 点击通知单返回会增加重复数据
         ArrSet(Arr, id) {
            var obj = {};
            const arrays = Arr.reduce((setArr, item) => {
@@ -311,7 +364,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
         },
@@ -324,15 +377,15 @@
            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?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}`
@@ -349,6 +402,28 @@
            uni
               .navigateTo({ url: `/pages/driver-page/driver-index/bill-of-lading-details/selectOrderPlan/selectOrderPlan?index=${index}` });
         },
         noobTour(v) {
            this.$refs.previewImage.open('https://mx.jzeg.cn:9095/appimg/image/tour/quality/quality1.jpg')
         },
         getLogOn() {
            this.$reqGet('getUserEntity').then(res => {
               this.phone = res.data.phone
            }).then(() => {
               uni.request({
                  url: `${BaseUrl}/admin/log/getLogOnType?phone=${this.phone}`,
                  success: res => {
                     // res.data.data 为1 代表第一次登录  为0取消学习指引  为2代表存在
                     if (res.data.data === 1) {
                        this.noobTour()
                     } else if (res.data.data === 2) {
                        this.isFirstLogin = true
                     } else {
                        this.isFirstLogin = false
                     }
                  }
               });
            })
         },
      }
   };
</script>
@@ -364,7 +439,7 @@
   .wait-collection {
      width: 100%;
      height: 600rpx;
      position: relative;
      position: fixed;
      top: vww(-10);
      z-index: 0;
   }
@@ -388,7 +463,7 @@
   .history-numbers {
      width: 100%;
      position: relative;
      top: vww(-110);
      // top: vww(-110);
      .history-information {
         width: 690rpx;
@@ -481,6 +556,28 @@
      }
   }
   .noob-tour {
      margin-bottom: vww(30);
      position: relative;
   }
   .u-popup {
      .u-transition {
         .u-popup__content {
            .editDriverPopup-container-box {}
            //closeIcon
            .u-popup__content__close--top-right {
               .u-icon {
                  .u-icon__icon {
                     font-size: vww(20) !important;
                  }
               }
            }
         }
      }
   }
   ::v-deep.customer-index {
      width: 100%;
      margin: 0 auto;
@@ -491,7 +588,7 @@
            width: vww(345);
            margin: 0 vww(15);
            position: relative;
            top: vww(-144);
            // top: vww(-144);
            .collection-form-item {
               width: 690rpx;