|
@@ -92,6 +92,16 @@
|
|
|
</a-table>
|
|
|
</a-form-model>
|
|
|
</a-spin>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-model-item label="附件" prop="accessory">
|
|
|
+ <ul v-for="(item, index) in accessory" :key="index" >
|
|
|
+ <li>
|
|
|
+ <a @click="accessoryDownload(item)">{{item}}</a>
|
|
|
+ </li>
|
|
|
+
|
|
|
+ </ul>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
</a-card>
|
|
|
<!-- 页面底部提交取消 -->
|
|
|
<div
|
|
@@ -118,7 +128,7 @@
|
|
|
<script>
|
|
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
|
import JEllipsis from '@/components/jeecg/JEllipsis'
|
|
|
-
|
|
|
+import { downFile } from '@/api/manage'
|
|
|
export default {
|
|
|
name: 'AddFabricDrawer', // 新增 装箱单 -面料
|
|
|
mixins: [JeecgListMixin],
|
|
@@ -357,6 +367,7 @@ export default {
|
|
|
className: 'replacecolor'
|
|
|
},
|
|
|
],
|
|
|
+ accessory:[],
|
|
|
addFabricData: [],
|
|
|
loading: false, // 表格加载
|
|
|
addFabric: {},
|
|
@@ -403,6 +414,27 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ accessoryDownload(name){
|
|
|
+ downFile(`/sys/common/static/${name}`).then(data => {
|
|
|
+ if (!data) {
|
|
|
+ this.$message.warning('文件下载失败')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (typeof window.navigator.msSaveBlob !== 'undefined') {
|
|
|
+ window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls')
|
|
|
+ } else {
|
|
|
+ let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
|
|
|
+ let link = document.createElement('a')
|
|
|
+ link.style.display = 'none'
|
|
|
+ link.href = url
|
|
|
+ link.setAttribute('download', name + '.xls')
|
|
|
+ document.body.appendChild(link)
|
|
|
+ link.click()
|
|
|
+ document.body.removeChild(link) // 下载完成移除元素
|
|
|
+ window.URL.revokeObjectURL(url) // 释放掉blob对象
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
// 分页、排序、筛选变化时触发
|
|
|
// handleTableChange(pagination, filters, sorter) {
|