Просмотр исходного кода

出库数量显示错误、库存管理、库存预警、盘点

jf 5 лет назад
Родитель
Сommit
976ad62e40

+ 14 - 11
ghsApp/src/admin/billing/index.vue

@@ -128,6 +128,7 @@ export default {
 		return {
 			COMMODITY_TYPE,
 			isModel: false,
+			offVerifyRepertory:true,
 			customData: {
 				bigCount: 0,
 				smallCount: 0
@@ -181,18 +182,20 @@ export default {
 						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();
-					}
+					// 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();
+					// }
 				}
 			})
 

+ 5 - 5
ghsApp/src/components/module/app-footer-cart.vue

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

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

@@ -89,7 +89,16 @@ 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,};
+			// return this.selectList.length;
 		},
 		/**
 		 * 当前选中商品列表中是否有没有库存的商品
@@ -242,7 +251,7 @@ export default {
 				const element = list[index];
 				if (element.id == item.id && element.classId == item.classId) {
 					has = true;
-					if(this.isPanDian){//盘点页面没有库存验证
+					if(this.offVerifyRepertory){//盘点页面没有库存验证
 						list[index] = { ...element, bigCount: ++element.bigCount };
 					}else{
 						if (this.isLimit) {
@@ -299,7 +308,7 @@ export default {
 				if (info.bigNum && info.bigNum > 0) {
 					list.push(params);
 				} else {
-					if(this.isPanDian){//盘点页面没有库存验证
+					if(this.offVerifyRepertory){//盘点页面没有库存验证
 						list.push(params);
 					}else{
 						this.$msg("库存不足");

+ 10 - 2
ghsApp/src/mixins/productContrapose.js

@@ -89,8 +89,16 @@ 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,};
+			// return this.selectList.length;
 		},
 		/**
 		 * 当前选中商品列表中是否有没有库存的商品

+ 2 - 2
ghsApp/src/pagesStorehouse/allot/allotEx.vue

@@ -22,7 +22,7 @@
 					<view class="info">
             <view class="info-order">{{ item.orderSn }}</view>
 						<view class="info-name">门店:{{ item.adminName }}</view>
-						<view class="info-name">数量:{{ item.smallNum || "-" }}/{{ item.bigNum || "-" }}</view>
+						<view class="info-name">数量:{{ item.bigNum || "-" }}/{{ item.smallNum || "-" }}</view>
             <view class="info-name">时间:{{ item.updateTime }}</view>
 					</view>
 					<view
@@ -49,7 +49,7 @@
 				<AppWrapperEmpty title="暂无记录" :is-empty="$util.isEmpty(list.data)" />
 			</block>
 		</scroll-view>
-		
+
 		<view class="app-footer open_btn">
 			<view @click="addEvent" class="admin-button-com middle blue">新增出库</view>
 		</view>

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

@@ -174,7 +174,7 @@ export default {
 		return {
 			pageType: "inventory",
 			isLimit: false,
-			isPanDian:true,
+			offVerifyRepertory:true,
 			tabIndex: 0,
 			tabs: [
 				{

+ 2 - 2
ghsApp/src/pagesStorehouse/stockWarn/detailed.vue

@@ -27,10 +27,10 @@
 						<t-tr v-for="(item, index) in list.data" :key="index">
 							<t-td v-for="(column, colIndex) in columns" :key="colIndex" :align="column.align" :color="column.color">
 								<view v-if="column.custom == 'change'">
-									{{ `${item.smallNumOrder}/${item.bigNumOrder}` }}
+									{{ `${item.bigNumOrder}/${item.smallNumOrder}` }}
 								</view>
 								<view v-else-if="column.custom == 'stock'">
-									{{ `${item.smallNumStock}/${item.bigNumStock}` }}
+									{{ `${item.bigNumStock}/${item.smallNumStock}` }}
 								</view>
 								<view v-else-if="column.custom == 'time'">
 									<view class="icon-info">

+ 5 - 1
ghsApp/src/pagesStorehouse/stockWarn/manage.vue

@@ -111,10 +111,14 @@ export default {
 			]
 		};
 	},
+	computed:{
+		...mapGetters(["getMyShopInfo"]),
+	},
 	onLoad() {
 		let type = this.tabs[this.tabIndex].key == STOCK_TYPE.WARN ? "waring" : "";
 		// 当前门店
-		this.shopId = this.userInfo.id;
+		// this.shopId = this.userInfo.id;
+		this.shopId = this.getMyShopInfo.id;
 		if(type=="waring"){
 			this.initDataContrapose({ type, shopId: this.shopId });
 		}else{