yangan
2025-04-11 5e08d4f61c24db589bd6d30875fcb1191f719b16
pages/driver-page/driver-index/driver-index.vue
@@ -424,6 +424,36 @@
    >
      <div v-html="notice.content"></div>
    </u-modal>
   <!-- 外销抢单选择车牌 -->
   <u-modal :show="show"
   showCancelButton
     @confirm="showConFirm(activeObj)"
        @cancel="showCancel"
   :title="title" >
         <view class="slot-content">
            <view style="text-align: left;">
            <u-radio-group
            v-model="paramsCarNo"
            placement="column"
         >
            <u-radio
            :iconSize="40"
            :labelSize="40"
            :size="40"
            :customStyle="{marginBottom: '8px'}"
            v-for="(item, index) in paramsArr"
            :key="index"
            :label="item.carNo + '--' + item.name"
            :name="item.carNo"
            @change="radioChange"
            >
            </u-radio>
         </u-radio-group>
      </view>
         </view>
      </u-modal>
  </div>
</template>
<script>
@@ -464,9 +494,14 @@
      labaIcon: `${onlineurl}/appimg/image/aboutUs/laba.jpg`,
      newIcon: `${onlineurl}/appimg/image/aboutUs/labaHeight.jpg`,
      markFlag: "none",
     activeObj:{},
      noticeModelShow: false,
      garidInitTop: "", //元素初始距离顶部的高度
      screenHeight: "",
     show:false,
     paramsArr:[],
     paramsCarNo:'',
     title:'选择车牌',
      notice: {
        title: "",
        content: "",
@@ -691,7 +726,31 @@
    },
    // 抢单按钮
    qiangDanBtn: Debounce(function (value) {
      if (value.tmcCount == "0") {
      console.log(value,'value')
      this.activeObj = value;
      if(value.orderType === '外销'){
         this.$reqPost('getCarNosByFleetId',{fleetId:value.fleetId},'params').then(res=>{
         console.log(res,'ress')
         this.paramsArr = res.data;
         this.show = true;
   //       if (value.tmcCount == "0") {
    //     this.qiangDan(
    //       value.orderPlanId,
    //       value.fleetId,
    //       value.customerId === null ? "0" : value.customerId,
    //       value.xsUserId === null ? "0" : value.xsUserId
    //     );
    //   } 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}单,确定抢单?`;
    //   }
      })
      }else{
         if (value.tmcCount == "0") {
        this.qiangDan(
          value.orderPlanId,
          value.fleetId,
@@ -706,7 +765,33 @@
        this.qiangDanShow = true;
        this.qiangDanContent = `已抢${value.tmcCount}单,确定抢单?`;
      }
      }
    }, 500),
   showConFirm(value){
      if (value.tmcCount == "0") {
        this.qiangDan(
          value.orderPlanId,
          value.fleetId,
          value.customerId === null ? "0" : value.customerId,
          value.xsUserId === null ? "0" : value.xsUserId
        );
      } 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}单,确定抢单?`;
      }
     this.show  =false;
   },
   showCancel(){
      this.show = false;
   },
    // 抢单模态框
    qiangDanConfirm() {
@@ -724,6 +809,7 @@
    },
    // 抢单请求
    qiangDan(id, fleetId, customerId, xsUserId) {
      console.log(this.paramsCarNo,'paramsCarNo')
      this.$reqPost(
        "qiangDan",
        {
@@ -731,11 +817,13 @@
          fleetId: fleetId,
          customerId: customerId,
          xsUserId: xsUserId,
        carNo:this.paramsCarNo ? this.paramsCarNo : '',
        },
        "params"
      )
        .then((res) => {
          if (res.code == 0) {
         this.paramsCarNo = '';
            this.$u.toast("抢单成功");
          } else {
            this.$u.toast(res.msg ? res.msg : "抢单失败");