yangan
2025-02-11 8edf190dd8755446613da55e0730c4aeabf60890
pages/driver-page/driver-index/driver-index.vue
@@ -4,10 +4,22 @@
         <view class="driver-index-body">
            <!-- 待领取提煤单 -->
            <view class="wait-collection"
               style="background: url('https://mx.jzeg.cn:9096/appimg/image/banner/diverbanner.png') no-repeat;background-size:contain">
               style="background: url('https://mr1.res.jzeg.cn:9096/appimg/image/banner/diverbanner.png') no-repeat;background-size:contain">
            </view>
            <!-- 引导页 -->
            <noob-tour></noob-tour>
            <!-- 自主配送界面 -->
            <view class="self-deliver">
               <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 class="collection-form">
               <view class="collection-form-item"
                  v-for="(item, index) in driverBillOfLoadingData.list1"
@@ -77,7 +89,6 @@
                  @confirm="qiangDanConfirm"
                  @cancel="qiangDanCancel"></u-modal>
            </view>
            <!-- 待预约提煤单 -->
            <view class="wait-appointment">
               <combined-title title="待预约提煤单"></combined-title>
@@ -146,11 +157,13 @@
                     </view>
                     <view class="fourth-line">
                        <view class="button-img"
                        v-if="!(item.orderType === '内购' ||item.orderType === '转入')"
                           @click.stop="cancelAppoint(item)">
                           请求退单
                        </view>
                        <view class="button-img"
                           @click.stop="toAppointmentClick(item)">立即预约</view>
                     </view>
                  </view>
               </view>
@@ -163,6 +176,30 @@
                  content="是否确认退单"
                  @confirm="cancelAppointConfirm"
                  @cancel="cancelAppointCancel"></u-modal>
            </view>
            <!-- 场内接单弹窗 -->
            <view class="">
               <u-modal :show="insideConnectShow"
                  title="接单选择"
                  showCancelButton
                  cancel-text="正常接单"
                  confirm-text="场内接单"
                  content="场内接单无需称皮,是否确认接单"
                  @confirm="insideConnectConfirm"
                  @cancel="insideConnectCancel"></u-modal>
            </view>
            <!-- 二维码弹窗 -->
            <view class="qCodeModal">
               <u-modal :show="qCodeModalVisible"
               :showConfirmButton="false"
               :negativeTop="150"
               @close="qCodeModalVisible = false"
               closeOnClickOverlay
               >
                  <uv-qrcode ref="qrcode" canvas-id="qrcode" :value="qCodeValue" size="500rpx" :loading="qCodeloading"
         :options="options"></uv-qrcode>
               </u-modal>
            </view>
            <!-- 已预约提煤单 -->
            <view class="Reserved">
@@ -233,6 +270,16 @@
                           <!-- <view class="order-type">{{ item.orderType }}</view> -->
                        </view>
                     </view>
                     <view class="fourth-line">
                        <view class="button-img"
                        v-if="item.status<3 && !(item.orderType === '内购' ||item.orderType === '转入')"
                           @click.stop="cancelAppoint(item)">
                           请求退单
                        </view>
                        <view class="button-img"
                            v-if="item.qrCode == 1"
                           @click.stop="viewQcode(item)">查看二维码</view>
                     </view>
                  </view>
               </view>
               <view class="white-block"></view>
@@ -249,11 +296,13 @@
   import noobTour from '@/components/noobTour/noobTour.vue'
   import { mapState } from 'vuex'
   import { BaseUrl } from '@/api/publicInterface.js'
   import uvQrcode from '@/uni_modules/uv-qrcode/components/uv-qrcode/uv-qrcode.vue'; // 引入生成二维码组件
   export default {
      components: {
         combinedTitle,
         previewImage,
         noobTour
         noobTour,
         uvQrcode
      },
      props: {
         indexdriverBillOfLoadingData: {
@@ -278,6 +327,8 @@
      },
      data() {
         return {
            qCodeValue:'',
            qCodeloading:false,
            driverBillOfLoadingData: {
               list1: [],
               list2: [],
@@ -286,16 +337,28 @@
            // 接单模态框
            qiangDanShow: false,
            qiangDanTitle: '接单提示',
            qCodeModalVisible:false,
            qiangDanContent: '',
            qiangDanOrderPlanId: null,
            fleetId: '',
            xsUserId: '',
            customerId: '',
            isFirstLogin: true, //是否是第一次登录
            phone: "",
            isFirstTime: false, //是否是登录进入首页,还是别的页面返回 false是登录 true是别的页面
            cancelAppointShow: false, //确认退单弹窗控制
            cancelAppointId: ''
            cancelAppointId: '',
            insideConnectShow: false,
            orderPlanId: '',
            fleetId: '',
            customerId: '',
            xsUserId: '',
            filedId: '',
            options: {
            useDynamicSize: false,
            errorCorrectLevel: 'Q',
            margin: 10,
            areaColor: "#fff",
            // 指定二维码前景,一般可在中间放logo
            foregroundImageSrc: '',
         }
         };
      },
      onShow() {
@@ -325,16 +388,26 @@
         },
         // 接单按钮
         qiangDanBtn(value) {
            if (value.tmcCount == '0') {
               this.qiangDan(value.orderPlanId, value.fleetId, value.customerId === null ? '0' : value.customerId,
                  value.xsUserId === null ? '0' : value.xsUserId);
            //是否可以场内接单,1 可以2不可以
            if (value.isInsideConnect === 1) {
               this.insideConnectShow = true
               this.orderPlanId = value.orderPlanId
               this.fleetId = value.fleetId
               this.customerId = !value.customerId ? '0' : value.customerId
               this.xsUserId = !value.xsUserId ? '0' : value.xsUserId
               this.filedId = value.filedId
            } else {
               this.qiangDanOrderPlanId = value.orderPlanId;
               this.fleetId = value.fleetId;
               this.customerId = value.customerId === null ? '0' : value.customerId;
               this.xsUserId = value.xsUserId === null ? '0' : value.xsUserId;
               this.qiangDanShow = true;
               this.qiangDanContent = `已接${value.tmcCount}单,确定接单?`;
               if (value.tmcCount == '0') {
                  this.qiangDan(value.orderPlanId, value.fleetId, !value.customerId ? '0' : value.customerId,
                     !value.xsUserId ? '0' : value.xsUserId);
               } else {
                  this.qiangDanOrderPlanId = value.orderPlanId;
                  this.fleetId = value.fleetId;
                  this.customerId = !value.customerId ? '0' : value.customerId;
                  this.xsUserId = !value.xsUserId ? '0' : value.xsUserId;
                  this.qiangDanShow = true;
                  this.qiangDanContent = `已接${value.tmcCount}单,确定接单?`;
               }
            }
         },
         // 接单模态框
@@ -360,7 +433,7 @@
               .then(res => {
                  uni.hideLoading()
                  if (res.code == 0) {
                     this.$u.toast('接单成功');
                     this.$u.toast('接单正在处理中...');
                  } else {
                     this.$u.toast(res.msg ? res.msg : '接单失败');
                  }
@@ -372,6 +445,25 @@
               }).catch(e => {
                  uni.hideLoading()
               })
         },
         insideConnectHandle(orderPlanId, fleetId, customerId, xsUserId, filedId) {
            uni.showLoading({
               title: '加载中'
            })
            this.$reqPost('insideConnect', {
               orderPlanId,
               fleetId,
               customerId,
               xsUserId,
               filedId
            }, 'params').then(res => {
               uni.hideLoading()
               if (res.code == 0) {
                  this.$u.toast('场内接单成功');
               } else {
                  this.$u.toast(res.msg ? res.msg : '场内接单失败');
               }
            })
         },
         list3CardIconClick(value) {
            uni.navigateTo({
@@ -386,6 +478,10 @@
         },
         // 请求退单
         cancelAppoint(item) {
            if (item.status >= 3) {
               this.$u.toast('当前状态不可退单')
               return
            }
            this.cancelAppointShow = true
            this.cancelAppointId = item.id
         },
@@ -414,12 +510,62 @@
         cancelAppointCancel() {
            this.cancelAppointShow = false
         },
         insideConnectCancel() {
            this.insideConnectShow = false
            this.qiangDan(this.orderPlanId, this.fleetId, this.customerId, this.xsUserId)
         },
         // 场内接单
         insideConnectConfirm() {
            this.insideConnectShow = false
            this.insideConnectHandle(this.orderPlanId, this.fleetId, this.customerId, this.xsUserId, this.filedId)
         },
         // 去预约
         toAppointmentClick(value) {
            uni.navigateTo({
               url: `/pages/driver-page/appointment/appointment?takeCoalId=${value.id}&filedId=${value.filedId}&deptId=${value.deptId}&sendDate=${value.sendDate}`
            });
            // 由于自主配送单 是外购单 但是不需要填写原发为1不需要填写原发
            uni.setStorageSync('isNeedOrigin', value.orderType === '外购' && value.isSpecial === 1 ? 1 : 0)
            if (value.orderType === '外购') {
               uni.navigateTo({
                  url: `/pages/driver-page/driver-index/bill-of-lading-details/originInfo/originInfo?orderPlanId=${value.id}&filedId=${value.filedId}&deptId=${value.deptId}&sendDate=${value.sendDate}&isSpecial=${value.isSpecial}&coalName=${value.coalName}`
               });
            } else {
               uni.navigateTo({
                  url: `/pages/driver-page/appointment/appointment?takeCoalId=${value.id}&filedId=${value.filedId}&deptId=${value.deptId}&sendDate=${value.sendDate}&coalName=${value.coalName}`
               });
            }
         },
         // 自主配送
         selfDeliver() {
            uni.navigateTo({
               url: '/pages/driver-page/driver-index/SelfDelivery/SelfDelivery'
            })
         },
         //查看二维码
         viewQcode(item){
            console.log('查看二维码')
            this.$reqGet('showQRCode',{code:item.code}).then(res=>{
               console.log(res,'ress')
               if(res.data){
                  this.qCodeModalVisible = true;
                  this.qCodeValue = res.data;
                  this.$nextTick(() => {
                  this.$refs.qrcode.remake({
                  success: () => {
                     console.log('生成成功');
                  },
                  fail: err => {
                     console.log(err)
                  }
               });
            })
               }else{
                  this.$u.toast(res.msg || '生成失败')
               }
            })
         }
      }
   };
</script>
@@ -493,7 +639,7 @@
      .button-img {
         width: vww(122);
         height: vww(41);
         background: url('https://mx.jzeg.cn:9096/appimg/image/banner/button.png') no-repeat;
         background: url('https://mr1.res.jzeg.cn:9096/appimg/image/banner/button.png') no-repeat;
         background-size: cover;
         font-size: 28rpx;
         font-weight: 300;
@@ -536,6 +682,20 @@
         .wait-collection {
            width: 100%;
            height: 600rpx;
         }
         // 自主配送
         .self-deliver {
            position: relative;
            top: vww(-120);
            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;
         }
         .collection-form {
@@ -584,7 +744,7 @@
                        height: vww(28);
                        line-height: vww(28);
                        text-align: center;
                        background: url('https://mx.jzeg.cn:9096/appimg/image/banner/blueblock.png') no-repeat;
                        background: url('https://mr1.res.jzeg.cn:9096/appimg/image/banner/blueblock.png') no-repeat;
                        background-size: contain;
                        font-size: 30rpx;
                        font-weight: 400;
@@ -627,7 +787,7 @@
                        height: vww(28);
                        line-height: vww(28);
                        text-align: center;
                        background: url('https://mx.jzeg.cn:9096/appimg/image/banner/redblock.png') no-repeat;
                        background: url('https://mr1.res.jzeg.cn:9096/appimg/image/banner/redblock.png') no-repeat;
                        background-size: contain;
                        font-size: 30rpx;
                        font-weight: 400;
@@ -785,7 +945,7 @@
                        height: vww(28);
                        line-height: vww(28);
                        text-align: center;
                        background: url('https://mx.jzeg.cn:9096/appimg/image/banner/blueblock.png') no-repeat;
                        background: url('https://mr1.res.jzeg.cn:9096/appimg/image/banner/blueblock.png') no-repeat;
                        background-size: contain;
                        font-size: 30rpx;
                        font-weight: 400;
@@ -821,7 +981,7 @@
                        height: vww(28);
                        line-height: vww(28);
                        text-align: center;
                        background: url('https://mx.jzeg.cn:9096/appimg/image/banner/redblock.png') no-repeat;
                        background: url('https://mr1.res.jzeg.cn:9096/appimg/image/banner/redblock.png') no-repeat;
                        background-size: contain;
                        font-size: 30rpx;
                        font-weight: 400;
@@ -859,7 +1019,7 @@
                        height: vww(28);
                        line-height: vww(28);
                        text-align: center;
                        background: url('https://mx.jzeg.cn:9096/appimg/image/banner/redblock.png') no-repeat;
                        background: url('https://mr1.res.jzeg.cn:9096/appimg/image/banner/redblock.png') no-repeat;
                        background-size: contain;
                        font-size: 30rpx;
                        font-weight: 400;
@@ -931,6 +1091,12 @@
         }
         .Reserved {
            .fourth-line {
               justify-content: flex-end;
               letter-spacing: vww(2);
               left: 223rpx !important;
            }
            .white-block {
               width: 100%;
               height: vww(50);