[update] 收入合同、文件上传限制、文件预览

This commit is contained in:
zhaoxiao
2021-09-06 17:44:13 +08:00
parent 804fe3cafa
commit 575c1b7cd5
6 changed files with 97 additions and 30 deletions
@@ -6,15 +6,16 @@
<div class="part-title-text">工作组信息</div>
</div>
<!-- 工作组信息区域-->
<a-spin :spinning="loading">
<a-spin :spinning="spinning">
<div class="work-group-detail">
<div class="work-group-detail-item work-group-detail-item-small"
v-for="(item, index) in detailTitleList"
:key="index">
<div class="work-group-detail-item-title">{{ item.title }}:</div>
<div class="work-group-detail-item-content"
v-if="item.fieldName === 'chargeNoticeAId' || item.fieldName === 'chargeNoticeBId'">
{{ workingGroupDetail[item.fieldName] }}
<div class="work-group-detail-item-content work-group-detail-item-filename"
v-if="(item.fieldName === 'chargeNoticeA' || item.fieldName === 'chargeNoticeB') && workingGroupDetail[item.fieldName]"
@click="previewFile(workingGroupDetail[item.fieldName])">
{{ workingGroupDetail[item.fieldName].fileName }}
</div>
<div class="work-group-detail-item-content" v-else>{{ workingGroupDetail[item.fieldName] }}</div>
</div>
@@ -61,7 +62,8 @@
<!-- 操作按钮区域-->
<div class="table-operator">
<a-button type="primary" icon="plus" @click="handleAdd">添加成员</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :data="importParam" :action="importExcelUrl" @change="handleImportExcel">
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :data="importParam"
:action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<a-button type="primary" icon="export" @click="handleExportXls('工作组成员')">导出</a-button>
@@ -74,18 +76,18 @@
<!-- table表格区域-->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:scroll="{x: 1500}"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange"
class="j-table-force-nowrap">
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:scroll="{x: 1500}"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange"
class="j-table-force-nowrap">
<!-- 工作组名称-->
<template slot="projectName" slot-scope="text, record">
@@ -115,7 +117,8 @@
<project-detail-modal ref="projectDetail"></project-detail-modal>
<working-group-member-unit-module ref="modalForm" @ok="modalFormOk"></working-group-member-unit-module>
<working-group-member-set-charge-notice ref="setChargeNotic" @ok="modalFormOk"></working-group-member-set-charge-notice>
<working-group-member-set-charge-notice ref="setChargeNotic"
@ok="modalFormOk"></working-group-member-set-charge-notice>
</div>
</template>
@@ -128,6 +131,10 @@ import StatusSlot from '../../components/tools/StatusSlot'
import ProjectDetailModal from '../../components/ProjectDetailModal'
import WorkingGroupMemberUnitModule from './modules/WorkingGroupMemberUnitModule'
import WorkingGroupMemberSetChargeNotice from './modules/WorkingGroupMemberSetChargeNotice'
import { getFileInfo } from '../../api/api'
import Vue from 'vue'
import { ACCESS_TOKEN } from '../../store/mutation-types'
const Base64 = require('js-base64').Base64
export default {
name: 'WorkingGroupMemberUnitMaintenance',
@@ -150,6 +157,7 @@ export default {
disableMixinCreated: true,
workingGroupProject: '',
workingGroupProjectId: '',
spinning: false,
detailTitleList: [
{
title: '工作组项目名称',
@@ -174,7 +182,7 @@ export default {
fieldName: 'chargeNoticeNoA'
}, {
title: '收费通知A',
fieldName: 'chargeNoticeAId'
fieldName: 'chargeNoticeA'
}, {
title: '本年应收款B',
fieldName: 'yearChargeB'
@@ -183,7 +191,7 @@ export default {
fieldName: 'chargeNoticeNoB'
}, {
title: '收费通知B',
fieldName: 'chargeNoticeBId'
fieldName: 'chargeNoticeB'
}
],
labelCol: {
@@ -285,6 +293,7 @@ export default {
* 初始化工作组信息
*/
initWorkGruopData() {
this.spinning = true
this.workingGroupProject = this.$route.query.workingGroupProject
this.workingGroupProjectId = this.$route.query.workingGroupProjectId
this.filters.workingGroupId = this.workingGroupProjectId
@@ -295,6 +304,21 @@ export default {
}
getWorkingGroupById(param).then(res => {
this.workingGroupDetail = res.result
// this.workingGroupDetail.chargeNoticeA = {}
// this.workingGroupDetail.chargeNoticeB = {}
this.getFile()
}).finally(() => {
this.spinning = false
})
},
async getFile() {
await getFileInfo({ id: this.workingGroupDetail.chargeNoticeAId }).then(res => {
this.workingGroupDetail.chargeNoticeA = res.result
this.$forceUpdate()
})
await getFileInfo({ id: this.workingGroupDetail.chargeNoticeBId }).then(res => {
this.workingGroupDetail.chargeNoticeB = res.result
this.$forceUpdate()
})
},
handleAdd: function () {
@@ -368,6 +392,19 @@ export default {
this.$message.warn(res.message)
}
})
},
/**
* 文件预览
* @param file
*/
previewFile(file) {
console.log(file)
if (file && file.url) {
const fileFullUrl = `${window._CONFIG['domianWebSocketURL']}/sys/common/download/${file.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}`
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
// let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(fileFullUrl)}`
window.open(url)
}
}
}
}
@@ -407,6 +444,10 @@ export default {
word-break: break-all;
color: #2F3133;
}
&-filename {
cursor: pointer;
}
}
}