|
@@ -87,8 +87,8 @@ import { constructStateArr,HylyArr,SsksArr,XZArr } from '../../../utils/data/sel
|
|
|
import { useRouter } from "vue-router";
|
|
|
import {
|
|
|
DeleteDsxm,
|
|
|
- exportCityConstructionFile,
|
|
|
- GetDsjsList,
|
|
|
+ exportCityConstructionFile, exportCityConstructionFile2,
|
|
|
+ GetDsjsList, GetDsjsList2,
|
|
|
GetDsxmDetail,
|
|
|
getDxsmAllYear
|
|
|
} from '../../../api/projectAudit'
|
|
@@ -106,7 +106,8 @@ const data_detail = ref({})
|
|
|
const previewIsShow = ref(false)
|
|
|
const select_year = ref([])
|
|
|
onMounted(() => {
|
|
|
- toList()
|
|
|
+ console.log(11);
|
|
|
+ toList()
|
|
|
getDxsmAllYear().then(res =>{
|
|
|
let data = res.data
|
|
|
data.sort((pre,cur) => {
|
|
@@ -175,11 +176,16 @@ function getExportTime(){
|
|
|
}
|
|
|
}
|
|
|
function toList() {
|
|
|
- console.log(getExportTime())
|
|
|
+ // console.log(getExportTime())
|
|
|
tableData.value = []
|
|
|
tableTotal.value = 0
|
|
|
stateFilterAll.value[0].count = 0
|
|
|
- GetDsjsList({
|
|
|
+ let isSj = false //是否包含时间参数
|
|
|
+ if(formInline.sbsj && formInline.sbsj[1] && formInline.sbsj[0]){
|
|
|
+ isSj = true
|
|
|
+ }
|
|
|
+ let fun = isSj ? GetDsjsList2 : GetDsjsList
|
|
|
+ fun({
|
|
|
hyly:formInline.hyly,
|
|
|
nd:formInline.nd,
|
|
|
ssks:formInline.ssks,
|
|
@@ -190,10 +196,10 @@ function toList() {
|
|
|
zzsbsj:formInline.sbsj && formInline.sbsj[0],
|
|
|
},currentPage.value,pageSize.value).then(res => {
|
|
|
|
|
|
- tableData.value = res.data.list
|
|
|
- tableTotal.value = res.data.total
|
|
|
- stateFilterAll.value[0].count = res.data.total
|
|
|
- })
|
|
|
+ tableData.value = res.data.list
|
|
|
+ tableTotal.value = res.data.total
|
|
|
+ stateFilterAll.value[0].count = res.data.total
|
|
|
+ })
|
|
|
}
|
|
|
function exportList(){
|
|
|
let exportArr = getExportTime()
|
|
@@ -201,8 +207,17 @@ function toList() {
|
|
|
elAlert('只能导出半年左右数据')
|
|
|
return
|
|
|
}
|
|
|
+ let urlArr = []
|
|
|
+ let isSj = false //是否包含时间参数
|
|
|
+ if(formInline.sbsj && formInline.sbsj[1] && formInline.sbsj[0]){
|
|
|
+ isSj = true
|
|
|
+ }else{
|
|
|
+ exportArr.value = [[]]
|
|
|
+ }
|
|
|
+ console.log(exportArr.value);
|
|
|
+ let fun = isSj ? exportCityConstructionFile2 : exportCityConstructionFile
|
|
|
exportArr.value.forEach(item => {
|
|
|
- exportCityConstructionFile({
|
|
|
+ fun({
|
|
|
hyly:formInline.hyly,
|
|
|
nd:formInline.nd,
|
|
|
ssks:formInline.ssks,
|
|
@@ -223,7 +238,21 @@ function toList() {
|
|
|
isSuccess = false
|
|
|
}
|
|
|
if (isSuccess){
|
|
|
- window.open(res.data,'_self')
|
|
|
+ urlArr.push(res.data)
|
|
|
+ // window.open(res.data,'_self') //使用window.open会被浏览器拦截,改成在iframe中打开
|
|
|
+ if(urlArr.length === exportArr.value.length){
|
|
|
+ console.log(urlArr);
|
|
|
+ let count = 0
|
|
|
+ for(let i = 0; i < urlArr.length; i++){
|
|
|
+ // window.open(url,'_blank')
|
|
|
+ let hiddenIFrameID = 'hiddenDownloader' + count++;
|
|
|
+ let iframe = document.createElement('iframe');
|
|
|
+ iframe.id = hiddenIFrameID;
|
|
|
+ iframe.style.display = 'none';
|
|
|
+ document.body.appendChild(iframe);
|
|
|
+ iframe.src = urlArr[i];//直接下载,不会弹出新的页面
|
|
|
+ }
|
|
|
+ }
|
|
|
}else {
|
|
|
showMessage({
|
|
|
type:'error',
|