Browse Source

修改样式

master
邓宏 2 years ago
parent
commit
95ec2a09bb
  1. 3
      components/form.vue
  2. 24
      pages/massif/index.vue
  3. 32
      pages/massif/info.vue
  4. 6
      pages/warehouse/info.vue
  5. 20
      pages/warehouse/mana.vue

3
components/form.vue

@ -122,6 +122,9 @@
font-size:20rpx;
color:#FBA83C;
}
&/deep/>.u-form-item__body__right__message{
margin-left:0!important;
}
}
}
</style>

24
pages/massif/index.vue

@ -94,7 +94,7 @@
</view>
<view class="btns">
<text class="plant-xiugai">修改</text>
<text class="plant-shanchu">删除</text>
<text class="plant-shanchu" @click.stop="del(k)">删除</text>
<text class="plant-xinzeng" @click.stop="$u.route({url:'pages/massif/mana/index'})">地块管理</text>
</view>
</view>
@ -144,6 +144,28 @@ import request from '@/common/request'
}
}
},
async del(index){
if((await uni.showModal({ title:"提示", content:"确定删除?" }))[1].confirm){
var res=await request("/api/plantPlot/deletePlantPlotInfo",{
method:"DELETE",
params:{id:this.list[index].id}
})
if(res.statu){
if(this.list.length>6){
this.list.splice(index,1)
this.total--
}else{
this.search()
}
}else{
uni.showModal({
title:"提示",
content:res.msg||"删除失败!",
showCancel:false,
})
}
}
},
},
}
</script>

32
pages/massif/info.vue

@ -3,15 +3,11 @@
background:#F6F6F6;
padding:14px 0;
min-height:100%;
&>.u-button{
margin:38px auto 0px;
width:80%;
}
}
</style>
<template>
<view class="container">
<u-form class="card inline" :model="formData" ref="form" :rules="rules" labelWidth="auto">
<u-form class="card inline" errorType="toast" :model="formData" ref="form" :rules="rules" labelWidth="auto">
<d-form
v-for="(v,k) in fields"
:key="k"
@ -22,7 +18,7 @@
@input="formData[k]=$event"
@selectDate="selectDate"/>
</u-form>
<u-button shape="circle" color="#10C176">保存</u-button>
<button class="cu-btn round bg-green shadow submit" @click="sumbit">保存</button>
</view>
</template>
<script>
@ -35,8 +31,8 @@ import dForm from '@/components/form.vue'
plantBaseName:{label:"基地名称"},
plotNumber:{label:"地块编号"},
plotName:{label:"地块名称"},
area:{label:"地块面积(亩)",type:'digit'},
drawArea:{label:"实际面积",type:'digit'},
drawArea:{label:"地块面积(亩)",type:'digit'},
realityArea:{label:"实际面积",type:'digit'},
image:{label:"地块图片",type:"upImg",num:3},
date:{label:"使用日期",type:"dateRange",value:[]},
jw:{label:"经/纬度"},
@ -47,6 +43,7 @@ import dForm from '@/components/form.vue'
plotNumber:"",
plotName:"",
drawArea:0,
realityArea:0,
image:[],
beginTime:"",
endTime:"",
@ -55,7 +52,17 @@ import dForm from '@/components/form.vue'
address:"",
},
rules:{
date:{required:true, message:"日期必填!", trigger:"blue"}
plantBaseName:{required:true, message:"基地名称必填!", trigger:"blue"},
plotNumber:{required:true, message:"地块编号必填!", trigger:"blue"},
plotName:{required:true, message:"地块名称必填!", trigger:"blue"},
drawArea:{required:true, message:"地块面积必填!", trigger:"blue"},
realityArea:{required:true, message:"实际面积必填!", trigger:"blue"},
image:{required:true, type:"array",min:1, message:"地块图片必填!", trigger:"blue"},
date:{required:true,validator:(rule,val,call)=>{
if(!this.fields.date.value[0])call(new Error('请选择开始时间!'));
else if(!this.fields.date.value[1])call(new Error('请选择结束时间!'));
else call()
}, trigger:"blue"}
},
}
},
@ -66,6 +73,13 @@ import dForm from '@/components/form.vue'
case "start":this.fields.date.value[0]=e.value;break;
case 'end':this.fields.date.value[1]=e.value;break;
}
},
sumbit(){
this.$refs.form.validate().then(async valid=>{
if(valid){
}
})
}
},
}

6
pages/warehouse/info.vue

@ -2,10 +2,6 @@
.container{
background:#F6F6F6;
padding:28rpx 0;
&>.u-button{
margin:76rpx auto 0rpx;
width:80%;
}
}
</style>
<template>
@ -13,7 +9,7 @@
<u-form class="card inline" :model="formData" ref="form" :rules="rules" labelWidth="auto">
<d-form v-for="(v,k) in fields" :key="k" v-bind="v" :required="!!rules[k]" :field="k" @input="formData[k]=$event" @select="fields[k].value=$event"/>
</u-form>
<u-button shape="circle" color="#10C176">确认提交</u-button>
<button class="cu-btn round bg-green shadow submit" @click="">确认提交</button>
</view>
</template>
<script>

20
pages/warehouse/mana.vue

@ -4,26 +4,6 @@
background:#F6F6F6;
padding-bottom:20rpx;
&>.search{
display:flex;
align-items: center;
background:#fff;
margin:0rpx 30rpx;
border-radius: 40rpx;
padding:6rpx;
height:60rpx;
.u-icon{
margin:0 14rpx;
flex-shrink: 0;
}
input{
flex-grow: 1;
}
.u-button{
flex-shrink: 0;
width:max-content;
}
}
&>.item{
display:flex;
&>image{

Loading…
Cancel
Save