Browse Source

前端小程序 sdy

zhongtianhaoyuan 3 năm trước cách đây
mục cha
commit
2daff60129

+ 1 - 1
config/index.js

@@ -1,7 +1,7 @@
 const dev = {
 	// baseUrl: 'http://192.168.1.120:8090/',
 	baseUrl: 'https://www.zthymaoyi.com',
-	baseUrlNew: 'http://api.eliangeyun.com/',
+	baseUrlNew: 'http://192.168.1.120:8090/',
 	h5Appid: 'wxb66b599f7f61b46f',
 	debug: false
 }

+ 88 - 47
pageD/warehousings/ex_warehouse.vue

@@ -97,9 +97,9 @@
 					<text class="tit">出库日期</text>
 
 					<view class="con-list" @click="show = true">
-						{{WarehouseInOutInfo.inOutDate!=''?WarehouseInOutInfo.inOutDate:time}}
+						{{WarehouseInOutInfo.inOutDate!='' || WarehouseInOutInfo.inOutDate != null ? WarehouseInOutInfo.inOutDate : time1}}
 					</view>
-					<u-picker :params='params' :default-time='time' @confirm="DateChange" v-model="show" mode="time">
+					<u-picker :params='params' :default-time='time1' @confirm="DateChange" v-model="show" mode="time">
 					</u-picker>
 
 				</view>
@@ -108,8 +108,8 @@
 				</view>
 				<upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
 					:size-type="['compressed']" @on-success="getImgUrl" @on-remove="onRemove"
-					@on-uploaded="isAdd = true" :before-upload="filterFileType"></upload> 
-					<!-- <view style="height: 90px; margin-left: 16px;" class="flex">
+					@on-uploaded="isAdd = true" :before-upload="filterFileType"></upload>
+				<!-- <view style="height: 90px; margin-left: 16px;" class="flex">
 							<image v-bind:src="license1" class="picture1" v-if="this.license1 != null || this.license1 !=''"></image>
 						<view  @click="uploadPictures">
 							<image src="../../static/img/authentication/business@3x.png" mode="" class="picture"></image>
@@ -230,10 +230,10 @@
 				maxSize: 5 * 1024 * 1024, //限制文件大小 5M
 				btnLoading: false, //防止重复点击
 				imgUrls: [],
-				warehouse:[],
-				warehouseIndex:-1,
-				warehouse1:[],
-				warehouseIndex1:-1,
+				warehouse: [],
+				warehouseIndex: -1,
+				warehouse1: [],
+				warehouseIndex1: -1,
 				warehouselist: [],
 				isAdd: true,
 				params: {
@@ -242,11 +242,12 @@
 					day: true,
 				},
 				show: false,
-				license1:"",
+				license1: "",
+
 			}
 		},
 		computed: {
-			time() {
+			time1() {
 				var date = new Date()
 				var year = date.getFullYear()
 				var month = date.getMonth()
@@ -259,6 +260,23 @@
 				}
 				return year + '-' + month + "-" + date1
 			},
+			// time:{
+			// 	var date = new Date()
+			// 	var year = date.getFullYear()
+			// 	var month = date.getMonth()
+			// 	var date1 = date.getDate()
+			// 	set() {
+			// 			if (month + 1 < 10) {
+			// 				month = "0" + (month + 1)
+			// 			}
+			// 			if (date1 + 1 < 10) {
+			// 				date1 = "0" + date1
+			// 			}
+			// 		},
+			// 		get() {
+			// 			return year + '-' + month + "-" + date1
+			// 		},
+			// },
 			startDate() {
 				return new Date(new Date(new Date().toLocaleDateString()).getTime() - (1 * 60 * 60 * 1000))
 			},
@@ -285,7 +303,7 @@
 
 			})
 			this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
-				compId: '',
+				compId: '2710b21efc1e4393930c5dc800010dc4',
 				warehouseType: 1,
 			}).then(res => {})
 		},
@@ -298,35 +316,51 @@
 			this.WarehouseInOutInfo.titleNo = option.titleNo
 			this.WarehouseInOutInfo.id = option.id
 			this.WarehouseInOutInfo.carNo = option.carNo
-			var date = new Date()
-			var year = date.getFullYear()
-			var month = date.getMonth()
-			var date1 = date.getDate()
-			if (month + 1 < 10) {
-				month = "0" + (month + 1)
-			}
-			this.time = year + '-' + month + "-" + date1
+			// var date = new Date()
+			// var year = date.getFullYear()
+			// var month = date.getMonth()
+			// var date1 = date.getDate()
+			// if (month + 1 < 10) {
+			// 	month = "0" + (month + 1)
+			// }
+			// this.time = year + '-' + month + "-" + date1
+			this.getList(this.WarehouseInOutInfo.id)
 		},
 		methods: {
-			uploadPictures(){
+			// uploadPictures(){
+			// 	var that = this
+			// 	wx.chooseImage({
+			// 		sourceType: ['camera', 'album'],
+			// 		success: function(res) {
+			// 			wx.uploadFile({
+			// 				url: 'https://www.zthymaoyi.com/upload/admin',
+			// 				filePath: res.tempFilePaths[0],
+			// 				name: 'file',
+			// 				success(res) {
+			// 					var data = res.data
+			// 					var strToObj = JSON.parse(data)
+			// 					that.WarehouseInOutInfo.addressUrl = strToObj.url
+			// 					that.license1 = strToObj.url
+			// 					that.certificates = false
+			// 				}
+			// 			})
+			// 		}
+			// 	})
+			// },
+			getList(id1) {
 				var that = this
-				wx.chooseImage({
-					sourceType: ['camera', 'album'],
-					success: function(res) {
-						wx.uploadFile({
-							url: 'https://www.zthymaoyi.com/upload/admin',
-							filePath: res.tempFilePaths[0],
-							name: 'file',
-							success(res) {
-								var data = res.data
-								var strToObj = JSON.parse(data)
-								that.WarehouseInOutInfo.addressUrl = strToObj.url
-								that.license1 = strToObj.url
-								that.certificates = false
-							}
+				this.$api.doRequest('get', '/warehouseInOutInfo/getInfo', {
+						id: id1
+					}).then(res => {
+						this.WarehouseInOutInfo = res.data.data
+					})
+					.catch(res => {
+						uni.showToast({
+							title: res.errmsg,
+							icon: 'none',
+							duration: 2000
 						})
-					}
-				})
+					});
 			},
 			warehouseChange(e) {
 				var id = ''
@@ -371,8 +405,7 @@
 				}
 			},
 			getImgUrl(res) {
-				console.log("res",res)
-				this.imgUrls.push(res.data);
+				this.imgUrls.push(res);
 			},
 			onRemove(index) {
 				this.imgUrls.splice(index, 1);
@@ -382,8 +415,8 @@
 					this.$api.msg('毛重输入错误')
 					return
 				}
-				if (this.WarehouseInOutInfo.grossWeight.indexOf('.') != -1) {
-					if (this.WarehouseInOutInfo.grossWeight.split('.')[1].length > 2) {
+				if (this.WarehouseInOutInfo.grossWeight.toString().indexOf('.') != -1) {
+					if (this.WarehouseInOutInfo.grossWeight.toString().split('.')[1].length > 2) {
 						this.$api.msg('毛重输入错误')
 						return
 					}
@@ -486,7 +519,7 @@
 				if (this.imgUrls.length > 0) {
 					this.WarehouseInOutInfo.addressUrl = this.imgUrls[0]
 				}
-				console.log(this.WarehouseInOutInfo,"卖粮对象")
+				console.log(this.WarehouseInOutInfo, "卖粮对象")
 				this.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse', this.WarehouseInOutInfo).then(res => {
 					if (res.data.code == 200) {
 						uni.showToast({
@@ -494,7 +527,10 @@
 							icon: 'none',
 							duration: 2000
 						})
-						uni.navigateBack({})
+						// uni.navigateBack({})
+						setTimeout(() => {
+							uni.navigateBack({})
+						}, 200)
 					} else {
 						uni.showToast({
 							title: res.data.message,
@@ -704,6 +740,7 @@
 </script>
 <style scoped lang='scss'>
 	.upload {
+
 		/deep/.u-list-item,
 		.u-add-wrap {
 			background-color: #eceae8;
@@ -850,24 +887,28 @@
 			}
 		}
 	}
+
 	.container {
 		padding-bottom: 160upx;
 	}
-	.xiangji{
+
+	.xiangji {
 		width: 25px;
-		height: 25px;	
+		height: 25px;
 		margin: 0 auto;
 		margin-top: 35px;
 		margin-left: -60px;
 	}
-	.picture{
+
+	.picture {
 		width: 90px;
 		height: 90px;
 		border-radius: 10px;
-/* 
+		/* 
 		position: relative; */
 	}
-	.picture1{
+
+	.picture1 {
 		width: 90px;
 		height: 90px;
 		border-radius: 10px;

+ 6 - 1
pageD/warehousings/ex_warehouse_detail.vue

@@ -97,7 +97,7 @@
 					<text class="tit">磅单照片</text>
 				</view>
 				<view style="width: 90px;height: 90px; margin-left: 16px;" >
-					<image src="https://liangxin.zthymaoyi.com/file/upload/cf17d321762d4064886cc9688433f003.png" mode=""></image>
+					<image v-bind:src="WarehouseInOutInfo.addressUrl" mode="" class="picture"></image>
 				</view>
 			</view>
 			<view class="center">
@@ -370,4 +370,9 @@
 		height: 90px;
 		border-radius: 10px;
 	}
+	.picture{
+		width: 75px;
+		height: 75px;
+		border-radius: 10px;
+	}
 </style>

+ 17 - 14
pageD/warehousings/warehousingDetails.vue

@@ -87,8 +87,8 @@
 				<view class="c-row ">
 					<text class="tit">磅单照片</text>
 				</view>
-				<view style="padding-left: 30rpx;">
-					<u-image width="30%" height="180rpx" :src="warehouseInOutInfo.addressUrl"></u-image>
+				<view >
+					<image  v-bind:src="warehouseInOutInfo.addressUrl" class="picture"></image>
 				</view>
 			</view>
 		</view>
@@ -97,49 +97,49 @@
 			<view class="c-row ">
 				<text class="tit">质检员</text>
 				<view class="con-list">
-					<text>{{warehouseInOutInfo.qualityInspector}}</text>
+					<text>{{warehouseInOutInfo.warehouseInOutDetail.qualityInspector}}</text>
 				</view>
 			</view>
 			<view class="c-row ">
 				<text class="tit">蛋白(%){{'>='}}</text>
 				<view class="con-list">
-					<text>{{warehouseInOutInfo.protein}}</text>
+					<text>{{warehouseInOutInfo.warehouseInOutDetail.protein}}</text>
 				</view>
 			</view>
 			<view class="c-row ">
 				<text class="tit">水分(%){{'<='}}</text>
 				<view class="con-list">
-					<text>{{warehouseInOutInfo.waterContent}}</text>
+					<text>{{warehouseInOutInfo.warehouseInOutDetail.waterContent}}</text>
 				</view>
 			</view>
 			<view class="c-row ">
 				<text class="tit">容重(g/L){{'<='}}</text>
 				<view class="con-list">
-					<text>{{warehouseInOutInfo.bulkDensity}}</text>
+					<text>{{warehouseInOutInfo.warehouseInOutDetail.bulkDensity}}</text>
 				</view>
 			</view>
 			<view class="c-row ">
 				<text class="tit">热损伤(%){{'<='}}</text>
 				<view class="con-list">
-					<text>{{warehouseInOutInfo.jiaorenli}}</text>
+					<text>{{warehouseInOutInfo.warehouseInOutDetail.jiaorenli}}</text>
 				</view>
 			</view>
 			<view class="c-row ">
 				<text class="tit">杂质(%){{'<='}}</text>
 				<view class="con-list">
-					<text>{{warehouseInOutInfo.impurity}}</text>
+					<text>{{warehouseInOutInfo.warehouseInOutDetail.impurity}}</text>
 				</view>
 			</view>
 			<view class="c-row ">
 				<text class="tit">霉变粒(%){{'<='}}</text>
 				<view class="con-list">
-					<text>{{warehouseInOutInfo.mildewGrain}}</text>
+					<text>{{warehouseInOutInfo.warehouseInOutDetail.mildewGrain}}</text>
 				</view>
 			</view>
 			<view class="c-row ">
 				<text class="tit">不完整粒(%){{'<='}} </text>
 				<view class="con-list">
-					<text>{{warehouseInOutInfo.imperfectGrain}}</text>
+					<text>{{warehouseInOutInfo.warehouseInOutDetail.imperfectGrain}}</text>
 				</view>
 			</view>
 			<view class="c-row ">
@@ -188,7 +188,6 @@
 						duration: 2000
 					})
 				});
-				console.log(this.warehouseInOutInfo)
 			}
 		}
 		}
@@ -328,12 +327,16 @@
 			.icon-shoucang {
 				font-size: 46upx;
 			}
-		}
-	
-		
+		}	
 	}
 	.container{
 		padding-bottom: 160upx;
 	}
+	.picture{
+		width: 75px;
+		height: 75px;
+		border-radius: 10px;
+		margin-left: 16px;
+	}
 </style>
 

+ 48 - 18
pageD/warehousings/warehousings.vue

@@ -23,7 +23,7 @@
 			<view class="c-row ">
 				<text class="tit">车牌号</text>
 				<view class="con-list">
-					<text>{{WarehouseInOutInfo1.carNo}}</text>
+					<text>{{WarehouseInOutInfo.carNo}}({{this.WarehouseInOutInfo.tranCarNo}})</text>
 				</view>
 			</view>
 		</view>
@@ -105,6 +105,7 @@
 					<text class="tit">上传磅单照片</text>
 				</view>
 				<upload
+				v-if="WarehouseInOutInfo.addressUrl == null || WarehouseInOutInfo.addressUrl == ''"
 					class="upload"
 					ref="upload"
 					:action="action"
@@ -116,6 +117,7 @@
 					@on-uploaded="isAdd = true"
 					:before-upload="filterFileType"
 				></upload>
+				<image v-bind:src="WarehouseInOutInfo.addressUrl" mode="" v-if="WarehouseInOutInfo.addressUrl != null || WarehouseInOutInfo.addressUrl != ''" class="picture"></image>
 			</view>
 		</view>
 			
@@ -281,6 +283,7 @@ import upload from '@/components/upload.vue';
 			this.WarehouseInOutInfo.goodsName = option.goodsName
 			this.WarehouseInOutInfo.startWeight = option.startWeight
 			this.WarehouseInOutInfo1.carNo = option.carNo + '(' + option.tranCarNo + ')'
+			this.WarehouseInOutInfo.tranCarNo = option.tranCarNo
 			this.WarehouseInOutInfo.warehouseName = option.warehouseName
 			this.WarehouseInOutInfo.id = option.id
 			this.WarehouseInOutInfo.carNo = option.carNo
@@ -292,8 +295,27 @@ import upload from '@/components/upload.vue';
 				month="0"+(month+1)
 			}
 			this.time = year+'-'+month+"-"+date1
+			this.getList(this.WarehouseInOutInfo.id)
 		},
 		methods: {
+			getList(id1){
+				var that=this
+				this.$api.doRequest('get','/warehouseInOutInfo/getInfo',{id:id1}).then(res => {
+					
+					that.WarehouseInOutInfo = res.data.data
+					 that.list = that.WarehouseInOutInfo.warehouseInOutDetail
+					this.pinIndex = this.WarehouseInOutInfo.gradeKey
+					this.WarehouseInOutInfo.deductionAmount = Math.abs(res.data.data.deductionAmount) 
+
+				})
+				.catch(res => {
+					uni.showToast({
+						title: res.errmsg,
+						icon:'none',
+						duration: 2000
+					})
+				});
+			},
 			warehouseChange(e){
 				var id=''
 				this.warehouseIndex=e.detail.value
@@ -334,7 +356,7 @@ import upload from '@/components/upload.vue';
 				}
 			},
 			getImgUrl(res) {
-				this.imgUrls.push(res.data);
+				this.imgUrls.push(res);
 			},
 			onRemove(index) {
 				this.imgUrls.splice(index, 1);
@@ -344,8 +366,8 @@ import upload from '@/components/upload.vue';
 					this.$api.msg('毛重输入错误')
 					return
 				}
-				if(this.WarehouseInOutInfo.grossWeight.indexOf('.')!=-1){
-					if(this.WarehouseInOutInfo.grossWeight.split('.')[1].length>2){
+				if(this.WarehouseInOutInfo.grossWeight.toString().indexOf('.')!=-1){
+					if(this.WarehouseInOutInfo.grossWeight.toString().split('.')[1].length>2){
 						this.$api.msg('毛重输入错误')
 						return
 					}
@@ -354,8 +376,8 @@ import upload from '@/components/upload.vue';
 					this.$api.msg('皮重输入错误')
 					return
 				}
-				if(this.WarehouseInOutInfo.tare.indexOf('.')!=-1){
-					if(this.WarehouseInOutInfo.tare.split('.')[1].length>2){
+				if(this.WarehouseInOutInfo.tare.toString().indexOf('.')!=-1){
+					if(this.WarehouseInOutInfo.tare.toString().split('.')[1].length>2){
 						this.$api.msg('皮重输入错误')
 						return
 					}
@@ -364,8 +386,8 @@ import upload from '@/components/upload.vue';
 					this.$api.msg('扣款金额输入错误')
 					return
 				}
-				if(this.WarehouseInOutInfo.deductionAmount&&this.WarehouseInOutInfo.deductionAmount.indexOf('.')!=-1){
-					if(this.WarehouseInOutInfo.deductionAmount.split('.')[1].length>2){
+				if(this.WarehouseInOutInfo.deductionAmount&&this.WarehouseInOutInfo.deductionAmount.toString().indexOf('.')!=-1){
+					if(this.WarehouseInOutInfo.deductionAmount.toString().split('.')[1].length>2){
 						this.$api.msg('扣款金额输入错误')
 						return
 					}
@@ -460,7 +482,9 @@ import upload from '@/components/upload.vue';
 							icon: 'none',
 							duration: 2000
 						})
-						uni.navigateBack({})
+						setTimeout(() => {
+							uni.navigateBack({})
+						}, 200)
 					}else{
 						uni.showToast({
 							title: res.data.message,
@@ -500,8 +524,8 @@ import upload from '@/components/upload.vue';
 					this.$api.msg('毛重输入错误')
 					return
 				}
-				if(this.WarehouseInOutInfo.grossWeight.indexOf('.')!=-1){
-					if(this.WarehouseInOutInfo.grossWeight.split('.')[1].length>2){
+				if(this.WarehouseInOutInfo.grossWeight.toString().indexOf('.')!=-1){
+					if(this.WarehouseInOutInfo.grossWeight.toString().split('.')[1].length>2){
 						this.$api.msg('毛重输入错误')
 						return
 					}
@@ -510,8 +534,8 @@ import upload from '@/components/upload.vue';
 					this.$api.msg('皮重输入错误')
 					return
 				}
-				if(this.WarehouseInOutInfo.tare.indexOf('.')!=-1){
-					if(this.WarehouseInOutInfo.tare.split('.')[1].length>2){
+				if(this.WarehouseInOutInfo.tare.toString().indexOf('.')!=-1){
+					if(this.WarehouseInOutInfo.toString().tare.split('.')[1].length>2){
 						this.$api.msg('皮重输入错误')
 						return
 					}
@@ -520,8 +544,8 @@ import upload from '@/components/upload.vue';
 					this.$api.msg('扣款金额输入错误')
 					return
 				}
-				if(this.WarehouseInOutInfo.deductionAmount&&this.WarehouseInOutInfo.deductionAmount.indexOf('.')!=-1){
-					if(this.WarehouseInOutInfo.deductionAmount.split('.')[1].length>2){
+				if(this.WarehouseInOutInfo.deductionAmount&&this.WarehouseInOutInfo.deductionAmount.toString().indexOf('.')!=-1){
+					if(this.WarehouseInOutInfo.deductionAmount.toString().split('.')[1].length>2){
 						this.$api.msg('扣款金额输入错误')
 						return
 					}
@@ -606,11 +630,11 @@ import upload from '@/components/upload.vue';
 				}
 				this.WarehouseInOutInfo.warehouseInOutDetail = this.list
 				this.WarehouseInOutInfo.statusFlag = 3
+				this.WarehouseInOutInfo.pcFlag = 0
 				this.WarehouseInOutInfo.taskType = "入库任务"
 				uni.showLoading({
 					title:"正在提交"
 				})
-				
 				this.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse', this.WarehouseInOutInfo).then(res => {
 					if(res.data.code==200){
 						uni.showToast({
@@ -659,10 +683,12 @@ import upload from '@/components/upload.vue';
 				}
 			},
 			ruChange(e) {
+				this.ruIndex = e.detail.value
 				this.WarehouseInOutInfo.inOutTypeKey = e.detail.value
 				this.WarehouseInOutInfo.inOutType = this.ruType[this.ruIndex];
 			},
 			pinChange(e) {
+				this.pinIndex = e.detail.value
 				this.WarehouseInOutInfo.gradeKey = e.detail.value
 				this.WarehouseInOutInfo.grade = this.pinType[this.pinIndex];
 			},
@@ -808,10 +834,14 @@ import upload from '@/components/upload.vue';
 				font-size: 46upx;
 			}
 		}
-	
-		
 	}
 	.container{
 		padding-bottom: 160upx;
 	}
+	.picture{
+		width: 75px;
+		height: 75px;
+		border-radius: 10px;
+		margin-left: 16px;
+	}
 </style>

+ 0 - 2
pages/task/my_task.vue

@@ -116,7 +116,6 @@
 					title:"正在加载"
 				})
 				this.$api.doRequest('get', '/warehouseInOutInfo/selectInfoByKeyWord', this.warehouseInOutInfo).then(res => {
-					console.log(res, "对象")
 					if (res.data.code == 200) {
 						this.taskInfo = res.data.data
 						uni.hideLoading()
@@ -147,7 +146,6 @@
 				this.warehouseInOutInfo.statusFlag = this.statusFlag
 				//this.warehouseInOutInfo.status = this.status
 				this.$api.doRequest('get', '/warehouseInOutInfo/selectInfo', this.warehouseInOutInfo).then(res => {
-					console.log(res, "对象")
 					if (res.data.code == 200) {
 						let data = res.data.data.records
 						//采购信息