[update] 修改评审会记录设置优质标准,企标计划操作栏按钮加分割线

This commit is contained in:
lideqin
2023-09-20 10:13:24 +08:00
parent 02385bd805
commit 32a9330549
4 changed files with 63 additions and 3 deletions
+15
View File
@@ -128,6 +128,21 @@ export function downFile (url, parameter) {
})
}
/**
* 下载文件 用于excel导出
* @param url
* @param parameter
* @returns {*}
*/
export function postDownFile (url, parameter) {
return axios({
url: url,
params: parameter,
method: 'post',
responseType: 'blob'
})
}
/**
* 下载文件
* @param url 文件路径
@@ -178,6 +178,7 @@
<!-- 操作栏 -->
<div slot="action" slot-scope="{record}" class="action-span-cell">
<a @click="handleDetail(record)" class="table-ope-btn" v-has="'enterpriseStandardLibrary:plan:detail'">{{ $t('view') }}</a>
<a-divider type="vertical" />
<a @click="handleDelete(record.id)" class="table-ope-btn" v-if="record.allowDel" v-has="'enterpriseStandardLibrary:plan:delete'">{{ $t('delete') }}</a>
</div>
@@ -216,10 +216,11 @@ export default {
return
}
const param = {}
param.ids = this.selectedRowKeys.join(',')
param.standardNos = this.selectionRows.map(item => item.standardNo).join(',')
setQualityStandard(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.loadData()
} else {
this.$message.warning(res.message)
}
@@ -171,6 +171,7 @@ import TreeNodeModal from './modules/TreeNodeModal'
import UserSelectModal from '../../../components/selection/UserSelectModal'
// 配置标准弹框
import AllocationStandardDrawer from './modules/AllocationStandardDrawer'
import { postDownFile } from '@/api/manage'
export default {
name: 'EnterpriseStandardList',
@@ -221,8 +222,8 @@ export default {
delete: '/laws/standard/enterprise/singleDelete', // 删除
deleteBatch: '/laws/standard/enterprise/deleteByIdsAndModule', // 批量删除
importUrl: '', // 导入
exportXlsUrl: '', // 导出
exportZipUrl: '', // 带文件导出
exportXlsUrl: '/laws/standard/enterprise/exportData', // 导出
exportZipUrl: '/laws/standard/enterprise/exportDataWithFile', // 带文件导出
downTemplateUrl: '' // 下载导入模板
},
showAction: true, // 是否显示操作列
@@ -329,6 +330,48 @@ export default {
this.getTableHeader()
this.loadData()
},
handleExportXls (fileName) {
if (!fileName || typeof fileName !== 'string') {
fileName = '导出文件'
}
const param = this.getQueryParams()
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
param.selections = this.selectedRowKeys.join(',')
}
console.log('导出参数', param)
// 加一个大的提示
const modalLoading = this.$info({
title: '提示',
content: <span>正在导出请稍候 <a-spin size="small" /></span>,
keyboard: false
})
// 把知道了这个按钮去掉
this.$nextTick(() => {
document.getElementsByClassName('ant-modal-confirm-btns')[0].style = 'display:none'
})
postDownFile(this.url.exportXlsUrl, param).then((data) => {
if (!data) {
this.$message.warning('文件下载失败')
return
}
if (typeof window.navigator.msSaveBlob !== 'undefined') {
window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xlsx')
} else {
const url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
const link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.setAttribute('download', fileName + '.xlsx')
document.body.appendChild(link)
link.click()
document.body.removeChild(link) // 下载完成移除元素
window.URL.revokeObjectURL(url) // 释放掉blob对象
}
}).finally(() => {
// 销毁这个提示
modalLoading.destroy()
})
},
// 配置标准
handleAllocationStandard () {
console.log(this.currentTreeNode)