Browse Source

添加农事 修改操作是否必填判断

master
邓宏 2 years ago
parent
commit
4f4f399204
  1. 2
      common/request.js
  2. 6
      pages/massif/add_farming.vue

2
common/request.js

@ -5,7 +5,7 @@ export function host(host='default',suffix='/plant_manage'){
// default:`http://i5skii.natappfree.cc` //陈 // default:`http://i5skii.natappfree.cc` //陈
// default:`http://jjytvc.natappfree.cc` //马 // default:`http://jjytvc.natappfree.cc` //马
// default:`http://6exd5b.natappfree.cc` //何 // default:`http://6exd5b.natappfree.cc` //何
default:"http://192.168.0.14:7000" default:"http://192.168.0.23:7000"
}:{ }:{
default:`` default:``
} }

6
pages/massif/add_farming.vue

@ -44,7 +44,7 @@
display:flex; display:flex;
align-items:center; align-items:center;
height:70rpx; height:70rpx;
&:before{ &.mast:before{
content:"*"; content:"*";
color:red; color:red;
margin-right:5rpx; margin-right:5rpx;
@ -204,7 +204,7 @@
<view class="card"> <view class="card">
<view v-if="/^用药$|^施肥$/.test(formData.farmingType)" class="item" @click="toPestRecord"> <view v-if="/^用药$|^施肥$/.test(formData.farmingType)" class="item" @click="toPestRecord">
<view class="tabulation"> <view class="tabulation" :class="{mast:/^用药$/.test(formData.farmingType)}">
<text class="title">操作</text> <text class="record">病虫害记录</text><text class="plant-youbian"/> <text class="title">操作</text> <text class="record">病虫害记录</text><text class="plant-youbian"/>
</view> </view>
<view class="value" v-if="formData.farmPests"> <view class="value" v-if="formData.farmPests">
@ -341,7 +341,7 @@ export default {
}else if(/^播种$|^用药$|^施肥$/.test(this.formData.farmingType) && this.formData.inputList.length<=0){ }else if(/^播种$|^用药$|^施肥$/.test(this.formData.farmingType) && this.formData.inputList.length<=0){
uni.showToast({title:"请添加农资!",icon:"none"}) uni.showToast({title:"请添加农资!",icon:"none"})
return false return false
}else if(/^用药$|^施肥$/.test(this.formData.farmingType) && !this.formData.farmPests){ }else if(/^用药$/.test(this.formData.farmingType) && !this.formData.farmPests){
uni.showToast({title:"请添加病虫害记录!",icon:"none"}) uni.showToast({title:"请添加病虫害记录!",icon:"none"})
return false return false
} }

Loading…
Cancel
Save