Răsfoiți Sursa

Merge branch 'master' of http://git.huaml.com/zhh/front-end

wangn 5 ani în urmă
părinte
comite
09e10e98a5
1 a modificat fișierele cu 24 adăugiri și 18 ștergeri
  1. 24 18
      ghsApp/src/components/module/app-commodity.vue

+ 24 - 18
ghsApp/src/components/module/app-commodity.vue

@@ -72,6 +72,7 @@ export default {
 			COMMODITY_TYPE,
 			// isAllActive: false,
 			// isAllFocus: false,
+			isAlterMoney:false,
 			isAloneAllActive: false,
 			isAloneAllFocus: false,
 
@@ -98,8 +99,26 @@ export default {
 		moveAllInput(e){
 			this.isAloneAllActive=false;
 			this.isAloneAllFocus=false;
-			if(e==''){return}
-			this.changeAutoPrice = e;
+			// if(e==''){return}
+			this.changeAutoPrice = e?e:0;
+			if(this.isAlterMoney){
+				this.isAlterMoney = false;
+				// let self = this
+				changePriceByIdApi({
+					productId: this.info.id,
+					price: this.changeAutoPrice
+				}).then(res => {
+					if(res.code == 1){
+						this.showPrice = res.data.price
+						this.isShowSucceed = true
+						setTimeout(()=>{
+							this.isShowSucceed = false
+						},1000)
+					}else{
+						this.$msg(res.msg)
+					}
+				})
+			}
 		},
 		addEvents() {
 			this.animationFun('add');
@@ -115,23 +134,10 @@ export default {
 			this.animationFun('del');
 			this.$emit("del", this.info);
 		},
-		async changePriceEvent(event) {
+		changePriceEvent(event) {
 			this.isFocus = false;
-			let self = this
-			await changePriceByIdApi({
-				productId: this.info.id,
-				price: this.changeAutoPrice
-			}).then(res => {
-				if(res.code == 1){
-					this.showPrice = res.data.price
-					this.isShowSucceed = true
-					setTimeout(()=>{
-						this.isShowSucceed = false
-					},1000)
-				}else{
-					self.$msg(res.msg)
-				}
-			})
+			this.isAlterMoney = true;
+
 		},
 		customNum() {
 			// if(!this.info.bigCount){