Browse Source

联调农事记录

master
邓宏 2 years ago
parent
commit
2eeeaa8d8b
  1. 12
      pages/baseMana/formReacord.vue
  2. 17
      pages/massif/add_farming.vue
  3. 12
      uni_modules/d-search/components/d-search/d-search.vue

12
pages/baseMana/formReacord.vue

@ -17,11 +17,15 @@
line-height: 60rpx;
text-align:center;
position:relative;
color:#333;
&:before{
transform: rotate(90deg);
position:absolute;
right:10rpx;
}
&.noData{
color:#999;
}
}
}
@ -75,10 +79,12 @@
</style>
<template>
<view class="container flex">
<d-search v-model="searchVal.search" :list="typeList" @search="clean();search()"/>
<d-search v-model="searchVal.search" :selectVal="searchVal.value" :list="typeList" @select="searchVal.value=$event" @search="clean();search()"/>
<view class="date-range">
<picker mode="date" class="plant-youbian">请选择开始时间</picker> ~ <picker mode="date" class="plant-youbian">请选择结束时间</picker>
<picker mode="date" class="plant-youbian" :class="{noData:!searchVal.startTime}" @change="searchVal.startTime=$event.detail.value;clean();search()">{{searchVal.startTime||"请选择开始时间"}}</picker>
~
<picker mode="date" class="plant-youbian" :class="{noData:!searchVal.endTime}" @change="searchVal.endTime=$event.detail.value;clean();search()">{{searchVal.endTime||"请选择结束时间"}}</picker>
</view>
<scroll-view scroll-y @scrolltolower="search">
@ -90,6 +96,7 @@
<text>负责人{{v.principal}}</text> <text>记录时间{{v.time}}</text>
</view>
</view>
<u-empty v-if="list.length==0" width="70%" icon="/static/noData.png"/>
</scroll-view>
</view>
</template>
@ -100,6 +107,7 @@ import request from '@/common/request.js'
return{
searchVal:{
search:"",
value:"",
pageNo:1,
pageSize:6,
plotId:"",

17
pages/massif/add_farming.vue

@ -106,7 +106,8 @@
<view class="type">
<view class="title">农事类型</view>
<view class="content">
<text v-for="k in 8" :key="k">自定义+</text>
<text v-for="(v,k) in typeList" :key="k">{{v.label}}</text>
<text>自定义+</text>
</view>
</view>
@ -141,6 +142,7 @@ import request from '@/common/request'
export default {
data(){
return{
typeList:[],
fields:{
people:{label:"操作人",styleType:"parallel"},
date:{label:"操作日期",styleType:"parallel",type:"calendar"},
@ -173,9 +175,22 @@ export default {
}
},
onLoad(options){
this.init()
this.getMassifDetail(options.plotId)
},
methods:{
async init(){
var res=await request("/api/plantFarming/listFarmName")
if(res.statu){
this.typeList=res.data
}else{
uni.showModal({
title:"提示",
content:res.msg||"获取农事类型失败!",
showCancel:false,
})
}
},
async getMassifDetail(id){
var res=await request("/api/plantPlot/queryById",{
params:{id}

12
uni_modules/d-search/components/d-search/d-search.vue

@ -87,13 +87,13 @@
<view class="d-search" @click="isShow=false">
<view class="search" @click.stop="">
<u-icon name="search" color="#999999" size="20"/>
<input placeholder="请输入搜索内容" :value="(list.find(v=>v.value==value)||{label:''}).label||value" auto-blur @focus="isShow=true" @blur="isShow=false" @input="$emit('input',$event.detail.value)" @confirm="$emit('search')"/>
<u-button type="primary" shape="circle" color="#10C176" text="搜索" size="mini" @click="$emit('search')"/>
<input placeholder="请输入搜索内容" :value="(list.find(v=>v.value==value)||{label:''}).label||value" auto-blur @focus="isShow=true" @input="$emit('input',$event.detail.value)" @confirm="isShow=false;$emit('search')"/>
<u-button type="primary" shape="circle" v-if="list.length<=0" color="#10C176" text="搜索" size="mini" @click="$emit('search')"/>
</view>
<view v-if="list.length>0" @click.stop="" class="want_search card" :class="{show:isShow}">
<text class="title">猜你想搜</text>
<view class="content">
<text v-for="(v,k) in list" :class="{active:false}" :key="k" @click="$emit('input', v.value);$emit('search')">{{v.label}}</text>
<text v-for="(v,k) in list" :class="{active:v.value==selectVal}" :key="k" @click="$emit('select', v.value==selectVal?'':v.value);">{{v.label}}</text>
</view>
</view>
<view class="mask" :class="{show:isShow}" v-if="list.length>0"/>
@ -109,7 +109,11 @@ export default {
list:{
type:Array,
default:()=>[]
}
},
selectVal:{
type:[String,Number],
default:''
},
},
data(){
return{

Loading…
Cancel
Save