[update] 修改企标稽查,企标计划,企标宣贯导出后缀;企标复审计划,企标稽查,企标计划中列表日期有特殊判断

This commit is contained in:
lideqin
2023-09-28 10:05:03 +08:00
parent 19a6fe9dcd
commit df8359bcf6
5 changed files with 153 additions and 10 deletions
@@ -127,11 +127,11 @@
</a-tooltip>
</template>
<!-- 计划稽查日期 到期前一周标红 -->
<!-- 计划稽查日期 到期前一周标红 -->
<template slot="scheduledCheckDate" slot-scope="{text}">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<div class="table-text">{{ text || text === 0 ? text : global.emptyLine }}</div>
<div class="table-text" :class="{'table-red-text': text && new Date(Date.parse(text)) > sevenDaysAgo}">{{ text || text === 0 ? text : global.emptyLine }}</div>
</a-tooltip>
</template>
@@ -324,14 +324,21 @@ export default {
clickEvent: 'handleRectificationPlan',
has: 'enterpriseStandardLibrary:check:rectificationPlan'
}
]
],
sevenDaysAgo: undefined
}
},
mounted () {
this.getSysCategoryTree()
this.sevenDaysAgo = this.getSevenDaysAgo()
},
methods: {
isHasPermission,
// 获取七天前日期
getSevenDaysAgo () {
const dateStr = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate() - 7)
return new Date(Date.parse(dateStr))
},
// 获取组织机构树
getSysCategoryTree () {
queryDepartTreeList().then((res) => {
@@ -361,6 +368,49 @@ export default {
}
})
},
// 导出
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'
})
downFile(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 + '.xls')
} 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 + '.xls')
document.body.appendChild(link)
link.click()
document.body.removeChild(link) // 下载完成移除元素
window.URL.revokeObjectURL(url) // 释放掉blob对象
}
}).finally(() => {
// 销毁这个提示
modalLoading.destroy()
})
},
// 导出延期数据
handleExportPostponeData (fileName) {
if (!fileName || typeof fileName !== 'string') {