yf_zd 5 gadi atpakaļ
vecāks
revīzija
aba7cdca1b

+ 1 - 1
src/main.js

@@ -14,7 +14,7 @@ Vue.config.productionTip = false //是阻止显示生产模式的消息
 
 Vue.prototype.jsonUrl = 'http://182.92.193.64'; //地图三级下钻页面使用-韩有波
 // Vue.prototype.$host = 'http://182.92.193.64:8002/api' // 线上图片服务器路径常量
-Vue.prototype.$host = 'http://192.168.1.120:8001/api' // 线下图片服务器路径常量
+Vue.prototype.$host = 'http://192.168.1.4:8000/' // 线下图片服务器路径常量
 
 
 import 'babel-polyfill' //兼容IE11

+ 6 - 6
src/pages/symanger/farmThing/harvest.vue

@@ -4,7 +4,6 @@
 			<el-breadcrumb-item>农事管理</el-breadcrumb-item>
 			<el-breadcrumb-item>采收</el-breadcrumb-item>
 		</el-breadcrumb>
-		{{planted}}
 		<div class="search-box">
 			<div class="filter-box">
 				<el-select
@@ -65,7 +64,7 @@
 						<div class="btns2">
 							<a
 								:class="{ bg: itemId == item.id ? true : false }"
-								@click="showQRcode(item.id)"
+								@click="showQRcode(item.id,item.backcode)"
 								>二维码</a
 							>
 						</div>
@@ -186,7 +185,7 @@
 			@close="QRcodeDialogClosed"
 		>
 			<div id="qrCode" ref="QRcodeShowImg"></div>
-			<!-- <p>{{ QRcode }}</p> -->
+			<p>{{ QRcodenum }}</p>
 		</el-dialog>
 	</div>
 </template>
@@ -235,7 +234,7 @@ export default {
 					{ required: true, message: '请选择操作人', trigger: 'change' }
 				]
 			},
-			QRcode: ''
+			QRcodenum: ''
 		}
 	},
 	created() {
@@ -350,13 +349,14 @@ export default {
 			// 	}
 			// })
 		},
-		showQRcode(id) {
+		showQRcode(id,backcode) {
 			this.itemId = id
 			this.showQRcodeDialogVisible = true
 			this.QRcode = id
+			this.QRcodenum = backcode
 			this.$nextTick(() => {
 				new QRCode(this.$refs.QRcodeShowImg, {
-					text: 'http://94.191.119.50:8555/#/tracebackDetailApp/' + id,
+					text: 'http://192.168.1.12:8000/#/tracebackDetailApp/' + backcode,
 					width: 200,
 					height: 200,
 					colorDark: '#333333', //二维码颜色

+ 14 - 20
src/pages/symanger/farmThing/sale.vue

@@ -238,7 +238,7 @@ export default {
 				method: 'POST',
 				url: '/api/all_base'
 			}).then((res) => {
-				this.baseList = res.data.data.data
+				this.baseList = res.data.data
 			})
 		},
 		getList() {
@@ -250,14 +250,12 @@ export default {
 					farmname: this.base
 				})
 			}).then((res) => {
-				if (res.data.message == '') {
-					let data = res.data.data.data
-					this.tableData = data.map((item) => {
-						item.selltime = this.formatTime(item.selltime * 1000)
-						return item
-					})
-					this.totalNum = res.data.data.counts
-				}
+				let data = res.data.data
+				this.tableData = data.map((item) => {
+					item.selltime = this.formatTime(item.selltime * 1000)
+					return item
+				})
+				this.totalNum = res.data.counts
 			})
 		},
 		saleEdit(row) {
@@ -283,12 +281,10 @@ export default {
 				url: '/api/pick_info',
 				data: this.qs.stringify({ page: this.page })
 			}).then((res) => {
-				if (res.data.message == '') {
-					let data = res.data.data.data
-					this.harvestList = data.filter((item) => {
-						return item.sell == '0'
-					})
-				}
+				let data = res.data.data
+				this.harvestList = data.filter((item) => {
+					return item.sell == '0'
+				})
 			})
 		},
 		saleAdd() {
@@ -313,10 +309,8 @@ export default {
 						user: this.addForm.operator
 					})
 				}).then((res) => {
-					if (res.data.message == '') {
-						this.getList()
-						this.farmThingAddDialogVisible = false
-					}
+					this.getList()
+					this.farmThingAddDialogVisible = false
 				})
 			})
 		},
@@ -337,7 +331,7 @@ export default {
 						user: this.editForm.operator
 					})
 				}).then((res) => {
-					if (res.data.message == '') {
+					if (res.data == 1) {
 						this.getList()
 					} else {
 						this.$message.warning(res.data.message)

+ 10 - 12
src/pages/symanger/farmThing/transport.vue

@@ -332,7 +332,7 @@ export default {
 				method: 'POST',
 				url: '/api/all_base'
 			}).then((res) => {
-				this.baseList = res.data.data.data
+				this.baseList = res.data.data
 			})
 		},
 		getList() {
@@ -344,16 +344,14 @@ export default {
 					farmname: this.base
 				})
 			}).then((res) => {
-				if (res.data.message == '') {
-					let data = res.data.data.data
+					let data = res.data.data
 					this.tableData = data.map((item) => {
 						item.stime = this.formatTime(item.stime * 1000)
 						item.etime = this.formatTime(item.etime * 1000)
 						item.address = item.province + item.city + item.area
 						return item
 					})
-					this.totalNum = res.data.data.counts
-				}
+					this.totalNum = res.data.counts
 			})
 		},
 		transEdit(row) {
@@ -387,12 +385,10 @@ export default {
 				url: '/api/sell_info',
 				data: this.qs.stringify({ page: this.page })
 			}).then((res) => {
-				if (res.data.message == '') {
-					let data = res.data.data.data
+					let data = res.data.data
 					this.selltList = data.filter((item) => {
 						return item.is_trans == '0' //获取未运输的采收
 					})
-				}
 			})
 		},
 		saleAdd() {
@@ -425,9 +421,11 @@ export default {
 						area: this.destination.district
 					})
 				}).then((res) => {
-					if (res.data.message == '') {
+					if (res.data == 1) {
 						this.getList()
 						this.farmThingAddDialogVisible = false
+					}else{
+						this.$message.warning(res.data)
 					}
 				})
 			})
@@ -456,10 +454,10 @@ export default {
 						area: this.destination.district
 					})
 				}).then((res) => {
-					if (res.data.message == '') {
+					if (res.data == 1) {
 						this.getList()
 					} else {
-						this.$message.warning(res.data.message)
+						this.$message.warning(res.data)
 					}
 				})
 				this.farmThingEditDialogVisible = false
@@ -485,7 +483,7 @@ export default {
 							id: id
 						})
 					}).then((res) => {
-						if (res.data.message == '') {
+						if (res.data == 1) {
 							this.$message({
 								type: 'success',
 								message: '删除成功!'

+ 6 - 8
src/pages/symanger/resultInfo/cqReports.vue

@@ -18,7 +18,7 @@
 						<i @click="delectImg(item.id)" class="iconfont icon-shanchu"></i>
 					</div>
 					<div class="photoImg">
-						<img :src="$host + item.qualityphoto" />
+						<img :src="$host+item.qualityphoto" />
 					</div>
 					<div class="photoMsg">{{ item.qualitydesc }}</div>
 				</div>
@@ -151,8 +151,8 @@ export default {
 					backcode: this.backcode
 				})
 			}).then((res) => {
-				if (res.data.message == '') {
-					this.reportList = res.data.data
+				if (res.status == 200) {
+					this.reportList = res.data._list
 				}
 			})
 		},
@@ -170,7 +170,7 @@ export default {
 							id
 						})
 					}).then((res) => {
-						if (res.data.message == '') {
+						if (res.data == 1) {
 							this.$message({
 								type: 'success',
 								message: '删除成功!'
@@ -199,9 +199,7 @@ export default {
 					url: '/api/base_photo',
 					data: form
 				}).then((res) => {
-					if (res.data.message == '') {
-						this.addSyForm.img = res.data.data.src
-					}
+					this.addSyForm.img = res.data.src
 				})
 			})
 		},
@@ -248,7 +246,7 @@ export default {
 							qualityphoto: this.addSyForm.img
 						})
 					}).then((res) => {
-						if (res.data.message == '') {
+						if (res.status == 200) {
 							this.addPrportVisible = false
 							this.$message.success('提交成功!')
 							this.getInfo()

+ 8 - 8
src/pages/symanger/resultInfo/growRecord.vue

@@ -193,13 +193,13 @@ export default {
 					backcode: this.backcode
 				})
 			}).then((res) => {
-				if (res.data.message == '') {
+				if (res.status == 200) {
 					let {
 						photo2: img2,
 						photo3: img3,
 						photo4: img4,
 						photo5: img5
-					} = res.data.data
+					} = res.data
 					this.addSyForm = {
 						img2,
 						img3,
@@ -298,22 +298,22 @@ export default {
 					url: '/api/base_photo',
 					data: form
 				}).then((res) => {
-					if (res.data.message == '') {
+					if (res.status == 200) {
 						switch (this.flag) {
 							case 1:
-								this.addSyForm.img1 = res.data.data.src
+								this.addSyForm.img1 = res.data.src
 								break
 							case 2:
-								this.addSyForm.img2 = res.data.data.src
+								this.addSyForm.img2 = res.data.src
 								break
 							case 3:
-								this.addSyForm.img3 = res.data.data.src
+								this.addSyForm.img3 = res.data.src
 								break
 							case 4:
-								this.addSyForm.img4 = res.data.data.src
+								this.addSyForm.img4 = res.data.src
 								break
 							case 5:
-								this.addSyForm.img5 = res.data.data.src
+								this.addSyForm.img5 = res.data.src
 								break
 						}
 					}

+ 4 - 6
src/pages/symanger/resultInfo/productInfo.vue

@@ -113,8 +113,8 @@ export default {
 					backcode: this.backcode
 				})
 			}).then((res) => {
-				if (res.data.message == '') {
-					let { productphoto, productdesc } = res.data.data
+				if (res.status == 200) {
+					let { productphoto, productdesc } = res.data
 					this.addSyForm.intro = productdesc
 					this.addSyForm.imgSrc = productphoto
 				}
@@ -146,9 +146,7 @@ export default {
 					url: '/api/base_photo',
 					data: form
 				}).then((res) => {
-					if (res.data.message == '') {
-						this.addSyForm.imgSrc = res.data.data.src
-					}
+					this.addSyForm.imgSrc = res.data.src
 				})
 			})
 		},
@@ -170,7 +168,7 @@ export default {
 							productdesc: this.addSyForm.intro
 						})
 					}).then((res) => {
-						if (res.data.message == '') {
+						if (res.status == 200){
 							this.$message.success('提交成功!')
 						}
 					})

+ 9 - 11
src/pages/symanger/resultInfo/resultInfoList.vue

@@ -65,7 +65,7 @@
 							type="primary"
 							size="mini"
 							plain
-							@click="showQRcodeFun(item.id)"
+							@click="showQRcodeFun(item.id,item.backcode)"
 							>二维码</el-button
 						>
 					</div>
@@ -87,7 +87,7 @@
 			@close="QRcodeDialogClosed"
 		>
 			<div id="qrCode" ref="QRcodeShowImg"></div>
-			<p>{{ QRcode }}</p>
+			<p>{{ QRcodenum }}</p>
 			<!-- <span slot="footer" class="dialog-footer">
                <el-button @click="showQRcodeVisible= false">取 消</el-button>
                <el-button type="primary" @click="addUserSubm">确认</el-button>
@@ -112,7 +112,7 @@ export default {
 		return {
 			page: 1,
 			totalNum: 0,
-			QRcode: '',
+			QRcodenum: '',
 			keyWords: '',
 			pickList: [],
 			base:'',
@@ -166,7 +166,7 @@ export default {
 				method: 'POST',
 				url: '/api/all_base'
 			}).then((res) => {
-				this.baseList = res.data.data.data
+				this.baseList = res.data.data
 			})
 		},
 		getPickList() {
@@ -175,10 +175,8 @@ export default {
 				url: '/api/pick_info',
 				data: this.qs.stringify({ page: this.page,farmname:this.base })
 			}).then((res) => {
-				if (res.data.message == '') {
-					this.pickList = res.data.data.data
-					this.totalNum = res.data.data.counts
-				}
+				this.pickList = res.data.data
+				this.totalNum = res.data.counts
 			})
 		},
 		lookProduct(backcode) {
@@ -222,12 +220,12 @@ export default {
 			this.page = val
 			this.getPickList()
 		},
-		showQRcodeFun(id) {
+		showQRcodeFun(id,backcode) {
 			this.showQRcodeVisible = true
-			this.QRcode = id
+			this.QRcodenum = backcode
 			this.$nextTick(() => {
 				new QRCode(this.$refs.QRcodeShowImg, {
-					text: 'http://47.104.218.216:8000/#/tracebackDetailApp/' + id,
+					text: 'http://192.168.1.12:8000/#/tracebackDetailApp/' + backcode,
 					width: 200,
 					height: 200,
 					colorDark: '#333333', //二维码颜色

+ 29 - 37
src/pages/symanger/resultInfo/tracebackDetail.vue

@@ -242,22 +242,20 @@ export default {
 					backcode: this.backcode
 				})
 			}).then((res) => {
-				if (res.data.message == '') {
-					let obj = res.data.data
-					this.center.lng =
-						obj.farmaddr && obj.farmaddr.split(';')[0].split(',')[0]
-					this.center.lat =
-						obj.farmaddr && obj.farmaddr.split(';')[0].split(',')[1]
-					obj.productphoto = obj.productphoto ? `/api/${obj.productphoto}` : '' //图片地址
-					this.pinfo = obj
+				let obj = res.data
+				this.center.lng =
+					obj.farmaddr && obj.farmaddr.split(';')[0].split(',')[0]
+				this.center.lat =
+					obj.farmaddr && obj.farmaddr.split(';')[0].split(',')[1]
+				obj.productphoto = obj.productphoto ? `/api/${obj.productphoto}` : '' //图片地址
+				this.pinfo = obj
 
-					//地块地图定位
-					// map.clearOverlays();
-					var new_point = new this.BMap.Point(this.center.lng, this.center.lat)
-					var marker = new this.BMap.Marker(new_point) // 创建标注
-					this.map.addOverlay(marker) // 将标注添加到地图中
-					this.map.panTo(new_point)
-				}
+				//地块地图定位
+				// map.clearOverlays();
+				var new_point = new this.BMap.Point(this.center.lng, this.center.lat)
+				var marker = new this.BMap.Marker(new_point) // 创建标注
+				this.map.addOverlay(marker) // 将标注添加到地图中
+				this.map.panTo(new_point)
 			})
 		},
 		//成长相册
@@ -269,13 +267,11 @@ export default {
 					backcode: this.backcode
 				})
 			}).then((res) => {
-				if (res.data.message == '') {
-					let {photo2, photo3, photo4, photo5} = res.data.data
-					this.growPic[0].img = photo2
-					this.growPic[1].img = photo3
-					this.growPic[2].img = photo4
-					this.growPic[3].img = photo5
-				}
+				let {photo2, photo3, photo4, photo5} = res.data
+				this.growPic[0].img = photo2
+				this.growPic[1].img = photo3
+				this.growPic[2].img = photo4
+				this.growPic[3].img = photo5
 			})
 		},
 		//成长档案
@@ -287,18 +283,16 @@ export default {
 					backcode: this.backcode
 				})
 			}).then((res) => {
-				if (res.data.message == '') {
-					let data = res.data.data.data
-					let arr = data.irrigate
-						.concat(data.job)
-						.concat(data.manura)
-						.concat(data.medi)
-						.concat(data.plant)
-					arr.sort((a, b) => {
-						return a.uptime - b.uptime
-					})
-					this.activities = arr
-				}
+				let data = res.data.data
+				let arr = data.irrigate
+					.concat(data.job)
+					.concat(data.manura)
+					.concat(data.medi)
+					.concat(data.plant)
+				arr.sort((a, b) => {
+					return a.uptime - b.uptime
+				})
+				this.activities = arr
 			})
 		},
 		//检验报告
@@ -310,9 +304,7 @@ export default {
 					backcode: this.backcode
 				})
 			}).then((res) => {
-				if (res.data.message == '') {
-					this.reportList = res.data.data
-				}
+				this.reportList = res.data._list
 			})
 		},
 		handlerBMap({ BMap, map }) {

+ 27 - 33
src/pages/symanger/resultInfo/tracebackDetailApp.vue

@@ -21,7 +21,7 @@
 							<div class="varietyInfoTxt">
 								<div>名称:{{ pinfo.pickname }}</div>
 								<div>产地:{{ pinfo.farm + '/' + pinfo.land }}</div>
-								<div>种植日期:{{ (pinfo.picktime * 1000) | formatTime }}</div>
+								<div>种植日期:{{ (pinfo.planttime * 1000) | formatTime }}</div>
 								<div>采摘日期:{{ (pinfo.picktime * 1000) | formatTime }}</div>
 							</div>
 						</div>
@@ -89,7 +89,7 @@
 									>
 										<el-card
 											class="box-card growImg"
-											:body-style="{ padding: '0 0 5px 0' }"
+											:body-style="{ padding: '0 0 5px 0'}"
 										>
 											<div>
 												<template v-if="item.img">
@@ -217,6 +217,7 @@ export default {
 				land: '',
 				pickname: '',
 				picktime: '',
+				planttime: '',
 				address: '',
 				user: '',
 				productdesc: '',
@@ -261,13 +262,11 @@ export default {
 					backcode: this.backcode
 				})
 			}).then((res) => {
-				if (res.data.message == '') {
-					let obj = res.data.data
-					obj.productphoto = obj.productphoto ? `/api/${obj.productphoto}` : '' //图片地址
-					let lng = obj.farmaddr && obj.farmaddr.split(';')[0].split(',')[0]
-					let lat = obj.farmaddr && obj.farmaddr.split(';')[0].split(',')[1]
-					this.formatAddress(lng, lat, obj)
-				}
+				let obj = res.data
+				obj.productphoto = obj.productphoto ? `/api/${obj.productphoto}` : '' //图片地址
+				let lng = obj.farmaddr && obj.farmaddr.split(';')[0].split(',')[0]
+				let lat = obj.farmaddr && obj.farmaddr.split(';')[0].split(',')[1]
+				this.formatAddress(lng, lat, obj)
 			})
 		},
 		//经纬度转换
@@ -302,12 +301,10 @@ export default {
 					backcode: this.backcode
 				})
 			}).then((res) => {
-				if (res.data.message == '') {
-					this.reportList = res.data.data
+					this.reportList = res.data._list
 					this.$nextTick(() => {
 						this.swiperInit()
 					})
-				}
 			})
 		},
 		//成长相册
@@ -319,13 +316,11 @@ export default {
 					backcode: this.backcode
 				})
 			}).then((res) => {
-				if (res.data.message == '') {
-					let { photo2, photo3, photo4, photo5 } = res.data.data
-					this.growPic[0].img = photo2
-					this.growPic[1].img = photo3
-					this.growPic[2].img = photo4
-					this.growPic[3].img = photo5
-				}
+				let { photo2, photo3, photo4, photo5 } = res.data
+				this.growPic[0].img = photo2
+				this.growPic[1].img = photo3
+				this.growPic[2].img = photo4
+				this.growPic[3].img = photo5
 			})
 		},
 		//成长档案
@@ -337,18 +332,16 @@ export default {
 					backcode: this.backcode
 				})
 			}).then((res) => {
-				if (res.data.message == '') {
-					let data = res.data.data.data
-					let arr = data.irrigate
-						.concat(data.job)
-						.concat(data.manura)
-						.concat(data.medi)
-						.concat(data.plant)
-					arr.sort((a, b) => {
-						return a.uptime - b.uptime
-					})
-					this.activities = arr
-				}
+				let data = res.data.data
+				let arr = data.irrigate
+					.concat(data.job)
+					.concat(data.manura)
+					.concat(data.medi)
+					.concat(data.plant)
+				arr.sort((a, b) => {
+					return a.uptime - b.uptime
+				})
+				this.activities = arr
 			})
 		},
 		handleChange(activeNames) {
@@ -460,8 +453,9 @@ export default {
 			img {
 				margin: auto;
 				display: block;
-				width: 80%;
-				height: auto;
+				// width: 100%;
+				// height: auto;
+				height: 2rem;
 			}
 		}
 		// 成长档案