From 6ba1c5a9f73604edb005212b7fed058e185ce295 Mon Sep 17 00:00:00 2001
From: yangan <yangan0921@163.com>
Date: 星期四, 18 七月 2024 16:38:41 +0800
Subject: [PATCH] featL库管首页样式更新

---
 pages/driver-page/drvier-my/certifiCate/certifiCate.vue |  235 +++++++++++++++++++++++++++++-----------------------------
 1 files changed, 118 insertions(+), 117 deletions(-)

diff --git a/pages/driver-page/drvier-my/certifiCate/certifiCate.vue b/pages/driver-page/drvier-my/certifiCate/certifiCate.vue
index 0003ecc..33f5731 100644
--- a/pages/driver-page/drvier-my/certifiCate/certifiCate.vue
+++ b/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>
@@ -90,7 +90,8 @@
 						<u-form-item labelWidth="20%"
 							label="浜у搧"
 							ref="item1" 
-							prop='productId'>
+							prop='productName'
+							required>
 							<u--input placeholder="璇疯緭鍏ヤ骇鍝�"
 								v-model="tranSportForm.productName"
 								class="input"
@@ -99,7 +100,8 @@
 						<u-form-item labelWidth="20%"
 							label="瀹㈡埛"
 							ref="item1" 
-							prop='productId'>
+							prop='customerName'
+							required>
 							<u--input placeholder="璇疯緭鍏ュ鎴�"
 								v-model="tranSportForm.customerName"
 								class="input"
@@ -127,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="娣诲姞椹鹃┒鍛�"
@@ -212,39 +214,6 @@
 					</view>
 				</view>
 			</u-popup>
-			
-			<u-popup :closeable='true'
-				:round="30"
-				mode='bottom'
-				:show="selfDeliverShow"
-				@close="selfDeliverClose"
-				@open="selfDeliverOpen">
-				<view class="name-list-section">
-					<view class="name-list_title">
-						閫夋嫨瀹㈡埛
-					</view>
-					<view class="name-list_container">
-						<u-empty mode="data"
-							icon="http://cdn.uviewui.com/uview/empty/data.png"
-							text="鏆傛棤鏁版嵁"
-							textSize="30"
-							iconSize="1000"
-							v-if="customerNameList.length===0"></u-empty>
-						<view class="name-list_container_item"
-							v-for="(item,index) in customerNameList" :key="index"
-							@click="selectCustomer(item)">
-							<view class="item-image">
-								<image src="https://mx.jzeg.cn:9096/appimg/image/banner/address.png"
-									mode="widthFix"
-									style="width: 18px;"></image>
-							</view>
-							<view class="item-customerName">
-								{{item.customerName}}
-							</view>
-						</view>
-					</view>
-				</view>
-			</u-popup>
 		</view>
 	</view>
 </template>
@@ -257,7 +226,12 @@
 			return {
 				minDate: this.getToday(),
 				previewImageShow: false,
-				supercargoList:[],
+				supercargoList:[{
+					driverName:"",
+					driverIdcard:"",
+					driverPhone:""
+				}],
+				userInfo: {},
 				scoreDetailList: [],
 				editTranShow:false,
 				upload:false,
@@ -265,8 +239,6 @@
 				BaseUrl,
 				previewImageSrc: '',
 				certificateData:[],
-				userInfo: {},
-				customerNameList:[],
 				driverList:[{
 					driverName:"",
 					driverIdcard:""
@@ -277,24 +249,42 @@
 					customerId:""
 				},
 				sportRules:{
+					productName:{
+						type: 'string',
+						required: true,
+						message: '璇峰~鍐欎骇鍝佸悕绉�',
+						trigger: ['blur', 'change']
+					},
+					customerName:{
+						type: 'string',
+						required: true,
+						message: '璇峰~鍐欏鎴峰悕绉�',
+						trigger: ['blur', 'change']
+					},
 					certificateNo: {
 						type: 'string',
 						required: true,
 						message: '璇峰~鍐欒繍杈撹瘉鍙�',
 						trigger: ['blur', 'change']
 					},
-					expirationTime: {
+					expirationTime: [{
 						type: 'string',
 						required: true,
 						message: '璇烽�夋嫨杩愯緭璇佽繃鏈熸椂闂�',
 						trigger: ['blur', 'change']
-					},
-					startTime:{
+					},{
+						pattern: /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/,
+						message: '璇烽�夋嫨寮�濮嬫椂闂�'
+					}],
+					startTime:[{
 						type: 'string',
 						required: true,
-						message: '璇烽�夋嫨杩愯緭璇佽繃鏈熸椂闂�',
+						message: '璇烽�夋嫨杩愯緭璇佸紑濮嬫椂闂�',
 						trigger: ['blur', 'change']
-					},
+					},{
+						pattern: /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/,
+						message: '璇烽�夋嫨寮�濮嬫椂闂�'
+					}],
 					carNo: [{
 							type: 'string',
 							required: true,
@@ -330,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;
 					});
@@ -355,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');
@@ -375,7 +373,6 @@
 				});
 			},
 			editTranClick(){
-				this.getShipToList()
 				this.editTranShow = true;
 			},
 			editTranClose(){
@@ -386,21 +383,16 @@
 				this.$refs.sportRef
 					.validate()
 					.then(res => {
-						if (this.tranSportForm.productName == '' ) {
-							uni.showToast({
-								title: '璇烽�夋嫨浜у搧锛�',
-								icon: 'error',
-								duration: 2000
-							});
-						}else if(this.tranSportForm.customerName == ''){
-							uni.showToast({
-								title: '璇烽�夋嫨瀹㈡埛锛�',
-								icon: 'error',
-								duration: 2000
-							});
-						}
+						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]$/
-						if(this.driverList.length>0){
+						if (this.fileList9.length==0) {
+							uni.showToast({
+								title: '璇烽�夋嫨杩愯緭璇侊紒',
+								icon: 'error',
+								duration: 2000
+							});
+							submit=false
+						}else if(this.driverList.length>0){
 							this.driverList.forEach((item,index)=>{
 								if(!item.driverName){
 									uni.showToast({
@@ -408,19 +400,21 @@
 										icon: 'error',
 										duration: 2000
 									});
-								}
-								if(!item.driverIdcard){
+									submit=false
+								}else if(!item.driverIdcard){
 									uni.showToast({
 										title: `璇峰~鍐欓┚椹惰韩浠借瘉锛乣,
 										icon: 'error',
 										duration: 2000
 									});
+									submit=false
 								}else if(!idcardtext.test(item.driverIdcard)){
 									uni.showToast({
 										title: `璇锋楠岄┚椹跺憳韬唤璇侊紒`,
 										icon: 'error',
 										duration: 2000
 									});
+									submit=false
 								}
 							})
 						}
@@ -432,72 +426,86 @@
 										icon: 'error',
 										duration: 2000
 									});
-								}
-								if(!item.driverIdcard){
+									submit=false
+								}else if(!item.driverIdcard){
 									uni.showToast({
 										title: `璇峰~鍐欐娂杩愯韩浠借瘉锛乣,
 										icon: 'error',
 										duration: 2000
 									});
+									submit=false
 								}else if(!idcardtext.test(item.driverIdcard)){
 									uni.showToast({
 										title: `璇锋楠屾娂杩愯韩浠借瘉锛乣,
 										icon: 'error',
 										duration: 2000
 									});
-								}
-								if(!item.driverPhone){
+									submit=false
+								}else if(!item.driverPhone){
 									uni.showToast({
 										title: `璇峰~鍐欐娂杩愭墜鏈哄彿锛乣,
 										icon: 'error',
 										duration: 2000
 									});
+									submit=false
 								}else if( !/^1[23456789]\d{9}$/.test(item.driverPhone)){
 									uni.showToast({
 										title: `璇锋楠屾娂杩愭墜鏈哄彿锛乣,
 										icon: 'error',
 										duration: 2000
 									});
+									submit=false
 								}
 							})
 						}
-						let driverName=""
-						let driverIdcard=""
-						let supercargoInfo=''
-						driverName = this.driverList.map((item, index) => {
-						        return item.driverName;
-						      }).join(",");
-						driverIdcard = this.driverList.map((item, index) => {
-								 return item.driverIdcard;
-							   }).join(",");
-						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(submit){
+							   let driverName=""
+							   let driverIdcard=""
+							   let supercargoInfo=''
+							   driverName = this.driverList.map((item, index) => {
+							           return item.driverName;
+							         }).join(",");
+							   driverIdcard = this.driverList.map((item, index) => {
+							   		 return item.driverIdcard;
+							   	   }).join(",");
+							   supercargoInfo = this.supercargoList.map((item, index) => {
+							   	 return item.driverName+ '|'+item.driverIdcard+"|"+item.driverPhone
+							      }).join(",");
+							   this.$reqPost('addJcroadtransport', {
+							   	userId:this.userInfo.userId,
+							   	...this.tranSportForm,
+							   	driverName:driverName,
+							   	driverIdcard:driverIdcard,
+							   	supercargoInfo:supercargoInfo
+							   }, 'json').then(res => {
+							   	if (res.code == 0) {
+							   		this.editTranShow = false;
+							   		this.$u.toast('鎻愪氦鎴愬姛');
+							   		this.tranSportForm={
+							   			carNo:"",
+							   			productId:"",
+							   			customerId:""
+							   		}
+							   		this.driverList=[{
+							   			driverName:"",
+							   			driverIdcard:""
+							   		}]
+							   		this.supercargoList=[{
+							   			driverName:"",
+							   			driverIdcard:"",
+							   			driverPhone:""
+							   		}]
+							   		this.fileList9=[]
+							   		this.getData();
+							   	} else {
+							   		uni.showToast({
+							   			title: res.msg,
+							   			icon: 'none',
+							   			duration: 2000
+							   		});
+							   	}
+							   })
 						   }
-						   if(this.tranSportForm.expirationTime){
-						   	this.tranSportForm.expirationTime=this.tranSportForm.expirationTime+" 23:55"
-						   }
-						this.$reqPost('addJcroadtransport', {
-							userId:this.userInfo.userId,
-							...this.tranSportForm,
-							driverName:driverName,
-							driverIdcard:driverIdcard,
-							supercargoInfo:supercargoInfo
-						}, 'json').then(res => {
-							if (res.code == 0) {
-								this.editTranShow = false;
-								this.$u.toast('鎻愪氦鎴愬姛');
-								this.getData();
-							} else {
-								uni.showToast({
-									title: res.msg,
-									icon: 'none',
-									duration: 2000
-								});
-							}
-						})
 					})
 			},
 			async afterRead(event) {
@@ -545,17 +553,6 @@
 					});
 				});
 			},
-			// 鑾峰彇瀹㈡埛
-			getShipToList() {
-				this.$reqGet('getShipToList')
-					.then(res => {
-						if (res.code == 0) {
-							this.customerNameList = res.data
-						}else {
-						this.$u.toast('鍔犺浇澶辫触')
-					}
-				})
-			},
 			getScoreDetail() {
 				uni.showLoading({
 					title: '鍔犺浇涓��'
@@ -579,10 +576,14 @@
 				})
 			},
 			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=>{

--
Gitblit v1.9.1