Kaynağa Gözat

库存明细

shish 4 yıl önce
ebeveyn
işleme
16fcce58dd

+ 2 - 3
hdApp/src/admin/goodsManage/detail.vue

@@ -211,9 +211,7 @@ export default {
       uni.navigateBack({delta:1})
     },
     init() {
-      getCategory().then(() => {
-          this.getDetail()
-      })
+      this.getDetail()
     },
     getDetail() {
       return getDetailB({ id: this.option.id }) .then(res => {
@@ -227,6 +225,7 @@ export default {
         this.form.sold = res.data.sold
         this.currentImgData = res.data.smallImgList
         this.form.shopImg = res.data.shortImgList
+        getCategory(res.data.flower,false)
       })
     },
     formSubmit(e) {

+ 8 - 2
hdApp/src/admin/goodsManage/list.vue

@@ -39,8 +39,8 @@
                   </view>
                 </view>
                 <view class="goods-list-bottom flex-center-between">
-                  <text @click.stop="">销售记录</text>
-                  <text @click.stop="">库存明细</text>
+                  <text @click.stop="getSaleRecord">销售记录</text>
+                  <text @click.stop="getStockChange(goodsItem)">库存明细</text>
                   <text @click.stop="edit(goodsItem.id)">编辑</text>
                 </view>
               </view>
@@ -93,6 +93,12 @@ export default {
 
   },
   methods: {
+    getSaleRecord(){
+      this.$msg('开发中')
+    },
+    getStockChange(item){
+      this.$util.pageTo({url: "/admin/goodsManage/stockChange?id="+item.id})
+    },
     goBottom(){
       if (!this.list.finished) {
         this.getGoodsList().then((res) => {

+ 173 - 0
hdApp/src/admin/goodsManage/stockChange.vue

@@ -0,0 +1,173 @@
+<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'">
+						<t-tr header>
+							<t-th>时间</t-th>
+							<t-th><view style="width:180upx;">事项</view></t-th>
+							<t-th>名称</t-th>
+							<t-th>变动</t-th>
+							<t-th>剩余</t-th>
+						</t-tr>
+						<t-tr v-for="(item, index) in list.data" :key="index">
+							<t-td><view>{{ item.addTime.substr(5,11) }}</view></t-td>
+							<t-td><view style="width:180upx;">{{item.typeName}}</view></t-td>
+							<t-td><view>{{item.relateName}}</view></t-td>
+							<t-td><view>{{parseFloat(item.goodsNum)}}</view></t-td>
+							<t-td><view>{{parseFloat(item.newStock)}}</view></t-td>
+						</t-tr>
+					</t-table>
+				</block>
+				<block v-else>
+					<AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
+				</block>
+			</view>
+		</scroll-view>
+	</view>
+</view>
+</template>
+<script>
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import SelectList from "@/components/plugin/selectList";
+import { goodsStockChange } from "@/api/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 {
+			isShow:false,
+			customizationTime:'',
+			menuTimeObj:'',
+			menuShopObj:'',
+			selectTimeId:'',
+			shopId:'',
+			itemId:'',
+			nowTime: "",
+			showTimeDropdown: false,
+			nowShop: "",
+			showShopDropdown: false,
+			dataList: [],
+			params:{
+				id: '',
+			},
+		};
+	},
+	onPullDownRefresh() {
+		this.resetList();
+		this._list().then(res => {
+			uni.stopPullDownRefresh();
+		});
+	},
+	onLoad(e) {
+		this.params.id = e.id
+	},
+	onReachBottom() {
+		if (!this.list.finished) {
+			this._list().then((res) => {
+				uni.stopPullDownRefresh();
+			});
+		} else {
+			uni.stopPullDownRefresh();
+		}
+	},
+	methods: {
+		...mapActions(['setUserShopAll']),
+		async init() {
+			this._list();
+		},
+		_list() {
+			return goodsStockChange({...this.params,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 {
+			/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>

+ 5 - 0
hdApp/src/api/stock/index.js

@@ -0,0 +1,5 @@
+import https from '@/plugins/luch-request_0.0.7/request'
+
+export const goodsStockChange = data => {
+	return https.get('/stock/goods-stock-change', data)
+}

+ 1 - 5
hdApp/src/api/store/index.js

@@ -8,8 +8,4 @@ export const withdrawCashList = data => {
 }
 export const capitaList = data => {
 	return https.get('/shop-capital/list', data)
-}
-
-// export const mainMy = async (data) => {
-// 	return https.get("/main/my", data);
-// };
+}

+ 2 - 1
hdApp/src/pages.json

@@ -195,7 +195,8 @@
 				{ "path": "plantConfirm", "style": { "navigationBarTitleText": "确认采购" } },
 				{ "path": "plantResult", "style": { "navigationBarTitleText": "结果" } },
 				{ "path": "cgNewPlant", "style": { "navigationBarTitleText": "新采购" } },
-				{ "path": "cgNewPlantResult", "style": { "navigationBarTitleText": "采购成功" } }
+				{ "path": "cgNewPlantResult", "style": { "navigationBarTitleText": "采购成功" } },
+				{ "path": "stockChange", "style": { "navigationBarTitleText": "库存变动记录" } }
 			]
 		},
 		{

+ 2 - 2
hdApp/src/utils/config.js

@@ -30,12 +30,12 @@ export async function getLevel(update) {
  * 获取分类列表
  * @parmas update为true时会重新触发请求,重置vuex的数据
  */
-export async function getCategory(update) {
+export async function getCategory(flower,update=false) {
 	let data = store.getters.getCategory
 	if (!UTIL.isEmpty(data) && !update) {
 		return data
 	}
-	await getCategoryList().then(res => {
+	await getCategoryList({flower}).then(res => {
 		data = res.data
 		store.dispatch('setCategory', data)
 	}).catch(() => {