|
|
|
@ -2,13 +2,24 @@ |
|
|
|
<div class="customer-css"> |
|
|
|
<el-dialog :title="titleCon" :close-on-click-modal="false" :visible.sync="visible" width="390px" style="height: 520px;" class="customer-dialog" @close="handleDialogClose" :show-close="!uploading"> |
|
|
|
<el-form :inline="true" label-position="top" label-width="80px"> |
|
|
|
<!-- <el-row> |
|
|
|
<el-row> |
|
|
|
<el-form-item label=" "> |
|
|
|
<a href="/static/downLoad/NotifyUploadModel.xlsx" download="领料申请单导入模板.xlsx"> |
|
|
|
下载 Excel 模板 |
|
|
|
</a> |
|
|
|
<el-button |
|
|
|
type="primary" |
|
|
|
icon="el-icon-download" |
|
|
|
:disabled="uploading" |
|
|
|
@click="downloadPartNoTemplate"> |
|
|
|
下载物料 Excel 模板 |
|
|
|
</el-button> |
|
|
|
<el-button |
|
|
|
type="warning" |
|
|
|
icon="el-icon-download" |
|
|
|
:disabled="uploading" |
|
|
|
@click="downloadShoporderTemplate"> |
|
|
|
下载工单 Excel 模板 |
|
|
|
</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-row> --> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-upload class="customer-upload" drag action="javascript:void(0);" ref="uploadFile" :limit="1" accept=".xlsx,.xls" |
|
|
|
@ -53,6 +64,7 @@ export default { |
|
|
|
}, |
|
|
|
uploading: false, // 上传状态标志 |
|
|
|
returnData: '', // 返回的数据 |
|
|
|
partNoloading: false, // 物料模板下载状态 |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
@ -166,6 +178,77 @@ export default { |
|
|
|
this.uploading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
downloadPartNoTemplate() { |
|
|
|
const loading = this.$loading({ |
|
|
|
lock: true, |
|
|
|
text: '正在下载模板...', |
|
|
|
spinner: 'el-icon-loading', |
|
|
|
background: 'rgba(0, 0, 0, 0.7)' |
|
|
|
}) |
|
|
|
|
|
|
|
this.$http({ |
|
|
|
url: this.$http.adornUrl('/orderIssure/issureNotify/downloadPartNoTemplate'), |
|
|
|
method: 'get', |
|
|
|
responseType: 'blob' |
|
|
|
}).then(response => { |
|
|
|
loading.close() |
|
|
|
|
|
|
|
// 创建下载链接 |
|
|
|
const blob = new Blob([response.data], { |
|
|
|
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' |
|
|
|
}) |
|
|
|
const url = window.URL.createObjectURL(blob) |
|
|
|
const link = document.createElement('a') |
|
|
|
link.href = url |
|
|
|
link.download = '无订单物料Excel模板.xlsx' |
|
|
|
document.body.appendChild(link) |
|
|
|
link.click() |
|
|
|
document.body.removeChild(link) |
|
|
|
window.URL.revokeObjectURL(url) |
|
|
|
|
|
|
|
this.$message.success('模板下载成功') |
|
|
|
}).catch(error => { |
|
|
|
loading.close() |
|
|
|
console.error('模板下载失败:', error) |
|
|
|
this.$message.error('模板下载失败,请联系管理员') |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
downloadShoporderTemplate(){ |
|
|
|
const loading = this.$loading({ |
|
|
|
lock: true, |
|
|
|
text: '正在下载模板...', |
|
|
|
spinner: 'el-icon-loading', |
|
|
|
background: 'rgba(0, 0, 0, 0.7)' |
|
|
|
}) |
|
|
|
|
|
|
|
this.$http({ |
|
|
|
url: this.$http.adornUrl('/orderIssure/issureNotify/downloadShoporderTemplate'), |
|
|
|
method: 'get', |
|
|
|
responseType: 'blob' |
|
|
|
}).then(response => { |
|
|
|
loading.close() |
|
|
|
|
|
|
|
// 创建下载链接 |
|
|
|
const blob = new Blob([response.data], { |
|
|
|
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' |
|
|
|
}) |
|
|
|
const url = window.URL.createObjectURL(blob) |
|
|
|
const link = document.createElement('a') |
|
|
|
link.href = url |
|
|
|
link.download = '无订单订单号Excel模板.xlsx' |
|
|
|
document.body.appendChild(link) |
|
|
|
link.click() |
|
|
|
document.body.removeChild(link) |
|
|
|
window.URL.revokeObjectURL(url) |
|
|
|
|
|
|
|
this.$message.success('模板下载成功') |
|
|
|
}).catch(error => { |
|
|
|
loading.close() |
|
|
|
console.error('模板下载失败:', error) |
|
|
|
this.$message.error('模板下载失败,请联系管理员') |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |