|
|
@ -117,6 +117,24 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
&>.footer{ |
|
|
|
margin:10rpx -32rpx -32rpx; |
|
|
|
background:#eee; |
|
|
|
height:60rpx; |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: space-around; |
|
|
|
button{ |
|
|
|
font-size:24rpx; |
|
|
|
padding:0; |
|
|
|
height:100%; |
|
|
|
color:#999; |
|
|
|
&:before{ |
|
|
|
color:#FFB000; |
|
|
|
margin-right:10rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -126,10 +144,10 @@ |
|
|
|
<view class="head"> |
|
|
|
<image mode="aspectFit" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAXhJREFUOE+dk7FLw1AQxr+LbSyInQuODiIW+hc4iZP/QCfBpXmmUHR26eRopdT0ZRLX7k7FybmgKAUJjrZriTqY2Jy80IQ0aik5eMO7++7H4953hFRYlrWlaZoAcEBEG6rMzG8AboMgkKZpviRbKLo0m81cqVQ6B3BKRLk0eAb6JqIWgDPDMHyVCwHtdnu1UCj0mXn3r8Z0jpnvPc/bbzQaXyHAtm0JwFimOdIwsxRCHFOn09nJ5/OPAFaiYrVaxWAwgOM4i5hT3/crJKVsEdFJUlmr1UKAOouCmS/Jtu0hgO2MgKECfABYywIA8KkALoD1jIB3BXgCUE4DRqMRxuPx3Ahc150bLDM/K8CFMk9SqX6hWCz+mt9kMkGv14vzQRC0qNvtljVNe0h+45J+mBJRJTSSlPKKiMwlG0MZM1tCiHpsZV3X+0SUzcrRPui6rl5yBED75zUBM197nldXexAvU1I8s/YhgD0Am7PaK4A7Zr4RQijjxfEDDjS1T8RMzc4AAAAASUVORK5CYII="/> |
|
|
|
<text class="title">农资使用情况</text> |
|
|
|
<text class="add" @click="toAdd">+添加农事</text> |
|
|
|
<text class="add" @click="toAdd()">+添加农事</text> |
|
|
|
</view> |
|
|
|
<scroll-view scroll-y @scrolltolower="search"> |
|
|
|
<view class="card" v-for="(v,k) in list" :key="k" @click="toDetail(v)"> |
|
|
|
<view class="card" v-for="(v,k) in list" :key="k"> |
|
|
|
<template v-if="v.inputName"> |
|
|
|
<view class="name"> |
|
|
|
<text>{{v.type}}</text> <text>{{v.inputName}}</text> <text>{{v.inputTotal||0}}{{v.unit}}</text> <text class="plant-youbian"/> |
|
|
@ -145,8 +163,13 @@ |
|
|
|
<view v-else class="detail"> |
|
|
|
<text>{{v.type}}</text> <text>负责人:{{v.principal}}</text> <text>记录日期:{{new Date(v.time).format('yyyy-MM-dd')}}</text> |
|
|
|
</view> |
|
|
|
<view class="footer"> |
|
|
|
<button class="cu-btn txt XP-bianji1" @click="toAdd(v)">编辑</button> |
|
|
|
<button class="cu-btn txt XP-shanchu1" @click="del(k)">删除</button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<u-empty v-if="list.length<=0" text="未查询到相关信息" width="70%" icon="/static/noData.png"/> |
|
|
|
<view style="border:0.5rpx solid transparent;"/> |
|
|
|
</scroll-view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
@ -183,25 +206,26 @@ export default { |
|
|
|
this.search() |
|
|
|
}, |
|
|
|
methods:{ |
|
|
|
toAdd(){ |
|
|
|
toAdd(v){ |
|
|
|
uni.navigateTo({ |
|
|
|
url:`/pages/massif/add_farming?plotId=${this.plotId}`, |
|
|
|
events:{update: e=>{ |
|
|
|
this.$provise.emit('addFarming') |
|
|
|
this.total=0 |
|
|
|
this.list=[] |
|
|
|
this.searchVal.pageNo=1 |
|
|
|
this.search() |
|
|
|
}} |
|
|
|
this.search('refresh') |
|
|
|
}}, |
|
|
|
success:res=>{ |
|
|
|
if(v){ |
|
|
|
res.eventChannel.emit("detail", v) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
reSearch(){ |
|
|
|
this.list=[] |
|
|
|
this.total=0 |
|
|
|
this.searchVal.pageNo=1 |
|
|
|
this.search() |
|
|
|
}, |
|
|
|
async search(){ |
|
|
|
async search(type){ |
|
|
|
if(type=='refresh'){ |
|
|
|
this.list=[] |
|
|
|
this.total=0 |
|
|
|
this.searchVal.pageNo=1 |
|
|
|
} |
|
|
|
if(this.total==0 || this.list.length<this.total){ |
|
|
|
var res=await request("/api/plantFarming/listFarmByPlotId",{ |
|
|
|
params: { |
|
|
@ -224,11 +248,32 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
toDetail(e){ |
|
|
|
uni.navigateTo({ |
|
|
|
url:`/pages/home/newsDetail?intoPage=farming`, |
|
|
|
success(res){ |
|
|
|
res.eventChannel.emit("detail",{...e,images: (e.images||'').split(',').filter(v=>v)}) |
|
|
|
del(index){ |
|
|
|
uni.showModal({ |
|
|
|
title:"提示", |
|
|
|
content:"确定删除?", |
|
|
|
success:async e=>{ |
|
|
|
if(e.confirm){ |
|
|
|
var res=await request("/suyuan/farmingApi/delete",{ |
|
|
|
method:"delete", |
|
|
|
params:{id:this.list[index].id} |
|
|
|
}) |
|
|
|
if(res.statu){ |
|
|
|
uni.showToast({title:"删除成功!",icon:"success"}) |
|
|
|
if(this.list.length>this.searchVal.pageSize+3){ |
|
|
|
this.list.splice(index, 1) |
|
|
|
this.total-- |
|
|
|
}else{ |
|
|
|
this.search('refresh') |
|
|
|
} |
|
|
|
}else{ |
|
|
|
uni.showModal({ |
|
|
|
title:"提示", |
|
|
|
content:res.msg||"删除失败!", |
|
|
|
showCancel:false, |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|