jf 5 lat temu
rodzic
commit
267c81b9e0

+ 29 - 26
ghsApp/src/admin/billing/index.vue

@@ -182,34 +182,37 @@ export default {
 		affirm(val) {
 			this.isFocus = false;
 			this.isFocusOne = false;
-			if (val.index === 0) {
-				this.modalCancel();
-			} else {
-				console.log(this.customData)
-				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 {
+					console.log(this.customData)
+					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;

+ 5 - 2
ghsApp/src/components/module/app-commodity.vue

@@ -18,7 +18,7 @@
 					<i class="iconfont iconzeng" :class="addAnimationData?'animation':''" @click="addEvents"></i>
 				</view>
 				<view class="open-bx" v-else-if="type == COMMODITY_TYPE.CHANGE">
-					<allSelectInput :isActive="isActive" :isFocus="isFocus" :value="changeAutoPrice"
+					<allSelectInput :isActive="isAllActive" :isFocus="isAllFocus" :value="changeAutoPrice"
 						@deleteInputVal="deleteInputVal" @initAllInput="initAllInput" @moveAllInput="moveAllInput">
 					</allSelectInput>
 					<!--<input class="change-input" v-model="changeAutoPrice" type="digit" placeholder="自动调价"  selection-start="0" selection-end="1" />-->
@@ -33,10 +33,11 @@
 <script>
 import { COMMODITY_TYPE } from "@/utils/declare";
 import AppImg from "@/components/app-img";
-import allSelectInput from "@/components/module/allSelectInput";
 import { autoPriceByIdApi, changePriceByIdApi } from '@/api/product/index'
 import productMins from "@/mixins/productContrapose";
 import animationMins from "@/mixins/animation";
+
+import allSelectInput from "@/components/module/allSelectInput";
 import allSelectInputMins from "@/mixins/allSelectInput";
 export default {
 	name: "Commodity",
@@ -69,6 +70,8 @@ export default {
 	data() {
 		return {
 			COMMODITY_TYPE,
+			isAllActive: false,
+			isAllFocus: false,
 			isShowSucceed:false,
 			changeAutoPrice:'',
 			showPrice:0.00,

+ 7 - 8
ghsApp/src/mixins/allSelectInput.js

@@ -1,28 +1,27 @@
 export default {
 	data() {
 		return {
-			isActive: false,
-			isFocus: false,
+
 		};
 	},
 
 	methods: {
-		// 离开全选input
+		// 离开全选input alone
 		moveAllInput(e){
-			this.isActive=false;
-			this.isFocus=false;
+			this.isAllActive=false;
+			this.isAllFocus=false;
 			if(e==''){return}
 			this.changeAutoPrice = e;
 		},
 		//input点击删除按键
 		deleteInputVal(){
-			this.isActive=false;
+			this.isAllActive=false;
 			this.changeAutoPrice = '';
 		},
 		// 选中input
 		initAllInput(){
-			this.isActive=true;
-			this.isFocus=true;
+			this.isAllActive=true;
+			this.isAllFocus=true;
 		},
 	}
 };