|
@@ -122,37 +122,15 @@ export default {
|
|
|
this.openImportModal = false
|
|
|
this.isShow = false
|
|
|
},
|
|
|
- // 导出
|
|
|
+ // 下载模板
|
|
|
handleExport () {
|
|
|
- const _this = this
|
|
|
- _this.spinning = true
|
|
|
- salesReturnDownload({}).then(res => {
|
|
|
- _this.spinning = false
|
|
|
- if (res.type == 'application/json') {
|
|
|
- var reader = new FileReader()
|
|
|
- reader.addEventListener('loadend', function () {
|
|
|
- const obj = JSON.parse(reader.result)
|
|
|
- _this.$notification.error({
|
|
|
- message: '提示',
|
|
|
- description: obj.message
|
|
|
- })
|
|
|
- })
|
|
|
- reader.readAsText(res)
|
|
|
- } else {
|
|
|
- this.download(res)
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- download (data) {
|
|
|
- if (!data) { return }
|
|
|
- const url = window.URL.createObjectURL(new Blob([data]))
|
|
|
const link = document.createElement('a')
|
|
|
link.style.display = 'none'
|
|
|
- link.href = url
|
|
|
- const fname = '销售退货单产品导入模板'
|
|
|
- link.setAttribute('download', fname + '.xlsx')
|
|
|
+ link.href = 'https://jianguan-images.oss-cn-beijing.aliyuncs.com/template/XiaoShouTuiHuoMingXiDaoRu.xlsx'
|
|
|
+ link.setAttribute('download', '销售退货导入模板' + '.xlsx')
|
|
|
document.body.appendChild(link)
|
|
|
link.click()
|
|
|
+ document.body.removeChild(link)
|
|
|
}
|
|
|
},
|
|
|
watch: {
|