yangan
2024-08-08 7af16f32de779ba2360344218f807c9909677ee1
pages/driver-page/driver-index/driver-index.vue
@@ -2,14 +2,14 @@
   <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>
            <!-- 引导页 -->
            <noob-tour></noob-tour>
            <!-- 自主配送界面 -->
            <view class="self-deliver">
            <!-- <view class="self-deliver">
               <view class="self-deliver_text">
                  创建自主配送单
               </view>
@@ -19,7 +19,7 @@
                     shape="cirle"
                     @click="selfDeliver"></u-button>
               </view>
            </view>
            </view> -->
            <view class="collection-form">
               <view class="collection-form-item"
                  v-for="(item, index) in driverBillOfLoadingData.list1"
@@ -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>
@@ -157,8 +157,9 @@
                     </view>
                     <view class="fifth-line">
                        <view class="button-img"
                            v-if="item.isDanger === 1 && !item.idCardEscort"
                           @click.stop="cancelCerifCate(item)">
                           添加押运员
                           道路运输证
                        </view>
                        <view class="button-img"
                           @click.stop="cancelAppoint(item)">
@@ -190,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"
@@ -210,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}}
@@ -231,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}}
@@ -263,7 +281,7 @@
                        v-if="item.isDanger === 1">
                           <view class="button-img"
                              @click.stop="cancelCerifCate(item)">
                              添加押运员                                                                                            押运员
                              道路运输证
                           </view>
                        <view class="button-img"
                           @click.stop="cancelAppoint(item)">
@@ -282,19 +300,36 @@
         mode="center"
         round="10">
         <view class="receiverPopup">
            <uni-table border
               stripe
               type="selection"
               @selection-change="selectionChange"
               emptyText="暂无更多数据">
               <uni-tr>
                  <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-tr>
            </uni-table>
            <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"
@@ -308,14 +343,13 @@
   import { customerId } from '@/utils/status';
   import combinedTitle from '@/components/combined-title/combined-title.vue';
   import previewImage from '@/components/kxj-previewImage/kxj-previewImage.vue';
   import noobTour from '@/components/noobTour/noobTour.vue'
   import { mapState } from 'vuex'
   import { BaseUrl } from '@/api/publicInterface.js'
   export default {
      components: {
         combinedTitle,
         previewImage,
         noobTour
      },
      props: {
         indexdriverBillOfLoadingData: {
@@ -341,8 +375,10 @@
      data() {
         return {
            show: false,
            BaseUrl,
            yaList:[],
            inspectData:[],
            activeObj:{},
            driverBillOfLoadingData: {
               list1: [],
               list2: [],
@@ -350,6 +386,8 @@
            },
            // 接单模态框
            qiangDanShow: false,
            enterCode:false,
            enterCodeStr:'',
            qiangDanTitle: '接单提示',
            qiangDanContent: '',
            qiangDanOrderPlanId: null,
@@ -364,6 +402,7 @@
            customerId: '',
            xsUserId: '',
            filedId: '',
            previewImageSrc:"",
         };
      },
      onShow() {
@@ -390,6 +429,7 @@
               .then(res => {
                  if (res.code == 0) {
                     this.$u.toast('添加成功');
                     this.qiangDanList();
                     this.show=false
                  } else {
                     this.$u.toast(res.msg ? res.msg : '添加失败');
@@ -466,6 +506,7 @@
                  uni.hideLoading()
                  if (res.code == 0) {
                     this.$u.toast('接单成功');
                  } else {
                     this.$u.toast(res.msg ? res.msg : '接单失败');
                  }
@@ -499,13 +540,13 @@
         },
         list3CardIconClick(value) {
            uni.navigateTo({
               url: `/pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details?orderPlanId=${value.id}&yyId=${value.yyId}&orderType=${value.orderType}`
               url: `/subPages/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}`
               url: `/subPages/bill-of-lading-details/bill-of-lading-details?orderPlanId=${name}`
            });
         },
         // 请求退单
@@ -521,6 +562,7 @@
            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}
                  })
@@ -570,22 +612,75 @@
         // 去预约
         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;
            if(value.isDanger === 1){
               if(!value.idCardEscort){
                  this.$u.toast('请选择道路运输证司机!');
                  this.cancelCerifCate(value);
                  return
               }
            }
            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: `/subPages/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: `/subPages/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: `/subPages/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}`
               });
            }
         }
      }
   };
@@ -623,7 +718,7 @@
      align-items: center;
      .send-date {
         width: 148rpx;
         min-width: 170rpx;
         height: 24rpx;
         line-height: 24rpx;
         font-size: 28rpx;
@@ -632,7 +727,7 @@
      }
      .havedclock {
         width: 58% !important;
         width: 70% !important;
         margin-right: 0 !important;
         .send-date {
@@ -671,9 +766,18 @@
      }
   }
   .receiverPopup {
      height: vww(110);
      width: 300rpx;
      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%;
@@ -718,7 +822,7 @@
      .driver-index-body {
         // margin-bottom: vww(56);
         // 待领取提煤单
         // 待领取收发单
         .wait-collection {
            width: 100%;
            height: 600rpx;
@@ -894,7 +998,7 @@
                  align-items: center;
                  .send-date {
                     width: 148rpx;
                     min-width: 146rpx;
                     height: 24rpx;
                     margin-left: vww(14);
                     margin-right: vww(56);