yangan
2024-07-10 5c7d78e847739fbd4af4aa28359fc3ee36763a19
pages/driver-page/driver-index/driver-index.vue
@@ -2,7 +2,7 @@
   <view class="">
      <view class="driver-index">
         <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">
            </view>
@@ -30,9 +30,9 @@
                        <view class="sign">装</view>
                        <view class="filedname exceedHide">
                           <text
                              v-if="item.orderType == '外销' || item.orderType == '内销'  ">{{ item.deptName|| ''  }}</text>
                              v-if="item.orderType == '外销' || item.orderType == '内销'||item.orderType == '外销退'  ">{{ item.deptName|| ''  }}</text>
                           <text
                              v-else-if="item.orderType == '外购' || item.orderType == '内购' ">{{ item.customerId?item.customerName:item.customerNameCopy|| ''  }}</text>
                              v-else-if="item.orderType == '外购' || item.orderType == '内购'||item.orderType == '外购退'  ">{{ item.customerId?item.customerName:item.customerNameCopy|| ''  }}</text>
                           <text v-else-if="item.orderType == '转出'|| item.orderType == '转入'">{{item.filedName}}
                           </text>
@@ -47,11 +47,11 @@
                     <view class="main-information">
                        <view class="sign">卸</view>
                        <view class="filedname exceedHide">
                           <text v-if="item.orderType == '外销' || item.orderType == '内销' ">
                           <text v-if="item.orderType == '外销' || item.orderType == '内销'||item.orderType == '外销退' ">
                              {{ item.customerNameCopy ? item.customerNameCopy : item.customerName|| ''  }}
                           </text>
                           <text
                              v-else-if="item.orderType == '外购' || item.orderType == '内购' ">{{ item.deptName|| ''  }}</text>
                              v-else-if="item.orderType == '外购' || item.orderType == '内购'||item.orderType == '外购退'  ">{{ item.deptName|| ''  }}</text>
                           <text
                              v-else-if="item.orderType == '转出'|| item.orderType == '转入'">{{item.toFiledName}}
@@ -89,9 +89,9 @@
                  @confirm="qiangDanConfirm"
                  @cancel="qiangDanCancel"></u-modal>
            </view>
            <!-- 待预约提煤单 -->
            <!-- 待预约收发单 -->
            <view class="wait-appointment">
               <combined-title title="待预约提煤单"></combined-title>
               <combined-title title="待预约收发单"></combined-title>
               <u-empty mode="data"
                  icon="http://cdn.uviewui.com/uview/empty/data.png"
                  text="暂无数据"
@@ -109,9 +109,9 @@
                           <view class="sign">装</view>
                           <view class="filedname exceedHide">
                              <text
                                 v-if="item.orderType == '外销' || item.orderType == '内销' ">{{ item.deptName }}</text>
                                 v-if="item.orderType == '外销' || item.orderType == '内销'||item.orderType == '外销退' ">{{ item.deptName }}</text>
                              <text
                                 v-else-if="item.orderType == '外购' || item.orderType == '内购' ">{{ item.customerName }}</text>
                                 v-else-if="item.orderType == '外购' || item.orderType == '内购'||item.orderType == '外购退' ">{{ item.customerName }}</text>
                              <text
                                 v-else-if="item.orderType == '转出'|| item.orderType == '转入'">{{item.filedName}}
                              </text>
@@ -129,9 +129,9 @@
                           <view class="sign">卸</view>
                           <view class="filedname exceedHide">
                              <text
                                 v-if="item.orderType == '外销' || item.orderType == '内销' ">{{ item.customerName }}</text>
                                 v-if="item.orderType == '外销' || item.orderType == '内销'||item.orderType == '外销退' ">{{ item.customerName }}</text>
                              <text
                                 v-else-if="item.orderType == '外购' || item.orderType == '内购' ">{{ item.deptName }}</text>
                                 v-else-if="item.orderType == '外购' || item.orderType == '内购'||item.orderType == '外购退'  ">{{ item.deptName }}</text>
                              <text
                                 v-else-if="item.orderType == '转出'|| item.orderType == '转入'">{{item.toFiledName}}</text>
                           </view>
@@ -155,7 +155,12 @@
                           <!-- <view class="order-type">{{ item.orderType }}</view> -->
                        </view>
                     </view>
                     <view class="fourth-line">
                     <view class="fifth-line">
                        <view class="button-img"
                            v-if="item.isDanger === 1"
                           @click.stop="cancelCerifCate(item)">
                           道路运输证
                        </view>
                        <view class="button-img"
                           @click.stop="cancelAppoint(item)">
                           请求退单
@@ -186,9 +191,26 @@
                  @confirm="insideConnectConfirm"
                  @cancel="insideConnectCancel"></u-modal>
            </view>
            <!-- 已预约提煤单 -->
            <!-- 已预约收发单 -->
            <!-- 填写集装箱号 -->
               <view class="">
               <u-modal :show="enterCode"
                  title="集装箱号"
                  showCancelButton
                  content="请填写集装箱号"
                  @confirm="cancelCodeEnter"
                  @cancel="cancelCodeCancel">
                  <view style="    display: flex; align-items: center;">
                      <text>请输入:</text>   <u--input
                  style="border: 1px solid black"
                  v-model="enterCodeStr"
                        placeholder="请输入集装箱号"></u--input>
                  </view>
                  </u-modal>
            </view>
            <view class="Reserved">
               <combined-title title="已预约提煤单"></combined-title>
               <combined-title title="已预约收发单"></combined-title>
               <u-empty mode="data"
                  icon="http://cdn.uviewui.com/uview/empty/data.png"
                  textSize="30"
@@ -206,9 +228,9 @@
                           <view class="sign">装</view>
                           <view class="filedname exceedHide">
                              <text
                                 v-if="item.orderType == '外销' || item.orderType == '内销' ">{{ item.deptName }}</text>
                                 v-if="item.orderType == '外销' || item.orderType == '内销'||item.orderType == '外销退' ">{{ item.deptName }}</text>
                              <text
                                 v-else-if="item.orderType == '外购' || item.orderType == '内购' ">{{ item.customerName }}</text>
                                 v-else-if="item.orderType == '外购' || item.orderType == '内购'||item.orderType == '外购退'  ">{{ item.customerName }}</text>
                              <text v-else-if="item.orderType == '转出'||item.orderType == '转入'">
                                 {{item.filedName}}
@@ -227,9 +249,9 @@
                           <view class="sign">卸</view>
                           <view class="filedname exceedHide">
                              <text
                                 v-if="item.orderType == '外销' || item.orderType == '内销' ">{{ item.customerName }}</text>
                                 v-if="item.orderType == '外销' || item.orderType == '内销'||item.orderType == '外销退' ">{{ item.customerName }}</text>
                              <text
                                 v-else-if="item.orderType == '外购' || item.orderType == '内购'">{{ item.deptName }}</text>
                                 v-else-if="item.orderType == '外购' || item.orderType == '内购'||item.orderType == '外购退' ">{{ item.deptName }}</text>
                              <text v-else-if="item.orderType == '转出'||item.orderType == '转入'">
                                 {{item.toFiledName}}
@@ -256,7 +278,11 @@
                        </view>
                     </view>
                     <view class="fourth-line"
                        v-if="item.status<3">
                        v-if="item.isDanger === 1">
                           <view class="button-img"
                              @click.stop="cancelCerifCate(item)">
                              道路运输证
                           </view>
                        <view class="button-img"
                           @click.stop="cancelAppoint(item)">
                           请求退单
@@ -268,6 +294,48 @@
            </view>
         </view>
      </view>
      <u-popup :show="show"
         @close="close"
         @open="open"
         mode="center"
         round="10">
         <view class="receiverPopup">
            <view class="image">
               <u--image
                  :src="previewImageSrc != null ? BaseUrl + previewImageSrc : ''"
                  width="80px"
                  height="80px"
                  >
                  <view slot="error"
                     style="font-size: 24rpx;">加载失败</view>
               </u--image>
            </view>
            <view class="tables">
               <uni-table border
                  stripe
                  type="selection"
                  @selection-change="selectionChange"
                  emptyText="暂无更多数据">
                  <uni-tr>
                     <uni-th align="center">押运员</uni-th>
                     <uni-th align="center">身份证号</uni-th>
                     <uni-th align="center">手机号</uni-th>
                  </uni-tr>
                  <uni-tr v-for="(item, index) in inspectData"
                     :key="item.id">
                     <uni-td align="center">{{ item.name.split("|")[0]  }}</uni-td>
                     <uni-td align="center">{{ item.name.split("|")[1]  }}</uni-td>
                     <uni-td align="center">{{ item.name.split("|")[2]  }}</uni-td>
                  </uni-tr>
               </uni-table>
            </view>
            <view class="receiverPopup__btn"><u-button text="确定"
                  type="primary"
                  @click="popClick"
                  :loading="ClickLoading"></u-button></view>
         </view>
      </u-popup>
   </view>
</template>
@@ -307,6 +375,11 @@
      },
      data() {
         return {
            show: false,
            BaseUrl,
            yaList:[],
            inspectData:[],
            activeObj:{},
            driverBillOfLoadingData: {
               list1: [],
               list2: [],
@@ -314,6 +387,8 @@
            },
            // 接单模态框
            qiangDanShow: false,
            enterCode:false,
            enterCodeStr:'',
            qiangDanTitle: '接单提示',
            qiangDanContent: '',
            qiangDanOrderPlanId: null,
@@ -328,12 +403,39 @@
            customerId: '',
            xsUserId: '',
            filedId: '',
            previewImageSrc:"",
         };
      },
      onShow() {
         this.init();
      },
      methods: {
         open() {},
         close() {
            this.show = false;
         },
         selectionChange(e) {
            this.yaList= e.detail.index.map(item=>{
               return this.inspectData[item]
            })
         },
         popClick(){
            let data=this.yaList.map(item=>{
               return  item.name
            })
            let paramsData={
               idCardEscort:data.join(','),roadTransportId:this.yaList[0].roadTransportId,id: this.yaList[0].Id
            }
            this.$reqPut('saveMyEscort', paramsData, 'json')
               .then(res => {
                  if (res.code == 0) {
                     this.$u.toast('添加成功');
                     this.show=false
                  } else {
                     this.$u.toast(res.msg ? res.msg : '添加失败');
                  }
               })
         },
         // 跳转地图
         skipMap(val) {
            uni.navigateTo({
@@ -343,6 +445,7 @@
            });
         },
         init() {
            this.inspectData=[]
            this.qiangDanList();
         },
         // 司机首页列表
@@ -403,6 +506,7 @@
                  uni.hideLoading()
                  if (res.code == 0) {
                     this.$u.toast('接单成功');
                  } else {
                     this.$u.toast(res.msg ? res.msg : '接单失败');
                  }
@@ -439,7 +543,7 @@
               url: `/pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details?orderPlanId=${value.id}&yyId=${value.yyId}&orderType=${value.orderType}`
            });
         },
         // 提煤单详情
         // 收发单详情
         cardBodyClick(name) {
            uni.navigateTo({
               url: `/pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details?orderPlanId=${name}`
@@ -453,6 +557,23 @@
            }
            this.cancelAppointShow = true
            this.cancelAppointId = item.id
         },
         cancelCerifCate(value){
            this.$reqGet('getMyEscortList', { customerId: value.customerId }).then(res => {
               this.inspectData=[]
               if (res.code == 0) {
                  this.previewImageSrc=res.data.certificateImg
                  this.inspectData=res.data.persons.map(item=>{
                     return {name:item,roadTransportId:res.data.id,Id: value.id}
                  })
                  this.show=true
               } else {
                  this.$u.toast(res.msg ? res.msg : '请添加道路运输证');
                  uni.navigateTo({
                     url: '/pages/driver-page/drvier-my/certifiCate/certifiCate'
                  })
               }
            })
         },
         // 退单弹窗确认
         cancelAppointConfirm() {
@@ -491,22 +612,69 @@
         // 去预约
         toAppointmentClick(value) {
            // 由于自主配送单 是外购单 但是不需要填写原发为1不需要填写原发
            uni.setStorageSync('isNeedOrigin', value.orderType === '外购' && value.isSpecial === 1 ? 1 : 0)
            if (value.orderType === '外购') {
            uni.setStorageSync('isNeedOrigin', value.orderType === '外购' && value.isSpecial === 1 ? 1 : 0);
            //判断是不是集装箱 是否需要输入
            this.activeObj = value;
            console.log(value,'123')
            if(value.isContainerNum){
              this.enterCode = true;
            }else{
              this.enterCode = false;
                 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}`
                  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}&isWeight=${value.isWeight}`
               });
            } else {
               uni.navigateTo({
                  url: `/pages/driver-page/appointment/appointment?takeCoalId=${value.id}&filedId=${value.filedId}&deptId=${value.deptId}&sendDate=${value.sendDate}`
               });
            }
              }
         },
         // 自主配送
         selfDeliver() {
            uni.navigateTo({
               url: '/pages/driver-page/driver-index/SelfDelivery/SelfDelivery'
            })
         },
         cancelCodeEnter(){
            console.log(this.activeObj,'tmid')
            this.activeObj.containerNumber = this.enterCodeStr;
             this.$reqPut('addContainer',{
               id:this.activeObj.id,
               containerNumber:this.activeObj.containerNumber
            }).then(res=>{
               this.$u.toast('操作成功');
               this.enterCodeStr = '';
               this.enterCode = false;
            }).catch(err=>{
            }).finally(() => {
               if (this.activeObj.orderType === '外购') {
               uni.navigateTo({
                  url: `/pages/driver-page/driver-index/bill-of-lading-details/originInfo/originInfo?orderPlanId=${this.activeObj.id}&filedId=${this.activeObj.filedId}&deptId=${this.activeObj.deptId}&sendDate=${this.activeObj.sendDate}&isSpecial=${this.activeObj.isSpecial}&isWeight=${this.activeObj.isWeight}`
               });
            } else {
               uni.navigateTo({
                  url: `/pages/driver-page/appointment/appointment?takeCoalId=${this.activeObj.id}&filedId=${this.activeObj.filedId}&deptId=${this.activeObj.deptId}&sendDate=${this.activeObj.sendDate}`
               });
            }
            })
         },
         cancelCodeCancel(){
            this.enterCode = false;
            this.enterCodeStr = '';
               if (this.activeObj.orderType === '外购') {
               uni.navigateTo({
                  url: `/pages/driver-page/driver-index/bill-of-lading-details/originInfo/originInfo?orderPlanId=${this.activeObj.id}&filedId=${this.activeObj.filedId}&deptId=${this.activeObj.deptId}&sendDate=${this.activeObj.sendDate}&isSpecial=${this.activeObj.isSpecial}&isWeight=${this.activeObj.isWeight}`
               });
            } else {
               uni.navigateTo({
                  url: `/pages/driver-page/appointment/appointment?takeCoalId=${this.activeObj.id}&filedId=${this.activeObj.filedId}&deptId=${this.activeObj.deptId}&sendDate=${this.activeObj.sendDate}`
               });
            }
         }
      }
   };
@@ -591,7 +759,35 @@
      }
   }
   .receiverPopup {
      height: vww(220);
      width: 700rpx;
      .image{
         width: 100%;
         height: vww(110);
         display: flex;
         align-items: center;
         justify-content: center;
      }
      .tables{
         width: 100%;
      }
      .receiverPopup__title {
         margin: vww(10) auto 0;
         width: 80%;
         text-align: center;
      }
      &__btn {
         margin: vww(10) auto;
         width: 50%;
         .u-button {
            height: vww(20);
         }
      }
   }
   /deep/.u-button {
      width: 100%;
      height: 28px !important;
@@ -620,7 +816,7 @@
      .driver-index-body {
         // margin-bottom: vww(56);
         // 待领取提煤单
         // 待领取收发单
         .wait-collection {
            width: 100%;
            height: 600rpx;
@@ -1029,6 +1225,23 @@
               .fourth-line {
                  @include fourthLine;
               }
               .fifth-line {
                  height: vww(68);
                  display: flex;
                  align-items: center;
                  .button-img {
                     width: vww(122);
                     height: vww(41);
                     background: url('https://mx.jzeg.cn:9096/appimg/image/banner/button.png') no-repeat;
                     background-size: cover;
                     font-size: 28rpx;
                     font-weight: 300;
                     color: #ffffff;
                     text-align: center;
                     line-height: vww(40);
                  }
               }
            }
         }