Browse Source

路上库存

shish 2 years ago
parent
commit
26482520d8

+ 1 - 1
ghsApp/src/admin/item/components/item.vue

@@ -38,7 +38,7 @@
 						剩<text style="font-size:23upx;">{{ info.stock?parseFloat(info.stock):0 }}</text>
 						<text style="margin-left:9upx;font-size:23upx;" v-if="info.onStock>0">路上<text style="font-weight:700;">{{info.onStock}}</text></text>
 						<text style="margin-left:9upx;font-size:23upx;display:inline-block;color:#999;font-weight:normal;">成本{{ info.cost ? parseInt(info.cost) : 0 }}</text>
-						<text style="margin-left:9upx;font-size:23upx;display:inline-block;color:#999;font-weight:normal;">销{{ info.actualSold ? parseInt(info.actualSold) : 0 }}</text>
+						<text style="margin-left:9upx;font-size:23upx;display:inline-block;color:#999;font-weight:normal;">销{{ info.actualSold ? parseInt(info.actualSold) : 0 }}</text>
 						<text style="margin-left:9upx;font-size:23upx;display:inline-block;color:#999;font-weight:normal;">
 							{{info.ratioType == 0 ? info.ratio :'若干'}}支
 						</text>

+ 5 - 0
ghsApp/src/admin/item/list.vue

@@ -96,6 +96,7 @@
 				<view style="width:100vw;margin-top:8upx;"><button @click="preSell()">预售</button></view>
 				<view style="width:100vw;margin-top:8upx;"><button @click="orderRecord()">下单记录</button></view>
 				<view style="width:100vw;margin-top:8upx;"><button @click="copyCreate()">复制新建</button></view>
+				<view style="width:100vw;margin-top:8upx;"><button @click="onStockChange()">路上库存变动</button></view>
 				<view style="width:100vw;margin-top:8upx;"><button @click="sendStock()">分配库存</button></view>
 				<view style="width:100vw;margin-top:8upx;"><button @click="shareItem()">打开分享(批发)</button></view>
 				<view style="width:100vw;margin-top:8upx;"><button @click="getHdPosterFn()">分享海报(批发)</button></view>
@@ -411,6 +412,10 @@ export default {
 				})
 			})
 		},
+		onStockChange(){
+			this.closeRightShow()
+			this.pageTo({url: '/pagesStorehouse/stockWarn/onStockChange?id='+this.currentInfo.id+'&name='+this.currentInfo.name})
+		},
 		priceChange(){
 			this.closeRightShow()
 			this.pageTo({url: '/admin/changePrice/changeList?id='+this.currentInfo.id})

+ 4 - 0
ghsApp/src/api/storehouse/stock.js

@@ -17,6 +17,10 @@ export const clearOutOrder = data => {
 	return https.get("/stock-out/clear", data);
 };
 
+export const getOnStockDetailApi = async data => {
+	return https.get("/on-stock/detail", data);
+};
+
 /** *
  * 库存明细
  */

+ 2 - 1
ghsApp/src/pages.json

@@ -329,7 +329,8 @@
 			"root": "pagesStorehouse/stockWarn/",
 			"pages": [
 				{ "path": "manage", "style": { "navigationBarTitleText": "库存预警" } },
-				{ "path": "detailed", "style": { "navigationBarTitleText": "库存明细", "enablePullDownRefresh": true } }
+				{ "path": "detailed", "style": { "navigationBarTitleText": "库存明细", "enablePullDownRefresh": true } },
+				{ "path": "onStockChange", "style": { "navigationBarTitleText": "路上库存变动明细", "enablePullDownRefresh": true } }
 			]
 		},
 		{

+ 194 - 0
ghsApp/src/pagesStorehouse/stockWarn/onStockChange.vue

@@ -0,0 +1,194 @@
+<template>
+<view class="app-content">
+	<view class="ex-page">
+		<scroll-view scroll-y scroll-with-animation class="main-view">
+			<view class="space-view ex-table">
+				<block v-if="!$util.isEmpty(list.data)">
+					<t-table :headerBackgroundColor="'#F0F2F6'">
+						<view style="position:fixed;width:100%;top:0">
+						<t-tr header>
+							<t-th><view style="width:130upx;color:#333333;font-size:30upx;font-weight:bold;">时间</view></t-th>
+							<t-th><view style="width:120upx;color:#333333;font-size:30upx;font-weight:bold;">名称</view></t-th>
+							<t-th><view style="width:190upx;color:#333333;font-size:30upx;font-weight:bold;">事项</view></t-th>
+							<t-th><view style="color:#333333;font-size:30upx;font-weight:bold;">变动</view></t-th>
+							<t-th><view style="color:#333333;font-size:30upx;font-weight:bold;">剩余</view></t-th>
+						</t-tr>
+						</view>
+						<view style="margin-top:80upx;">
+						<t-tr v-for="(item, index) in list.data" :key="index">
+							<t-td align="center" color="info">
+								<view style="width:130upx;color:#333333;font-size:28upx;" @click="goDetail(item)">
+									<view>{{ item.addTime.substr(5,11) }}</view>
+									<view>{{item.ptStyle==1?'零售':'批发'}}</view>
+								</view>
+							</t-td>
+							<t-td>
+								<view @click="goDetail(item)" 
+								style="width:120upx;color:#333333;font-size:25upx;word-break:break-all;">
+									{{item.relateName}}
+								</view>
+							</t-td>
+							<t-td>
+								<view @click="goDetail(item)" 
+								style="width:190upx;color:#333333;font-size:28upx;word-break:break-all;">
+									{{item.typeName}}
+								</view>
+							</t-td>
+							<t-td>
+								<view style="color:#333333;font-size:30upx;" @click="goDetail(item)">
+									<text v-if="item.io == 1">+</text>
+									<text v-if="item.io == 0">-</text>
+									{{parseFloat(item.itemNum)}}
+								</view>
+							</t-td>
+							<t-td>
+								<view @click="goDetail(item)" style="color:#333333;font-size:30upx;">
+									{{parseFloat(item.newStock)}}
+								</view>
+							</t-td>
+						</t-tr>
+						</view>
+					</t-table>
+				</block>
+				<block v-else>
+					<AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
+				</block>
+			</view>
+		</scroll-view>
+	</view>
+</view>
+</template>
+<script>
+const Month = (new Date().getMonth()+1)<10?'0'+(new Date().getMonth()+1):new Date().getMonth()+1
+const time = `${new Date().getFullYear()}-${Month}-${new Date().getDate()}`;
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import SelectList from "@/components/plugin/selectList";
+import { getOnStockDetailApi } from "@/api/storehouse/stock";
+import { list,selectShop } from "@/mixins";
+import {mapActions, mapGetters} from "vuex";
+export default {
+	components: { SelectList, AppWrapperEmpty},
+	mixins: [list,selectShop],
+	computed: {		...mapGetters(["getDictionariesInfo","getLoginInfo"])	},
+	data() {
+		return {
+
+		};
+	},
+	onPullDownRefresh() {
+		this.resetList();
+		this.getStockList().then(res => {
+			uni.stopPullDownRefresh();
+		});
+	},
+	onReachBottom() {
+		if (!this.list.finished) {
+			this.getStockList().then((res) => {
+				uni.stopPullDownRefresh();
+			});
+		} else {
+			uni.stopPullDownRefresh();
+		}
+	},
+	methods: {
+		...mapActions(['setUserShopAll']),
+		init(){
+			if(this.option.name){
+				uni.setNavigationBarTitle({ title: this.option.name })
+			}
+			this.getStockList()
+		},
+		goDetail(item){
+			if(item.recordType == 1){
+				this.pageTo({ url: '/pagesPurchase/info?orderSn='+item.orderSn})
+			}
+		},
+		getStockList() {
+			console.log(this.option)
+			return getOnStockDetailApi({id:this.option.id,page: this.list.page}).then(res => {
+				this.completes(res)
+			});
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+.ex-page {
+	height: 100%;
+	display: flex;
+	flex-direction: column;
+	.top-bar {
+		position: absolute;
+		left: 0;
+		display: flex;
+		width: 100%;
+		// box-shadow: 0 5upx 5upx 5upx rgba($color: #000000, $alpha: 0.2);
+		z-index: 20;
+		.bar{
+			width: 50%;
+			height: 100%;
+			text-align: center;
+			&:nth-child(1){
+				border-right: 1upx solid #eeeeec;
+			}
+		}
+	}
+	.main-view {
+		/*margin-top: 80upx;*/
+		flex: 1;
+		background-color: #f9fbfc;
+		.space-view {
+			background-color: #fff;
+		}
+		.ex-info {
+			padding: 30upx;
+			.info-cell {
+				display: flex;
+				align-items: center;
+				font-size: 28upx;
+				&:not(:first-child) {
+					margin-top: 20upx;
+				}
+				.cell-label {
+					width: 110upx;
+					color: #666666;
+				}
+				.cell-value {
+					margin-left: 40upx;
+					color: #333;
+					&.warning {
+						color: #ffaf1d;
+					}
+					&.success {
+						color: #27c325;
+					}
+				}
+			}
+		}
+		.ex-table {
+			::v-deep.icon-info {
+				color: #333333;
+			}
+		}
+	}
+	.bar-view {
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		padding: 0 30upx;
+		width: 100%;
+		height: 100upx;
+
+		box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
+		.info-view {
+			font-size: 26upx;
+		}
+		.btn-view {
+			display: flex;
+			.admin-button-com {
+				margin: 0 10upx;
+			}
+		}
+	}
+}
+</style>