|
|
@@ -16,32 +16,16 @@
|
|
|
@on-load="onLoad"
|
|
|
>
|
|
|
<template #menu-left>
|
|
|
- <div>
|
|
|
- <el-dropdown @command="openFile">
|
|
|
- <el-button type="primary">
|
|
|
- 上传附件
|
|
|
- <el-icon class="el-icon--right">
|
|
|
- <arrow-down />
|
|
|
- </el-icon>
|
|
|
- </el-button>
|
|
|
- <template #dropdown>
|
|
|
- <el-dropdown-menu>
|
|
|
- <el-dropdown-item command="1"
|
|
|
- >备案证/可研批复
|
|
|
- </el-dropdown-item>
|
|
|
- <el-dropdown-item command="2">合同</el-dropdown-item>
|
|
|
- <el-dropdown-item command="3">工程量清单</el-dropdown-item>
|
|
|
- <el-dropdown-item command="4">现场照片</el-dropdown-item>
|
|
|
- <el-dropdown-item command="5"
|
|
|
- >项目核实认定表
|
|
|
- </el-dropdown-item>
|
|
|
- <el-dropdown-item command="6">其他资料</el-dropdown-item>
|
|
|
- </el-dropdown-menu>
|
|
|
- </template>
|
|
|
- </el-dropdown>
|
|
|
- <el-button type="primary" plain @click="exportFile"
|
|
|
- >导 出</el-button
|
|
|
- >
|
|
|
+ <div class="flex flex-center">
|
|
|
+ <filepicker
|
|
|
+ v-if="info"
|
|
|
+ :project-id="info.projectId"
|
|
|
+ :command="command"
|
|
|
+ @submit="onSuccess"
|
|
|
+ />
|
|
|
+ <el-button type="primary" class="ml-10" plain @click="exportFile"
|
|
|
+ >导 出
|
|
|
+ </el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -75,14 +59,6 @@
|
|
|
@click="downLoad(row)"
|
|
|
>下 载
|
|
|
</el-button>
|
|
|
- <el-button
|
|
|
- icon="Download"
|
|
|
- type="primary"
|
|
|
- size="mini"
|
|
|
- text
|
|
|
- @click="openFolder(row)"
|
|
|
- >打开文件夹
|
|
|
- </el-button>
|
|
|
<el-button
|
|
|
icon="Delete"
|
|
|
type="primary"
|
|
|
@@ -118,6 +94,8 @@ import { ElMessageBox } from 'element-plus'
|
|
|
import subInfo from '@/views/store/component/subInfo1.vue'
|
|
|
import subInfo2 from '@/views/store/component/subInfo2.vue'
|
|
|
import subInfo3 from '@/views/store/component/subInfo3.vue'
|
|
|
+import filepicker from '@/components/filepicker/index.vue'
|
|
|
+
|
|
|
export default {
|
|
|
props: {
|
|
|
info: {
|
|
|
@@ -125,7 +103,7 @@ export default {
|
|
|
default: null
|
|
|
}
|
|
|
},
|
|
|
- components: { subInfo, subInfo2, subInfo3 },
|
|
|
+ components: { subInfo, subInfo2, subInfo3, filepicker },
|
|
|
data() {
|
|
|
return {
|
|
|
pid: '',
|
|
|
@@ -136,6 +114,32 @@ export default {
|
|
|
preList: [],
|
|
|
form: {},
|
|
|
data: [],
|
|
|
+ command: [
|
|
|
+ {
|
|
|
+ label: '备案证/可研批复',
|
|
|
+ value: 1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '合同',
|
|
|
+ value: 2
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '工程量清单',
|
|
|
+ value: 3
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '现场照片',
|
|
|
+ value: 4
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '项目核实认定表',
|
|
|
+ value: 5
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '其他资料',
|
|
|
+ value: 6
|
|
|
+ }
|
|
|
+ ],
|
|
|
page: {
|
|
|
current: 1,
|
|
|
size: 10
|
|
|
@@ -247,7 +251,11 @@ export default {
|
|
|
* @param row
|
|
|
*/
|
|
|
downLoad(row) {
|
|
|
- window.open(row.url, '_blank')
|
|
|
+ console.log(row)
|
|
|
+ const link = document.createElement('a')
|
|
|
+ link.href = row.url
|
|
|
+ link.download = row.title
|
|
|
+ link.click()
|
|
|
},
|
|
|
/**
|
|
|
* 文件预览
|
|
|
@@ -318,9 +326,7 @@ export default {
|
|
|
}).then(res => {
|
|
|
if (res === 'confirm') {
|
|
|
const data = {
|
|
|
- id: row.id,
|
|
|
- projectId: row.projectId,
|
|
|
- fileId: row.folderId
|
|
|
+ ids: row.id
|
|
|
}
|
|
|
this.$api.store.removeFile(data).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
@@ -352,6 +358,23 @@ export default {
|
|
|
this.$message.error(res.msg)
|
|
|
}
|
|
|
})
|
|
|
+ },
|
|
|
+ onSuccess(list, expand) {
|
|
|
+ const tmps = list.map(e => {
|
|
|
+ return {
|
|
|
+ projectId: this.info.projectId,
|
|
|
+ fileId: e.id,
|
|
|
+ preId: this.pid,
|
|
|
+ type: expand.value
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.$api.store.linkFile(tmps).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.refreshChange()
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|