Browse Source

前端gjy

gjy 3 năm trước cách đây
mục cha
commit
88bf4fe221
1 tập tin đã thay đổi với 53 bổ sung9 xóa
  1. 53 9
      pageD/warehousings/warehousings.vue

+ 53 - 9
pageD/warehousings/warehousings.vue

@@ -55,14 +55,22 @@
 					<text class="tit">仓库</text>
 					<view style="color: #ff0000; padding-left: 10rpx;">*</view>
 					<view class="con-list">
-						<text @click=''>{{WarehouseInOutInfo.warehouseName}}</text>
+						<picker @change="warehouseChange" :value="warehouseIndex" :range="warehouse" class="con-list">
+							<view >
+								{{warehouseIndex>-1?warehouse[warehouseIndex]:'请选择仓库'}}
+							</view>
+						</picker>
 					</view>
 				</view>
 				<view class="c-row b-b">
 					<view class="title">仓位号</view>
 					<view style="color: #ff0000; padding-left: 10rpx;">*</view>
 					<view class="con-list">
-						<input placeholder-style="font-size:14px" placeholder="请输入仓位号" name="input" v-model="WarehouseInOutInfo.binNumber"></input>
+						<picker @change="warehouseChange1" :value="warehouseIndex1" :range="warehouse1" class="con-list">
+							<view >
+								{{warehouseIndex1>-1?warehouse1[warehouseIndex1]:'请选择仓位号'}}
+							</view>
+						</picker>
 					</view>
 				</view>
 			
@@ -89,7 +97,7 @@
 				<view class="c-row b-b">
 					<text class="tit">入库日期</text>
 					
-					<view class="con-list" @click="show = true">{{WarehouseInOutInfo.inOutDate!=''?WarehouseInOutInfo.inOutDate:time}}</view>
+					<view class="con-list" @click="show = true">{{WarehouseInOutInfo.inOutDate!=''?WarehouseInOutInfo.inOutDate:time1}}</view>
 					<u-picker  :params='params' :default-time='time' @confirm="DateChange" v-model="show" mode="time"></u-picker>
 					
 				</view>
@@ -210,12 +218,18 @@ import upload from '@/components/upload.vue';
 				pinType: ['不限(默认)', '一等品', '二等品', '三等品', '等外'],
 				ruIndex: '采购入库',
 				rutypes: '',
+				warehouse:[],
+				warehouseIndex:-1,
+				warehouse1:[],
+				warehouseIndex1:-1,
 				ruType: ['采购入库', '移库入库', '暂存入库', '贸易服务入库', '退库'],
 				action: this.$uploadUrl,
 				maxSize: 5 * 1024 * 1024,//限制文件大小 5M
 				btnLoading: false, //防止重复点击
 				imgUrls: [],
 				isAdd: true,
+				warehouselist:[],
+				warehouselist1:[],
 				params:{
 					year: true,
 					month: true,
@@ -225,7 +239,7 @@ import upload from '@/components/upload.vue';
 			}
 		},
 		computed: {
-				time() {
+				time1() {
 					var date=new Date()
 					var year=date.getFullYear()
 					var month=date.getMonth()
@@ -249,10 +263,17 @@ import upload from '@/components/upload.vue';
 			},
 			onShow(){
 				this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouse', {compId:'2710b21efc1e4393930c5dc800010dc4',warehouseType:1,}).then(res => {
-			console.log(res)
-			})
-			this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {compId:'',warehouseType:1,}).then(res => {
-			console.log(res)
+				 if(res.data.code==200){
+					 var arr=[]
+					 for(var i=0;i<res.data.data.length;i++){
+						 if(res.data.data[i].warehouseName==this.WarehouseInOutInfo.warehouseName){
+							 this.warehouseIndex=i
+						 }
+						 arr.push(res.data.data[i].warehouseName)
+					 }
+					 this.warehouselist=res.data.data
+					 this.warehouse=arr
+				 }
 			})
 			},
 		onLoad(option) {
@@ -273,7 +294,30 @@ import upload from '@/components/upload.vue';
 			this.time = year+'-'+month+"-"+date1
 		},
 		methods: {
-			
+			warehouseChange(e){
+				var id=''
+				this.warehouseIndex=e.detail.value
+				this.WarehouseInOutInfo.warehouseName=this.warehouse[this.warehouseIndex]
+				for(var i=0;i<this.warehouselist.length;i++){
+					if(this.warehouselist[i].warehouseName==this.WarehouseInOutInfo.warehouseName){
+						id=this.warehouselist[i].id
+					}
+				}
+				this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {id:id,}).then(res => {
+					var arr=[]
+					for(var i=0;i<res.data.data.warehousePositionInfoList.length;i++){
+						console.log(res.data.data.warehousePositionInfoList[i])
+						arr.push(res.data.data.warehousePositionInfoList[i].binNumber)
+					}
+					this.warehouse1=arr
+					this.warehouselist11=res.data.data
+				})
+			},
+			warehouseChange1(e){
+				var id=''
+				this.warehouseIndex1=e.detail.value
+				this.WarehouseInOutInfo.binNumber=this.warehouse1[this.warehouseIndex1]
+			},
 			DateChange(e) {
 				this.WarehouseInOutInfo.inOutDate=e.year+'-'+e.month+'-'+e.day
 			},