From d3cea5a349eac68ec27d9451c4eb107b9bd676d5 Mon Sep 17 00:00:00 2001 From: dingtalk_umvbsp Date: Fri, 10 Feb 2023 18:32:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=94=E8=B0=83=20=E5=A4=8D=E5=88=B6?= =?UTF-8?q?=E9=87=87=E6=94=B6=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/massif/mana/plantPlan.vue | 30 +++++++++++++++++++++++++++++- pages/massif/plant_plan.vue | 6 ++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/pages/massif/mana/plantPlan.vue b/pages/massif/mana/plantPlan.vue index 4c9cf15..cc4636c 100644 --- a/pages/massif/mana/plantPlan.vue +++ b/pages/massif/mana/plantPlan.vue @@ -144,7 +144,7 @@ @@ -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, + }) + } + } + } + }) + }, } } \ No newline at end of file diff --git a/pages/massif/plant_plan.vue b/pages/massif/plant_plan.vue index 0b2bf64..bbaeaf4 100644 --- a/pages/massif/plant_plan.vue +++ b/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)