|
|
@@ -6,16 +6,24 @@
|
|
|
:data="data"
|
|
|
ref="crud"
|
|
|
v-model="form"
|
|
|
+ v-model:page="page"
|
|
|
:before-open="beforeOpen"
|
|
|
@row-del="rowDel"
|
|
|
+ @current-change="currentChange"
|
|
|
+ @size-change="sizeChange"
|
|
|
@refresh-change="refreshChange"
|
|
|
- @row-save="rowSave"
|
|
|
- @row-update="rowUpdate"
|
|
|
>
|
|
|
+ <template #menu="{ row }">
|
|
|
+ <preview :id="row.bladeFileId">
|
|
|
+ <template #title>
|
|
|
+ <el-button type="primary" text icon="View">查看</el-button>
|
|
|
+ </template>
|
|
|
+ </preview>
|
|
|
+ </template>
|
|
|
<template #menu-left>
|
|
|
<div class="flex flex-center">
|
|
|
<filepicker
|
|
|
- :project-id="info.id"
|
|
|
+ :project-id="projectId"
|
|
|
:command="dictList"
|
|
|
@submit="selection"
|
|
|
/>
|
|
|
@@ -29,13 +37,30 @@
|
|
|
<script>
|
|
|
import wtCard from '@/components/wt-card/index.vue'
|
|
|
import filepicker from '@/components/filepicker/index.vue'
|
|
|
+import preview from '@/views/resource/component/preview.vue'
|
|
|
|
|
|
export default {
|
|
|
- components: { wtCard, filepicker },
|
|
|
+ components: { wtCard, filepicker, preview },
|
|
|
props: {
|
|
|
- info: {
|
|
|
- type: Object,
|
|
|
- default: null
|
|
|
+ projectId: {
|
|
|
+ required: true,
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
+ stageId: {
|
|
|
+ required: true,
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ projectId: {
|
|
|
+ handler(val) {
|
|
|
+ if (val.length > 0) {
|
|
|
+ this.onLoad()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
|
@@ -49,7 +74,7 @@ export default {
|
|
|
size: 'mini',
|
|
|
addBtn: false,
|
|
|
editBtn: false,
|
|
|
- viewBtn: true,
|
|
|
+ viewBtn: false,
|
|
|
delBtn: true,
|
|
|
columnBtn: false,
|
|
|
labelWidth: 140,
|
|
|
@@ -57,22 +82,22 @@ export default {
|
|
|
column: [
|
|
|
{
|
|
|
label: '文件名称',
|
|
|
- prop: 'title',
|
|
|
+ prop: 'fileName',
|
|
|
fixed: true,
|
|
|
width: 400
|
|
|
},
|
|
|
{
|
|
|
label: '文号',
|
|
|
- prop: 'amount'
|
|
|
+ prop: 'docNumber'
|
|
|
},
|
|
|
{
|
|
|
label: '上传人',
|
|
|
- prop: 'contacts',
|
|
|
+ prop: 'createUserName',
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
label: '上传时间',
|
|
|
- prop: 'partyB'
|
|
|
+ prop: 'createDate'
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
@@ -92,7 +117,7 @@ export default {
|
|
|
if (res.code === 200) {
|
|
|
if (code === 'traffic') {
|
|
|
this.dictList = res.data.map(e => {
|
|
|
- return { label: e.dictValue, value: e.dictKey }
|
|
|
+ return { label: e.dictValue, value: e.dictKey, code: code }
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
@@ -101,25 +126,16 @@ export default {
|
|
|
onLoad() {
|
|
|
this.loading = true
|
|
|
const data = Object.assign({
|
|
|
- projectId: this.projectId,
|
|
|
- stageId: this.stageId
|
|
|
+ projectId: this.projectId
|
|
|
})
|
|
|
- this.$api.contract
|
|
|
- .contractList(Object.assign(this.page, data))
|
|
|
+ this.$api.project
|
|
|
+ .preliminaryFiles(Object.assign(this.page, data))
|
|
|
.then(res => {
|
|
|
- this.data = res.data.records.map(ele => {
|
|
|
- if (ele.contractsStatus === -1) {
|
|
|
- ele.contractsStatus = ''
|
|
|
- }
|
|
|
- if (ele.type === -1) {
|
|
|
- ele.type = ''
|
|
|
- }
|
|
|
- return ele
|
|
|
- })
|
|
|
- this.page.total = res.data.total
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
this.loading = false
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.data = res.data.records
|
|
|
+ this.page.total = res.data.total
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
beforeOpen(done, type) {
|
|
|
@@ -135,16 +151,17 @@ export default {
|
|
|
this.$confirm('确定将选择数据删除?', {
|
|
|
type: 'warning'
|
|
|
}).then(res => {
|
|
|
- console.log(res)
|
|
|
if (res === 'confirm') {
|
|
|
- this.$api.contract.contractRemove({ ids: row.id }).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.$message.success(res.msg)
|
|
|
- this.onLoad()
|
|
|
- } else {
|
|
|
- this.$message.error(res.msg)
|
|
|
- }
|
|
|
- })
|
|
|
+ this.$api.project
|
|
|
+ .preliminaryFilesRemove({ ids: row.id })
|
|
|
+ .then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message.success(res.msg)
|
|
|
+ this.onLoad()
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
@@ -161,13 +178,15 @@ export default {
|
|
|
console.log(command, extra)
|
|
|
const tmps = list.map(ele => {
|
|
|
return {
|
|
|
- fileId: ele.fileId,
|
|
|
+ bladeFileId: ele.fileId,
|
|
|
projectId: ele.projectId,
|
|
|
- pid: ele.id,
|
|
|
- type: command.value
|
|
|
+ fileId: ele.id,
|
|
|
+ dictKey: command.value,
|
|
|
+ code: command.code,
|
|
|
+ folderId: ele.parentId
|
|
|
}
|
|
|
})
|
|
|
- this.$api.project.linkFile(tmps).then(res => {
|
|
|
+ this.$api.project.preliminaryFilesAdd(tmps).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.refreshChange()
|
|
|
} else {
|