Browse Source

完善客户账单明细--增加导出功能

master
yunuo970428 12 months ago
parent
commit
ce6575a7bd
  1. 37
      anrui-buscenter/anrui-finmanage-ui/src/views/anruifinmanagement/paymentConfirmation/customerBillingDetails.vue

37
anrui-buscenter/anrui-finmanage-ui/src/views/anruifinmanagement/paymentConfirmation/customerBillingDetails.vue

@ -122,7 +122,7 @@
</template>
<script>
import { createPdfByCustomer, customerBillDetailedListPage} from '@/api/anruifinmanagement/paymentConfirmation.js'
import { createPdfByCustomer, customerBillDetailedListPage, exportExcel } from '@/api/anruifinmanagement/paymentConfirmation.js'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import ButtonBar from '@/components/ButtonBar'
@ -140,6 +140,13 @@ export default {
isSearchShow: false,
btndisabled: false,
btnList: [
{
type: 'success',
size: 'small',
icon: 'export',
btnKey: 'doExport',
btnLabel: '导出'
},
{
type: 'info',
size: 'small',
@ -202,6 +209,9 @@ export default {
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'doExport':
this.doExport()
break
case 'doClose':
this.doClose()
break
@ -260,6 +270,31 @@ export default {
}
this.getList()
},
doExport() {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
exportExcel(this.listQuery.params).then((resp) => {
loading.close()
const blob = new Blob([resp], {
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()
})
},
handleDownLoad(row) {
createPdfByCustomer({ detailedSid: row.sid, createBySid: window.sessionStorage.getItem('userSid') }).then((resp) => {
if (resp.success && resp.data !== null) {

Loading…
Cancel
Save