|
@ -1,6 +1,10 @@ |
|
|
<style lang="scss" scoped> |
|
|
<style lang="scss" scoped> |
|
|
.farm-record{ |
|
|
.farm-record{ |
|
|
|
|
|
display:flex; |
|
|
|
|
|
flex-direction: column; |
|
|
|
|
|
height: 100%; |
|
|
&>.head{ |
|
|
&>.head{ |
|
|
|
|
|
flex-shrink: 0; |
|
|
display:flex; |
|
|
display:flex; |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
margin:30rpx; |
|
|
margin:30rpx; |
|
@ -20,44 +24,49 @@ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
.card{ |
|
|
scroll-view{ |
|
|
.name{ |
|
|
flex-grow: 1; |
|
|
display:flex; |
|
|
height:1rpx; |
|
|
align-items: center; |
|
|
.card{ |
|
|
text{ |
|
|
margin-top:0; |
|
|
&:first-child{ |
|
|
.name{ |
|
|
flex-shrink: 0; |
|
|
display:flex; |
|
|
color:#fff; |
|
|
align-items: center; |
|
|
background:#10C176; |
|
|
text{ |
|
|
font-size:20rpx; |
|
|
&:first-child{ |
|
|
border-radius: 8rpx 40rpx 8rpx 40rpx; |
|
|
flex-shrink: 0; |
|
|
width:80rpx; |
|
|
color:#fff; |
|
|
text-align: center; |
|
|
background:#10C176; |
|
|
height:40rpx; |
|
|
font-size:20rpx; |
|
|
line-height: 40rpx; |
|
|
border-radius: 8rpx 40rpx 8rpx 40rpx; |
|
|
margin-right:12rpx; |
|
|
width:80rpx; |
|
|
} |
|
|
text-align: center; |
|
|
&:nth-child(2){ |
|
|
height:40rpx; |
|
|
flex-grow: 1; |
|
|
line-height: 40rpx; |
|
|
} |
|
|
margin-right:12rpx; |
|
|
&:nth-child(3){ |
|
|
} |
|
|
flex-shrink: 0; |
|
|
&:nth-child(2){ |
|
|
color:#10C176; |
|
|
flex-grow: 1; |
|
|
font-weight: bold; |
|
|
} |
|
|
font-size:32rpx; |
|
|
&:nth-child(3){ |
|
|
margin-left:10rpx; |
|
|
flex-shrink: 0; |
|
|
|
|
|
color:#10C176; |
|
|
|
|
|
font-weight: bold; |
|
|
|
|
|
font-size:32rpx; |
|
|
|
|
|
margin-left:10rpx; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
.info{ |
|
|
.info{ |
|
|
margin-top:20rpx; |
|
|
margin-top:20rpx; |
|
|
border-top:2rpx solid rgba(216, 216, 216, 0.4); |
|
|
border-top:2rpx solid rgba(216, 216, 216, 0.4); |
|
|
padding-top:20rpx; |
|
|
padding-top:20rpx; |
|
|
display:flex; |
|
|
display:flex; |
|
|
justify-content: space-between; |
|
|
justify-content: space-between; |
|
|
text{ |
|
|
text{ |
|
|
color:#999; |
|
|
color:#999; |
|
|
font-size:24rpx; |
|
|
font-size:24rpx; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -70,17 +79,20 @@ |
|
|
<text class="title">农资使用情况</text> |
|
|
<text class="title">农资使用情况</text> |
|
|
<text class="add" @click="toAdd">+添加农事</text> |
|
|
<text class="add" @click="toAdd">+添加农事</text> |
|
|
</view> |
|
|
</view> |
|
|
<view class="card"> |
|
|
<scroll-view scroll-y @scrollotower="search"> |
|
|
<view class="name"> |
|
|
<view class="card" v-for="(v,k) in list" :key="k"> |
|
|
<text>施肥</text> <text>中量元素水溶肥</text> <text>200kg</text> |
|
|
<view class="name"> |
|
|
</view> |
|
|
<text>{{v.type}}</text> <text>{{v.inputName}}</text> <text>{{v.inputTotal}}{{v.unit}}</text> |
|
|
<view class="info"> |
|
|
</view> |
|
|
<text>负责人:张召忠</text> <text>记录时间:2022-12-12</text> |
|
|
<view class="info"> |
|
|
|
|
|
<text>负责人:{{v.principal}}</text> <text>记录时间:{{v.time}}</text> |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</scroll-view> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
<script> |
|
|
<script> |
|
|
|
|
|
import request from '@/common/request.js' |
|
|
export default { |
|
|
export default { |
|
|
name:"farmRecord", |
|
|
name:"farmRecord", |
|
|
props:{ |
|
|
props:{ |
|
@ -91,14 +103,48 @@ export default { |
|
|
}, |
|
|
}, |
|
|
data(){ |
|
|
data(){ |
|
|
return{ |
|
|
return{ |
|
|
|
|
|
searchVal:{ |
|
|
|
|
|
search:"", |
|
|
|
|
|
pageNo:1, |
|
|
|
|
|
pageSize:6, |
|
|
|
|
|
PlantBaseInfoId: this.$store.state.plantBaseInfoId, |
|
|
|
|
|
startTime:"", |
|
|
|
|
|
endTime:"", |
|
|
|
|
|
}, |
|
|
|
|
|
total:0, |
|
|
|
|
|
list:[], |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
created(){ |
|
|
|
|
|
this.search() |
|
|
|
|
|
}, |
|
|
methods:{ |
|
|
methods:{ |
|
|
toAdd(){ |
|
|
toAdd(){ |
|
|
uni.navigateTo({ |
|
|
uni.navigateTo({ |
|
|
url:`/pages/massif/add_farming?plotId=${this.plotId}` |
|
|
url:`/pages/massif/add_farming?plotId=${this.plotId}` |
|
|
}) |
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
async search(){ |
|
|
|
|
|
if(this.total==0 || this.list.length<this.total){ |
|
|
|
|
|
var res=await request("/api/plantFarming/listFarmByPlotId",{ |
|
|
|
|
|
params: { |
|
|
|
|
|
...this.searchVal, |
|
|
|
|
|
plotId: this.plotId, |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
if(res.statu){ |
|
|
|
|
|
this.list=this.list.concat(res.data.list) |
|
|
|
|
|
this.total=res.data.total |
|
|
|
|
|
this.searchVal.pageNo++ |
|
|
|
|
|
if(this.list.length==this.total)uni.showToast({title:"加载完成!",icon:"none"}) |
|
|
|
|
|
}else{ |
|
|
|
|
|
uni.showModal({ |
|
|
|
|
|
title:"提示", |
|
|
|
|
|
content:res.msg||"获取农事记录列表失败!", |
|
|
|
|
|
showCancel:false, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|