下载中职证书按钮更新

This commit is contained in:
2025-09-10 23:40:19 +08:00
parent 1c985b0269
commit 4871362166
14 changed files with 787 additions and 747 deletions

View File

@@ -27,9 +27,10 @@
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出execl</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini"
@click="handleExport">导出execl</el-button>
</el-col>
</el-form>
<el-table v-loading="loading" :data="tableData">
<el-table-column label="#" align="center" prop="id" />
@@ -58,6 +59,13 @@
<TufaLook id="printDiv" v-if="lookV" :formData="lookForm" />
</el-col>
<el-col :span="12">
<!-- 中职毕业证下载 -->
<el-form label-width="120px" v-if="lookForm.diplomaCertificate">
<el-form-item label="中职毕业证">
<el-button type="primary" size="mini" icon="el-icon-download" @click="downloadDiploma">下载毕业证
</el-button>
</el-form-item>
</el-form>
<el-button v-print="printContent">打印</el-button>
<hr />
<el-timeline>
@@ -177,6 +185,23 @@ export default {
this.getList();
},
methods: {
getFileName(path) {
if (!path) return '';
return path.split('/').pop();
},
downloadDiploma() {
if (!this.lookForm.diplomaCertificate) return;
const isAbsoluteUrl = this.lookForm.diplomaCertificate.startsWith('http');
const pdfUrl = isAbsoluteUrl
? this.lookForm.diplomaCertificate
: `${this.baseurl}${this.lookForm.diplomaCertificate}`;
const link = document.createElement('a');
link.href = pdfUrl;
link.download = this.getFileName(this.lookForm.diplomaCertificate);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
},
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
@@ -201,12 +226,12 @@ export default {
this.lookV = true;
},
/** 导出按钮操作 */
handleExport() {
this.download('/comprehensive/knzzZsgApply/export', {
...this.queryParams
}, `apply_${new Date().getTime()}.xlsx`)
}
/** 导出按钮操作 */
handleExport() {
this.download('/comprehensive/knzzZsgApply/export', {
...this.queryParams
}, `apply_${new Date().getTime()}.xlsx`)
}
}
}