合同附件
This commit is contained in:
parent
ebfc63e335
commit
a215c91c87
|
|
@ -731,6 +731,29 @@ const downloadContract = () => {
|
|||
window.open(wordUrl.value)
|
||||
}
|
||||
|
||||
// 下载合同附件
|
||||
const downloadAnnex = async () => {
|
||||
const baseUrl = window.location.origin;
|
||||
const fileUrl = `${baseUrl}/contract-annex.docx`;
|
||||
|
||||
try {
|
||||
const response = await fetch(fileUrl);
|
||||
if (!response.ok) throw new Error('网络响应不正常');
|
||||
|
||||
const blob = await response.blob();
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.style.display = 'none';
|
||||
a.href = url;
|
||||
a.download = 'contract-annex.docx'; // 设置下载文件名
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
} catch (error) {
|
||||
console.error('下载失败:', error);
|
||||
}
|
||||
}
|
||||
|
||||
const wordUrl = ref('')
|
||||
|
||||
//取件码弹窗参数
|
||||
|
|
@ -2046,11 +2069,12 @@ const pickUpView = async(item: any) => {
|
|||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="display: flex; justify-content: flex-end; margin-bottom: 10px">
|
||||
<span class="dialog-footer">
|
||||
<span class="dialog-footer">
|
||||
<el-button type="success" @click="downloadAnnex"> 下载附件 </el-button>
|
||||
<el-button @click="downloadContract" type="success"> 下载合同 </el-button>
|
||||
<el-button type="primary" @click="dialogFormVisibleSettleWord = false"
|
||||
>关 闭</el-button
|
||||
>
|
||||
<el-button @click="downloadContract" type="success"> 下载 </el-button>
|
||||
</span>
|
||||
</div>
|
||||
<div id="mmm" style="height: 600px"></div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue