yangan
2024-09-06 7e7e77134aa0324993ce7d9db9884eab4d8f98fe
pages/driver-page/drvier-my/certifiCate/certifiCate.vue
@@ -40,7 +40,7 @@
                  押运员:{{item.supercargoInfo?getUserName(item.supercargoInfo):'无'}}
               </view>
               <view class="line detail-value">
                  {{item.startTime}}-{{item.expirationTime}}
                  {{item.startTime?item.startTime.slice(0,10):""}}-{{item.expirationTime?item.expirationTime.slice(0,10):""}}
               </view>
            </view>
         </view>
@@ -55,7 +55,7 @@
               height="400px"></u--image>
         </u-popup>
      </view>
      <!-- 添加道路运输证 -->
      <!-- 添加剧毒运输证 -->
      <view class="editDriverPopup-container">
         <u-popup :show="editTranShow"
            mode="bottom"
@@ -129,13 +129,13 @@
                     label="运输证开始时间"
                     labelWidth="20%"
                     borderBottom>
                     <uni-datetime-picker v-model="tranSportForm.startTime" type="date"  />
                     <uni-datetime-picker v-model="tranSportForm.startTime" type="datetime"  />
                  </u-form-item>
                  <u-form-item prop="expirationTime"
                     label="运输证过期时间"
                     labelWidth="20%"
                     borderBottom>
                     <uni-datetime-picker v-model="tranSportForm.expirationTime" type="date" :start="minDate" />
                     <uni-datetime-picker v-model="tranSportForm.expirationTime" type="datetime" :start="minDate" />
                  </u-form-item>
                  <view class="adddelete"> 
                     <u-button text="添加驾驶员"
@@ -207,7 +207,7 @@
                  </u-form-item>
               </u--form>
               <view class="person-utils">
                  <u-button text="提交道路运输证"
                  <u-button text="提交剧毒运输证"
                     @click="updateRoad"
                     :disabled="upload"
                     type="primary"></u-button>
@@ -231,6 +231,7 @@
               driverIdcard:"",
               driverPhone:""
            }],
            userInfo: {},
            scoreDetailList: [],
            editTranShow:false,
            upload:false,
@@ -238,7 +239,6 @@
            BaseUrl,
            previewImageSrc: '',
            certificateData:[],
            userInfo: {},
            driverList:[{
               driverName:"",
               driverIdcard:""
@@ -267,18 +267,24 @@
                  message: '请填写运输证号',
                  trigger: ['blur', 'change']
               },
               expirationTime: {
                  type: 'string',
                  required: true,
                  message: '请选择运输证开始时间',
                  trigger: ['blur', 'change']
               },
               startTime:{
               expirationTime: [{
                  type: 'string',
                  required: true,
                  message: '请选择运输证过期时间',
                  trigger: ['blur', 'change']
               },
               },{
                  pattern: /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/,
                  message: '请选择开始时间'
               }],
               startTime:[{
                  type: 'string',
                  required: true,
                  message: '请选择运输证开始时间',
                  trigger: ['blur', 'change']
               },{
                  pattern: /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/,
                  message: '请选择开始时间'
               }],
               carNo: [{
                     type: 'string',
                     required: true,
@@ -314,6 +320,11 @@
         getData(){
            this.$reqGet('getUserEntity').then(res => {
               this.userInfo = res.data;
               this.tranSportForm.carNo=this.userInfo.carNo
               this.driverList[0]={
               driverName:this.userInfo.name,
               driverIdcard:this.userInfo.idCard
            }
               this.$reqGetId('getDriverListById', this.userInfo.userId).then(res => {
                  this.certificateData = res.data;
               });
@@ -339,7 +350,10 @@
           let year = now.getFullYear();
           let month = this.padStart(now.getMonth() + 1); // 月份是从0开始的
           let day = this.padStart(now.getDate());
           return `${year}-${month}-${day}`;
           let hour = this.padStart(now.getHours());
           let minute = this.padStart(now.getMinutes());
           let second = this.padStart(now.getSeconds());
           return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
         },
         padStart(value) {
           return value.toString().padStart(2, '0');
@@ -371,7 +385,6 @@
               .then(res => {
                  let submit=true
                  let idcardtext=/^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/
                  console.log(this.fileList9.length)
                  if (this.fileList9.length==0) {
                     uni.showToast({
                        title: '请选择运输证!',
@@ -458,12 +471,6 @@
                        supercargoInfo = this.supercargoList.map((item, index) => {
                            return item.driverName+ '|'+item.driverIdcard+"|"+item.driverPhone
                           }).join(",");
                           if(this.tranSportForm.startTime){
                              this.tranSportForm.startTime=this.tranSportForm.startTime+" 00:01"
                           }
                           if(this.tranSportForm.expirationTime){
                              this.tranSportForm.expirationTime=this.tranSportForm.expirationTime+" 23:55"
                           }
                        this.$reqPost('addJcroadtransport', {
                           userId:this.userInfo.userId,
                           ...this.tranSportForm,
@@ -496,12 +503,6 @@
                                 icon: 'none',
                                 duration: 2000
                              });
                           if(this.tranSportForm.startTime){
                              this.tranSportForm.startTime=this.tranSportForm.startTime.slice(0,10)
                           }
                           if(this.tranSportForm.expirationTime){
                              this.tranSportForm.expirationTime=this.tranSportForm.expirationTime.slice(0,10)
                           }
                           }
                        })
                     }