Browse Source

优化全选input

jf 5 years ago
parent
commit
fe7ac08802
1 changed files with 34 additions and 28 deletions
  1. 34 28
      ghsApp/src/pagesStorehouse/allot/exSelect.vue

+ 34 - 28
ghsApp/src/pagesStorehouse/allot/exSelect.vue

@@ -212,6 +212,9 @@ export default {
 		customNum(info) {
 			this.isModel = true;
 			this.customData = info;
+			this.$nextTick(()=>{
+				this.initAllInput();
+			})
 		},
 		modalCancel() {
 			this.isModel = false;
@@ -220,36 +223,39 @@ export default {
 		affirm(val) {
 			this.isFocus = false;
 			this.isFocusOne = false;
-			if (val.index === 0) {
-				this.modalCancel();
-			} else {
-				const {
-					bigCount,
-					smallCount,
-					bigNum,
-					bigUnit,
-					smallNum,
-					smallUnit,
-					ratio
-				} = this.customData;
-				const ratioNum = Number(ratio);
-
-				//超过库存时 设置为库存最大值
-				if (
-					Number(bigCount) * ratioNum + Number(smallCount) >
-					Number(bigNum) * ratioNum + Number(smallNum)
-				) {
-					uni.showToast({
-						title: `库存只有${bigNum}${bigUnit}${smallNum}${smallUnit}`,
-						icon: "none"
-					});
-					this.customData.bigCount = bigNum;
-					this.customData.smallCount = smallNum;
-				} else {
-					this.updateItemEvent(this.customData);
+			this.$nextTick(()=>{
+				if (val.index === 0) {
 					this.modalCancel();
+				} else {
+					const {
+						bigCount,
+						smallCount,
+						bigNum,
+						bigUnit,
+						smallNum,
+						smallUnit,
+						ratio
+					} = this.customData;
+					const ratioNum = Number(ratio);
+
+					//超过库存时 设置为库存最大值
+					if (
+						Number(bigCount) * ratioNum + Number(smallCount) >
+						Number(bigNum) * ratioNum + Number(smallNum)
+					) {
+						uni.showToast({
+							title: `库存只有${bigNum}${bigUnit}${smallNum}${smallUnit}`,
+							icon: "none"
+						});
+						this.customData.bigCount = bigNum;
+						this.customData.smallCount = smallNum;
+					} else {
+						this.updateItemEvent(this.customData);
+						this.modalCancel();
+					}
 				}
-			}
+			})
+
 		},
 		cancelEvent() {
 			this.showSubmitModel = false;