Browse Source

联调 复制采收计划

master
邓宏 2 years ago
parent
commit
d3cea5a349
  1. 30
      pages/massif/mana/plantPlan.vue
  2. 6
      pages/massif/plant_plan.vue

30
pages/massif/mana/plantPlan.vue

@ -144,7 +144,7 @@
<button class="cu-btn" style="--c:153, 153, 153;" @click.stop="toAdd(v.id)">采收</button>
</template>
<template v-else-if="v.status==2">
<button v-if="v.plantType=='水果'" class="cu-btn" style="--c:16, 193, 118;" @click.stop="">复制当前计划</button>
<button v-if="v.plantType=='水果'" class="cu-btn" style="--c:16, 193, 118;" @click.stop="copy(v.id)">复制当前计划</button>
<text class="over">已结束</text>
</template>
</view>
@ -280,6 +280,34 @@ export default {
}
})
},
async copy(id){
uni.showModal({
title:"提示",
content:"确定复制当前计划?",
success: async e=>{
if(e.confirm){
var res=await request("/api/plantPlan/copyPlan",{
params:{id}
})
if(res.statu){
uni.navigateTo({
url:`/pages/massif/plant_plan`,
event:{update:()=> {this.clean();this.search()} },
success(e){
e.eventChannel.emit("copy", res.data)
}
})
}else{
uni.showModal({
title:"提示",
content:res.msg||"复制失败!",
showCancel:false,
})
}
}
}
})
},
}
}
</script>

6
pages/massif/plant_plan.vue

@ -86,6 +86,12 @@ export default {
},
async onLoad(options){
this.eventChannel=this.getOpenerEventChannel()
this.eventChannel.on("copy",e=>{
this.formData=e
this.fields.images.value=e.images?.join?.(',')||''
this.fields.plantType.value=e.plantType
this.formData.plantType=e.plantType[1]
})
await this.init()
options.plotId && (this.formData.plotId=options.plotId)

Loading…
Cancel
Save