update 所有会议-会议纪要改成上传文件相同弹框,增加导出zip
This commit is contained in:
@@ -8,62 +8,43 @@
|
|||||||
@cancel="handleCancel"
|
@cancel="handleCancel"
|
||||||
cancelText="关闭">
|
cancelText="关闭">
|
||||||
<a-spin :spinning="confirmLoading">
|
<a-spin :spinning="confirmLoading">
|
||||||
<a-form :form="form">
|
|
||||||
<a-row>
|
|
||||||
<a-col :span="24">
|
|
||||||
<!--上传会议资料显示 -->
|
|
||||||
<!--<a-form-item label="会议文件" :labelCol="labelCol" :wrapperCol="wrapperCol" v-if="type === '2' ">-->
|
|
||||||
<!-- <j-upload file-type-error-message="请上传会议文件" :multiple="true"-->
|
|
||||||
<!-- :return-id="true"-->
|
|
||||||
<!-- v-decorator="['fileIds']"-->
|
|
||||||
<!-- :trigger-change="true"></j-upload>-->
|
|
||||||
<!--</a-form-item>-->
|
|
||||||
<!--上传会议纪要显示 -->
|
|
||||||
<a-form-item label="会议纪要" :labelCol="labelCol" :wrapperCol="wrapperCol" v-if="type === '1' ">
|
|
||||||
<j-upload file-type-error-message="请上传会议纪要" :multiple="true"
|
|
||||||
:return-id="true"
|
|
||||||
v-decorator="['fileIds']"
|
|
||||||
:trigger-change="true"></j-upload>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
</a-form>
|
|
||||||
<!-- 以表格的形式展示 所有的文件 -->
|
<!-- 以表格的形式展示 所有的文件 -->
|
||||||
<template v-if="type === '2' ">
|
<div class="table-operator">
|
||||||
<div class="table-operator">
|
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader"
|
||||||
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader"
|
:action="importExcelUrl" :beforeUpload="beforeUpload" @change="handleChange"
|
||||||
:action="importExcelUrl" :beforeUpload="beforeUpload" @change="handleChange"
|
|
||||||
>
|
|
||||||
<a-button type="primary" icon="plus">新增</a-button>
|
|
||||||
</a-upload>
|
|
||||||
<a-button type="danger" icon="delete" @click="batchDel">
|
|
||||||
批量删除
|
|
||||||
</a-button>
|
|
||||||
</div>
|
|
||||||
<a-table
|
|
||||||
ref="table"
|
|
||||||
size="middle"
|
|
||||||
rowKey="id"
|
|
||||||
:scroll="{x:'auto'}"
|
|
||||||
:pagination="false"
|
|
||||||
:columns="columns"
|
|
||||||
:dataSource="fileList"
|
|
||||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
|
||||||
class="j-table-force-nowrap"
|
|
||||||
>
|
>
|
||||||
<template slot="text" slot-scope="text">
|
<a-button type="primary" icon="plus">新增</a-button>
|
||||||
<a-tooltip>
|
</a-upload>
|
||||||
<template slot="title">{{ text }}</template>
|
<a-button type="danger" icon="delete" @click="batchDel">
|
||||||
<div class="table-text">{{ text }}</div>
|
批量删除
|
||||||
</a-tooltip>
|
</a-button>
|
||||||
</template>
|
<a-button type="primary" icon="export" @click="handleExportZip('文件')">
|
||||||
<span slot="action" slot-scope="record" class="action-span-cell">
|
导出
|
||||||
|
</a-button>
|
||||||
|
</div>
|
||||||
|
<a-table
|
||||||
|
ref="table"
|
||||||
|
size="middle"
|
||||||
|
rowKey="id"
|
||||||
|
:scroll="{x:'auto'}"
|
||||||
|
:pagination="false"
|
||||||
|
:columns="columns"
|
||||||
|
:dataSource="fileList"
|
||||||
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||||
|
class="j-table-force-nowrap"
|
||||||
|
>
|
||||||
|
<template slot="text" slot-scope="text">
|
||||||
|
<a-tooltip>
|
||||||
|
<template slot="title">{{ text }}</template>
|
||||||
|
<div class="table-text">{{ text }}</div>
|
||||||
|
</a-tooltip>
|
||||||
|
</template>
|
||||||
|
<span slot="action" slot-scope="record" class="action-span-cell">
|
||||||
<a class="color-blue" @click="myDownload(record)">下载</a>
|
<a class="color-blue" @click="myDownload(record)">下载</a>
|
||||||
<a class="color-blue" @click="myPreview(record)">查看</a>
|
<a class="color-blue" @click="myPreview(record)">查看</a>
|
||||||
<a class="color-blue" @click="deleteFile(record)">删除</a>
|
<a class="color-blue" @click="deleteFile(record)">删除</a>
|
||||||
</span>
|
</span>
|
||||||
</a-table>
|
</a-table>
|
||||||
</template>
|
|
||||||
</a-spin>
|
</a-spin>
|
||||||
<email-error-msg-modal ref="emailError"></email-error-msg-modal>
|
<email-error-msg-modal ref="emailError"></email-error-msg-modal>
|
||||||
</j-modal>
|
</j-modal>
|
||||||
@@ -71,7 +52,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import JUpload from '@comp/jero/JUpload'
|
import JUpload from '@comp/jero/JUpload'
|
||||||
import {httpAction} from '@api/manage'
|
import {downloadFileZip, httpAction} from '@api/manage'
|
||||||
import {getFileInfoByIds} from '@/api/api'
|
import {getFileInfoByIds} from '@/api/api'
|
||||||
import EmailErrorMsgModal from '@views/projectManagement/modules/EmailErrorMsgModal'
|
import EmailErrorMsgModal from '@views/projectManagement/modules/EmailErrorMsgModal'
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
@@ -121,22 +102,12 @@ export default {
|
|||||||
width: 1000,
|
width: 1000,
|
||||||
visible: false,
|
visible: false,
|
||||||
confirmLoading: false,
|
confirmLoading: false,
|
||||||
form: this.$form.createForm(this),
|
|
||||||
type: '', // 上传会议纪要还是上传会议资料
|
type: '', // 上传会议纪要还是上传会议资料
|
||||||
model: {},
|
model: {},
|
||||||
labelCol: {
|
|
||||||
xs: {span: 24},
|
|
||||||
sm: {span: 6}
|
|
||||||
},
|
|
||||||
wrapperCol: {
|
|
||||||
xs: {span: 24},
|
|
||||||
sm: {span: 18}
|
|
||||||
},
|
|
||||||
// 会议id
|
// 会议id
|
||||||
meetingId: '',
|
meetingId: '',
|
||||||
// 已经上传的会议文件
|
// 已经上传的会议文件
|
||||||
meetingFileIds: '',
|
meetingFileIds: '',
|
||||||
validatorRules: {},
|
|
||||||
url: {},
|
url: {},
|
||||||
columns,
|
columns,
|
||||||
fileList: [],
|
fileList: [],
|
||||||
@@ -166,7 +137,6 @@ export default {
|
|||||||
async edit(record, type) {
|
async edit(record, type) {
|
||||||
this.visible = true
|
this.visible = true
|
||||||
this.type = type
|
this.type = type
|
||||||
this.form.resetFields()
|
|
||||||
this.model = Object.assign({}, record)
|
this.model = Object.assign({}, record)
|
||||||
// 根据会议类型返回不同的url
|
// 根据会议类型返回不同的url
|
||||||
this.url = Object.assign({}, this.createUrlByMeetingType(record.meetingType + ''))
|
this.url = Object.assign({}, this.createUrlByMeetingType(record.meetingType + ''))
|
||||||
@@ -174,26 +144,18 @@ export default {
|
|||||||
// 会议资料与会议纪要的回显
|
// 会议资料与会议纪要的回显
|
||||||
if (type === '1') {
|
if (type === '1') {
|
||||||
this.meetingFileIds = this.model.meetingMinute ? this.model.meetingMinute : ''
|
this.meetingFileIds = this.model.meetingMinute ? this.model.meetingMinute : ''
|
||||||
if (this.meetingFileIds && this.meetingFileIds !== '') {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.form.setFieldsValue({'fileIds': this.meetingFileIds})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} else if (type === '2') {
|
} else if (type === '2') {
|
||||||
this.meetingFileIds = this.model.meetingData ? this.model.meetingData : ''
|
this.meetingFileIds = this.model.meetingData ? this.model.meetingData : ''
|
||||||
if (this.meetingFileIds && this.meetingFileIds !== '') {
|
|
||||||
this.fileList = await this.getFileInfoArr(this.meetingFileIds)
|
|
||||||
this.$nextTick(() => {
|
|
||||||
// this.form.setFieldsValue({'fileIds': this.meetingFileIds})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if (this.meetingFileIds && this.meetingFileIds !== '') {
|
||||||
|
this.fileList = await this.getFileInfoArr(this.meetingFileIds)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
close() {
|
close() {
|
||||||
this.$emit('close')
|
this.$emit('close')
|
||||||
// fix:80439 解决弹窗下次打开时,回显历史数据
|
// fix:80439 解决弹窗下次打开时,回显历史数据
|
||||||
this.fileList = []
|
this.fileList = []
|
||||||
|
this.onClearSelected()
|
||||||
this.meetingFileIds = ''
|
this.meetingFileIds = ''
|
||||||
this.type = ''
|
this.type = ''
|
||||||
this.visible = false
|
this.visible = false
|
||||||
@@ -281,32 +243,20 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 会议纪要-触发表单的验证
|
// 会议文件
|
||||||
if(this.type === '1') {
|
let ids = this.fileList.map(tt => tt.id).join(',')
|
||||||
// 触发表单验证
|
const params = {
|
||||||
this.form.validateFields((err, values) => {
|
fileIds: ids,
|
||||||
if (!err && values.fileIds !== undefined) {
|
id: that.meetingId
|
||||||
const params = {
|
|
||||||
fileIds: values.fileIds,
|
|
||||||
id: that.meetingId
|
|
||||||
}
|
|
||||||
let url = this.url.uploadCouncilFile
|
|
||||||
callbackFunc(url, params)
|
|
||||||
} else {
|
|
||||||
that.close()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else if (this.type === '2'){
|
|
||||||
// 会议文件
|
|
||||||
let ids = this.fileList.map(tt => tt.id).join(',')
|
|
||||||
const params = {
|
|
||||||
fileIds: ids,
|
|
||||||
id: that.meetingId
|
|
||||||
}
|
|
||||||
let url = this.url.uploadFile
|
|
||||||
// 会议文件 不用对比开始与最后文件的差别,后端会自己比对
|
|
||||||
callbackFunc(url, params)
|
|
||||||
}
|
}
|
||||||
|
let url
|
||||||
|
if(this.type === '1') {
|
||||||
|
url = this.url.uploadCouncilFile
|
||||||
|
} else if (this.type === '2'){
|
||||||
|
url = this.url.uploadFile
|
||||||
|
}
|
||||||
|
// 会议文件 不用对比开始与最后文件的差别,后端会自己比对
|
||||||
|
callbackFunc(url, params)
|
||||||
},
|
},
|
||||||
handleCancel() {
|
handleCancel() {
|
||||||
this.close()
|
this.close()
|
||||||
@@ -386,6 +336,14 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 导出zip
|
||||||
|
handleExportZip () {
|
||||||
|
// 有勾选就导出勾选,没有勾选就导出所有
|
||||||
|
const ids = this.selectedRowKeys.length ? this.selectedRowKeys.join(',') : this.fileList.map(item => item.id).join(',')
|
||||||
|
downloadFileZip('sys/common/zipDownload', this.title + '.zip', {
|
||||||
|
ids
|
||||||
|
})
|
||||||
|
},
|
||||||
beforeUpload(file) {
|
beforeUpload(file) {
|
||||||
this.uploadGoOn = true
|
this.uploadGoOn = true
|
||||||
file.uploadGoOn = true
|
file.uploadGoOn = true
|
||||||
|
|||||||
Reference in New Issue
Block a user