农业废弃物添加秸秆
This commit is contained in:
parent
5a20188666
commit
c67bb910da
|
|
@ -37,6 +37,14 @@
|
|||
<input type="text" placeholder="请输入覆膜作物" v-model="survMulchRecord.cropName" @blur="crop">
|
||||
</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_top">
|
||||
覆膜年份:
|
||||
|
|
@ -103,6 +111,7 @@
|
|||
mulchYear:'',
|
||||
mulchRemain:'',
|
||||
cropName:'',
|
||||
strawRemain:'',
|
||||
stationName:'',
|
||||
stationCode:'',
|
||||
mNote:'',
|
||||
|
|
@ -132,21 +141,17 @@
|
|||
value:res.data.data[i].stationCode
|
||||
})
|
||||
this.array.push(res.data.data[i].stationName)
|
||||
console.log(this.array)
|
||||
}
|
||||
})
|
||||
},
|
||||
bindPickerChange: function(e) {
|
||||
console.log('picker发送选择改变,携带值为', e.detail.value)
|
||||
this.index = e.detail.value
|
||||
console.log(this.index)
|
||||
this.survMulchRecord.stationName = this.array[this.index]
|
||||
for(var i=0;i<this.arrays.length;i++){
|
||||
if(this.survMulchRecord.stationName == this.arrays[i].label){
|
||||
this.survMulchRecord.stationCode = this.arrays[i].value
|
||||
}
|
||||
}
|
||||
console.log(this.survMulchRecord)
|
||||
},
|
||||
bindDateChange: function(e) {
|
||||
this.survMulchRecord.sampTime = e.detail.value
|
||||
|
|
@ -160,6 +165,9 @@
|
|||
crop(e){
|
||||
this.survMulchRecord.cropName = e.detail.value
|
||||
},
|
||||
cropRemain(e){
|
||||
this.survMulchRecord.strawRemain = e.detail.value
|
||||
},
|
||||
uploadimg(){
|
||||
var that = this
|
||||
uni.chooseImage({
|
||||
|
|
@ -182,7 +190,6 @@
|
|||
biz:'busi'
|
||||
}
|
||||
}).then(res =>{
|
||||
console.log(res.data)
|
||||
var imglist = that.imglist
|
||||
imglist.push({
|
||||
path:res.data.data.savePath,
|
||||
|
|
@ -190,7 +197,6 @@
|
|||
})
|
||||
var mpics = that.mpics
|
||||
mpics.push(res.data.data.savePath)
|
||||
console.log(imglist,1456145)
|
||||
})
|
||||
}
|
||||
}else {
|
||||
|
|
@ -204,7 +210,6 @@
|
|||
},
|
||||
// 预览图片
|
||||
seepic(item) {
|
||||
console.log(item.path,'图片路径')
|
||||
let photoList = this.imglist.map(item => {
|
||||
return this.baseUrl + '/applet/common/static/' + item.path;
|
||||
});
|
||||
|
|
@ -244,6 +249,14 @@
|
|||
})
|
||||
return
|
||||
}
|
||||
if(!this.survMulchRecord.strawRemain){
|
||||
uni.showToast({
|
||||
title: "请输入秸秆残留量",
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
return
|
||||
}
|
||||
if(!this.survMulchRecord.mulchYear){
|
||||
uni.showToast({
|
||||
title: "请选择覆膜年份",
|
||||
|
|
|
|||
|
|
@ -13,6 +13,10 @@
|
|||
<view class="left">覆膜作物:</view>
|
||||
<view class="nr">{{survMulchRecord.cropName}}</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="left">覆膜年份:</view>
|
||||
<view class="nr">{{survMulchRecord.mulchYear}}年</view>
|
||||
|
|
@ -75,9 +79,7 @@
|
|||
},
|
||||
onLoad(options) {
|
||||
this.survMulchRecord = JSON.parse(decodeURIComponent(options.item));
|
||||
console.log(this.survMulchRecord)
|
||||
this.mpics = this.survMulchRecord.mPics
|
||||
console.log(this.mpics)
|
||||
this.imglist = []
|
||||
var imglist = this.imglist
|
||||
for(var i=0;i<this.mpics.length;i++){
|
||||
|
|
@ -86,7 +88,6 @@
|
|||
fileid:this.mpics[i]
|
||||
})
|
||||
}
|
||||
console.log(this.imglist,'图片')
|
||||
},
|
||||
onShow() {
|
||||
|
||||
|
|
@ -99,7 +100,6 @@
|
|||
},
|
||||
// 预览图片
|
||||
seepic(item) {
|
||||
console.log(item.path,'图片路径')
|
||||
let photoList = this.imglist.map(item => {
|
||||
return item.path;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -37,6 +37,14 @@
|
|||
<input type="text" placeholder="请输入覆膜作物" v-model="survMulchRecord.cropName" @blur="crop">
|
||||
</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_top">
|
||||
覆膜年份:
|
||||
|
|
@ -103,6 +111,7 @@
|
|||
mulchYear:'',
|
||||
mulchRemain:'',
|
||||
cropName:'',
|
||||
strawRemain:'',
|
||||
stationName:'',
|
||||
stationCode:'',
|
||||
mNote:'',
|
||||
|
|
@ -119,9 +128,7 @@
|
|||
},
|
||||
onLoad(options) {
|
||||
this.survMulchRecord = JSON.parse(decodeURIComponent(options.item));
|
||||
console.log(this.survMulchRecord)
|
||||
this.mpics = this.survMulchRecord.mPics
|
||||
console.log(this.mpics)
|
||||
this.imglist = []
|
||||
var imglist = this.imglist
|
||||
for(var i=0;i<this.mpics.length;i++){
|
||||
|
|
@ -145,21 +152,17 @@
|
|||
value:res.data.data[i].stationCode
|
||||
})
|
||||
this.array.push(res.data.data[i].stationName)
|
||||
console.log(this.array)
|
||||
}
|
||||
})
|
||||
},
|
||||
bindPickerChange: function(e) {
|
||||
console.log('picker发送选择改变,携带值为', e.detail.value)
|
||||
this.index = e.detail.value
|
||||
console.log(this.index)
|
||||
this.survMulchRecord.stationName = this.array[this.index]
|
||||
for(var i=0;i<this.arrays.length;i++){
|
||||
if(this.survMulchRecord.stationName == this.arrays[i].label){
|
||||
this.survMulchRecord.stationCode = this.arrays[i].value
|
||||
}
|
||||
}
|
||||
console.log(this.survMulchRecord)
|
||||
},
|
||||
bindDateChange: function(e) {
|
||||
this.survMulchRecord.sampTime = e.detail.value
|
||||
|
|
@ -173,6 +176,9 @@
|
|||
crop(e){
|
||||
this.survMulchRecord.cropName = e.detail.value
|
||||
},
|
||||
cropRemain(e){
|
||||
this.survMulchRecord.strawRemain = e.detail.value
|
||||
},
|
||||
uploadimg(){
|
||||
var that = this
|
||||
uni.chooseImage({
|
||||
|
|
@ -194,8 +200,7 @@
|
|||
file:res.tempFilePaths[i],
|
||||
biz:'busi'
|
||||
}
|
||||
}).then(res =>{
|
||||
console.log(res.data)
|
||||
}).then(res =>{
|
||||
var imglist = that.imglist
|
||||
imglist.push({
|
||||
path:res.data.data.savePath,
|
||||
|
|
@ -203,7 +208,6 @@
|
|||
})
|
||||
var mpics = that.mpics
|
||||
mpics.push(res.data.data.savePath)
|
||||
console.log(imglist,1456145)
|
||||
})
|
||||
}
|
||||
}else {
|
||||
|
|
@ -221,7 +225,6 @@
|
|||
},
|
||||
// 预览图片
|
||||
seepic(item) {
|
||||
console.log(item.path,'图片路径')
|
||||
let photoList = this.imglist.map(item => {
|
||||
return this.baseUrl + '/applet/common/static/' + item.path;
|
||||
});
|
||||
|
|
@ -257,6 +260,14 @@
|
|||
})
|
||||
return
|
||||
}
|
||||
if(!this.survMulchRecord.strawRemain){
|
||||
uni.showToast({
|
||||
title: "请输入秸秆残留量",
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
return
|
||||
}
|
||||
if(!this.survMulchRecord.mulchYear){
|
||||
uni.showToast({
|
||||
title: "请选择覆膜年份",
|
||||
|
|
@ -281,7 +292,6 @@
|
|||
})
|
||||
return
|
||||
}
|
||||
console.log(this.survMulchRecord)
|
||||
this.$http.post('/applet/survMulchRecord/edit',this.survMulchRecord).then(res=>{
|
||||
uni.showLoading({
|
||||
title: '正在提交...'
|
||||
|
|
|
|||
|
|
@ -41,6 +41,10 @@
|
|||
<span class="nrbt">覆膜作物:</span>
|
||||
{{item.cropName}}
|
||||
</view>
|
||||
<view class="bot_item">
|
||||
<span class="nrbt">秸秆残留量:</span>
|
||||
{{item.strawRemain?item.strawRemain:0}}
|
||||
</view>
|
||||
<view class="bot_item">
|
||||
<span class="nrbt">地膜残留量:</span>
|
||||
<span class="number">{{item.mulchRemain}}kg/hm²</span>
|
||||
|
|
@ -109,7 +113,6 @@
|
|||
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
|
||||
var navigationHeight = 44 * pxToRpxScale
|
||||
this.height = res.windowHeight * pxToRpxScale//将px 转换rpx
|
||||
console.log(this.height,ktxStatusHeight,navigationHeight)
|
||||
this.scorllheight = this.height - 182
|
||||
}
|
||||
});
|
||||
|
|
@ -122,14 +125,12 @@
|
|||
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
|
||||
var navigationHeight = 44 * pxToRpxScale
|
||||
this.height = res.windowHeight * pxToRpxScale//将px 转换rpx
|
||||
console.log(this.height,ktxStatusHeight,navigationHeight)
|
||||
this.scorllheight = this.height - 182
|
||||
}
|
||||
});
|
||||
let pages = getCurrentPages();
|
||||
let currPage = pages[pages.length - 1]; //当前页面
|
||||
this.reload = currPage.data.reload
|
||||
console.log('this.reload',this.reload)
|
||||
if(this.reload){
|
||||
this.cropName = ''
|
||||
this.sampTime = ''
|
||||
|
|
@ -152,7 +153,6 @@
|
|||
value:res.data.data[i].stationCode
|
||||
})
|
||||
this.array.push(res.data.data[i].stationName)
|
||||
console.log(this.array)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
@ -187,24 +187,18 @@
|
|||
this.List = this.List.concat(data)
|
||||
if(res.data.data.total != 0){
|
||||
this.allNum = Number(res.data.data.total)/Number(this.pageSize)+'';
|
||||
console.log(this.allNum,'总页数')
|
||||
if(this.allNum.indexOf('.') == -1) {
|
||||
this.allNum = this.allNum;
|
||||
console.log(this.allNum,'if')
|
||||
} else {
|
||||
this.allNum = parseInt(Number(this.allNum)+1);
|
||||
console.log(this.allNum,'else')
|
||||
}
|
||||
console.log(this.pageNo,this.allNum,'156156')
|
||||
if(this.pageNo == this.allNum) {
|
||||
this.isLastpage = true;
|
||||
this.loadStatus='nomore'
|
||||
console.log(this.isLastpage,'true','nomore')
|
||||
} else {
|
||||
this.isLastpage = false;
|
||||
// this.isLoadMore=true
|
||||
this.loadStatus = 'more'
|
||||
console.log(this.isLastpage,'false')
|
||||
}
|
||||
}else{
|
||||
this.isLastpage = true;
|
||||
|
|
@ -216,7 +210,6 @@
|
|||
})
|
||||
},
|
||||
lower() {
|
||||
console.log("最后一页了,取消下拉功能");
|
||||
// 最后一页了,取消下拉功能
|
||||
if (this.isLastpage) {
|
||||
return
|
||||
|
|
@ -226,7 +219,6 @@
|
|||
this.intervalId = setInterval(() => {
|
||||
num = num+1;
|
||||
},1000)
|
||||
console.log(this.intervalId,num)
|
||||
this.pageNo = this.pageNo + 1;
|
||||
let params = {}
|
||||
params.pageNo = this.pageNo
|
||||
|
|
@ -243,12 +235,10 @@
|
|||
if(this.pageNo == this.allNum) {
|
||||
this.isLastpage = true;
|
||||
this.loadStatus='nomore'
|
||||
console.log(this.isLastpage,'true')
|
||||
} else {
|
||||
this.isLastpage = false;
|
||||
// this.isLoadMore=true
|
||||
this.loadStatus = 'more'
|
||||
console.log(this.isLastpage,'false')
|
||||
}
|
||||
}else{
|
||||
this.isLastpage = true;
|
||||
|
|
@ -258,7 +248,6 @@
|
|||
})
|
||||
},
|
||||
bindPickerChange: function(e) {
|
||||
console.log('picker发送选择改变,携带值为', e.detail.value)
|
||||
this.index = e.detail.value
|
||||
this.stationName = this.array[this.index]
|
||||
for(var i=0;i<this.arrays.length;i++){
|
||||
|
|
@ -275,7 +264,6 @@
|
|||
this.getList()
|
||||
},
|
||||
changenr(){
|
||||
console.log(this.cropName)
|
||||
this.pageNo = 1
|
||||
this.getList()
|
||||
},
|
||||
|
|
@ -290,12 +278,10 @@
|
|||
})
|
||||
},
|
||||
caozuo(item){
|
||||
console.log(item)
|
||||
var that = this
|
||||
uni.showActionSheet({
|
||||
itemList: ['编辑', '删除'],
|
||||
success: function (res) {
|
||||
console.log('选中了第' + (res.tapIndex + 1) + '个按钮');
|
||||
if((res.tapIndex + 1) == 1){
|
||||
uni.navigateTo({
|
||||
url:'/packDetail/pages/waste/edit?item='+ encodeURIComponent(JSON.stringify(item))
|
||||
|
|
@ -306,8 +292,6 @@
|
|||
content: '是否删除数据?',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
console.log(item.id,1)
|
||||
that.$http.delete(that.deleteUrl+'?id='+item.id).then(res =>{
|
||||
if(res.data.code == 0){
|
||||
uni.showToast({
|
||||
|
|
|
|||
Loading…
Reference in New Issue