农业废弃物添加秸秆

This commit is contained in:
978184212@qq.com 2025-12-03 10:38:46 +08:00
parent 5a20188666
commit c67bb910da
4 changed files with 49 additions and 42 deletions

View File

@ -37,6 +37,14 @@
<input type="text" placeholder="请输入覆膜作物" v-model="survMulchRecord.cropName" @blur="crop"> <input type="text" placeholder="请输入覆膜作物" v-model="survMulchRecord.cropName" @blur="crop">
</view> </view>
</view> </view>
<view class="form_item">
<view class="form_top">
秸秆残留量:
</view>
<view class="form_bot">
<input type="text" placeholder="请输入秸秆残留量" v-model="survMulchRecord.strawRemain" @blur="cropRemain">
</view>
</view>
<view class="form_item"> <view class="form_item">
<view class="form_top"> <view class="form_top">
覆膜年份: 覆膜年份:
@ -103,6 +111,7 @@
mulchYear:'', mulchYear:'',
mulchRemain:'', mulchRemain:'',
cropName:'', cropName:'',
strawRemain:'',
stationName:'', stationName:'',
stationCode:'', stationCode:'',
mNote:'', mNote:'',
@ -132,21 +141,17 @@
value:res.data.data[i].stationCode value:res.data.data[i].stationCode
}) })
this.array.push(res.data.data[i].stationName) this.array.push(res.data.data[i].stationName)
console.log(this.array)
} }
}) })
}, },
bindPickerChange: function(e) { bindPickerChange: function(e) {
console.log('picker发送选择改变携带值为', e.detail.value)
this.index = e.detail.value this.index = e.detail.value
console.log(this.index)
this.survMulchRecord.stationName = this.array[this.index] this.survMulchRecord.stationName = this.array[this.index]
for(var i=0;i<this.arrays.length;i++){ for(var i=0;i<this.arrays.length;i++){
if(this.survMulchRecord.stationName == this.arrays[i].label){ if(this.survMulchRecord.stationName == this.arrays[i].label){
this.survMulchRecord.stationCode = this.arrays[i].value this.survMulchRecord.stationCode = this.arrays[i].value
} }
} }
console.log(this.survMulchRecord)
}, },
bindDateChange: function(e) { bindDateChange: function(e) {
this.survMulchRecord.sampTime = e.detail.value this.survMulchRecord.sampTime = e.detail.value
@ -160,6 +165,9 @@
crop(e){ crop(e){
this.survMulchRecord.cropName = e.detail.value this.survMulchRecord.cropName = e.detail.value
}, },
cropRemain(e){
this.survMulchRecord.strawRemain = e.detail.value
},
uploadimg(){ uploadimg(){
var that = this var that = this
uni.chooseImage({ uni.chooseImage({
@ -182,7 +190,6 @@
biz:'busi' biz:'busi'
} }
}).then(res =>{ }).then(res =>{
console.log(res.data)
var imglist = that.imglist var imglist = that.imglist
imglist.push({ imglist.push({
path:res.data.data.savePath, path:res.data.data.savePath,
@ -190,7 +197,6 @@
}) })
var mpics = that.mpics var mpics = that.mpics
mpics.push(res.data.data.savePath) mpics.push(res.data.data.savePath)
console.log(imglist,1456145)
}) })
} }
}else { }else {
@ -204,7 +210,6 @@
}, },
// //
seepic(item) { seepic(item) {
console.log(item.path,'图片路径')
let photoList = this.imglist.map(item => { let photoList = this.imglist.map(item => {
return this.baseUrl + '/applet/common/static/' + item.path; return this.baseUrl + '/applet/common/static/' + item.path;
}); });
@ -244,6 +249,14 @@
}) })
return return
} }
if(!this.survMulchRecord.strawRemain){
uni.showToast({
title: "请输入秸秆残留量",
icon: 'none',
duration: 2000
})
return
}
if(!this.survMulchRecord.mulchYear){ if(!this.survMulchRecord.mulchYear){
uni.showToast({ uni.showToast({
title: "请选择覆膜年份", title: "请选择覆膜年份",

View File

@ -13,6 +13,10 @@
<view class="left">覆膜作物:</view> <view class="left">覆膜作物:</view>
<view class="nr">{{survMulchRecord.cropName}}</view> <view class="nr">{{survMulchRecord.cropName}}</view>
</view> </view>
<view class="form_item" v-if="survMulchRecord.strawRemain">
<view class="left">秸秆残留量:</view>
<view class="nr">{{survMulchRecord.strawRemain}}</view>
</view>
<view class="form_item" v-if="survMulchRecord.mulchYear"> <view class="form_item" v-if="survMulchRecord.mulchYear">
<view class="left">覆膜年份:</view> <view class="left">覆膜年份:</view>
<view class="nr">{{survMulchRecord.mulchYear}}</view> <view class="nr">{{survMulchRecord.mulchYear}}</view>
@ -75,9 +79,7 @@
}, },
onLoad(options) { onLoad(options) {
this.survMulchRecord = JSON.parse(decodeURIComponent(options.item)); this.survMulchRecord = JSON.parse(decodeURIComponent(options.item));
console.log(this.survMulchRecord)
this.mpics = this.survMulchRecord.mPics this.mpics = this.survMulchRecord.mPics
console.log(this.mpics)
this.imglist = [] this.imglist = []
var imglist = this.imglist var imglist = this.imglist
for(var i=0;i<this.mpics.length;i++){ for(var i=0;i<this.mpics.length;i++){
@ -86,7 +88,6 @@
fileid:this.mpics[i] fileid:this.mpics[i]
}) })
} }
console.log(this.imglist,'图片')
}, },
onShow() { onShow() {
@ -99,7 +100,6 @@
}, },
// //
seepic(item) { seepic(item) {
console.log(item.path,'图片路径')
let photoList = this.imglist.map(item => { let photoList = this.imglist.map(item => {
return item.path; return item.path;
}); });

View File

@ -37,6 +37,14 @@
<input type="text" placeholder="请输入覆膜作物" v-model="survMulchRecord.cropName" @blur="crop"> <input type="text" placeholder="请输入覆膜作物" v-model="survMulchRecord.cropName" @blur="crop">
</view> </view>
</view> </view>
<view class="form_item">
<view class="form_top">
秸秆残留量:
</view>
<view class="form_bot">
<input type="text" placeholder="请输入秸秆残留量" v-model="survMulchRecord.strawRemain" @blur="crop">
</view>
</view>
<view class="form_item"> <view class="form_item">
<view class="form_top"> <view class="form_top">
覆膜年份: 覆膜年份:
@ -103,6 +111,7 @@
mulchYear:'', mulchYear:'',
mulchRemain:'', mulchRemain:'',
cropName:'', cropName:'',
strawRemain:'',
stationName:'', stationName:'',
stationCode:'', stationCode:'',
mNote:'', mNote:'',
@ -119,9 +128,7 @@
}, },
onLoad(options) { onLoad(options) {
this.survMulchRecord = JSON.parse(decodeURIComponent(options.item)); this.survMulchRecord = JSON.parse(decodeURIComponent(options.item));
console.log(this.survMulchRecord)
this.mpics = this.survMulchRecord.mPics this.mpics = this.survMulchRecord.mPics
console.log(this.mpics)
this.imglist = [] this.imglist = []
var imglist = this.imglist var imglist = this.imglist
for(var i=0;i<this.mpics.length;i++){ for(var i=0;i<this.mpics.length;i++){
@ -145,21 +152,17 @@
value:res.data.data[i].stationCode value:res.data.data[i].stationCode
}) })
this.array.push(res.data.data[i].stationName) this.array.push(res.data.data[i].stationName)
console.log(this.array)
} }
}) })
}, },
bindPickerChange: function(e) { bindPickerChange: function(e) {
console.log('picker发送选择改变携带值为', e.detail.value)
this.index = e.detail.value this.index = e.detail.value
console.log(this.index)
this.survMulchRecord.stationName = this.array[this.index] this.survMulchRecord.stationName = this.array[this.index]
for(var i=0;i<this.arrays.length;i++){ for(var i=0;i<this.arrays.length;i++){
if(this.survMulchRecord.stationName == this.arrays[i].label){ if(this.survMulchRecord.stationName == this.arrays[i].label){
this.survMulchRecord.stationCode = this.arrays[i].value this.survMulchRecord.stationCode = this.arrays[i].value
} }
} }
console.log(this.survMulchRecord)
}, },
bindDateChange: function(e) { bindDateChange: function(e) {
this.survMulchRecord.sampTime = e.detail.value this.survMulchRecord.sampTime = e.detail.value
@ -173,6 +176,9 @@
crop(e){ crop(e){
this.survMulchRecord.cropName = e.detail.value this.survMulchRecord.cropName = e.detail.value
}, },
cropRemain(e){
this.survMulchRecord.strawRemain = e.detail.value
},
uploadimg(){ uploadimg(){
var that = this var that = this
uni.chooseImage({ uni.chooseImage({
@ -194,8 +200,7 @@
file:res.tempFilePaths[i], file:res.tempFilePaths[i],
biz:'busi' biz:'busi'
} }
}).then(res =>{ }).then(res =>{
console.log(res.data)
var imglist = that.imglist var imglist = that.imglist
imglist.push({ imglist.push({
path:res.data.data.savePath, path:res.data.data.savePath,
@ -203,7 +208,6 @@
}) })
var mpics = that.mpics var mpics = that.mpics
mpics.push(res.data.data.savePath) mpics.push(res.data.data.savePath)
console.log(imglist,1456145)
}) })
} }
}else { }else {
@ -221,7 +225,6 @@
}, },
// //
seepic(item) { seepic(item) {
console.log(item.path,'图片路径')
let photoList = this.imglist.map(item => { let photoList = this.imglist.map(item => {
return this.baseUrl + '/applet/common/static/' + item.path; return this.baseUrl + '/applet/common/static/' + item.path;
}); });
@ -257,6 +260,14 @@
}) })
return return
} }
if(!this.survMulchRecord.strawRemain){
uni.showToast({
title: "请输入秸秆残留量",
icon: 'none',
duration: 2000
})
return
}
if(!this.survMulchRecord.mulchYear){ if(!this.survMulchRecord.mulchYear){
uni.showToast({ uni.showToast({
title: "请选择覆膜年份", title: "请选择覆膜年份",
@ -281,7 +292,6 @@
}) })
return return
} }
console.log(this.survMulchRecord)
this.$http.post('/applet/survMulchRecord/edit',this.survMulchRecord).then(res=>{ this.$http.post('/applet/survMulchRecord/edit',this.survMulchRecord).then(res=>{
uni.showLoading({ uni.showLoading({
title: '正在提交...' title: '正在提交...'

View File

@ -41,6 +41,10 @@
<span class="nrbt">覆膜作物:</span> <span class="nrbt">覆膜作物:</span>
{{item.cropName}} {{item.cropName}}
</view> </view>
<view class="bot_item">
<span class="nrbt">秸秆残留量:</span>
{{item.strawRemain?item.strawRemain:0}}
</view>
<view class="bot_item"> <view class="bot_item">
<span class="nrbt">地膜残留量:</span> <span class="nrbt">地膜残留量:</span>
<span class="number">{{item.mulchRemain}}kg/hm²</span> <span class="number">{{item.mulchRemain}}kg/hm²</span>
@ -109,7 +113,6 @@
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
var navigationHeight = 44 * pxToRpxScale var navigationHeight = 44 * pxToRpxScale
this.height = res.windowHeight * pxToRpxScale//px rpx this.height = res.windowHeight * pxToRpxScale//px rpx
console.log(this.height,ktxStatusHeight,navigationHeight)
this.scorllheight = this.height - 182 this.scorllheight = this.height - 182
} }
}); });
@ -122,14 +125,12 @@
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
var navigationHeight = 44 * pxToRpxScale var navigationHeight = 44 * pxToRpxScale
this.height = res.windowHeight * pxToRpxScale//px rpx this.height = res.windowHeight * pxToRpxScale//px rpx
console.log(this.height,ktxStatusHeight,navigationHeight)
this.scorllheight = this.height - 182 this.scorllheight = this.height - 182
} }
}); });
let pages = getCurrentPages(); let pages = getCurrentPages();
let currPage = pages[pages.length - 1]; // let currPage = pages[pages.length - 1]; //
this.reload = currPage.data.reload this.reload = currPage.data.reload
console.log('this.reload',this.reload)
if(this.reload){ if(this.reload){
this.cropName = '' this.cropName = ''
this.sampTime = '' this.sampTime = ''
@ -152,7 +153,6 @@
value:res.data.data[i].stationCode value:res.data.data[i].stationCode
}) })
this.array.push(res.data.data[i].stationName) this.array.push(res.data.data[i].stationName)
console.log(this.array)
} }
}) })
}, },
@ -187,24 +187,18 @@
this.List = this.List.concat(data) this.List = this.List.concat(data)
if(res.data.data.total != 0){ if(res.data.data.total != 0){
this.allNum = Number(res.data.data.total)/Number(this.pageSize)+''; this.allNum = Number(res.data.data.total)/Number(this.pageSize)+'';
console.log(this.allNum,'总页数')
if(this.allNum.indexOf('.') == -1) { if(this.allNum.indexOf('.') == -1) {
this.allNum = this.allNum; this.allNum = this.allNum;
console.log(this.allNum,'if')
} else { } else {
this.allNum = parseInt(Number(this.allNum)+1); this.allNum = parseInt(Number(this.allNum)+1);
console.log(this.allNum,'else')
} }
console.log(this.pageNo,this.allNum,'156156')
if(this.pageNo == this.allNum) { if(this.pageNo == this.allNum) {
this.isLastpage = true; this.isLastpage = true;
this.loadStatus='nomore' this.loadStatus='nomore'
console.log(this.isLastpage,'true','nomore')
} else { } else {
this.isLastpage = false; this.isLastpage = false;
// this.isLoadMore=true // this.isLoadMore=true
this.loadStatus = 'more' this.loadStatus = 'more'
console.log(this.isLastpage,'false')
} }
}else{ }else{
this.isLastpage = true; this.isLastpage = true;
@ -216,7 +210,6 @@
}) })
}, },
lower() { lower() {
console.log("最后一页了,取消下拉功能");
// //
if (this.isLastpage) { if (this.isLastpage) {
return return
@ -226,7 +219,6 @@
this.intervalId = setInterval(() => { this.intervalId = setInterval(() => {
num = num+1; num = num+1;
},1000) },1000)
console.log(this.intervalId,num)
this.pageNo = this.pageNo + 1; this.pageNo = this.pageNo + 1;
let params = {} let params = {}
params.pageNo = this.pageNo params.pageNo = this.pageNo
@ -243,12 +235,10 @@
if(this.pageNo == this.allNum) { if(this.pageNo == this.allNum) {
this.isLastpage = true; this.isLastpage = true;
this.loadStatus='nomore' this.loadStatus='nomore'
console.log(this.isLastpage,'true')
} else { } else {
this.isLastpage = false; this.isLastpage = false;
// this.isLoadMore=true // this.isLoadMore=true
this.loadStatus = 'more' this.loadStatus = 'more'
console.log(this.isLastpage,'false')
} }
}else{ }else{
this.isLastpage = true; this.isLastpage = true;
@ -258,7 +248,6 @@
}) })
}, },
bindPickerChange: function(e) { bindPickerChange: function(e) {
console.log('picker发送选择改变携带值为', e.detail.value)
this.index = e.detail.value this.index = e.detail.value
this.stationName = this.array[this.index] this.stationName = this.array[this.index]
for(var i=0;i<this.arrays.length;i++){ for(var i=0;i<this.arrays.length;i++){
@ -275,7 +264,6 @@
this.getList() this.getList()
}, },
changenr(){ changenr(){
console.log(this.cropName)
this.pageNo = 1 this.pageNo = 1
this.getList() this.getList()
}, },
@ -290,12 +278,10 @@
}) })
}, },
caozuo(item){ caozuo(item){
console.log(item)
var that = this var that = this
uni.showActionSheet({ uni.showActionSheet({
itemList: ['编辑', '删除'], itemList: ['编辑', '删除'],
success: function (res) { success: function (res) {
console.log('选中了第' + (res.tapIndex + 1) + '个按钮');
if((res.tapIndex + 1) == 1){ if((res.tapIndex + 1) == 1){
uni.navigateTo({ uni.navigateTo({
url:'/packDetail/pages/waste/edit?item='+ encodeURIComponent(JSON.stringify(item)) url:'/packDetail/pages/waste/edit?item='+ encodeURIComponent(JSON.stringify(item))
@ -306,8 +292,6 @@
content: '是否删除数据?', content: '是否删除数据?',
success: function (res) { success: function (res) {
if (res.confirm) { if (res.confirm) {
console.log('用户点击确定');
console.log(item.id,1)
that.$http.delete(that.deleteUrl+'?id='+item.id).then(res =>{ that.$http.delete(that.deleteUrl+'?id='+item.id).then(res =>{
if(res.data.code == 0){ if(res.data.code == 0){
uni.showToast({ uni.showToast({