Browse Source

巡园记录 联调删除接口

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

8
pages/massif/add_farming.vue

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

13
pages/patrolGarden/detail.vue

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

86
pages/patrolGarden/record.vue

@ -6,8 +6,18 @@
scroll-view{ scroll-view{
flex-grow: 1; flex-grow: 1;
height:1rpx; 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{ .card{
margin-top:0rpx; margin:0rpx;
&>.title{ &>.title{
display: flex; display: flex;
align-items: center; align-items: center;
@ -97,24 +107,31 @@
</d-navbar> </d-navbar>
<d-search v-model="searchVal.search" @search="search('pageOne')"/> <d-search v-model="searchVal.search" @search="search('pageOne')"/>
<scroll-view scroll-y @scrolltolower="search()"> <scroll-view scroll-y @scrolltolower="search()">
<view class="card" v-for="(v,k) in list" :key="k" @click="toDetail(v)"> <u-swipe-action>
<view class="title"> <u-swipe-action-item v-for="(v,k) in list" :key="k">
<text class="icon"/> <view class="card" @click="toDetail(v)">
<text class="name over">{{v.baseName}}</text> <view class="title">
<text v-if="v.flagAbnormal==0" class="statu no">无异常</text> <text class="icon"/>
<text v-else class="statu unusual">异常</text> <text class="name over">{{v.baseName}}</text>
<text v-if="v.flagAbnormal==1" class="deal">(已处理{{v.deal}}/{{v.detailVos.length}})</text> <text v-if="v.flagAbnormal==0" class="statu no">无异常</text>
<text class="plant-youbian"/> <text v-else class="statu unusual">异常</text>
</view> <text v-if="v.flagAbnormal==1" class="deal">(已处理{{v.deal}}/{{v.detailVos.length}})</text>
<view class="imgs"> <text class="plant-youbian"/>
<image v-for="(v1,k1) in v.pic.slice(0,4)" :style="{'--c':v.pic.length-4>0?`'+${v.pic.length-4}'`:''}" :key="k1" mode="aspectFill" :src="`${host}/${v1}`"/> </view>
</view> <view class="imgs">
<u-read-more toggle closetext="展开" showHeight="80rpx" textIndent="0em" style="margin-top:10rpx;">{{v.remark}}</u-read-more> <image v-for="(v1,k1) in v.pic.slice(0,4)" :style="{'--c':v.pic.length-4>0?`'+${v.pic.length-4}'`:''}" :key="k1" mode="aspectFill" :src="`${host}/${v1}`"/>
<view class="foot"> </view>
<text>巡园日期{{v.operateDate}}</text> <u-read-more toggle closetext="展开" showHeight="80rpx" textIndent="0em" style="margin-top:10rpx;">{{v.remark}}</u-read-more>
<text>{{v.userName}}</text> <view class="foot">
</view> <text>巡园日期{{v.operateDate}}</text>
</view> <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;"/> <view style="border:1rpx solid transparent;"/>
<u-empty :show="list.length<=0" text="未查询到相关信息" width="50%" icon="/static/noData.png"/> <u-empty :show="list.length<=0" text="未查询到相关信息" width="50%" icon="/static/noData.png"/>
</scroll-view> </scroll-view>
@ -140,11 +157,20 @@ export default {
this.search() this.search()
}, },
methods:{ methods:{
async search(type){ async search(type, i){
if(type=='pageOne'){ if(type=='pageOne'){
this.searchVal.pageNo=1 this.searchVal.pageNo=1
this.list=[] this.list=[]
this.total=0 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){ if(this.total==0||this.list.length<this.total){
var res=await request("/api/basetour/queryTourListByBaseId",{ 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(){ toAddPage(){
uni.navigateTo({ uni.navigateTo({
url:"/pages/patrolGarden/info", url:"/pages/patrolGarden/info",
@ -175,6 +220,7 @@ export default {
toDetail(e){ toDetail(e){
uni.navigateTo({ uni.navigateTo({
url:"/pages/patrolGarden/detail", url:"/pages/patrolGarden/detail",
events:{update:()=>this.search('pageOne')},
success:res=>{ success:res=>{
res.eventChannel.emit('detail',e) 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