tianhui 3 роки тому
батько
коміт
d88f328f4c
2 змінених файлів з 22 додано та 10 видалено
  1. 17 9
      pages/center/monthly/monthly.vue
  2. 5 1
      pages/handleMonthly/handleMonthly.vue

+ 17 - 9
pages/center/monthly/monthly.vue

@@ -32,6 +32,7 @@
 				</view>
 			</scroll-view>
 		</mescroll-body>
+		<u-modal v-model="canclShow" content="确认取消" @confirm="confirm"></u-modal>
 		<u-toast ref="uToast" />
 	</view>
 </template>
@@ -42,6 +43,8 @@
 		mixins: [MescrollMixin], // 使用mixin
 		data() {
 			return {
+				id:'',
+				canclShow: false,
 				monthlyList: [],
 				monthList:'',
 				beginTime:'',
@@ -122,26 +125,31 @@
 				
 			},
 			cancelMonth(monthId){
+				this.id=monthId;
+				this.canclShow = true;
 				console.log('monthId',monthId)
-				this.$u.api.cancelMonth({monthId: monthId})
+			},
+			confirm(){
+				this.$u.api.cancelMonth({monthId: this.id})
 				.then(res=>{
 					if(res.code === 200){
-					this.$refs.uToast.show({
-						title: err.msg,
+					this.$refs.uToast.show({ 
+						title: res.msg,
 						type: 'success',
 					});
+					this.downCallback()
 					}else{
-						this.$refs.uToast.show({
-							title: err.msg,
-							type: 'error',
-						});
+						
 					}
 				}).catch(err=>{
-					
+					this.$refs.uToast.show({
+						title: err.msg,
+						type: 'error',
+					});
 				})
-			}
 		}
 	}
+	}
 </script>
 
 <style lang="scss" scoped>

+ 5 - 1
pages/handleMonthly/handleMonthly.vue

@@ -46,6 +46,8 @@
 	export default {
 		data() {
 			return {
+				startTime:'',
+				endTime:'',
 				payUrl:'',
 				monthId: '',
 				vehicleNo:'',
@@ -113,6 +115,8 @@
 				}
 				const t1 = year + '.' + (month > 9 ? month : '0' + month) + '.' + (day > 9 ? day : '0' + day)
 				const t2 = year2 + '.' + month2 + '.' + day2
+				this.startTime=t1
+				this.endTime=t2
 				this.monthStartTime=year + '-' + (month > 9 ? month : '0' + month) + '-' + (day > 9 ? day : '0' + day) + ' ' + hours + ':' + minutes + ':' +seconds
 				this.monthEndTime=year2 + '-' + month2 + '-' + day2 + ' ' + hours + ':' + minutes + ':' +seconds
 				return t1 + '-' + t2
@@ -176,7 +180,7 @@
 					energyType:this.form.carLicense.energyType,
 					monthStartTime:this.monthStartTime,
 					monthEndTime:this.monthEndTime,
-					monthCount:this.form.monthAmount})
+					monthCount:this.form.month})
 					.then(res => {
 						console.log("createMonth",res)
 						if(res.code === 200){