Эх сурвалжийг харах

供货商、零售端开单扎和支单位切换

jf 5 жил өмнө
parent
commit
82e51cc1e5

+ 19 - 5
ghsApp/src/App.vue

@@ -97,10 +97,24 @@ export default {
 	page {
 		height: 100%;
 	}
-	.animation{animation:imgmove 0.3s 1;animation-iteration-count:1}
-	@-webkit-keyframes imgmove{
-		0%{transform: scale(0.7);}
-		//50%{transform: scale(1);}
-		100%{transform: scale(1);}
+	/**开单-扎和支切换样式**/
+	.switchover-unit{
+		position: fixed;
+		left: calc(170rpx / 2 - 50rpx);
+		bottom: 140rpx;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		width: 100rpx;
+		height: 100rpx;
+		color: #FFFFFF;
+		background: #4b8cf4;
+		border-radius: 50%;
+		font-size: 42rpx;
+		font-weight: 700;
+		z-index: 2;
 	}
+	/**开单-增加减少动画**/
+	.animation{animation:imgmove 0.3s 1;animation-iteration-count:1}
+	@-webkit-keyframes imgmove{0%{transform: scale(0.7);}100%{transform: scale(1);}}
 </style>

+ 0 - 16
ghsApp/src/admin/billing/index.vue

@@ -293,22 +293,6 @@ export default {
 			height: 100%;
 			left: 0;
 		}
-		.switchover-unit{
-			position: fixed;
-			left: calc(170rpx / 2 - 50rpx);
-			bottom: 140rpx;
-			display: flex;
-			align-items: center;
-			justify-content: center;
-			width: 100rpx;
-			height: 100rpx;
-			color: #FFFFFF;
-			background: #4b8cf4;
-			border-radius: 50%;
-			font-size: 42rpx;
-			font-weight: 700;
-			z-index: 2;
-		}
 	}
 	.right-box {
 		height: 100%;

+ 10 - 41
ghsApp/src/pagesStorehouse/allot/exSelect.vue

@@ -7,51 +7,21 @@
 				@search="searchFn"
 			/>
 		</view>
-		<app-tabs
-			:tabs="tabs"
-			:currentTab="tabIndex"
-			@change="change"
-			itemWidth="50%"
-		/>
+		<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"
-				>
+			<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">
 					<text>{{ item.className || "" }}</text>
-					<text
-						class="tag"
-						v-if="
-							getSelectClassById(item.classId).bigCount > 0 ||
-								getSelectClassById(item.classId).smallCount > 0
-						"
-					>
-						<text
-							v-if="
-								getSelectClassById(item.classId).bigCount > 0 ||
-									getSelectClassById(item.classId).smallCount > 0
-							"
-						>
+					<text class="tag" v-if=" getSelectClassById(item.classId).bigCount > 0 || getSelectClassById(item.classId).smallCount > 0">
+						<text v-if="getSelectClassById(item.classId).bigCount > 0 || getSelectClassById(item.classId).smallCount > 0">
 							{{ `${getSelectClassById(item.classId).bigCount}` }}
 						</text>
-						<text v-if="getSelectClassById(item.classId).smallCount > 0">
-							/
-						</text>
-						<text v-if="getSelectClassById(item.classId).smallCount > 0">{{
-							getSelectClassById(item.classId).smallCount
-						}}</text>
+						<text v-if="getSelectClassById(item.classId).smallCount > 0">/</text>
+						<text v-if="getSelectClassById(item.classId).smallCount > 0">{{getSelectClassById(item.classId).smallCount}}</text>
 					</text>
 				</div>
+				<view style="height: 240rpx"></view>
+				<view class="switchover-unit" @tap="isSmallCount = !isSmallCount">{{isSmallCount?'支':'扎'}}</view>
 			</scroll-view>
 
 			<scroll-view
@@ -190,6 +160,7 @@ export default {
 				// },
 			],
 			isModel: false,
+			isSmallCount:false,//是否是小单位(支)
 			customData: {
 				bigCount: 0,
 				smallCount: 0
@@ -345,14 +316,12 @@ export default {
         margin-bottom: 110upx;
       }
 		}
-
 		.active {
 			position: relative;
 			color: $mainColor;
 			font-size: 26px;
 			background: #fff;
 		}
-
 		.active::before {
 			content: "";
 			position: absolute;

+ 10 - 35
ghsApp/src/pagesStorehouse/inventory/select.vue

@@ -14,44 +14,20 @@
 <!--			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"
-				>
+			<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" >
 					<text>{{ item.className || "" }}</text>
-					<text
-						class="tag"
-						v-if="
-							getSelectClassById(item.classId).bigCount > 0 ||
-								getSelectClassById(item.classId).smallCount > 0
-						"
-					>
-						<text
-							v-if="
-								getSelectClassById(item.classId).bigCount > 0 ||
-									getSelectClassById(item.classId).smallCount > 0
-							"
-						>
+					<text class="tag"
+						v-if=" getSelectClassById(item.classId).bigCount > 0 || getSelectClassById(item.classId).smallCount > 0">
+						<text v-if="getSelectClassById(item.classId).bigCount > 0 || getSelectClassById(item.classId).smallCount > 0">
 							{{ `${getSelectClassById(item.classId).bigCount}` }}
 						</text>
-						<text v-if="getSelectClassById(item.classId).smallCount > 0">
-							/
-						</text>
-						<text v-if="getSelectClassById(item.classId).smallCount > 0">{{
-							getSelectClassById(item.classId).smallCount
-						}}</text>
+						<text v-if="getSelectClassById(item.classId).smallCount > 0">/</text>
+						<text v-if="getSelectClassById(item.classId).smallCount > 0">{{getSelectClassById(item.classId).smallCount}}</text>
 					</text>
 				</div>
+				<view style="height: 240rpx"></view>
+				<view class="switchover-unit" @tap="isSmallCount = !isSmallCount">{{isSmallCount?'支':'扎'}}</view>
 			</scroll-view>
 
 			<scroll-view
@@ -174,6 +150,7 @@ export default {
 		return {
 			pageType: "inventory",
 			isLimit: false,
+			isSmallCount:false,//是否是小单位(支)
 			offVerifyRepertory:true,
 			tabIndex: 0,
 			tabs: [
@@ -314,14 +291,12 @@ export default {
         margin-bottom: 110upx;
       }
 		}
-
 		.active {
 			position: relative;
 			color: $mainColor;
 			font-size: 26px;
 			background: #fff;
 		}
-
 		.active::before {
 			content: "";
 			position: absolute;

+ 19 - 12
hdApp/src/App.vue

@@ -104,17 +104,24 @@ export default {
 page {
   height: 100%;
 }
-.animation {
-  animation: imgmove 0.3s 1;
-  animation-iteration-count: 1;
-}
-@-webkit-keyframes imgmove {
-  0% {
-    transform: scale(0.7);
-  }
-  //50%{transform: scale(1);}
-  100% {
-    transform: scale(1);
-  }
+/**开单-扎和支切换样式**/
+.switchover-unit{
+	position: fixed;
+	left: calc(170rpx / 2 - 50rpx);
+	bottom: 140rpx;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	width: 100rpx;
+	height: 100rpx;
+	color: #FFFFFF;
+	background: #4b8cf4;
+	border-radius: 50%;
+	font-size: 42rpx;
+	font-weight: 700;
+	z-index: 2;
 }
+/**开单-增加减少动画**/
+.animation{animation:imgmove 0.3s 1;animation-iteration-count:1}
+@-webkit-keyframes imgmove{0%{transform: scale(0.7);}100%{transform: scale(1);}}
 </style>

+ 4 - 1
hdApp/src/admin/billing/index.vue

@@ -60,6 +60,8 @@
 						<text v-if="getSelectClassById(item.classId).smallCount > 0">{{ getSelectClassById(item.classId).smallCount }}</text>
 					</text>
 				</div>
+				<view style="height: 240rpx"></view>
+				<view class="switchover-unit" @tap="isSmallCount = !isSmallCount">{{isSmallCount?'支':'扎'}}</view>
 			</scroll-view>
 			<scroll-view scroll-y class="right-box" v-if="tabIndex == 1" :scroll-into-view="scrollClassId">
 				<!--内容部分 start -->
@@ -140,7 +142,7 @@
 		>
 		</modal-module>
 		<!--<FooterCart :price="allGoodsPrice" :count="allGoodsCount" @confirm="confirmSelectGoodsEvent" v-if="tabIndex == 0"></FooterCart>-->
-		<FooterCart :price="allGoodsPrice" :count="allGoodsCount" @confirm="confirmSelectGoodsEvent" v-if="tabIndex == 0"></FooterCart>
+		<FooterCart :price="allGoodsPrice" :countNumber="allGoodsCount" @confirm="confirmSelectGoodsEvent" v-if="tabIndex == 0"></FooterCart>
 		<FooterCart :price="allPrice" :count="allCount" @confirm="confirmSelectEvent" v-if="tabIndex == 1"></FooterCart>
 	</view>
 </template>
@@ -179,6 +181,7 @@ export default {
 				{	name: "花材"	},
 				{	name: '培训班'	},
 			],
+			isSmallCount:false,//是否是小单位(支)
 			isModel: false,
 			customData: {
 				bigCount: 0,

+ 10 - 3
hdApp/src/components/module/app-footer-cart.vue

@@ -4,8 +4,11 @@
 			<view class="cart-lf_bx">
 				<view class="cart-dot_bx">
 					<i class="iconfont icongouwuche"></i>
-					<text class="count" v-if="count > 0">
-						{{ count }}
+					<view class="count" v-if="countNumber==0&&count.bigLength>0||countNumber==0&&count.smallLength>0">
+						{{ count.bigLength }}<text v-if="count.smallLength>0">/{{count.smallLength}}</text>
+					</view>
+					<text class="count" v-if="countNumber > 0">
+						{{ countNumber }}
 					</text>
 				</view>
 				<view class="price"> ¥{{ price }} </view>
@@ -25,9 +28,13 @@ export default {
 			type: Number,
 			default: 0
 		},
-		count: {
+		countNumber: {
 			type: Number,
 			default: 0
+		},
+		count: {
+			type: Object,
+			default: {}
 		}
 	},
 	methods: {

+ 33 - 10
hdApp/src/mixins/product.js

@@ -146,8 +146,15 @@ export default {
 		},
 		//选择商品总数
 		allCount() {
-			// console.log(444444, this.selectList);
-			return this.selectList.length;
+			let bigLength = 0;
+			let smallLength = 0;
+			if (this.selectList) {
+				for (const item of this.selectList) {
+					bigLength += item.bigCount
+					smallLength += item.smallCount
+				}
+			}
+			return {bigLength:bigLength,smallLength:smallLength,};
 		},
 		/**
 			* 描点-定位分类
@@ -396,17 +403,32 @@ export default {
 				if (element.id == item.id && element.classId == item.classId) {
 					has = true;
 					if(this.offVerifyRepertory){//盘点页面没有库存验证
-						list[index] = { ...element, bigCount: ++element.bigCount };
+						if(this.isSmallCount){
+							list[index] = { ...element, smallCount: ++element.smallCount };
+						}else{
+							list[index] = { ...element, bigCount: ++element.bigCount };
+						}
+						// list[index] = { ...element, bigCount: ++element.bigCount };
 					}else {
 						if (this.isLimit) {
 							if (element.bigCount < item.bigNum) {
-								list[index] = {...element, bigCount: ++element.bigCount};
+								if(this.isSmallCount){
+									list[index] = { ...element, smallCount: ++element.smallCount };
+								}else{
+									list[index] = { ...element, bigCount: ++element.bigCount };
+								}
+								// list[index] = {...element, bigCount: ++element.bigCount};
 							}
 							//  else if (element.smallCount < item.smallNum) {
 							// 	list[index] = { ...element, smallCount: ++element.smallCount };
 							// }
 						} else {
-							list[index] = {...element, bigCount: ++element.bigCount};
+							if(this.isSmallCount){
+								list[index] = { ...element, smallCount: ++element.smallCount };
+							}else{
+								list[index] = { ...element, bigCount: ++element.bigCount };
+							}
+							// list[index] = {...element, bigCount: ++element.bigCount};
 						}
 						if (this.isLimit) {
 							const {bigCount, smallCount} = list[index];
@@ -441,8 +463,8 @@ export default {
 
 				let params = {
 					...info,
-					bigCount: 1, //扎数
-					smallCount: 0, //支数
+					bigCount: this.isSmallCount?0:1, //扎数
+					smallCount: this.isSmallCount?1:0, //支数
 					autoPrice: 0 //调价价格
 				};
 				if (info.bigNum && info.bigNum > 0) {
@@ -503,9 +525,10 @@ export default {
 					has = true;
 
 					if (element.bigCount > 0) {
-						list[index] = { ...element, bigCount: --element.bigCount };
-					} else if (element.smallCount > 0) {
-						list[index] = { ...element, smallCount: 0 };
+						if(!this.isSmallCount){list[index] = { ...element, bigCount: --element.bigCount };}
+					}
+					if (element.smallCount > 0) {
+						if(this.isSmallCount){list[index] = { ...element, smallCount: --element.smallCount };}
 					}
 
 					if (this.isLimit) {

+ 3 - 0
hdApp/src/pagesPurchase/ghsProduct.vue

@@ -19,6 +19,8 @@
 						<text v-if="getSelectClassById(item.classId).smallCount > 0">{{ getSelectClassById(item.classId).smallCount }}</text>
 					</text>
 				</div>
+				<view style="height: 240rpx"></view>
+				<view class="switchover-unit" @tap="isSmallCount = !isSmallCount">{{isSmallCount?'支':'扎'}}</view>
 			</scroll-view>
 			<scroll-view scroll-y class="right-box" :scroll-into-view="scrollClassId">
 				<!--内容部分 start -->
@@ -139,6 +141,7 @@ export default {
 			offVerifyRepertory:true,//关闭库存验证
 			isGhsProduct:true,//采购进店开单
 			isModel: false,
+			isSmallCount: false,
 			customData: {
 				bigCount: 0,
 				smallCount: 0

+ 11 - 44
hdApp/src/pagesStorehouse/inventory/select.vue

@@ -7,51 +7,21 @@
 				@search="searchFn"
 			/>
 		</view>
-		<app-tabs
-			:tabs="tabs"
-			:currentTab="tabIndex"
-			@change="change"
-			itemWidth="50%"
-		/>
+		<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"
-				>
+			<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">
 					<text>{{ item.className || "" }}</text>
-					<text
-						class="tag"
-						v-if="
-							getSelectClassById(item.classId).bigCount > 0 ||
-								getSelectClassById(item.classId).smallCount > 0
-						"
-					>
-						<text
-							v-if="
-								getSelectClassById(item.classId).bigCount > 0 ||
-									getSelectClassById(item.classId).smallCount > 0
-							"
-						>
+					<text class="tag" v-if="getSelectClassById(item.classId).bigCount > 0 || getSelectClassById(item.classId).smallCount > 0">
+						<text v-if="getSelectClassById(item.classId).bigCount > 0 || getSelectClassById(item.classId).smallCount > 0">
 							{{ `${getSelectClassById(item.classId).bigCount}` }}
 						</text>
-						<text v-if="getSelectClassById(item.classId).smallCount > 0">
-							/
-						</text>
-						<text v-if="getSelectClassById(item.classId).smallCount > 0">{{
-							getSelectClassById(item.classId).smallCount
-						}}</text>
+						<text v-if="getSelectClassById(item.classId).smallCount > 0">/</text>
+						<text v-if="getSelectClassById(item.classId).smallCount > 0">{{getSelectClassById(item.classId).smallCount}}</text>
 					</text>
 				</div>
+				<view style="height: 240rpx"></view>
+				<view class="switchover-unit" @tap="isSmallCount = !isSmallCount">{{isSmallCount?'支':'扎'}}</view>
 			</scroll-view>
 
 			<scroll-view
@@ -136,11 +106,7 @@
 			padding="30rpx 30rpx"
 		>
 		</modal-module>
-		<FooterCart
-			:price="allPrice"
-			:count="allCount"
-			@confirm="confirmSelectEvent"
-		></FooterCart>
+		<FooterCart :price="allPrice" :count="allCount" @confirm="confirmSelectEvent"></FooterCart>
 	</view>
 </template>
 
@@ -167,6 +133,7 @@ export default {
 		return {
 			pageType: "inventory",
 			isLimit: false,
+			isSmallCount: false,
 			tabIndex: 0,
 			tabs: [
 				{