yangan
2024-06-21 7f02619d92353f989cccf29fd58321d4f13500bb
pages/driver-page/drvier-my/certifiCate/certifiCate.vue
@@ -36,6 +36,12 @@
               <view class="line detail-value">
                  司机:{{item.driverName}}
               </view>
               <view class="line detail-value">
                  押运员:{{item.supercargoInfo?getUserName(item.supercargoInfo):'无'}}
               </view>
               <view class="line detail-value">
                  {{item.startTime}}-{{item.expirationTime}}
               </view>
            </view>
         </view>
      </view>
@@ -121,7 +127,7 @@
                     label="运输证开始时间"
                     labelWidth="20%"
                     borderBottom>
                     <uni-datetime-picker v-model="tranSportForm.startTime" type="date" :start="minDate" />
                     <uni-datetime-picker v-model="tranSportForm.startTime" type="date"  />
                  </u-form-item>
                  <u-form-item prop="expirationTime"
                     label="运输证过期时间"
@@ -251,7 +257,11 @@
         return {
            minDate: this.getToday(),
            previewImageShow: false,
            supercargoList:[],
            supercargoList:[{
               driverName:"",
               driverIdcard:"",
               driverPhone:""
            }],
            scoreDetailList: [],
            editTranShow:false,
            upload:false,
@@ -314,17 +324,20 @@
      },
      onLoad() {
         this.getScoreDetail()
         this.$reqGet('getUserEntity').then(res => {
            this.userInfo = res.data;
            this.$reqGetId('getDriverListById', this.userInfo.userId).then(res => {
               this.certificateData = res.data;
            });
         });
         this.getData()
      },
      methods: {
         ...mapMutations(['changeisUploadimg']),
         beforeRead() {
            this.changeisUploadimg(true);
         },
         getData(){
            this.$reqGet('getUserEntity').then(res => {
               this.userInfo = res.data;
               this.$reqGetId('getDriverListById', this.userInfo.userId).then(res => {
                  this.certificateData = res.data;
               });
            });
         },
         imageClick(data) {
            this.previewImageSrc = data;
@@ -480,7 +493,7 @@
                     if (res.code == 0) {
                        this.editTranShow = false;
                        this.$u.toast('提交成功');
                        this.init();
                        this.getData();
                     } else {
                        uni.showToast({
                           title: res.msg,
@@ -570,10 +583,20 @@
            })
         },
         deleteSupercar(){
            this.supercargoList.splice(this.supercargoList.length - 1, 1)
            if(this.supercargoList.length>1){
               this.supercargoList.splice(this.supercargoList.length - 1, 1)
            }
         },
         deleteDriver(){
            this.driverList.splice(this.driverList.length - 1, 1);
            if(this.driverList.length>1){
               this.driverList.splice(this.driverList.length - 1, 1);
            }
         },
         getUserName(e){
            let data= e.split(',').map(item=>{
               return item.split("|")[0]
            }).join(',')
            return data
         }
      }
   }