|
@@ -80,6 +80,8 @@
|
|
|
@click="search">搜索</el-button>
|
|
|
<el-button @click="onReSet"
|
|
|
type="primary">重置</el-button>
|
|
|
+ <el-button @click="exportSporad"
|
|
|
+ style=" background: #14928a; border:1px solid #14928a;color:#fff">导出</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div class="tableWrap">
|
|
@@ -375,6 +377,12 @@ import { getEmployeeOrgan } from '@/api/buildTeam'
|
|
|
import pagination from '@/components/Pagination/index'
|
|
|
import { vaildStudentUrl } from '@/utils/validate'
|
|
|
import { addZero, getZero, removeZero, getBasic, updateOpenFlag } from '@/api/zeroManager'
|
|
|
+import axios from 'axios'
|
|
|
+import qs from 'qs'
|
|
|
+import {
|
|
|
+ getToken
|
|
|
+} from '@/utils/auth'
|
|
|
+import load from '@/utils/loading'
|
|
|
import QRCode from 'qrcodejs2'
|
|
|
export default {
|
|
|
name: 'sporadicList',
|
|
@@ -676,6 +684,56 @@ export default {
|
|
|
}).catch(() => {
|
|
|
});
|
|
|
|
|
|
+ },
|
|
|
+ exportSporad () {
|
|
|
+ let url = '/api-web/export/sporadicChargeInfo'
|
|
|
+ let data = this.searchForm
|
|
|
+ const options = {
|
|
|
+ method: 'get',
|
|
|
+ headers: {
|
|
|
+ 'Authorization': getToken()
|
|
|
+ },
|
|
|
+ params: data,
|
|
|
+ url,
|
|
|
+ responseType: 'blob'
|
|
|
+ }
|
|
|
+ this.$confirm('您确定导出零星缴费列表', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ load.startLoading()
|
|
|
+ axios(options).then(res => {
|
|
|
+ let blob = new Blob([res.data], {
|
|
|
+ // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
|
|
|
+ type: 'application/vnd.ms-excel;charset=utf-8'
|
|
|
+ //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
|
|
|
+ })
|
|
|
+
|
|
|
+ let text = (new Response(blob)).text()
|
|
|
+ text.then(res => {
|
|
|
+ // 判断是否报错
|
|
|
+ if (res.indexOf('code') != -1) {
|
|
|
+ let json = JSON.parse(res)
|
|
|
+ this.$message.error(json.msg)
|
|
|
+ } else {
|
|
|
+ let objectUrl = URL.createObjectURL(blob)
|
|
|
+ let link = document.createElement("a")
|
|
|
+ let nowTime = new Date()
|
|
|
+ let ymd = nowTime.getFullYear() + '' + (nowTime.getMonth() + 1) + '' + nowTime.getDate()
|
|
|
+ let fname = ymd + '零星缴费' //下载文件的名字
|
|
|
+ link.href = objectUrl
|
|
|
+ link.setAttribute("download", fname)
|
|
|
+ document.body.appendChild(link)
|
|
|
+ link.click()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ load.endLoading();
|
|
|
+ }).catch(error => {
|
|
|
+ this.$message.error('导出数据失败,请联系管理员');
|
|
|
+ load.endLoading();
|
|
|
+ })
|
|
|
+ }).catch(() => { })
|
|
|
}
|
|
|
},
|
|
|
watch: {
|