Browse Source

Merge remote-tracking branch 'origin/master'

master
马景富 2 years ago
parent
commit
c4dd1895ae
  1. 2
      pages/baseMana/formReacord.vue
  2. 2
      pages/massif/add_farming.vue
  3. 6
      pages/massif/pestRecord.vue
  4. 36
      pages/massif/pestType.vue
  5. 6
      uni_modules/d-search/components/d-search/d-search.vue

2
pages/baseMana/formReacord.vue

@ -122,7 +122,7 @@
</style>
<template>
<view class="container flex">
<d-search v-model="searchVal.search" :selectVal="searchVal.value" :list="typeList" @select="searchVal.value=$event" @search="clean();search()"/>
<d-search :btn="false" 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" :class="{noData:!searchVal.startTime}" :end="searchVal.endTime" @change="searchVal.startTime=$event.detail.value;clean();search()" >{{searchVal.startTime||"请选择开始时间"}}</picker>

2
pages/massif/add_farming.vue

@ -208,7 +208,7 @@
<text class="title">操作</text> <text class="record">病虫害记录</text><text class="plant-youbian"/>
</view>
<view class="value" v-if="formData.farmPests">
过程:{{formData.farmPests.growthProcessLabel}}病虫害部位:{{formData.farmPests.pestSite}}症状{{formData.farmPests.symptomLabel}}
过程:{{formData.farmPests.growthProcessLabel}}病虫害部位:{{formData.farmPests.pestSite}}症状{{formData.farmPests.symptomLabel}}({{formData.farmPests.pestName}})
</view>
</view>
<u-form class="inline" errorType="toast" :model="formData" :rules="rules" ref="form" labelWidth="auto">

6
pages/massif/pestRecord.vue

@ -32,7 +32,7 @@ export default {
pestSite:{label:"病虫害部位",type:"checkBox",value:[],columns:[{label:"根",value:"根"},{label:"茎",value:"茎"},{label:"叶",value:"叶"}]},
growthProcess:{label:"作物生长过程",type:"select-tab",dictCode:"growth_process"},
symptom:{label:"显著症状",type:"select-tab",dictCode:"symptom"},
type:{label:"害虫名称",type:"navigate",btnFun:()=>uni.navigateTo({url:"/pages/massif/pestType",events:{type:e=>this.formData.type=e}})},
pestName:{label:"害虫名称",type:"navigate",btnFun:()=>uni.navigateTo({url:"/pages/massif/pestType",events:{type:e=>this.formData.pestName=e}})},
medicationArea:{label:"农资作用面积",type:"digit",suffix:"亩"},
pic:{label:"凭证",type:"upImg",value:""},
description:{label:"病虫害描述",type:"textarea"},
@ -41,7 +41,7 @@ export default {
growthProcess:'',
pestSite:'',
symptom:"",
type:"",
pestName:"",
medicationArea:"",
pic:[],
description:"",
@ -50,7 +50,7 @@ export default {
growthProcess:{required:true,message:"请选择作物生长过程!",trigger:['blur','change']},
pestSite:{required:true,message:"请选择病虫害部位!",trigger:['blur','change']},
symptom:{required:true,message:"请选择显著症状!",trigger:['blur','change']},
type:{required:true,message:"请选择害虫!",trigger:['blur','change']},
pestName:{required:true,message:"请选择害虫!",trigger:['blur','change']},
medicationArea:{required:true,message:"请输入农资作用面积!",type:"number",trigger:['blur','change']},
pic:{required:true,validator:(rule,val,call)=>{
if(!this.fields.pic.value)call(new Error("请选择凭证!"));

36
pages/massif/pestType.vue

@ -76,6 +76,17 @@
}
}
}
.addPest{
position:absolute;
bottom:0;
left:0;
width:100%;
background:#fff;
color:#333;
height:60rpx;
padding:0 20rpx;
}
}
</style>
<template>
@ -98,13 +109,17 @@
<view class="tabs">
<text v-for="(v,k) in agrProd" :class="{active:searchVal.value==v.value}" :key="k" @click="agrSearch(v.value)">{{v.label}}</text>
</view>
<view class="title">害虫种类 <button class="cu-btn round sm" v-if="searchVal.value">自定义+</button></view>
<view class="title">害虫种类 <button class="cu-btn round sm" v-if="searchVal.value" @click="show=true">自定义+</button></view>
<scroll-view scroll-y>
<view class="items">
<text :class="{active:select==v}" v-for="(v,k) in list" :key="k" @click="select=v">{{v}}</text>
</view>
<u-empty :show="list.length<=0" text="为查询到相关信息" width="70%" icon="/static/noData.png"/>
</scroll-view>
<u-overlay :show="show" @click="show=false">
<input class="addPest" placeholder="请输入" @click.stop="" :focus="show" @blur="show=false" @confirm="addPest($event.detail.value)"/>
</u-overlay>
</view>
</template>
<script>
@ -121,6 +136,7 @@ export default {
},
select:"",
eventChannel:null,
show:false,
}
},
computed:{
@ -210,6 +226,24 @@ export default {
})
}
},
async addPest(e){
var res=await request("/common/api/dict/AddCategory",{
method:"post",
body:{
pid: typeof this.searchVal.value=='string'?this.searchVal.value:this.cropList.find(v=>v.pest==this.searchVal.value).value,
name:e
}
})
if(res.statu){
this.list.push(e)
}else{
uni.showModal({
title:"提示",
content:"添加害虫失败!",
showCancel:false,
})
}
},
}
}
</script>

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

@ -94,7 +94,7 @@
<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" @input="$emit('input',$event.detail.value)" @confirm="isShow=false;$emit('search')"/>
<text class="plant-zengjia" v-if="value" @click="$emit('input','');$emit('search')"/>
<u-button type="primary" shape="circle" v-if="list.length<=0" color="#10C176" text="搜索" size="mini" @click="$emit('search')"/>
<u-button type="primary" shape="circle" v-if="btn" 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>
@ -120,6 +120,10 @@ export default {
type:[String,Number],
default:''
},
btn:{
type:Boolean,
default:true
},
background:{
type:String,
default:"#fff"

Loading…
Cancel
Save