Ver Fonte

供货商所有全选input替换成原生input

jiangfeng há 5 anos atrás
pai
commit
edf581d604

+ 5 - 46
ghsApp/src/admin/billing/index.vue

@@ -68,17 +68,8 @@
 				<view class="select-cmd_bx" v-if="customData">
 					<view class="kc"> 库存 {{ customData.stock }} </view>
 					<view class="num_bx">
-						<allMoreSelectInput
-							:isActive="isActive" :isFocus="isFocus" :value="customData.bigCount"
-							:isActiveOne="isActiveOne" :isFocusOne="isFocusOne" :valueOne="customData.smallCount"
-							@deleteInputVal="deleteInputVal" @initAllInput="initAllInput" @moveAllInput="moveAllInput"
-							@deleteInputValOne="deleteInputValOne" @initAllInputOne="initAllInputOne" @moveAllInputOne="moveAllInputOne">
-						</allMoreSelectInput>
-						<!--<allMoreSelectInput :isActive="isActive" :isFocus="isFocus" :value="customData.smallCount"-->
-																										<!--@deleteInputVal="deleteInputVal" @initAllInput="initAllInput" @moveAllInput="moveAllInput">-->
-						<!--</allMoreSelectInput>支-->
-						<!--<input v-model="customData.bigCount" type="number" />扎-->
-						<!--<input v-model="customData.smallCount" type="number" style="margin-left:24upx" />支-->
+						<input v-model="customData.bigCount" @focus="customData.bigCount = null" type="number" />扎
+						<input v-model="customData.smallCount" @focus="customData.smallCount = null" type="number" style="margin-left:24upx" />支
 					</view>
 				</view>
 			</template>
@@ -104,10 +95,6 @@ import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import Commondity from "@/components/module/app-commodity";
 import FooterCart from "@/components/module/app-footer-cart";
 import ModalModule from "@/components/plugin/modal";
-
-import allMoreSelectInput from "@/components/module/allMoreSelectInput";
-import allMoreSelectInputMins from "@/mixins/allMoreSelectInput";
-
 import { COMMODITY_TYPE } from "@/utils/declare";
 import productMins from "@/mixins/product";
 export default {
@@ -118,9 +105,9 @@ export default {
 		AppWrapperEmpty,
 		Commondity,
 		ModalModule,
-		FooterCart,allMoreSelectInput
+		FooterCart,
 	},
-	mixins: [productMins,allMoreSelectInputMins],
+	mixins: [productMins],
 	data() {
 		return {
 			COMMODITY_TYPE,
@@ -153,49 +140,21 @@ export default {
 		customNum(info) {
 			this.isModel = true;
 			this.customData = info;
-			this.$nextTick(()=>{
-				this.initAllInput();
-			})
 		},
 		modalCancel() {
 			this.isModel = false;
 			this.customData = {};
 		}, // 取消 确认
 		affirm(val) {
-			this.isFocus = false;
-			this.isFocusOne = false;
-			this.$nextTick(()=>{
 				if(this.customData.bigCount==0 && this.customData.smallCount==0){
 					this.delAllEvent(this.customData)}
 				if (val.index === 0) {
 					this.modalCancel();
 				} else {
-					const {
-						bigCount,
-						smallCount,
-						bigNum,
-						bigUnit,
-						smallNum,
-						smallUnit,
-						ratio
-					} = this.customData;
-					const ratioNum = Number(ratio);
 					this.updateItemEvent(this.customData);
 					this.modalCancel();
-					//超过库存时 设置为库存最大值 1
-					// 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() {

+ 8 - 8
ghsApp/src/mixins/product.js

@@ -229,10 +229,10 @@ export default {
 		 */
 		getSelectItemById(id, classId) {
 			let info = {
-				bigCount: 0, //扎数
-				smallCount: 0, //支数
-				autoPrice: 0, //调价价格
-				itemPrice: 0 //调价价格
+				bigCount: null, //扎数
+				smallCount: null, //支数
+				autoPrice: null, //调价价格
+				itemPrice: null //调价价格
 			};
 			const item =
 				this.selectList &&
@@ -393,10 +393,10 @@ export default {
 
 				let params = {
 					...info,
-					bigCount: 0, //扎数
-					smallCount: 0, //支数
-					autoPrice: 0, //调价价格
-					realityWeight: 0 //调价价格
+					bigCount: null, //扎数
+					smallCount: null, //支数
+					autoPrice: null, //调价价格
+					realityWeight: null //调价价格
 				};
 				list.push(params);
 				console.log(list)

+ 45 - 39
ghsApp/src/pagesPurchase/add.vue

@@ -69,10 +69,12 @@
 					<view class="select-cmd_bx">
 						<view class="num_bx">
 							<view class="kc">总价</view>
-							<allSelectInput :isActive="isAloneAllActive" :isFocus="isAloneAllFocus" :value="customData.itemPrice" :placeholder="'采购金额'"
-																							:width="416" :height="80" :fontSize="40"
-																							@deleteInputVal="deleteAloneInputVal" @initAllInput="initAloneAllInput" @moveAllInput="moveAloneAllInput">
-							</allSelectInput> <text style="margin-left: 20rpx">元</text>
+							<input v-model="customData.itemPrice" @focus="customData.itemPrice = null" type="number" placeholder="采购金额" />
+							<!--<allSelectInput :isActive="isAloneAllActive" :isFocus="isAloneAllFocus" :value="customData.itemPrice" :placeholder="'采购金额'"-->
+																							<!--:width="416" :height="80" :fontSize="40"-->
+																							<!--@deleteInputVal="deleteAloneInputVal" @initAllInput="initAloneAllInput" @moveAllInput="moveAloneAllInput">-->
+							<!--</allSelectInput> -->
+							<text style="margin-left: 20rpx">元</text>
 						</view>
 					</view>
 					<view class="select-cmd_bx">
@@ -80,23 +82,24 @@
 							<view class="kc">
 								数量
 							</view>
-							<allMoreSelectInput
-								:isActive="isActive" :isFocus="isFocus" :value="customData.bigCount"
-								:isActiveOne="isActiveOne" :isFocusOne="isFocusOne" :valueOne="customData.smallCount"
-								@deleteInputVal="deleteInputVal" @initAllInput="initAllInput" @moveAllInput="moveAllInput"
-								@deleteInputValOne="deleteInputValOne" @initAllInputOne="initAllInputOne" @moveAllInputOne="moveAllInputOne">
-							</allMoreSelectInput>
-							<!--<input v-model="customData.bigCount" type="number" focus />扎-->
-							<!--<input v-model="customData.smallCount" type="number" style="margin-left:24upx"/>支-->
+							<!--<allMoreSelectInput-->
+								<!--:isActive="isActive" :isFocus="isFocus" :value="customData.bigCount"-->
+								<!--:isActiveOne="isActiveOne" :isFocusOne="isFocusOne" :valueOne="customData.smallCount"-->
+								<!--@deleteInputVal="deleteInputVal" @initAllInput="initAllInput" @moveAllInput="moveAllInput"-->
+								<!--@deleteInputValOne="deleteInputValOne" @initAllInputOne="initAllInputOne" @moveAllInputOne="moveAllInputOne">-->
+							<!--</allMoreSelectInput>-->
+							<input v-model="customData.bigCount" @input="countWeight" @focus="customData.bigCount = null" type="number"  />扎
+							<input v-model="customData.smallCount" @input="countWeight" @focus="customData.smallCount = null" type="number" style="margin-left:24upx"/>支
 						</view>
 					</view>
 					<view class="select-cmd_bx">
 						<view class="num_bx">
 							<view class="kc">重量</view>
-							<allSelectInput :isActive="isWeightActive" :isFocus="isWeightFocus" :value="customData.realityWeight" :placeholder="'公斤'"
-																							:width="416" :height="80" :fontSize="40"
-																							@deleteInputVal="deleteWeightInputVal" @initAllInput="initWeightAllInput" @moveAllInput="moveWeightAllInput">
-							</allSelectInput>
+							<input v-model="customData.realityWeight" @focus="customData.realityWeight = null" type="number" placeholder="公斤" />
+							<!--<allSelectInput :isActive="isWeightActive" :isFocus="isWeightFocus" :value="customData.realityWeight" :placeholder="'公斤'"-->
+																							<!--:width="416" :height="80" :fontSize="40"-->
+																							<!--@deleteInputVal="deleteWeightInputVal" @initAllInput="initWeightAllInput" @moveAllInput="moveWeightAllInput">-->
+							<!--</allSelectInput>-->
 						</view>
 					</view>
 				</view>
@@ -125,11 +128,11 @@ import ModalModule from "@/components/plugin/modal";
 import FooterCart from "@/components/module/app-footer-cart";
 import productMins from "@/mixins/product";
 
-import allMoreSelectInput from "@/components/module/allMoreSelectInput";
-import allMoreSelectInputMins from "@/mixins/allMoreSelectInput";
+// import allMoreSelectInput from "@/components/module/allMoreSelectInput";
+// import allMoreSelectInputMins from "@/mixins/allMoreSelectInput";
 
-import allSelectInput from "@/components/module/allSelectInput";
-import allSelectInputMins from "@/mixins/allSelectInput";
+// import allSelectInput from "@/components/module/allSelectInput";
+// import allSelectInputMins from "@/mixins/allSelectInput";
 export default {
 	name: "purchase", // 采购
 	components: {
@@ -138,9 +141,9 @@ export default {
 		AppWrapperEmpty,
 		CommodityPurchase,
 		ModalModule,
-		FooterCart,allMoreSelectInput,allSelectInput
+		FooterCart
 	},
-	mixins: [productMins,allMoreSelectInputMins,allSelectInputMins],
+	mixins: [productMins],
 	data() {
 		return {
 			pageType: "purchase",
@@ -154,16 +157,24 @@ export default {
 			isModel: false,
 			showSubmitModel: false,
 			customData: {
-				bigCount: 0,
-				smallCount: 0,
-				itemPrice: 0,
-				weight:0,
-				realityWeight:0,
+				bigCount: null,
+				smallCount: null,
+				itemPrice: null,
+				weight:null,
+				realityWeight:null,
 			}
 		};
 	},
 	onLoad() {},
 	methods: {
+		// 计算重量
+		countWeight(){
+			let ratio = this.customData.ratio;
+			let smallCount = this.customData.smallCount;
+			let bigCount = this.customData.bigCount;
+			let weight = this.customData.weight;
+			this.customData.realityWeight = (smallCount * weight / ratio + bigCount * weight).toFixed(2)
+		},
 		// 离开全选input alone
 		moveAloneAllInput(e){
 			this.isAloneAllActive=false;
@@ -193,22 +204,17 @@ export default {
 			this.isModel = true;
 			console.log(info,'customData')
 			this.customData = info;
-			this.$nextTick(()=>{
-				// this.initAllInput();
-				this.initAloneAllInput();
-			})
+			// this.$nextTick(()=>{
+			// 	// this.initAllInput();
+			// 	this.initAloneAllInput();
+			// })
 		},
 		modalCancel() {
 			this.isModel = false;
 			this.customData = {};
 		}, // 取消 确认
 		affirm(val) {
-			// this.moveAllInput();
-			// this.moveAllInputOne();
-			this.isFocus = false;
-			this.isFocusOne = false;
-			this.isAloneAllActive=false;
-			this.isAloneAllFocus=false;
+
 			this.$nextTick(()=>{
 				console.log('customData',this.customData);
 				console.log('val.index',val.index);
@@ -223,11 +229,11 @@ export default {
 				if (val.index === 0) {
 					this.modalCancel();
 				} else {
-					if(this.customData.itemPrice==0||this.customData.itemPrice==''){
+					if(this.customData.itemPrice==''){
 						uni.showToast({title:"请输入总价格",icon:"none"})
 						return;
 					}
-					if(this.customData.bigCount==0&&this.customData.smallCount==0){
+					if(this.customData.bigCount==''&&this.customData.smallCount==''){
 						uni.showToast({title:"请输入花材数量",icon:"none"})
 						return;
 					}

+ 5 - 5
ghsApp/src/pagesPurchase/components/CommodityPurchase.vue

@@ -78,22 +78,22 @@ export default {
     },
     bigCount: {
       type: Number,
-      default: 0
+      default: null
     },
     smallCount: {
       type: Number,
-      default: 0
+      default: null
     },
     autoPrice: {
       type: Number,
-      default: 0
+      default: null
     },
     itemPrice: {
       type: Number,
-      default: 0
+      default: null
     },realityWeight: {
       type: Number,
-      default: 0
+      default: null
     },
   },
   data () {

+ 2 - 5
ghsApp/src/pagesPurchase/details.vue

@@ -392,11 +392,8 @@ export default {
 			}
 		},
 		gobackEvent() {
-			uni.navigateTo({
-				url: "/pagesPurchase/add",
-				success: result => {},
-				fail: () => {},
-				complete: () => {}
+			uni.navigateBack({
+				delta: 1,
 			});
 		}
 	}

+ 8 - 8
ghsApp/src/pagesStorehouse/allot/exSelect.vue

@@ -90,14 +90,14 @@
 				<view class="select-cmd_bx" v-if="customData">
 					<view class="kc"> 库存{{ customData.stock }} </view>
 					<view class="num_bx">
-						<allMoreSelectInput
-							:isActive="isActive" :isFocus="isFocus" :value="customData.bigCount"
-							:isActiveOne="isActiveOne" :isFocusOne="isFocusOne" :valueOne="customData.smallCount"
-							@deleteInputVal="deleteInputVal" @initAllInput="initAllInput" @moveAllInput="moveAllInput"
-							@deleteInputValOne="deleteInputValOne" @initAllInputOne="initAllInputOne" @moveAllInputOne="moveAllInputOne">
-						</allMoreSelectInput>
-						<!--<input v-model="customData.bigCount" type="number" />扎-->
-						<!--<input v-model="customData.smallCount" type="number" style="margin-left:24upx"/>支-->
+						<!--<allMoreSelectInput-->
+							<!--:isActive="isActive" :isFocus="isFocus" :value="customData.bigCount"-->
+							<!--:isActiveOne="isActiveOne" :isFocusOne="isFocusOne" :valueOne="customData.smallCount"-->
+							<!--@deleteInputVal="deleteInputVal" @initAllInput="initAllInput" @moveAllInput="moveAllInput"-->
+							<!--@deleteInputValOne="deleteInputValOne" @initAllInputOne="initAllInputOne" @moveAllInputOne="moveAllInputOne">-->
+						<!--</allMoreSelectInput>-->
+						<input v-model="customData.bigCount" @focus="customData.bigCount = null" type="number" />扎
+						<input v-model="customData.smallCount" @focus="customData.smallCount = null" type="number" style="margin-left:24upx"/>支
 					</view>
 				</view>
 			</template>

+ 11 - 11
ghsApp/src/pagesStorehouse/inventory/select.vue

@@ -88,14 +88,14 @@
 				<view class="select-cmd_bx" v-if="customData">
 					<view class="kc"> 库存{{ customData.stock }} </view>
 					<view class="num_bx">
-						<allMoreSelectInput
-							:isActive="isActive" :isFocus="isFocus" :value="customData.bigCount"
-							:isActiveOne="isActiveOne" :isFocusOne="isFocusOne" :valueOne="customData.smallCount"
-							@deleteInputVal="deleteInputVal" @initAllInput="initAllInput" @moveAllInput="moveAllInput"
-							@deleteInputValOne="deleteInputValOne" @initAllInputOne="initAllInputOne" @moveAllInputOne="moveAllInputOne">
-						</allMoreSelectInput>
-<!--						<input v-model="customData.bigCount" type="number" />扎-->
-<!--						<input v-model="customData.smallCount" type="number" style="margin-left:24upx"/>支-->
+						<!--<allMoreSelectInput-->
+							<!--:isActive="isActive" :isFocus="isFocus" :value="customData.bigCount"-->
+							<!--:isActiveOne="isActiveOne" :isFocusOne="isFocusOne" :valueOne="customData.smallCount"-->
+							<!--@deleteInputVal="deleteInputVal" @initAllInput="initAllInput" @moveAllInput="moveAllInput"-->
+							<!--@deleteInputValOne="deleteInputValOne" @initAllInputOne="initAllInputOne" @moveAllInputOne="moveAllInputOne">-->
+						<!--</allMoreSelectInput>-->
+						<input v-model="customData.bigCount" @focus="customData.bigCount = null" type="number" />扎
+						<input v-model="customData.smallCount" @focus="customData.smallCount = null" type="number" style="margin-left:24upx"/>支
 					</view>
 				</view>
 			</template>
@@ -180,9 +180,9 @@ export default {
 		customNum(info) {
 			this.isModel = true;
 			this.customData = info;
-			this.$nextTick(()=>{
-				this.initAllInput();
-			})
+			// this.$nextTick(()=>{
+			// 	this.initAllInput();
+			// })
 		},
 		modalCancel() {
 			this.isModel = false;