瀏覽代碼

前端小程序合代码 sdy

zhongtianhaoyuan 3 年之前
父節點
當前提交
f129ea351a

+ 11 - 10
pages/erp/exWarehousing/exWarehousing.vue

@@ -161,9 +161,9 @@
 				show6: false,
 				show7: false,
 				isPC: true,
-				contractNoList: [{
-					contractNo: ""
-				}],
+				// contractNoList: [{
+				// 	contractNo: ""
+				// }],
 				typeList: [{
 						type: "干粮"
 					},
@@ -222,7 +222,7 @@
 					minute: true,
 					second: true
 				},
-				inOutDate1: "",
+				// inOutDate1: "",
 				netWeight: ""
 			}
 		},
@@ -242,10 +242,12 @@
 			this.binNumber = helper.erpWarehouse.binNumber
 			this.warehouseName = helper.erpWarehouse.warehouseName
 			this.detailData.goodsName = uni.getStorageSync('erpContractNo').goodsName;
-			this.detailData.contractNo = uni.getStorageSync('erpContractNo').contractNo;
+			if(uni.getStorageSync('erpContractNo').contractNo){
+				this.detailData.contractNo = uni.getStorageSync('erpContractNo').contractNo;
+			}
 			this.detailData.goodsNameKey = uni.getStorageSync('erpContractNo').goodsNameKey;
-			if (!uni.getStorageSync('erpContractNo').tranCarInfoList) uni.getStorageSync('erpContractNo')
-				.tranCarInfoList = []
+			if (!uni.getStorageSync('erpContractNo').tranCarInfoList)
+			 uni.getStorageSync('erpContractNo').tranCarInfoList = []
 			if (!this.detailData.contractNo) {
 				this.detailData.contractNo = '请选择合同编号'
 			} else {
@@ -303,8 +305,8 @@
 				this.detailData.agent = this.handlerList[e].staffName
 			},
 			dateChange(e) {
-				this.detailData.inOutDate = e.year + "-" + e.month + "-" + e.day
-				this.inOutDate1 = e.year + "-" + e.month + "-" + e.day + " " + e.hour + ":" + e.minute
+				this.detailData.inOutDate = e.year + "-" + e.month + "-" + e.day + " " + e.hour + ":" + e.minute +":" + e.second
+				// this.inOutDate1 = e.year + "-" + e.month + "-" + e.day + " " + e.hour + ":" + e.minute
 			},
 			warehousingTypePicker(e) {
 				this.detailData.inOutType = this.warehousingTypeList[e].constValue
@@ -398,7 +400,6 @@
 				let title = ""
 				if (num == 1) {
 					this.detailData.statusFlag = 1
-					this.detailData.inOutDate = this.inOutDate1
 					this.detailData.backOffice = this.userInfo.userName
 					this.detailData.backOfficeId = this.userInfo.id
 					title = "暂存成功"

+ 32 - 20
pages/erp/improvedExWaehousing/improvedExWaehousing.vue

@@ -4,14 +4,18 @@
 			<view class="left" @click='show1=true'>
 				<view>{{warehouseName}}</view>
 				<u-icon name="arrow-right"></u-icon>
-				<u-select v-model="show1" :default-value='[0]' :list="warehouseList" @confirm="confirmWarehouse">
-				</u-select>
+				<!-- <u-picker v-model="show1" :default-value='[0]' mode="selector" :list="warehouseList" @confirm="confirmWarehouse">
+				</u-picker> -->
+				<u-picker @confirm="warehousechange" range-key='warehouseName' mode="selector" v-model="show1"
+					:range="warehouseList"></u-picker>
 			</view>
 			<view class="right" @click='show2=true'>
-				<view>{{positionName}}</view>
+				<view>{{binNumber}}仓位</view>
 				<u-icon name="arrow-right"></u-icon>
-				<u-select v-model="show2" :default-value='[0]' :list="positionList" @confirm="confirmPositon">
-				</u-select>
+				<!-- <u-picker v-model="show2" :default-value='[0]' mode="selector" :list="positionList" @confirm="confirmPositon">
+				</u-picker> -->
+				<u-picker @confirm="warehouseCWchange" range-key='binNumber' mode="selector" v-model="show2"
+					:range="warehouseCWList"></u-picker>
 			</view>
 		</view>
 		<view class="content2">
@@ -36,16 +40,17 @@
 				pageSize: 10,
 				positionId: "",
 				binNumber: "",
-				warehouseName: '鲅鱼圈一号库',
-				positionName: '102仓位',
-				warehouseList: [{
-					"label": '1',
-					"value": '1'
-				}],
-				positionList: [{
-					"label": '102仓位',
-					"value": '1'
-				}],
+				// warehouseName: '鲅鱼圈一号库',
+				// positionName: '102仓位',
+				binNumber: "",
+				warehouseName: '',
+				warehouseList: [],
+				warehouseCWList:[],
+				
+				// positionList: [{
+				// 	"label": '102仓位',
+				// 	"value": '1'
+				// }],
 				dataList: []
 			}
 		},
@@ -54,7 +59,12 @@
 			this.getList()
 		},
 		onShow() {
-			this.positionId = helper.erpWarehouse.positionId
+			let _data = helper.erpWarehouse
+			this.positionId = _data.positionId
+			this.warehouseList = _data.allWarehouse
+			this.warehouseCWList = _data.warehouseCWList
+			this.warehouseName = _data.warehouseName
+			this.binNumber = _data.binNumber
 		},
 		methods: {
 			getList() {
@@ -70,12 +80,14 @@
 					}
 				})
 			},
-			confirmWarehouse() {},
-			confirmPositon() {},
+			warehousechange(e) {
+				 this.warehouseName = this.warehouseList[e[0]].warehouseName
+			},
+			warehouseCWchange(e) {
+				 this.binNumber = this.warehouseCWList[e[0]].binNumber
+			},
 			goDetail(val) {
-				
 				uni.navigateTo({
-					// /pages/erp/warehousing/selectContractNo
 					url: '/pages/erp/improvedExWaehousing/improvedExWaehousingDetail?data=' + JSON.stringify(val),
 				})
 			}

+ 5 - 6
pages/erp/improvedExWaehousing/improvedExWaehousingDetail.vue

@@ -234,19 +234,18 @@
 			},
 		},
 		onLoad(options) {
-			// this.detailData = JSON.parse(options.data)
-			this.detailData = {}
+			this.detailData = JSON.parse(options.data)
 			this.netWeight = this.detailData.netWeight
 			console.log(this.detailData, "dmksj")
 
 			// this.imgUrl = this.detailData.addressUrl.split(",")
 
-			for (let i = 0; i < this.detailData.addressUrl.split(",").length; i++) {
+			// for (let i = 0; i < this.detailData.addressUrl.split(",").length; i++) {
 				this.imgUrl.push({
-						url:this.detailData.addressUrl.split(",")[i]
+						url:this.detailData.addressUrl.split(",")[0]
 					})
-			}
-			console.log(this.imgUrl)
+			// }
+			// console.log(this.imgUrl)
 			this.cangId = options.cangId
 		},
 		onShow() {

+ 6 - 2
pages/erp/improvedWrehousing/improvedWrehousing.vue

@@ -83,8 +83,12 @@
 					}
 				})
 			},
-			confirmWarehouse() {},
-			confirmPositon() {},
+			warehousechange(e) {
+				 this.warehouseName = this.warehouseList[e[0]].warehouseName
+			},
+			warehouseCWchange(e) {
+				 this.binNumber = this.warehouseCWList[e[0]].binNumber
+			},
 			goDetail(val) {
 				uni.navigateTo({
 					url: '/pages/erp/improvedWrehousing/improvedWrehousingDetail?data=' + JSON.stringify(val),

+ 4 - 4
pages/erp/index.vue

@@ -254,6 +254,7 @@ import helper from '@/common/helper.js';
 				this.init(this.compList[e[0]].compId)
 			},
 			init(compId) {
+				debugger
 				console.log(this.userInfo)
 				this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouseSelf', {
 					compId: compId,
@@ -271,9 +272,7 @@ import helper from '@/common/helper.js';
 							this.baseId = res.data.data[0].positionInfos[0].baseId
 							this.positionId = res.data.data[0].positionInfos[0].id
 							console.log('this.warehouseCWList',this.warehouseCWList)
-							// this.makeBinNumber()
-						
-					}
+					}	
 					else{
 						this.warehouseList=[]
 						this.warehouseCWList = []
@@ -291,11 +290,12 @@ import helper from '@/common/helper.js';
 				this.agent = this.warehouseList[e[0]].agent
 				this.warehouseId =this.warehouseList[e[0]].id
 				this.warehouseCWList = this.warehouseList[e[0]].positionInfos
+				this.warehouseCWchange([0])
 			},
 			warehouseCWchange(e){
 				this.binNumber = this.warehouseCWList[e[0]].binNumber
 				this.baseId = this.warehouseCWList[e[0]].baseId
-				this.positionId = this.warehouseCWList[e[0]].positionId
+				this.positionId = this.warehouseCWList[e[0]].id
 			}
 
 		}