shish vor 5 Jahren
Ursprung
Commit
02367277a2
1 geänderte Dateien mit 18 neuen und 4 gelöschten Zeilen
  1. 18 4
      ghsApp/src/pagesOrder/refund.vue

+ 18 - 4
ghsApp/src/pagesOrder/refund.vue

@@ -187,12 +187,26 @@ export default {
 		},
 		refundFun(){
 			let product = [];
+			let hasError = false;
 			this.product.forEach(ele=>{
-				if(ele.isActive&&ele.big>0||ele.small>0){
+				if(ele.big>0||ele.small>0){
 					product.push({"productId":ele.productId,"bigNum":ele.big?ele.big:0,"smallNum":ele.small?ele.small:0});
 				}
+				if(!this.$util.isEmpty(ele.big) && ele.big <= 0){
+					uni.showToast({title:'数量填写有误',icon:'none'})
+					hasError = true;
+					return;
+				}
+				if(!this.$util.isEmpty(ele.small) && ele.small <= 0){
+					uni.showToast({title:'数量填写有误',icon:'none'})
+					hasError = true
+					return;					
+				}
 			})
-			if(this.refundMoney==''){
+			if(hasError){
+				return
+			}
+			if(this.refundMoney<=0){
 				uni.showToast({title:'退款金额不能小于0',icon:'none'});return;
 			}
 			if(this.$util.isEmpty(product)&&this.refundType==1){
@@ -218,11 +232,11 @@ export default {
 			// this.isMonitor = false
 				this.product.forEach(ele=>{
 					if(Number(ele.big)>Number(ele.bigNum)){
-						uni.showToast({title:'不能大于商品数量',icon:'none'})
+						uni.showToast({title:'不能大于数量',icon:'none'})
 						ele.big = ele.bigNum;
 					}
 					if(Number(ele.small)>Number(ele.smallNum)){
-						uni.showToast({title:'不能大于商品数量',icon:'none'})
+						uni.showToast({title:'不能大于数量',icon:'none'})
 						ele.small = ele.smallNum;
 					}
 				})