Browse Source

完善月还计提已办--增加导出

master
yunuo970428 1 year ago
parent
commit
a7d4e77118
  1. 10
      anrui-riskcenter-ui/src/api/monthlyallowance/monthlyallowance.js
  2. 28
      anrui-riskcenter-ui/src/views/workFlow/yuehuanjitiFlow/monthlyallowanceYiBan.vue

10
anrui-riskcenter-ui/src/api/monthlyallowance/monthlyallowance.js

@ -47,6 +47,16 @@ export default {
params: data
})
},
// 导出
exportExcel(data) {
return request({
url: '/riskcenter/v1/loanmonthlyaccrualapply/accrualDetailsExport',
method: 'post',
responseType: 'blob', // 表明返回服务器返回的数据类型
params: data,
headers: { 'Content-Type': 'application/json' }
})
},
// 提交流程
submit: function(params) {
return request({

28
anrui-riskcenter-ui/src/views/workFlow/yuehuanjitiFlow/monthlyallowanceYiBan.vue

@ -4,6 +4,7 @@
<div class="tab-header webtop">
<div>{{ viewTitle }}</div>
<div>
<el-button type="primary" size="small" @click="toExport()">导出</el-button>
<el-button type="danger" size="small" @click="openRevoke()">撤回</el-button>
</div>
</div>
@ -172,6 +173,33 @@ export default {
}, '*')
}
})
},
toExport() {
if (this.formobj.records.length > 0) {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.exportExcel({ sid: this.formobj.sid }).then((res) => {
loading.close()
const blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const fileName = '本月应还记录' + '.xls'
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'nonde'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
}).catch(() => {
loading.close()
})
}
}
}
}

Loading…
Cancel
Save