shish 5 ani în urmă
părinte
comite
1ca74efbe0

+ 3 - 46
ghsApp/src/mixins/product.js

@@ -18,7 +18,6 @@ export default {
 			//id动态切换
 			scroll_into_view:"",
 			timeFun:"",
-
 		};
 	},
 	onLoad(options) {
@@ -26,8 +25,6 @@ export default {
 		if (pageType) {
 			this.pageType = pageType;
 		}
-
-
 	},
 	onShow(){
 		if (this.autoLoad) {
@@ -62,7 +59,6 @@ export default {
 					}
 				}
 			}
-
 			return Math.round(price * 100) / 100;
 		},
 		allPrice() {
@@ -81,7 +77,6 @@ export default {
 					}
 				}
 			}
-
 			return Math.round(price * 100) / 100;
 		},
 		//选择商品总数
@@ -96,9 +91,7 @@ export default {
 			}
 			return {bigLength:bigLength,smallLength:smallLength,};
 		},
-		/**
-		 * 当前选中商品列表中是否有没有库存的商品
-		 */
+		//当前选中商品列表中是否有没有库存的商品
 		hasNoStock() {
 			let has = false;
 			if (this.selectList) {
@@ -155,57 +148,22 @@ export default {
 				this.scroll_into_view = 'class_0';
 				this.scrollPushList();
 				console.log('this.filterProductInfo',this.filterProductInfo)
-			} catch (error) {
-			} finally {
+			} catch (error) {} finally {
 				uni.hideLoading();
 			}
 		},
-		/**
-			* 滚动或切换分类 获取更多数据
-			* **/
+		//滚动或切换分类 获取更多数据
 		scrollPushList(){
 			let list = copyObject(this.productInfo);
 			let classList = [];
 			for (let i=0;i<list.length;i++){
 				if(i<2){
-
 					classList.push({...list[i],isActive:true});
 				}else{
 					classList.push({...list[i],isActive:false});
 				}
 			}
 			this.filterProductInfo = classList
-			return
-			if(this.$util.isEmpty(this.filterProductInfo)){	//第一次进入无数据
-				let classList = [];
-				list.forEach(ele=>{
-					classList = [...classList,{child:[],classId:ele.classId,className:ele.className}]
-				})
-				classList[this.classIndex].child = list[this.classIndex].child;
-				this.filterProductInfo = classList;
-				let classIndex = 1;
-				this.timeFun = setInterval(()=>{
-					if(classIndex<this.filterProductInfo.length){
-						classList[classIndex].child = list[classIndex].child;
-						this.filterProductInfo = classList;
-						classIndex++
-					}else{
-						clearInterval(this.timeFun)
-					}
-				},600)
-			}else{//获取更多数据
-				if(this.$util.isEmpty(this.filterProductInfo[this.classIndex].child)){
-					this.filterProductInfo[this.classIndex].child = list[this.classIndex].child;
-				}
-				if(this.classIndex+1<this.filterProductInfo.length-1){
-					if(this.$util.isEmpty(this.filterProductInfo[this.classIndex+1].child)){
-						this.filterProductInfo[this.classIndex+1].child = list[this.classIndex+1].child;
-					}
-				}
-			}
-
-
-
 		},
 		/**
 		 * 通过id获取当前选中的该商品信息
@@ -416,7 +374,6 @@ export default {
 				this.$nextTick(()=>{
 					this.customNum(params1)
 				})
-				// this.$forceUpdate();
 		},
 		/**
 		 * 减去商品

+ 9 - 26
ghsApp/src/pagesPurchase/add.vue

@@ -17,11 +17,12 @@
 					</text>
 				</div>
 			</scroll-view>
-<!--			<scroll-view scroll-y class="right-box" :scroll-into-view="scrollClassId">-->
-			<scroll-view scroll-y class="right-box" :scroll-into-view="scroll_into_view" scroll-with-animation="true"
-																@scroll="scroll_detail"
-																lower-threshold="100"
-																@scrolltolower="scroll_bottom">
+			<scroll-view scroll-y class="right-box" 
+					:scroll-into-view="scroll_into_view" 
+					scroll-with-animation="true"
+					@scroll="scroll_detail"
+					lower-threshold="100"
+					@scrolltolower="scroll_bottom">
 				<!--内容部分 start -->
 				<block v-if="!$util.isEmpty(filterProductInfo)">
 					<view class="item_list_bx selectAll" v-for="(classItem, classIndex) in filterProductInfo" :key="classIndex" :id="`class_${classIndex}`">
@@ -56,7 +57,7 @@
 				<!--内容部分 end -->
 			</scroll-view>
 		</view>
-		<!-- :maskClosable="false" -->
+
 		<modal-module
 			:show="isModel"
 			@cancel="modalCancel"
@@ -93,16 +94,6 @@
 				</view>
 			</template>
 		</modal-module>
-		<!-- <modal-module
-			:show="showSubmitModel"
-			@cancel="cancelEvent"
-			@click="submitEvent"
-			title="有花材库存不足,确认下一步?"
-			color="#333"
-			:size="32"
-			padding="30rpx 30rpx"
-		>
-		</modal-module> -->
 		<FooterCart :price="allPriceFun" :count="allCount" @confirm="confirmSelectEvent"></FooterCart>
 	</view>
 </template>
@@ -116,11 +107,6 @@ import ModalModule from "@/components/plugin/modal";
 import FooterCart from "@/components/module/app-footer-cart";
 import productMins from "@/mixins/product";
 import { mapGetters } from "vuex";
-// import allMoreSelectInput from "@/components/module/allMoreSelectInput";
-// import allMoreSelectInputMins from "@/mixins/allMoreSelectInput";
-
-// import allSelectInput from "@/components/module/allSelectInput";
-// import allSelectInputMins from "@/mixins/allSelectInput";
 export default {
 	name: "purchase", // 采购
 	components: {
@@ -213,15 +199,12 @@ export default {
 				this.customData.bigCount = 	this.customData.bigCount==0?null:this.customData.bigCount;
 				this.isFocus = true;
 			})
-			// this.$nextTick(()=>{
-			// 	// this.initAllInput();
-			// 	this.initAloneAllInput();
-			// })
 		},
 		modalCancel() {
 			this.isModel = false;
 			this.customData = {};
-		}, // 取消 确认
+		},
+		// 取消 确认
 		affirm(val) {
 
 			this.$nextTick(()=>{

+ 3 - 52
ghsApp/src/pagesStorehouse/allot/exSelect.vue

@@ -7,7 +7,6 @@
 				@input="searchFn"
 			/>
 		</view>
-<!--		<app-tabs :tabs="tabs" :currentTab="tabIndex" @change="change" itemWidth="50%"/>-->
 		<view class="scroll-middle_bx">
 			<scroll-view scroll-y scroll-with-animation class="tab-view" :scroll-top="scrollTop">
 				<div v-for="(item, index) in filterProductInfo" :key="index" class="tab-bar-item" :class="[classIndex == index ? 'active' : '']" :data-current="index" @tap.stop="swichClass(index)">
@@ -21,20 +20,12 @@
 					</text>
 				</div>
 				<view style="height: 120rpx"></view>
-				<!-- <view class="switchover-unit" @tap="isSmallCount = !isSmallCount">{{isSmallCount?'支':'扎'}}</view> -->
 			</scroll-view>
 
-<!--			<scroll-view-->
-<!--				scroll-y-->
-<!--				class="right-box"-->
-<!--				v-if="tabIndex == 0"-->
-<!--				:scroll-into-view="scrollClassId"-->
-<!--			>-->
 				<scroll-view scroll-y class="right-box" v-if="tabIndex == 0" :scroll-into-view="scroll_into_view" scroll-with-animation="true"
 																	@scroll="scroll_detail"
 																	lower-threshold="100"
 																	@scrolltolower="scroll_bottom">
-				<!--内容部分 start -->
 				<block v-if="!$util.isEmpty(filterProductInfo)">
 					<view class="item_list_bx selectAll" v-for="(classItem, classIndex) in filterProductInfo" :key="classIndex" :id="`class_${classIndex}`">
 						<view class="item_list_title">
@@ -58,20 +49,13 @@
 								@del="delEvent"
 							></Commondity>
 							</view>
-							<!-- <Commondity
-							:type="COMMODITY_TYPE.CHANGE"
-							@customNum="customNum"
-						></Commondity> -->
 						</template>
 					</view>
 				</block>
 				<block v-else>
-					<app-wrapper-empty
-						title="暂无数据"
-						:is-empty="$util.isEmpty(filterProductInfo)"
-					/>
+					<app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(filterProductInfo)" />
 				</block>
-				<!--内容部分 end -->
+
 			</scroll-view>
 			<block v-else>
 				<view style="width:100%">
@@ -79,7 +63,6 @@
 				</view>
 			</block>
 		</view>
-		<!-- :maskClosable="false" -->
 		<modal-module
 			:show="isModel"
 			@cancel="modalCancel"
@@ -93,12 +76,6 @@
 				<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" :focus="isFocus" type="number" />扎
 						<input v-model="customData.smallCount"  type="number" style="margin-left:24upx"/>支
 					</view>
@@ -157,9 +134,6 @@ export default {
 				{
 					name: "成品"
 				}
-				// {
-				//     name: '课程'
-				// },
 			],
 			isFocus: false,
 			isModel: false,
@@ -181,7 +155,6 @@ export default {
 			return content;
 		}
 	},
-
 	methods: {
 		//自定义数量
 		customNum(info) {
@@ -234,27 +207,6 @@ export default {
 
 				this.updateItemEvent(this.customData);
 				this.modalCancel();
-				// 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 = 0;
-				// 	this.customData.smallCount = 0;
-				// 	this.delAllEvent(this.customData)
-				// } else {
-				// 	this.updateItemEvent(this.customData);
-				// 	this.modalCancel();
-				// }
 			})
 
 		},
@@ -274,8 +226,7 @@ export default {
 				this.cancelEvent();
 			}
 		},
-
-
+		//确认选好了
 		confirmSelectEvent() {
 			if (this.selectList.length > 0) {