Merge branch 'main' into dev-sy-12-23

This commit is contained in:
BianLzhaoMin 2024-12-25 08:53:31 +08:00
commit 4f947e09b1
2 changed files with 21 additions and 0 deletions

Binary file not shown.

View File

@ -60,6 +60,9 @@
<el-button class="primary-lease" type="primary" @click="addContract"
>合同新建</el-button
>
<a href="/contract-template.docx" download="安徽省机械化装备共享平台-协议模板" >
<el-button class="primary-lease" type="primary" style="margin-left:20px">模板下载</el-button>
</a>
</el-form-item>
</el-col>
</el-row>
@ -528,6 +531,24 @@ const addAndEditFormRules = reactive({
fileInfoList: [{ required: true, message: '请上传合同附件', trigger: 'blur' }],
})
//
const onDownload = async (row) => {
try {
const response = await axios.get(row.fileUrl, {
responseType: 'blob',
});
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', row.fileName);
document.body.appendChild(link);
link.click();
} catch (error) {
ElMessage.error('下载失败,请稍后重试');
}
};
//
// const onSubmit = () => {
// addAndEditFormRef.value.validate(async (valid: any) => {