From 191ea111f781d49a30e9444ac188c326dff17834 Mon Sep 17 00:00:00 2001 From: zyk Date: Sat, 7 Mar 2026 12:38:58 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=A7=8D=E8=AE=A1=E5=88=92=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mating_plan/generate/index.vue | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/views/mating_plan/mating_plan/generate/index.vue b/src/views/mating_plan/mating_plan/generate/index.vue index e4147c6..9c8ca59 100644 --- a/src/views/mating_plan/mating_plan/generate/index.vue +++ b/src/views/mating_plan/mating_plan/generate/index.vue @@ -107,6 +107,13 @@ type="info" :closable="false" show-icon /> +
+ + 下载配对模板 + + 下载空白模板,填写耳号后上传 +
+ @@ -364,7 +371,8 @@ import { confirmApproveBreedPlan, viewBreedPlan, exportBreedPlanDetails, - delBreedPlanGenerate + delBreedPlanGenerate, + downloadPairTemplate } from '@/api/mating_plan/generate' const { proxy } = getCurrentInstance() @@ -520,6 +528,23 @@ function handleClearImport() { if (uploadRef.value) uploadRef.value.clearFiles() } +async function handleDownloadTemplate() { + try { + const res = await downloadPairTemplate() + const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }) + const url = window.URL.createObjectURL(blob) + const a = document.createElement('a') + a.href = url + a.download = '配种配对模板.xlsx' + document.body.appendChild(a) + a.click() + document.body.removeChild(a) + window.URL.revokeObjectURL(url) + } catch (e) { + proxy.$modal.msgError('下载模板失败:' + e.message) + } +} + // =================== Tab3:计划列表 =================== const listLoading = ref(false) const planList = ref([])