Selaa lähdekoodia

前端 小程序 sdy

zhongtianhaoyuan 3 vuotta sitten
vanhempi
commit
633b663a1f

+ 1 - 2
config/index.js

@@ -1,9 +1,8 @@
 const dev = {
 	baseUrl: 'https://www.zthymaoyi.com',
-	// baseUrlNew: 'http://192.168.1.120:8090/',
+	baseUrlNew: 'http://192.168.1.120:8090/',
 	// baseUrlNew: 'http://192.168.1.103:9100/',
 	// baseUrlNew: 'https://apitest.eliangeyun.com/',
-	baseUrlNew: 'http://api1.eliangeyun.com/',
 	// baseUrlNew: 'http://api1.eliangeyun.com/',
 	h5Appid: 'wxb66b599f7f61b46f',
 	debug: false

+ 9 - 0
pages.json

@@ -865,6 +865,15 @@
 		        "enablePullDownRefresh": false
 		    }
 		    
+		},
+		{
+		    "path" : "pages/erp/exWarehousing/selectContractNo",
+		    "style" :                                                                                    
+		    {
+		        "navigationBarTitleText": "选择合同",
+		        "enablePullDownRefresh": false
+		    }
+		    
 		}
 		,{
 		    "path" : "pages/erp/warehousing/selectCarNo",

+ 26 - 31
pages/erp/exWarehousing/exWarehousing.vue

@@ -139,7 +139,6 @@
 		</view>
 	</view>
 </template>
-
 <script>
 	import upload from '@/components/upload.vue';
 	import helper from '@/common/helper.js';
@@ -184,19 +183,7 @@
 						type: "等外"
 					}
 				],
-				handlerList: [{
-						name: "张三"
-					},
-					{
-						name: "二等"
-					},
-					{
-						name: "三等"
-					},
-					{
-						name: "等外"
-					}
-				],
+				handlerList: [],
 				warehousingTypeList: [],
 				action: this.$uploadUrl,
 				maxSize: 50 * 1024 * 1024, //限制文件大小 50M
@@ -215,20 +202,12 @@
 					gradeKey: "",
 					grossWeight: 0,
 					tare: 0,
-					// buckleWeightRatio: 0,
-					// solidGrainWater: 0,
-					// tidalGrainWater: 0,
-					// pureWeight: 0,
 				},
 				params: {
 					year: true,
 					month: true,
 					day: true,
-					// hour: true,
-					// minute: true,
-					// second: true
 				},
-				// inOutDate: "请选择出库日期",
 				netWeight: 0,
 			}
 		},
@@ -245,7 +224,7 @@
 			this.cangId = options.cangId
 		},
 		onShow() {
-			let _data = uni.getStorageSync('erpContractNo')
+			let _data = uni.getStorageSync('erpContractNoCK')==''?{}:uni.getStorageSync('erpContractNoCK')
 			this.binNumber = helper.erpWarehouse.binNumber
 			this.warehouseName = helper.erpWarehouse.warehouseName
 			this.detailData.goodsName = _data.goodsName;
@@ -253,7 +232,18 @@
 				this.detailData.contractNo = _data.contractNo;
 			}
 			this.detailData.goodsNameKey = _data.goodsNameKey;
-			if (!_data.tranCarInfoList) _data.tranCarInfoList = []
+			this.detailData.carNo = uni.getStorageSync('erpcarNoCK')
+			if (!_data.tranCarInfoList) {
+				this.isPC = false
+				_data.tranCarInfoList = []
+			} else {
+				this.isPC = true
+				if (uni.getStorageSync('ContractNoCar')) {
+					this.detailData.carNo = uni.getStorageSync('ContractNoCar')
+				} else {
+					this.detailData.carNo = _data.tranCarInfoList[0].carNo
+				}
+			}
 			if (!this.detailData.contractNo) {
 				this.detailData.contractNo = '请选择合同编号'
 			} else {
@@ -269,10 +259,11 @@
 			this.detailData.inOutDate = _day.getFullYear() + "-" + (_day.getMonth() + 1) + "-" + _day.getDate();
 			//出库类型
 			this.outWarehouse()
-			this.detailData.agent = helper.erpWarehouse.personCharge
+			if(helper.erpWarehouse.personCharge){
+				this.detailData.agent = helper.erpWarehouse.personCharge
+			}
 			//经办人
 			this.handler()
-
 		},
 		methods: {
 			//计算纯重
@@ -396,8 +387,8 @@
 					this.$api.msg('皮重不能大于毛重')
 					return
 				}
-				if (this.netWeight < 0) {
-					this.$api.msg('净重不能小于0')
+				if (this.netWeight <= 0) {
+					this.$api.msg('净重不能小于等于0')
 					return
 				}
 				if (this.detailData.type == "潮粮") {
@@ -581,7 +572,7 @@
 				this.detailData.warehouseName = helper.erpWarehouse.warehouseName
 				this.detailData.positionId = helper.erpWarehouse.positionId
 				this.detailData.binNumber = this.binNumber
-				this.detailData.goodsNameKey = uni.getStorageSync('erpContractNo').goodsNameKey;
+				this.detailData.goodsNameKey = uni.getStorageSync('erpContractNoCK').goodsNameKey;
 				this.detailData.compId = helper.erpWarehouse.compId
 				this.detailData.netWeight = this.netWeight
 				this.detailData.inOutFlag = 1
@@ -606,7 +597,11 @@
 								that.detailData).then(res => {
 								if (res.data.code == 200) {
 									that.$api.msg(title)
-									uni.navigateBack()
+									setTimeout(() => {
+										uni.navigateBack()
+									}, 1000)
+								}else{
+									that.$api.msg(res.data.message)
 								}
 							})
 						}
@@ -615,7 +610,7 @@
 			},
 			slectcontractNo() {
 				uni.navigateTo({
-					url: '/pages/erp/warehousing/selectContractNo?flag=' + 5
+					url: '/pages/erp/exWarehousing/selectContractNo?flag=' + 5
 				})
 			},
 			slectCarNo() {

+ 47 - 17
pages/erp/exWarehousing/selectContractNo.vue

@@ -3,10 +3,18 @@
 		<view class="content1">
 			<u-search placeholder="输入合同编号" :show-action="false" v-model="inputKeyword"></u-search>
 		</view>
-		<view class="content2" v-if="!inputKeyword">
-			<view class="title">最新合同</view>
+		<view class="content2" v-if="!inputKeyword&&newSelectList.length!=0">
+			<view class="title" v-if="">最新选择</view>
 			<view class="item-contnet">
-				<view class="item-list" v-for="(item,index) in newList" :key="index" @click="confirm(item)">
+				<view class="item-list" v-for="(item,index) in newSelectList" :key="index" @click="confirm(item)">
+					{{item.contractNo}}
+				</view>
+			</view>
+		</view>
+		<view class="content2" v-if="!inputKeyword&&moreList.length!=0 ">
+			<view class="title" v-if="">更多合同</view>
+			<view class="item-contnet">
+				<view class="item-list" v-for="(item,index) in moreList" :key="index" @click="confirm(item)">
 					{{item.contractNo}}
 				</view>
 			</view>
@@ -26,18 +34,24 @@
 			return {
 				inputKeyword: '',
 				newList: [],
+				newSelectList:[],
 				filterNewList: [],
-				compId: ''
+				moreList:[],
+				compId: '',
+				flag:""
 			}
 		},
-		onShow() {},
+		onShow() {
+			this.newSelectList =  uni.getStorageSync('erpContractNoListCK');
+		},
 		onLoad(options) {
-			this.compId = options.compId
-			console.log(helper.selectContractNo); 
+			this.flag = options.flag
+			this.compId = helper.erpWarehouse.compId 
 			this.getContractNoList()
 		},
 		watch: {
 			inputKeyword(val) {
+				console.log(this.newList)
 				this.filterNewList = this.newList.filter(function(item) {
 					if (item.contractNo.indexOf(val) > -1) {
 						return item
@@ -47,20 +61,36 @@
 		},
 		methods: {
 			confirm(item){
-				uni.setStorageSync('ContractNo', item);
+				let _list = uni.getStorageSync('erpContractNoListCK');
+				if(_list==''){
+					_list=[]
+				}
+				if(_list.length<=20){
+					_list = _list.filter(function(val) {
+						if (val.contractNo!=item.contractNo) {
+							return val
+						}
+					})
+					_list.unshift(item)
+				}else{
+					_list.unshift(item).pop(item)
+				}
+				uni.setStorageSync('erpContractNoListCK', _list);
+				uni.setStorageSync('erpContractNoCK', item);
 				uni.navigateBack({})
 			},
 			getContractNoList() {
-				this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
-					compId: this.compId,
-					flag: 5,
-				}).then(res => {
-					if (res.data.code == 200) {
-						console.log(res)
-						this.newList = res.data.data
-					}
-				})
+					this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
+						compId: this.compId,
+						flag: 5,
+					}).then(res => {
+						if (res.data.code == 200) {
+							this.moreList = res.data.data
+							this.newList = res.data.data
+						}
+					})
 			},
+		
 		}
 	}
 </script>

+ 39 - 87
pages/erp/improvedExWaehousing/improvedExWaehousing.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="warp">
+	<view class="wrap">
 		<view class="dropdown content1">
 			<view class="left" @click='show1=true'>
 				<view>{{warehouseName}}</view>
@@ -14,14 +14,6 @@
 					:range="warehouseCWList"></u-picker>
 			</view>
 		</view>
-		<!-- <view class="content2">
-			<view class="content2-item" v-for="(item,index) in dataList" @click="goDetail(item)">
-				<view class="item-style">{{item.contractNo}}</view>
-				<view class="item-style">{{item.carNo}}</view>
-				<view class="item-style">{{item.updateDate}}</view>
-				<view class="item-style">{{item.backOffice}}</view>
-			</view>
-		</view> -->
 		<view class="content2">
 			<view class="content2-item" v-for="(item,index) in dataList" @click="goDetail(item)">
 				<view class="row">
@@ -53,40 +45,40 @@
 				show1: false,
 				show2: false,
 				currentPage: 1,
-				pageSize: 10,
+				pageSize: 9999,
 				positionId: "",
 				binNumber: "",
-				binNumber: "",
 				warehouseName: '',
+				positionName: '',
 				warehouseList: [],
-				warehouseCWList:[],
-				dataList: []
+				warehouseCWList: [],
+				dataList: [],
+				allWarehouse: [],
+				showTime: ''
 			}
 		},
 		onLoad() {
 			this.positionId = helper.erpWarehouse.positionId
 			this.warehouseId = helper.erpWarehouse.warehouseId
-			this.getList()
 		},
 		onShow() {
-			this.positionId = helper.erpWarehouse.positionId
-			this.warehouseId = helper.erpWarehouse.warehouseId
 			let _data = helper.erpWarehouse
-			this.positionId = _data.positionId
-			this.warehouseId = _data.warehouseId
+			this.warehouseName = _data.warehouseName
 			this.warehouseList = _data.allWarehouse
 			this.warehouseCWList = _data.warehouseCWList
-			this.warehouseName = _data.warehouseName
 			this.binNumber = _data.binNumber
+			this.positionId = _data.positionId
+			this.warehouseId = _data.warehouseId
+			this.getList()
 		},
 		methods: {
 			getList() {
 				this.$api.doRequest('get', '/warehouseInOutInfo/selectWarehouseInOutInfo', {
-					positionId:this.positionId,
+					positionId: this.positionId,
 					baseId: this.warehouseId,
 					currentPage: this.currentPage,
 					pageSize: this.pageSize,
-					inOutFlag:1
+					inOutFlag: 1
 				}).then(res => {
 					if (res.data.code == 200) {
 						this.dataList = res.data.data.records
@@ -94,50 +86,32 @@
 				})
 			},
 			warehousechange(e) {
-				 this.warehouseName = this.warehouseList[e[0]].warehouseName
-				 this.warehouseId =this.warehouseList[e[0]].id
-				 this.warehouseCWList = this.warehouseList[e[0]].positionInfos
-				 this.warehouseCWchange([0])
+				this.warehouseName = this.warehouseList[e[0]].warehouseName
+				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.warehouseId = this.warehouseCWList[e[0]].baseId
-				 this.positionId = this.warehouseCWList[e[0]].id
-				 helper.erpWarehouse.binNumber = this.binNumber
-				  helper.erpWarehouse.warehouseName = this.warehouseName
-				 helper.erpWarehouse.positionId =  this.positionId
-				 helper.erpWarehouse.warehouseId = this.warehouseId 
-				 this.getList()
+				this.binNumber = this.warehouseCWList[e[0]].binNumber
+				this.warehouseId = this.warehouseCWList[e[0]].baseId
+				this.positionId = this.warehouseCWList[e[0]].id
+				helper.erpWarehouse.binNumber = this.binNumber
+				helper.erpWarehouse.warehouseName = this.warehouseName
+				helper.erpWarehouse.positionId = this.positionId
+				helper.erpWarehouse.warehouseId = this.warehouseId
+				helper.erpWarehouse.warehouseCWList = this.warehouseCWList//保存仓位列表,用于解决待完善出入库返回该页面仓库与仓位不匹配问题
+				this.getList()
 			},
 			goDetail(val) {
 				uni.navigateTo({
 					url: '/pages/erp/improvedExWaehousing/improvedExWaehousingDetail?data=' + JSON.stringify(val),
 				})
 			}
-
 		}
 	}
 </script>
 
 <style scoped lang="scss">
-	uni-page-body {
-		overflow: hidden;
-	}
-	// .warp {
-	// 	margin: 10rpx;
-	// 	padding: 20rpx 20rpx 140rpx 20rpx;
-	
-	// 	.top {
-	// 		display: flex;
-	// 		margin-bottom: 20rpx;
-	// 		border-radius: 20rpx;
-	// 		background: white;
-	// 		padding: 20rpx;
-	// 		.top-left {
-	// 			margin-right: 20rpx;
-	// 		}
-	// 	}
-	// }
 	.dropdown {
 		display: flex;
 		margin: 20rpx 0;
@@ -146,6 +120,7 @@
 		.left,
 		.right {
 			display: flex;
+			align-items: center;
 		}
 	}
 
@@ -157,46 +132,19 @@
 	}
 
 	.content2 {
-		margin: 20rpx;
-		background: #FFFFFF;
-		border-radius: 10rpx;
-
-		.content2-item {
-			padding: 20rpx;
-			margin-bottom: 10rpx;
-			// border-bottom: 1px solid #ccc;
-		}
-
-		.item-style {
-			display: inline-block;
-			width: 50%;
-		}
-	}
-	.content,
-	.content1,
-	.content2 {
-		border-radius: 20rpx;
-		background: white;
-		padding: 20rpx;
-	
-		.title {
-			font-size: 28rpx;
-			font-weight: 600;
-			color: #333333;
-		}
-	
 		.row {
 			display: flex;
 			justify-content: space-between;
 			border-bottom: 1px solid #EEEEEE;
 			padding: 21rpx 0;
-	
+
 			.right,
 			input {
 				font-size: 28rpx;
 				color: #333333;
 			}
 		}
+
 		.row-bottom {
 			.right-bottom {
 				width: 300rpx;
@@ -204,11 +152,15 @@
 			}
 		}
 	}
-	.bottom-btn {
-		width: 92%;
-		position: fixed;
-		bottom: 40rpx;
-		display: flex;
-		z-index: 2;
+
+	.content2-item {
+		background: white;
+		margin: 0 20rpx 20rpx 20rpx;
+		padding: 10rpx;
+		border-radius: 15rpx;
+	}
+
+	.no-boder {
+		border-bottom: none !important;
 	}
 </style>

+ 17 - 24
pages/erp/improvedExWaehousing/improvedExWaehousingDetail.vue

@@ -19,7 +19,6 @@
 				<view @click='show1=true'>{{detailData.type}}</view>
 				<u-picker :range="typeList" range-key="type" @confirm='typePicker($event)' v-model="show1"
 					mode="selector">
-					<!-- <view class="">{{detailData.type}}</view> -->
 				</u-picker>
 			</view>
 			<view class="row row-bottom">
@@ -182,19 +181,7 @@
 						type: "等外"
 					}
 				],
-				handlerList: [{
-						name: "张三"
-					},
-					{
-						name: "二等"
-					},
-					{
-						name: "三等"
-					},
-					{
-						name: "等外"
-					}
-				],
+				handlerList: [],
 				warehousingTypeList: [],
 				action: this.$uploadUrl,
 				maxSize: 50 * 1024 * 1024, //限制文件大小 50M
@@ -232,9 +219,9 @@
 		onLoad(options) {
 			this.detailData = JSON.parse(options.data)
 			this.netWeight = this.detailData.netWeight
-				this.imgUrl.push({
-						url:this.detailData.addressUrl.split(",")[0]
-					})
+			this.imgUrl.push({
+				url: this.detailData.addressUrl.split(",")[0]
+			})
 			this.cangId = options.cangId
 		},
 		onShow() {
@@ -341,8 +328,8 @@
 					this.$api.msg('货名不能为空')
 					return
 				}
-				
-				
+
+
 				if (!this.detailData.grossWeight) {
 					this.$api.msg('毛重不能为空')
 					return
@@ -377,8 +364,8 @@
 					this.$api.msg('皮重不能大于毛重')
 					return
 				}
-				if (this.netWeight < 0) {
-					this.$api.msg('净重不能小于0')
+				if (this.netWeight <= 0) {
+					this.$api.msg('净重不能小于等于0')
 					return
 				}
 				if (this.detailData.type == "潮粮") {
@@ -536,7 +523,8 @@
 						this.$api.msg('霉变粒占比输入错误')
 						return
 					}
-					if (String(this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') != -1 && String(this.detailData
+					if (String(this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') != -1 && String(this
+							.detailData
 							.warehouseInOutDetail.mildewGrain).length - (String(
 							this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') + 1) > 1) {
 						this.$api.msg('霉变粒占比输入错误')
@@ -549,7 +537,8 @@
 						this.$api.msg('不完善粒占比输入错误')
 						return
 					}
-					if (String(this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') != -1 && String(this.detailData
+					if (String(this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') != -1 && String(this
+							.detailData
 							.warehouseInOutDetail.imperfectGrain).length - (String(
 							this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') + 1) > 1) {
 						this.$api.msg('不完善粒占比输入错误')
@@ -585,7 +574,11 @@
 								that.detailData).then(res => {
 								if (res.data.code == 200) {
 									that.$api.msg(title)
-									uni.navigateBack()
+									setTimeout(() => {
+										uni.navigateBack()
+									}, 1000)
+								} else {
+									that.$api.msg(res.data.message)
 								}
 							})
 						}

+ 1 - 1
pages/erp/improvedWrehousing/improvedWrehousing.vue

@@ -61,7 +61,6 @@
 
 		},
 		onShow() {
-			console.log("完善入库-仓库信息", helper.erpWarehouse)
 			let _data = helper.erpWarehouse
 			this.warehouseName = _data.warehouseName
 			this.warehouseList = _data.allWarehouse
@@ -99,6 +98,7 @@
 				this.warehouseId = this.warehouseCWList[e[0]].baseId
 				this.positionId = this.warehouseCWList[e[0]].id
 				this.binNumber = this.warehouseCWList[e[0]].binNumber
+				helper.erpWarehouse.warehouseCWList = this.warehouseCWList//保存仓位列表,用于解决待完善出入库返回该页面仓库与仓位不匹配问题
 				helper.erpWarehouse.positionId =  this.positionId
 				helper.erpWarehouse.warehouseId = this.warehouseId 
 				helper.erpWarehouse.binNumber = this.binNumber 

+ 41 - 34
pages/erp/improvedWrehousing/improvedWrehousingDetail.vue

@@ -104,7 +104,6 @@
 			</view>
 			<view class="row row-bottom has-btn">
 				<view class="left">运费(元/吨)</view>
-				{{detailData.freight}}
 				<input @input='' v-model='detailData.freight' :disabled="isEditYF" class="right-bottom"
 					placeholder="自动获取"></input>
 				<u-button class="edit-btn" hover-class="none" @click="editYF">编辑</u-button>
@@ -130,7 +129,7 @@
 				<input @input='' v-model='detailData.warehouseInOutDetail.waterContent' class="right-bottom"
 					placeholder="输入水分占比"></input>
 			</view>
-			<view class="row row-bottom" style="border: 0;">
+			<view class="row row-bottom" >
 				<view class="left">容重(克/升)</view>
 				<input v-model='detailData.warehouseInOutDetail.bulkDensity' class="right-bottom"
 					placeholder="输入容重"></input>
@@ -188,17 +187,12 @@
 					year: true,
 					month: true,
 					day: true,
-					hour: true,
-					minute: true,
-					second: true
 				},
 				isEditCB: 'false',
 				isEditYF: 'false',
 				warehouseName: '',
 				binNumber: '',
-				contractNoList: [{
-					contractNo: "123"
-				}],
+				
 				typeList: [{
 						type: "干粮"
 					},
@@ -219,19 +213,7 @@
 						grade: "等外"
 					}
 				],
-				handlerList: [{
-						agent: "张三"
-					},
-					{
-						agent: "二等"
-					},
-					{
-						agent: "三等"
-					},
-					{
-						agent: "等外"
-					}
-				],
+				handlerList: [],
 				warehousingTypeList: [],
 				action: this.$uploadUrl,
 				maxSize: 50 * 1024 * 1024, //限制文件大小 50M
@@ -241,10 +223,10 @@
 				inOutDate1: "",
 				detailData: {
 					contractNo: "请选择合同编号",
-					carNo: '辽H12345',
+					carNo: '',
 					type: "干粮",
-					goodsName: "123",
-					inOutDate: '请输入库日期',
+					goodsName: "",
+					inOutDate: '请输入库日期',
 					grade: "一等品",
 					agent: '请选择经办人',
 					inOutType: '请选择入库类型',
@@ -268,15 +250,11 @@
 					url: this.detailData.addressUrl.split(",")[0]
 				})
 			}
-			console.log(this.imgUrl)
-			console.log(helper.erpWarehouse)
 		},
 		computed: {
 			...mapState(['hasLogin', 'userInfo']),
 		},
 		onShow() {
-			
-			console.log('详情数据',this.detailData)
 			if (this.detailData.inOutType == '采购入库'&&this.detailData.status!='已暂存') {
 				this.detailData.freight = 0
 			}
@@ -291,6 +269,32 @@
 			if (!this.detailData.goodsName) {
 				this.detailData.goodsName = '货名'
 			}
+			let _data = uni.getStorageSync('erpContractNo')==''?{}:uni.getStorageSync('erpContractNo')
+		     this.detailData.contractNo = _data.contractNo
+			if (!_data.tranCarInfoList){
+				this.isPC = false
+					this.detailData.carNo = ""
+				_data.tranCarInfoList = []
+			} else{
+				this.isPC = true
+				if(uni.getStorageSync('ContractNoCar')){
+					this.detailData.carNo = uni.getStorageSync('ContractNoCar')
+					this.$api.doRequest('get', '/warehouseBaseInfo/selectCost', {
+						contractNo: this.detailData.contractNo,
+						carNo:this.detailData.carNo
+					}).then(res => {
+						if (res.data.code == 200) {
+							this.detailData.cost = res.data.data
+						}
+					})
+				}else{
+					this.detailData.carNo = _data.tranCarInfoList[0].carNo
+				}
+			}
+			
+			
+			
+			
 			// 获取入库类型
 			this.getrkType()
 			//获取经办人
@@ -472,8 +476,8 @@
 				this.$api.msg('皮重不能大于毛重')
 				return
 			}
-			if (this.netWeight < 0) {
-				this.$api.msg('净重不能小于0')
+			if (this.netWeight <= 0) {
+				this.$api.msg('净重不能小于等于0')
 				return
 			}
 			if (this.detailData.type == "潮粮") {
@@ -705,7 +709,6 @@
 				let title = ""
 				if (num == 1) {
 					this.detailData.statusFlag = 1
-					this.detailData.inOutDate = this.inOutDate1
 					title = "暂存成功"
 				} else if (num == 2) {
 					this.detailData.statusFlag = 3
@@ -713,14 +716,18 @@
 				}
 				let that = this
 				uni.showModal({
-					content: "确定提交入库信息?",
+					content: "确定提交入库信息?",
 					success(res) {
 						if (res.confirm) {
 							that.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse',
 								that.detailData).then(res => {
 								if (res.data.code == 200) {
 									that.$api.msg(title)
-									uni.navigateBack()
+									setTimeout(() => {
+										uni.navigateBack()
+									}, 1000)
+								}else{
+									that.$api.msg(res.data.message)
 								}
 							})
 						}
@@ -804,7 +811,7 @@
 
 	.content2 {
 		margin-top: 10px;
-		display: flex;
+		// display: flex;
 		align-items: center;
 
 		.left {

+ 0 - 1
pages/erp/index.vue

@@ -34,7 +34,6 @@
 				</view>
 			</view>
 		</view>
-
 		<u-modal v-model="isShowAlert" :title-style="{fontSize: '18px',fontWeight:'500'}"
 			:content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='立即开通'
 			title='您尚未开通ERP业务' :content="content" @confirm="goOpenService"></u-modal>

+ 26 - 33
pages/erp/warehousing/warehousing.vue

@@ -80,9 +80,7 @@
 				<view class="left">入库日期</view>
 				<view @click='show4=true'>{{detailData.inOutDate}}</view>
 				<u-picker v-model="show4" mode="time" @confirm='dateChange($event)' :params="params">
-					<!-- <view >{{detailData.inOutDate ? detailData.inOutDate:"请选择日期" }}</view> -->
 				</u-picker>
-				<!-- <u-calendar v-model="show4" mode="date" @change='dateChange'></u-calendar> -->
 			</view>
 			<view class="row">
 				<view class="left">入库类型</view>
@@ -132,7 +130,7 @@
 				<input @input='' v-model='detailData.warehouseInOutDetail.waterContent' class="right-bottom"
 					placeholder="输入水分占比"></input>
 			</view>
-			<view class="row row-bottom" style="border: 0;">
+			<view class="row row-bottom">
 				<view class="left">容重(克/升)</view>
 				<input v-model='detailData.warehouseInOutDetail.bulkDensity' class="right-bottom"
 					placeholder="输入容重"></input>
@@ -190,17 +188,12 @@
 					year: true,
 					month: true,
 					day: true,
-					// hour: true,
-					// minute: true,
-					// second: true
 				},
 				isEditCB: 'false',
 				isEditYF: 'false',
 				warehouseName: '',
 				binNumber: '',
-				contractNoList: [{
-					contractNo: "123"
-				}],
+				contractNoList: [],
 				typeList: [{
 						type: "干粮"
 					},
@@ -221,19 +214,7 @@
 						grade: "等外"
 					}
 				],
-				handlerList: [{
-						agent: "张三"
-					},
-					{
-						agent: "二等"
-					},
-					{
-						agent: "三等"
-					},
-					{
-						agent: "等外"
-					}
-				],
+				handlerList: [],
 				warehousingTypeList: [],
 				action: this.$uploadUrl,
 				maxSize: 50 * 1024 * 1024, //限制文件大小 50M
@@ -245,7 +226,7 @@
 					contractNo: "请选择合同编号",
 					carNo: '请输入车牌号',
 					type: "干粮",
-					goodsName: "123",
+					goodsName: "",
 					inOutDate: '请选择入库日期',
 					grade: "一等品",
 					agent: '请选择经办人',
@@ -264,13 +245,13 @@
 			this.binNumber = helper.erpWarehouse.binNumber
 			this.warehouseName = helper.erpWarehouse.warehouseName
 			this.compId = helper.erpWarehouse.compId
-			console.log(helper.erpWarehouse)
 		},
 		computed: {
 			...mapState(['hasLogin', 'userInfo']),
 		},
 		onShow() {
-			let _data = uni.getStorageSync('erpContractNo')
+			let _data = uni.getStorageSync('erpContractNo')==''?{}:uni.getStorageSync('erpContractNo')
+			if(helper.erpWarehouse.personCharge)
 			this.detailData.agent = helper.erpWarehouse.personCharge
 			this.detailData.goodsName = _data.goodsName;
 			this.detailData.contractNo = _data.contractNo;
@@ -284,13 +265,23 @@
 			if (_data.inOutType == '采购入库') {
 				this.detailData.freight = 0
 			}
-			this.detailData.carNo = uni.getStorageSync('erpcarNo')
 			if (!_data.tranCarInfoList){
+				this.isPC = false
+				this.detailData.carNo = ""
+				this.detailData.cost = ""
 				_data.tranCarInfoList = []
 			} else{
 				this.isPC = true
 				if(uni.getStorageSync('ContractNoCar')){
 					this.detailData.carNo = uni.getStorageSync('ContractNoCar')
+					this.$api.doRequest('get', '/warehouseBaseInfo/selectCost', {
+						contractNo: this.detailData.contractNo,
+						carNo:this.detailData.carNo
+					}).then(res => {
+						if (res.data.code == 200) {
+							this.detailData.cost = res.data.data
+						}
+					})
 				}else{
 					this.detailData.carNo = _data.tranCarInfoList[0].carNo
 				}
@@ -306,7 +297,6 @@
 			if (!this.detailData.goodsName) {
 				this.detailData.goodsName = '货名'
 			}
-			console.log('当前合同', _data)
 			// 获取入库类型
 			this.getrkType()
 			//获取经办人
@@ -493,8 +483,8 @@
 					this.$api.msg('皮重不能大于毛重')
 					return
 				}
-				if (this.netWeight < 0) {
-					this.$api.msg('净重不能小于0')
+				if (this.netWeight <= 0) {
+					this.$api.msg('净重不能小于等于0')
 					return
 				}
 				if (this.detailData.type == "潮粮") {
@@ -726,7 +716,6 @@
 				let title = ""
 				if (num == 1) {
 					this.detailData.statusFlag = 1
-					this.detailData.inOutDate = this.inOutDate1
 					title = "暂存成功"
 				} else if (num == 2) {
 					this.detailData.statusFlag = 3
@@ -734,14 +723,18 @@
 				}
 				let that = this
 				uni.showModal({
-					content: "确定提交入库信息?",
+					content: "确定提交入库信息?",
 					success(res) {
 						if (res.confirm) {
 							that.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse',
 								that.detailData).then(res => {
 								if (res.data.code == 200) {
-									that.$api.msg(title)
+								that.$api.msg(title)
+								setTimeout(() => {
 									uni.navigateBack()
+								}, 1000)
+								}else{
+									that.$api.msg(res.data.message)
 								}
 							})
 						}
@@ -827,7 +820,7 @@
 
 	.content2 {
 		margin-top: 10px;
-		display: flex;
+		// display: flex;
 		align-items: center;
 
 		.left {