|
@@ -169,7 +169,7 @@
|
|
|
import { Vue, Component, Watch } from 'vue-property-decorator'
|
|
|
import { batchinfoPage, detectDataImport, detectDataPage } from '@/api/dataCheckModule/dataImport'
|
|
|
import { projectPage } from '@/api/dataCheckModule/projectList'
|
|
|
-import { uploadFile, getAllDepartments } from '@/api/base'
|
|
|
+import { uploadFile, getAllDepartments,downloadFile } from '@/api/base'
|
|
|
import { getDefaultPagination } from '@/utils/constant'
|
|
|
import { districts } from '@/views/zhpt/dataImport/common/constant'
|
|
|
import { ElForm } from 'element-ui/types/form'
|
|
@@ -290,7 +290,19 @@ export default class TanceDataImport extends Vue {
|
|
|
this.fileList = fileList
|
|
|
}
|
|
|
handlePreview(file) {
|
|
|
- console.log('点击文件列表中已上传的文件时的钩子', file)
|
|
|
+ if(this.formType==="edit"){
|
|
|
+ downloadFile({fileMark:file.fileId}).then(result=>{
|
|
|
+ const buffer = new Blob([result], {
|
|
|
+ type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
|
|
|
+ })
|
|
|
+ const link = document.createElement('a')
|
|
|
+ link.href = window.URL.createObjectURL(buffer)
|
|
|
+ link.download =file.name
|
|
|
+ link.click()
|
|
|
+ //释放内存
|
|
|
+ window.URL.revokeObjectURL(link.href)
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
handleExceed(files, fileList) {
|
|
|
this.$message.warning(
|
|
@@ -393,14 +405,15 @@ export default class TanceDataImport extends Vue {
|
|
|
return
|
|
|
}
|
|
|
const fileID = result.result[0].fileId
|
|
|
-
|
|
|
- const data = {
|
|
|
- prjId: this.addForm.project,
|
|
|
- district: this.addForm.district,
|
|
|
- departmentId: this.addForm.tcUnit,
|
|
|
- remark: this.addForm.remark,
|
|
|
- fileId: fileID
|
|
|
- }
|
|
|
+ const fileName = result.result[0].fileName
|
|
|
+ const data = {
|
|
|
+ prjId: this.addForm.project,
|
|
|
+ district: this.addForm.district,
|
|
|
+ departmentId: this.addForm.tcUnit,
|
|
|
+ remark: this.addForm.remark,
|
|
|
+ fileId: fileID,
|
|
|
+ fileName:fileName
|
|
|
+ }
|
|
|
detectDataImport(data)
|
|
|
.then((addResult) => {
|
|
|
if (addResult.code === 1) {
|
|
@@ -435,9 +448,7 @@ export default class TanceDataImport extends Vue {
|
|
|
type: 'tc',
|
|
|
remark: row.remark
|
|
|
}
|
|
|
- // this.fileList = row.toflyFiles.map((item) => {
|
|
|
- // return item.fileName
|
|
|
- // })
|
|
|
+ //this.fileList=[{name: row.fileName, fileId: row.fileId }]
|
|
|
}
|
|
|
/**数据导入列表 */
|
|
|
batchinfoPage() {
|