gcz 4 år sedan
förälder
incheckning
05b15c42c9
1 ändrade filer med 19 tillägg och 8 borttagningar
  1. 19 8
      pages/handleMonthly/handleMonthly.vue

+ 19 - 8
pages/handleMonthly/handleMonthly.vue

@@ -10,7 +10,7 @@
 		<u-select v-model="isShowCarLicense" :list="carLicenseList" @confirm="carLicenseListConfirm"></u-select>
 		<view class="handle-monthly-item">
 			<view>车辆信息</view>
-			<view>{{form.energyType| verifyStatusFilter}}</view>
+			<view>{{form.carLicense.energyType| verifyStatusFilter}}</view>
 		</view>
 		<view class="handle-monthly-item">
 			<view>包月金额</view>
@@ -142,39 +142,42 @@
 				this.form.dateRange = this.getMonthRange(new Date, this.form.month)
 			},
 			carLicenseListConfirm (item) {
+				console.log('item',item);
 				this.form.carLicense = item[0]
 			},
 			getMonthInfo(roadNo){
 				this.$u.api.monthInfo({roadNo: this.roadNo})
 				.then(res => {
 					if (res.code === 200){
-						this.vehicleNo = res.data.vehicleList[0].vehicleNo
 						this.lastActiveDate = res.data.lastActiveDate;
-						this.form.energyType=res.data.vehicleList[0].energyType;
 						this.form.monthAmount=res.data.monthAmount;
 						this.carLicenseList = [];
 						res.data.vehicleList.forEach(item => {
 							const obj = {
 								value: item.id,
-								label: item.vehicleNo
+								label: item.vehicleNo,
+								energyType:item.energyType
 							}
 							this.carLicenseList.push(obj)
-						})
+						});
+						console.log('this.carLicenseList',this.carLicenseList[0])
 						this.form.carLicense = this.carLicenseList[0]
 					}
+					
 				})
 			},
 			submit(roadNo){
 				// console.log(this.monthStartTime)
+				// console.log('this.form.carLicense',this.form.carLicense);
 				this.$u.api.createMonth({
 					roadNo:this.roadNo,
 					vehicleNo:this.form.carLicense.label,
-					energyType:this.form.energyType,
+					energyType:this.form.carLicense.energyType,
 					monthStartTime:this.monthStartTime,
 					monthEndTime:this.monthEndTime,
 					monthCount:this.form.monthAmount})
 					.then(res => {
-						console.log("1111",res)
+						console.log("createMonth",res)
 						if(res.code === 200){
 							this.monthId = res.data.monthId
 							console.log(this.monthId)
@@ -192,8 +195,15 @@
 									});
 								}
 							})
+						}else{
+							this.$refs.uToast.show({
+								title: res.msg,
+								type: 'warning',
+							});
 						}
-					})
+					}).catch(err=>{
+						
+					});
 				// this.getMonthInfo(roadNo)
 			}
 		},
@@ -204,6 +214,7 @@
 		},
 		filters:{
 			verifyStatusFilter(value) {
+				console.log('value',value)
 				if (value === 0) {
 				  return '';
 				} else if(value === 1){