|
|
@ -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> |