Browse Source

添加农事 修改左滑删除

master
邓宏 2 years ago
parent
commit
08efb3d920
  1. 54
      pages/massif/add_farming.vue
  2. 8
      pages/massif/agrSpecs.vue
  3. 2
      pages/massif/mana/index.vue
  4. 2
      pages/purchase/agrProdList.vue

54
pages/massif/add_farming.vue

@ -99,6 +99,44 @@
}
}
}
&>.u-swipe-action{
margin-top:20rpx;
.u-swipe-action-item__right__button{
display:flex;
align-items: center;
}
&/deep/ .u-swipe-action-item__content>view{
display:flex;
align-items: center;
background:rgba(16, 193, 119, 0.1);
border-radius: 24rpx;
height:94rpx;
padding:0 30rpx;
text{
&:first-child{
flex-shrink: 0;
color:#fff;
background:#10C176;
font-size: 20rpx;
border-radius:4px 40px 4px 40px;
width:80rpx;
height:40rpx;
text-align: center;
line-height: 40rpx;
margin-right:20rpx;
}
&:nth-child(2){
flex-grow: 1;
}
&:nth-child(3){
flex-shrink: 0;
color:#10C176;
font-weight: bold;
margin-left:20rpx;
}
}
}
}
}
.u-popup{
.u-popup__content>input{
@ -125,9 +163,19 @@
<view class="card">
<view class="plant-dikuaimianji">{{massif.plotName}}</view>
<view v-if="formData.inputList.length<=0" class="plant-batch-add" @click="toCollectList"/>
<view class="info" v-for="(v,k) in formData.inputList" :key="k">
<text>{{v.parentName}}</text> <text>{{v.name}}</text> <text>{{v.inputQuantity}}{{v.unit}}</text>
</view>
<u-swipe-action v-for="(v,k) in formData.inputList" :key="k">
<u-swipe-action-item>
<view>
<text>{{v.parentName}}</text> <text>{{v.name}}</text> <text>{{v.total}}</text>
</view>
<view slot="button" class="u-swipe-action-item__right__button">
<button class="cu-btn bg-red" style="margin:auto;" @click="formData.inputList.splice(k,1)">删除</button>
</view>
</u-swipe-action-item>
</u-swipe-action>
<!-- <view class="info" v-for="(v,k) in formData.inputList" :key="k">
<text>{{v.parentName}}</text> <text>{{v.name}}</text> <text>{{v.total}}</text>
</view> -->
<button class="cu-btn round bg-green shadow submit" v-if="formData.inputList.length>0" @click="toCollectList">+继续添加农资</button>
</view>

8
pages/massif/agrSpecs.vue

@ -228,9 +228,11 @@ export default {
},
async onLoad(options){
this.eventChannel=this.getOpenerEventChannel()
this.eventChannel.on("detail", e=>this.agrDetail=e)
this.eventChannel.on("detail", e=>{
this.agrDetail=e
this.init()
})
this.formData.inventoryId=options.id
this.init()
},
methods:{
async init(){
@ -253,7 +255,7 @@ export default {
if(valid){
this.eventChannel.emit("update", {
...this.formData,
unit:this.specsVal.specs[1],
total: `${parseFloat(this.specsVal.num)*parseFloat(this.specsVal.specs[0])}${this.specsVal.specs[1]}`,
parentName: this.agrDetail.parentName,
name: this.agrDetail.name,
})

2
pages/massif/mana/index.vue

@ -91,7 +91,7 @@ export default {
params:{id:this.plotId}
})
if(res.statu){
return res.data.longitude.split("|").map(v=>{
return (res.data.longitude||'').split("|").map(v=>{
var point=v.split(",")
if(point.length==2){
return {longitude:point[0],latitude:point[1]}

2
pages/purchase/agrProdList.vue

@ -79,7 +79,7 @@ export default {
searchVal:{
goodsName:"",
pageNo:1,
pageSize:5,
pageSize:10,
},
list:[],
total:0,

Loading…
Cancel
Save