md
This commit is contained in:
parent
89a1d4c188
commit
499b7aded2
@ -153,6 +153,14 @@
|
||||
@click="handleExportToBill"
|
||||
>导出EXCEL电子表</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExportToZip"
|
||||
>电子账单打包下载</el-button>
|
||||
<!-- <el-col :span="1.5" v-if="confirmStatus==1">
|
||||
<el-button
|
||||
type="primary"
|
||||
@ -258,6 +266,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import JSZip from 'jszip';
|
||||
import FileSaver from 'file-saver';
|
||||
|
||||
import { listEmisSettleBill,confirmSettleBillBySite, getEmisSettleBill, delEmisSettleBill, addEmisSettleBill, updateEmisSettleBill } from "@/api/emis/emisSettleBill";
|
||||
import MergeBillForm from '@/views/emis/emisSettleBill/MergeBillForm.vue';
|
||||
import elDateSimplePicker from '@/components/DatePickerAdv/elDateSimplePicker';
|
||||
@ -554,8 +565,8 @@ export default {
|
||||
},
|
||||
handleRemovceBillCode(){
|
||||
|
||||
},
|
||||
handleExportToBill() {
|
||||
},
|
||||
handleExportToBill() {
|
||||
if(this.selectList&&this.selectList.length>0){
|
||||
this.selectList.forEach(item=>{
|
||||
this.download('emis/emisSettleBill/exportBill', {
|
||||
@ -563,6 +574,28 @@ export default {
|
||||
}, `账单${item.settleBillName}.xlsx`)
|
||||
});
|
||||
}
|
||||
},
|
||||
async handleExportToZip() {
|
||||
if(this.selectList&&this.selectList.length>0){
|
||||
const zip = new JSZip()
|
||||
const cache = {}
|
||||
const promises = []
|
||||
for(let i=0;i<this.selectList.length;i++){
|
||||
let item=this.selectList[i];
|
||||
let url=`emis/emisSettleBill/exportBill`;
|
||||
const promise = this.getRemoteFile(url,{settleBillNo:item.settleBillNo}).then(data => {
|
||||
let fileName = `账单${item.settleBillName}.xlsx`
|
||||
zip.file(fileName, data, { binary: true }) // 逐个添加文件
|
||||
cache[fileName] = data
|
||||
})
|
||||
promises.push(promise)
|
||||
}
|
||||
Promise.all(promises).then(() => {
|
||||
zip.generateAsync({type:"blob"}).then(content => { // 生成二进制流
|
||||
FileSaver.saveAs(content, "账单.zip") // 利用file-saver保存文件
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
|
||||
@ -137,6 +137,16 @@
|
||||
@click="handleExportToBill"
|
||||
>导出EXCEL电子表</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExportToZip"
|
||||
v-hasPermi="['emis:emisSettleBill:export']"
|
||||
>电子账单打包下载</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
@ -221,6 +231,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import JSZip from 'jszip';
|
||||
import FileSaver from 'file-saver';
|
||||
|
||||
import { listEmisSettleBill, getEmisSettleBill, delEmisSettleBill, addEmisSettleBill, updateEmisSettleBill } from "@/api/emis/emisSettleBill";
|
||||
import MergeBillForm from '@/views/emis/emisSettleBill/MergeBillForm.vue';
|
||||
import elDateSimplePicker from '@/components/DatePickerAdv/elDateSimplePicker';
|
||||
@ -485,6 +499,28 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
async handleExportToZip() {
|
||||
if(this.selectionList&&this.selectionList.length>0){
|
||||
const zip = new JSZip()
|
||||
const cache = {}
|
||||
const promises = []
|
||||
for(let i=0;i<this.selectionList.length;i++){
|
||||
let item=this.selectionList[i];
|
||||
let url=`emis/emisSettleBill/exportBill`;
|
||||
const promise = this.getRemoteFile(url,{settleBillNo:item.settleBillNo}).then(data => {
|
||||
let fileName = `账单${item.settleBillName}.xlsx`
|
||||
zip.file(fileName, data, { binary: true }) // 逐个添加文件
|
||||
cache[fileName] = data
|
||||
})
|
||||
promises.push(promise)
|
||||
}
|
||||
Promise.all(promises).then(() => {
|
||||
zip.generateAsync({type:"blob"}).then(content => { // 生成二进制流
|
||||
FileSaver.saveAs(content, "账单.zip") // 利用file-saver保存文件
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
handleAddBillCode(){
|
||||
|
||||
},
|
||||
|
||||
@ -138,6 +138,16 @@
|
||||
v-hasPermi="['emis:emisSettleBill:export']"
|
||||
>导出EXCEL电子表</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExportToZip"
|
||||
v-hasPermi="['emis:emisSettleBill:export']"
|
||||
>电子账单打包下载</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
@ -218,11 +228,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
import JSZip from 'jszip';
|
||||
import FileSaver from 'file-saver';
|
||||
import { tansParams, blobValidate } from "@/utils/custom";
|
||||
import { getToken } from '@/utils/auth'
|
||||
|
||||
import { listEmisSettleBill, getEmisSettleBill, delEmisSettleBill, addEmisSettleBill, updateEmisSettleBill } from "@/api/emis/emisSettleBill";
|
||||
import MergeBillForm from '@/views/emis/emisSettleBill/MergeBillForm.vue';
|
||||
@ -486,9 +493,17 @@ export default {
|
||||
},
|
||||
handleRemovceBillCode(){
|
||||
|
||||
},
|
||||
async handleExportToBill() {
|
||||
|
||||
},
|
||||
handleExportToBill() {
|
||||
if(this.selectionList&&this.selectionList.length>0){
|
||||
this.selectionList.forEach(item=>{
|
||||
this.download('emis/emisSettleBill/exportBill', {
|
||||
settleBillNo:item.settleBillNo
|
||||
}, `账单${item.settleBillName}.xlsx`)
|
||||
});
|
||||
}
|
||||
},
|
||||
async handleExportToZip() {
|
||||
if(this.selectionList&&this.selectionList.length>0){
|
||||
const zip = new JSZip()
|
||||
const cache = {}
|
||||
@ -508,15 +523,7 @@ export default {
|
||||
FileSaver.saveAs(content, "账单.zip") // 利用file-saver保存文件
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
// this.selectionList.forEach(async item=>{
|
||||
// this.download('emis/emisSettleBill/exportBill', {
|
||||
// settleBillNo:item.settleBillNo
|
||||
// }, `账单${item.settleBillName}.xlsx`)
|
||||
// });
|
||||
}
|
||||
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
|
||||
@ -156,6 +156,15 @@
|
||||
@click="handleExportToBill"
|
||||
>导出EXCEL电子表</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExportToZip"
|
||||
>电子账单打包下载</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5" v-if="confirmStatus==1">
|
||||
<el-button
|
||||
type="primary"
|
||||
@ -258,6 +267,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import JSZip from 'jszip';
|
||||
import FileSaver from 'file-saver';
|
||||
|
||||
import { listEmisSettleBill,confirmSettleBillBySite,
|
||||
cancelConfirmBillBySite,
|
||||
getEmisSettleBill, delEmisSettleBill, addEmisSettleBill, updateEmisSettleBill } from "@/api/emis/emisSettleBill";
|
||||
@ -581,6 +593,28 @@ export default {
|
||||
}, `${item.settleBillName}.xlsx`)
|
||||
});
|
||||
}
|
||||
},
|
||||
async handleExportToZip() {
|
||||
if(this.selectList&&this.selectList.length>0){
|
||||
const zip = new JSZip()
|
||||
const cache = {}
|
||||
const promises = []
|
||||
for(let i=0;i<this.selectList.length;i++){
|
||||
let item=this.selectList[i];
|
||||
let url=`emis/emisSettleBill/exportBill`;
|
||||
const promise = this.getRemoteFile(url,{settleBillNo:item.settleBillNo}).then(data => {
|
||||
let fileName = `账单${item.settleBillName}.xlsx`
|
||||
zip.file(fileName, data, { binary: true }) // 逐个添加文件
|
||||
cache[fileName] = data
|
||||
})
|
||||
promises.push(promise)
|
||||
}
|
||||
Promise.all(promises).then(() => {
|
||||
zip.generateAsync({type:"blob"}).then(content => { // 生成二进制流
|
||||
FileSaver.saveAs(content, "账单.zip") // 利用file-saver保存文件
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user