qingyiay
2023-03-29 82af85eae92790fc125ca42d1a800046fe0bd916
pages/driver-page/driver-index/driver-index.vue
@@ -22,10 +22,10 @@
               <view class="right-top">
                  <view class="card-right-top-row">
                     <view>
                        <text>{{ item.deptName ||''}}</text>
                        <text>{{ item.deptName || '' }}</text>
                     </view>
                     <view>
                        <text>{{ item.coalName ||''}}</text>
                        <text>{{ item.coalName || '' }}</text>
                     </view>
                  </view>
                  <view class="card-right-top-row">
@@ -35,12 +35,12 @@
                  </view>
                  <view class="card-right-top-row">
                     <view>
                        <text>{{item.filedName||''}}</text>
                        <text>{{ item.filedName || '' }}</text>
                     </view>
                  </view>
                  <view class="card-right-top-row">
                     <view>
                        <text>{{item.orderCode||''}}</text>
                        <text>{{ item.orderCode || '' }}</text>
                     </view>
                  </view>
               </view>
@@ -130,14 +130,31 @@
import { customerId } from '@/utils/status';
export default {
   props: {
      indexdriverBillOfLoadingData: {
         type: Object,
         default: {}
      }
   },
   watch: {
      indexdriverBillOfLoadingData: {
         handler(v) {
            console.log(v, '刷新之后的司机首页');
            this.driverBillOfLoadingData = v;
         },
         deep: true,
         immediate: true
      }
   },
   data() {
      return {
         driverBillOfLoadingData: [],
         driverBillOfLoadingData: {},
         // 抢单模态框
         qiangDanShow: false,
         qiangDanTitle: '抢单提示',
         qiangDanContent: '',
         qiangDanOrderPlanId: null
         qiangDanOrderPlanId: null,
         fleetId: ''
      };
   },
   onShow() {
@@ -153,6 +170,7 @@
            title: '加载中...'
         });
         this.$reqGet('qiangDanList').then(res => {
            console.log(res, '司机首页');
            uni.hideLoading();
            this.driverBillOfLoadingData = res.data;
         });
@@ -160,9 +178,10 @@
      // 抢单按钮
      qiangDanBtn(value) {
         if (value.tmcCount == '0') {
            this.qiangDan(value.orderPlanId);
            this.qiangDan(value.orderPlanId, value.fleetId);
         } else {
            this.qiangDanOrderPlanId = value.orderPlanId;
            this.fleetId = value.fleetId;
            this.qiangDanShow = true;
            this.qiangDanContent = `已抢${value.tmcCount}单,确定抢单?`;
         }
@@ -170,21 +189,27 @@
      // 抢单模态框
      qiangDanConfirm() {
         this.qiangDanContent = '';
         this.qiangDan(this.qiangDanOrderPlanId);
         this.qiangDanShow = false;
         this.qiangDan(this.qiangDanOrderPlanId, this.fleetId);
      },
      qiangDanCancel() {
         this.qiangDanShow = false;
      },
      // 抢单请求
      qiangDan(id) {
         this.$reqPost('qiangDan', { orderPlanId: id }, 'params').then(res => {
            if (res.code == 0) {
               this.$u.toast('抢单成功');
            } else {
               this.$u.toast(res.data ? res.data : '抢单失败');
            }
            this.qiangDanList();
         });
      qiangDan(id, fleetId) {
         this.$reqPost('qiangDan', { orderPlanId: id, fleetId: fleetId }, 'params')
            .then(res => {
               if (res.code == 0) {
                  this.$u.toast('抢单成功');
               } else {
                  this.$u.toast(res.data ? res.data : '抢单失败');
               }
            })
            .then(() => {
               setTimeout(() => {
                  this.qiangDanList();
               }, 1000);
            });
      },
      list3CardIconClick(value) {
         uni.navigateTo({
@@ -267,11 +292,11 @@
         }
         &Table {
            .uni-table {
               min-width: 94%!important;
               min-width: 94% !important;
               .uni-table-tr {
                  padding: 0;
                  .uni-table-th {
                     width:33.3%;
                     width: 33.3%;
                     line-height: 58rpx;
                     padding: vww(5) vww(10);
                     color: #111111;