Browse Source

更新出入库

hi 7 hours ago
parent
commit
71f2571a8d
4 changed files with 21 additions and 16 deletions
  1. 1 0
      env.js
  2. 18 14
      pages/goods/detail.vue
  3. 1 1
      pages/picking-task/detail.vue
  4. 1 1
      pages/purchase/detail.vue

+ 1 - 0
env.js

@@ -3,6 +3,7 @@
  */
 export const BASE_URL = process.env.NODE_ENV === "development" ? 'http://192.168.2.112:8080' : 'https://erp.xianglitech.com.cn/prod-api'
 // https://erp.xianglitech.com.cn/prod-api
+// https://test-erp.xianglitech.com.cn/stage-api
 
 // 上传路径
 export const UPLOAD_URL = `${BASE_URL}/oss/upload`

+ 18 - 14
pages/goods/detail.vue

@@ -97,18 +97,19 @@
 					</view>
 				</view>
 				<scroll-view scroll-y class="scroll-y">
-					<view class="crk-item" v-for="item in 6" :key="item">
-						<view class="crk-item-title">娃哈哈AD钙</view>
-						<view class="crk-item-line">出库仓库:我的仓库</view>
-						<view class="crk-item-line">货物规格:500ml</view>
-						<view class="crk-item-line">出库时间:2025-04-03 16:44</view>
-						<view class="crk-item-line">出库数量:25件</view>
+					<view class="crk-item" v-for="(item,i) in cukList" :key="item">
+						<view class="crk-item-title">{{item.materialName}}</view>
+						<!-- <view class="crk-item-line">出库仓库:我的仓库-暂无</view> -->
+						<view class="crk-item-line">货物规格:{{item.materialStandard}}</view>
+						<view class="crk-item-line">{{currentCrkId == 'out' ?'出库':'入库'}}时间:{{item.operTime || '-'}}</view>
+						<view class="crk-item-line">{{currentCrkId == 'out' ?'出库':'入库'}}数量:{{item.actualQuantityInStorage || 0}}{{item.materialUnit || '-'}}</view>
 						<view class="img-box">
 							<u-image v-if="currentCrkId == 0" src="@/static/image/yck-img.png" width="132rpx" height="132rpx"></u-image>
 							<u-image v-if="currentCrkId == 1" src="@/static/image/yrk-img.png" width="132rpx" height="132rpx"></u-image>
 						</view>
 					</view>
-					<u-divider text="仅展示最近10条记录" :dashed="true"></u-divider>
+					<u-empty mode="data" v-if="cukList.length == 0"></u-empty>
+					<u-divider text="仅展示最近10条记录" v-if="cukList.length > 0" :dashed="true"></u-divider>
 					<view style="height: 40rpx;"></view>
 				</scroll-view>
 			
@@ -123,25 +124,28 @@
 		data() {
 			return {
 				navTitle:'哇哈哈AD盖',
-				goodsId:0,
+				goodsId:0,//单据id
+				materialId:0,//商品id
 				crkShow: false,
-				currentCrkId:'in',
+				currentCrkId:'out',
 				crkList:[
 					{
 						name:'出库',
-						id:'in'
+						id:'out'
 					},
 					{
 						name:'入库',
-						id:'out'
+						id:'in'
 					}
 				],
-				goodsInfo:{}
+				goodsInfo:{},
+				cukList:[],
 			}
 		},
 		onLoad(e) {
 			this.navTitle = e.name ? decodeURIComponent(e.name) : ''
 			this.goodsId = e.id
+			this.materialId = e.materialId
 			this.getMaterialDetail()
 		},
 		methods:{
@@ -161,13 +165,13 @@
 				uni.showLoading()
 				let urlParams = {
 					type:this.currentCrkId,
-					materialId:this.goodsId,
+					materialId:this.materialId,
 				}
 				let data = {pageNum:1,pageSize:10}
 				materialDepotDetail(urlParams,data)
 				.then(res=>{
 					if(res.code == 200) {
-						
+						this.cukList = res.data.rows
 					}
 					uni.hideLoading()
 				})

+ 1 - 1
pages/picking-task/detail.vue

@@ -179,7 +179,7 @@
 			},
 			toDetail() {
 				uni.navigateTo({
-					url:`/pages/goods/detail?id=${val.id}&name=${val.materialName}`
+					url:`/pages/goods/detail?id=${val.id}&name=${val.materialName}&materialId=${val.materialId}`
 				})
 			}
 		}

+ 1 - 1
pages/purchase/detail.vue

@@ -188,7 +188,7 @@
 			},
 			toDetail(val) {
 				uni.navigateTo({
-					url:`/pages/goods/detail?id=${val.id}&name=${val.materialName}`
+					url:`/pages/goods/detail?id=${val.id}&name=${val.materialName}&materialId=${val.materialId}`
 				})
 			}
 		}