Browse Source

巡园记录 联调删除接口

master
邓宏 2 months ago
parent
commit
c226fc2a9e
  1. 6
      pages/massif/add_farming.vue
  2. 13
      pages/patrolGarden/detail.vue
  3. 52
      pages/patrolGarden/record.vue
  4. BIN
      static/patrolGarden/handle.png
  5. BIN
      static/patrolGarden/unhandle.png

6
pages/massif/add_farming.vue

@ -126,7 +126,9 @@
}
}
&>.u-swipe-action{
.u-swipe-action-item{
margin-top:20rpx;
}
.u-swipe-action-item__right__button{
display:flex;
align-items: center;
@ -189,8 +191,8 @@
<view class="card">
<view class="plant-dikuaimianji">{{massif.plotName}}</view>
<view v-if="formData.inputList.length<=0" class="plant-batch-add" @click="toCollectList"/>
<u-swipe-action v-for="(v,k) in formData.inputList" :key="k">
<u-swipe-action-item :disabled="type=='check'">
<u-swipe-action>
<u-swipe-action-item v-for="(v,k) in formData.inputList" :key="k" :disabled="type=='check'">
<view>
<text>{{v.goodsType}}</text> <text>{{v.substanceName}}</text> <text>{{v.inputTotal}}{{v.specs[1]}}</text>
</view>

13
pages/patrolGarden/detail.vue

@ -89,7 +89,7 @@
<text class="label">基地名称</text>
<text class="val">{{detail.baseName}}</text>
</view>
<view class="item block">
<view class="item block" v-if="detail.pic&&detail.pic.length>0">
<text class="label">凭证</text>
<view class="imgs">
<image v-for="(v,k) in detail.pic" :key="k" :src="`${host}/${v}`"/>
@ -106,6 +106,10 @@
</view>
<view class="card" v-if="record" :class="({0:'unhandle',1:'handle'})[record.flagDeal]">
<view class="item">
<text class="label">地块名称</text>
<text class="val">{{record.plotName}}</text>
</view>
<view class="item">
<text class="label">位置</text>
<text class="val">{{record.position}}</text>
@ -126,7 +130,6 @@ export default {
data(){
return{
map:null,
demo:"",
host:host('imgUrl'),
detail:{},
record:null,
@ -146,7 +149,10 @@ export default {
this.detail=e
/* #ifdef APP-PLUS */
if(this.detail.detailVos){
if(this.detail?.detailVos?.length>0){
for(var i in this.detail.detailVos){
var marker=new plus.maps.Marker(new plus.maps.Point(this.detail.detailVos[i].lng, this.detail.detailVos[i].lat))
marker.setIcon(`/static/patrolGarden/${({0:'unhandle',1:'handle'})[this.detail.detailVos[i].flagDeal]}.png?i=${i}`)
@ -184,6 +190,7 @@ export default {
uni.showToast({title:"修改成功",icon:"success"})
this.detail.detailVos[this.record.index]=this.record
this.detail.detailVos[this.record.index].marker.setIcon(`/static/patrolGarden/${({0:'unhandle',1:'handle'})[this.record.flagDeal]}.png?i=${this.record.index}`)
this.eventChannel.emit("update")
}else{
uni.showModal({
title:"提示",

52
pages/patrolGarden/record.vue

@ -6,8 +6,18 @@
scroll-view{
flex-grow: 1;
height:1rpx;
.u-swipe-action{
.u-swipe-action-item{
margin:0 30rpx 30rpx;
}
.u-swipe-action-item__right__button{
display:flex;
align-items: center;
}
}
.card{
margin-top:0rpx;
margin:0rpx;
&>.title{
display: flex;
align-items: center;
@ -97,7 +107,9 @@
</d-navbar>
<d-search v-model="searchVal.search" @search="search('pageOne')"/>
<scroll-view scroll-y @scrolltolower="search()">
<view class="card" v-for="(v,k) in list" :key="k" @click="toDetail(v)">
<u-swipe-action>
<u-swipe-action-item v-for="(v,k) in list" :key="k">
<view class="card" @click="toDetail(v)">
<view class="title">
<text class="icon"/>
<text class="name over">{{v.baseName}}</text>
@ -115,6 +127,11 @@
<text>{{v.userName}}</text>
</view>
</view>
<view slot="button" class="u-swipe-action-item__right__button">
<button class="cu-btn bg-red" style="margin:auto;" @click="del(k)">删除</button>
</view>
</u-swipe-action-item>
</u-swipe-action>
<view style="border:1rpx solid transparent;"/>
<u-empty :show="list.length<=0" text="未查询到相关信息" width="50%" icon="/static/noData.png"/>
</scroll-view>
@ -140,11 +157,20 @@ export default {
this.search()
},
methods:{
async search(type){
async search(type, i){
if(type=='pageOne'){
this.searchVal.pageNo=1
this.list=[]
this.total=0
}else if(type=='del'){
if(this.list.length>this.searchVal.pageSize+3){
this.total--
this.list.splice(i,1)
}else{
this.searchVal.pageNo=1
this.list=[]
this.total=0
}
}
if(this.total==0||this.list.length<this.total){
var res=await request("/api/basetour/queryTourListByBaseId",{
@ -166,6 +192,25 @@ export default {
}
}
},
del(index){
uni.showModal({
title:"提示",
content:"确定删除?",
success:async e=>{
if(e.confirm){
var res=await request("/api/basetour/deleteById",{
params:{id:this.list[index].id}
})
if(res.statu){
uni.showToast({title:"删除成功!",icon:"success"})
this.search('del',index)
}else{
uni.showToast({title:"删除失败!",icon:"error"})
}
}
}
})
},
toAddPage(){
uni.navigateTo({
url:"/pages/patrolGarden/info",
@ -175,6 +220,7 @@ export default {
toDetail(e){
uni.navigateTo({
url:"/pages/patrolGarden/detail",
events:{update:()=>this.search('pageOne')},
success:res=>{
res.eventChannel.emit('detail',e)
}

BIN
static/patrolGarden/handle.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
static/patrolGarden/unhandle.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Loading…
Cancel
Save