|
|
@ -201,6 +201,9 @@ |
|
|
|
margin-right:12rpx; |
|
|
|
text-shadow: 6rpx -6rpx rgba(var(--c),0.3); |
|
|
|
} |
|
|
|
&.active{ |
|
|
|
color:rgba(var(--c),1); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.item{ |
|
|
@ -209,6 +212,7 @@ |
|
|
|
margin-top:40rpx; |
|
|
|
&:before{ |
|
|
|
content:" "; |
|
|
|
flex-shrink: 0; |
|
|
|
width:20rpx; |
|
|
|
height:20rpx; |
|
|
|
margin-right:16rpx; |
|
|
@ -217,8 +221,11 @@ |
|
|
|
} |
|
|
|
text{ |
|
|
|
&:first-child{ |
|
|
|
flex-shrink: 0; |
|
|
|
min-width:140rpx; |
|
|
|
color:#333333; |
|
|
|
font-size:28rpx; |
|
|
|
margin-right:20rpx; |
|
|
|
} |
|
|
|
&:nth-child(2){ |
|
|
|
color:#999999; |
|
|
@ -313,19 +320,21 @@ |
|
|
|
基地管理 <text class="plant-jiantou_zuoyouqiehuan" v-if="isAdmin" @click="show=true">切换基地</text> |
|
|
|
</view> |
|
|
|
<view class="matter"> |
|
|
|
<text class="plant-jilu" style="--c:16, 193, 118;margin-right:40px;">农事记录</text> |
|
|
|
<text class="plant-tourupin" style="--c:255, 195, 83;">投入品</text> |
|
|
|
<text class="plant-jilu" :class="{active:baseIndex=='record'}" style="--c:16, 193, 118;margin-right:40px;" @click="baseIndex=='record'?baseIndex='':baseIndex='record'">农事记录</text> |
|
|
|
<text class="plant-tourupin" :class="{active:baseIndex=='input'}" style="--c:255, 195, 83;" @click="baseIndex=='input'?baseIndex='':baseIndex='input'">投入品</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="item" style="--c:16, 193, 118;"> |
|
|
|
<text>农事</text> <text>[示例]今日完成了草莓园浇水任务。</text> |
|
|
|
</view> |
|
|
|
<view class="item" style="--c:255, 195, 83;"> |
|
|
|
<text>投入品</text> <text>[示例]今日完成了草莓园浇水任务。</text> |
|
|
|
</view> |
|
|
|
<view class="item" style="--c:255, 195, 83;"> |
|
|
|
<text>投入品</text> <text>[示例]今日完成了草莓园浇水任务。</text> |
|
|
|
</view> |
|
|
|
<template v-if="!baseIndex || baseIndex=='record'"> |
|
|
|
<view v-for="(v,k) in baseInfo.farmWork||[]" :key="`${k}_work`" class="item" style="--c:16, 193, 118;"> |
|
|
|
<text>农事</text> <text class="over">{{new Date(v.time).format('yyyy-MM-dd')}}{{v.userName}}{{v.plotName}}{{v.farmWorkName}}</text> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
<template v-if="!baseIndex || baseIndex=='input'"> |
|
|
|
<view v-for="(v,k) in baseInfo.farmingInput||[]" :key="`${k}_input`" class="item" style="--c:255, 195, 83;"> |
|
|
|
<text>投入品</text> <text class="over">{{new Date(v.time).format('yyyy-MM-dd')}}{{v.userName}}{{v.plotName}}{{v.farmWorkName}}</text> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
<u-empty v-if="isEmpty" width="70%" icon="/static/noData.png"/> |
|
|
|
</view> |
|
|
|
|
|
|
|
<u-picker v-if="isAdmin" :show="show" :columns="plantBase" keyName="baseName" closeOnClickOverlay @close="show=false" @confirm="$store.commit('setBaseId', $event.value[0].id);show=false" @cancel="show=false"/> |
|
|
@ -341,16 +350,24 @@ import request from '@/common/request.js' |
|
|
|
show:false, |
|
|
|
plantBase:[[]], |
|
|
|
massif:{}, |
|
|
|
baseInfo:{}, |
|
|
|
baseIndex:"", |
|
|
|
} |
|
|
|
}, |
|
|
|
computed:{ |
|
|
|
isAdmin(){ |
|
|
|
return this.$store.getters.userInfo.roleCode=='companyAdmin' |
|
|
|
}, |
|
|
|
isEmpty(){ |
|
|
|
if(!baseIndex)return (this.baseInfo.farmWork||[]).length+(baseInfo.farmingInput||[]).length<=0 |
|
|
|
else if(baseIndex=='record')return (this.baseInfo.farmWork||[]).length<=0 |
|
|
|
else return (baseInfo.farmingInput||[]).length<=0 |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch:{ |
|
|
|
"$store.state.plantBaseInfoId"(n){ |
|
|
|
this.getMassif(n) |
|
|
|
this.getBaseInfo(n) |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
@ -392,6 +409,21 @@ import request from '@/common/request.js' |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
async getBaseInfo(plantBaseId){ |
|
|
|
console.log('-------------getBaseInfo-----------------') |
|
|
|
var res=await request("/api/plantIndex/queryFarmWorkAndInput",{ |
|
|
|
params:{plantBaseId} |
|
|
|
}) |
|
|
|
if(res.statu){ |
|
|
|
this.baseInfo=res.data |
|
|
|
}else{ |
|
|
|
uni.showModal({ |
|
|
|
title:"提示", |
|
|
|
content:res.msg||"获取基地管理信息失败!", |
|
|
|
showCancel:false, |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|