Browse Source

党员、缴费记录导出

shibei_master
Jackwang 3 years ago
parent
commit
07f6619068
  1. 91
      src/views/modules/communityParty/members/index.vue
  2. 46
      src/views/modules/partymember/icpartymemberpayrecorddetail.vue

91
src/views/modules/communityParty/members/index.vue

@ -107,32 +107,32 @@
</div>
</el-card>
<el-card class="resi-card-table">
<div class="resi-row-btn">
<el-button class="diy-button--add" size="small" @click="handleAdd">新增</el-button>
<!-- <el-button
class="diy-button--export"
size="small"
@click="handleExportModule('room')">下载模板</el-button>
<el-upload
ref="upload"
class="upload-demo"
action="uploadUlr"
:limit="1"
:accept="'.xls,.xlsx'"
:with-credentials="true"
:show-file-list="false"
:auto-upload="true"
:on-success="handleExcelSuccess"
:before-upload="beforeExcelUpload"
:http-request="uploadHttpRequest"
>
<el-button size="small" class="diy-button--delete" :loading="importLoading">{{importBtnTitle}}</el-button>
</el-upload>
<el-button class="diy-button--reset" size="small" :loading="exportBtn" @click="handleExport">{{ exportBtnTitle }}</el-button> -->
<!-- <el-button-->
<!-- class="diy-button&#45;&#45;export"-->
<!-- size="small"-->
<!-- @click="handleExportModule('room')">下载模板</el-button>-->
<!-- <el-upload-->
<!-- ref="upload"-->
<!-- class="upload-demo"-->
<!-- action="uploadUlr"-->
<!-- :limit="1"-->
<!-- :accept="'.xls,.xlsx'"-->
<!-- :with-credentials="true"-->
<!-- :show-file-list="false"-->
<!-- :auto-upload="true"-->
<!-- :on-success="handleExcelSuccess"-->
<!-- :before-upload="beforeExcelUpload"-->
<!-- :http-request="uploadHttpRequest"-->
<!-- >-->
<!-- <el-button size="small" class="diy-button&#45;&#45;delete" :loading="importLoading">{{importBtnTitle}}</el-button>-->
<!-- </el-upload>-->
<el-button class="diy-button--reset" size="small" :loading="exportBtn" @click="handleExport">{{ exportBtnTitle }}</el-button>
</div>
<el-table
:data="tableData"
row-key="id"
@ -294,7 +294,7 @@
:close-on-click-modal="false"
:before-close="handlerCancle"
>
<crate-form v-if="dialogVisible" :info="detailInfo" :partyList="optionsG"
<crate-form v-if="dialogVisible" :info="detailInfo" :partyList="optionsG"
:disabled="disabled"
@saveBase="handleSearch" @cancle="handlerCancle" />
</el-dialog>
@ -417,7 +417,7 @@ export default {
partyProps: {
label: 'partyOrgName',
value: 'id',
checkStrictly: true
checkStrictly: true
}
}
},
@ -444,17 +444,17 @@ export default {
// this.getCateList('query')
// this.getCateList('addorupdate')
this.pageLoading = true
// this.tableHeight = document.documentElement.clientHeight - this.$refs.searchCard.$el.offsetHeight - 280 + 'px'
},
mounted() {
this.$nextTick(() => {
this.searchH = this.$refs.searchCard.$el.offsetHeight
console.log('tableHeight', this.tableHeight)
})
},
methods: {
handleSizeChange(val) {
@ -540,11 +540,11 @@ export default {
}
},
async handleExportModule () {
let url = "/resi/partymember/icpartymemberstyle/import/template-download"
let url = "/resi/partymember/icPartyMember/import/template-download"
let params = {}
await this.$http({
method: 'POST',
url,
@ -556,7 +556,7 @@ export default {
if (res.headers["content-disposition"]) {
let fileName = window.decodeURI(res.headers["content-disposition"].split(";")[1].split("=")[1])
this.download(res.data, fileName)
} else this.$message.error('下载失败')
})
.catch(err => {
@ -573,7 +573,7 @@ export default {
if(!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式!')
}
if (!isLt1M) {
this.$message.error('上传文件大小不能超过 10MB!')
}
@ -590,7 +590,7 @@ export default {
const formData = new FormData() //FormDataappend('key', value)
formData.append('file', file.file) //
this.$http
.post('/resi/partymember/icpartymemberstyle/import', formData).then(res => {
.post('/resi/partymember/icPartyMember/import', formData).then(res => {
console.log('res-up', res)
if (res.data.code == 0 && res.data.msg == 'success') {
// this.$message.success('')
@ -603,7 +603,7 @@ export default {
file.onError() //
// this.$message.error('')
})
this.importLoading = false
this.importBtnTitle = '导入'
this.$refs.upload.clearFiles()
@ -614,11 +614,12 @@ export default {
let params = {
agencyId: this.$store.state.user.agencyId,
pageSize: 9999,
pageNo: this.currentPage
pageNo: this.currentPage,
...this.searchForm
}
// .post('epmetuser/icresiuser/exportExcel', params)
await axios({
url: window.SITE_CONFIG['apiURL'] + '/resi/partymember/icpartymemberstyle/export',
url: window.SITE_CONFIG['apiURL'] + '/resi/partymember/icPartyMember/export',
// url: 'epmetuser/icresiuser/exportExcel',
method: 'post',
data: params,
@ -685,7 +686,7 @@ export default {
this.handleSearch()
},
handleAdd() {
this.dialogVisible = true
},
@ -703,7 +704,7 @@ export default {
await this.getDetail(row.id)
this.dialogVisible = true
},
handleDel(row) {
let params = {
ids: [row.id]
@ -753,7 +754,7 @@ export default {
return this.$message.error(res.msg)
} else {
console.log('获取查询详情成功', res.data)
this.optionsG = this.deepArrTOnull(res.data)
}
})
@ -786,7 +787,7 @@ export default {
return this.$message.error(res.msg)
} else {
console.log('获取查询详情成功', res.data)
if (type === 'query') this.optionsC = res.data
else this.optionsEditC = res.data
}
@ -819,7 +820,7 @@ export default {
})
this.tableLoading = false
}
}
}
</script>
@ -935,8 +936,8 @@ export default {
text-align: center;
}
}
.resi-btns {
margin-top: 20px;

46
src/views/modules/partymember/icpartymemberpayrecorddetail.vue

@ -71,7 +71,7 @@
</el-card>
<el-card class="resi-card-table">
<div class="resi-row-btn">
<el-button type="warning" size="small" class="diy-button--reset" @click="exportHandle()">{{ $t('export') }}</el-button>
<el-button type="warning" size="small" :loading="exportBtn" class="diy-button--reset" @click="exportHandle()">{{ $t('export') }}</el-button>
</div>
<el-table class="resi-table" v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<!--<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>-->
@ -111,8 +111,9 @@
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './icpartymemberpayrecorddetail-add-or-update'
import axios from 'axios'
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './icpartymemberpayrecorddetail-add-or-update'
export default {
mixins: [mixinViewModule],
@ -124,6 +125,8 @@
deleteURL: '/resi/partymember/icPartyMemberPayRecordDetail',
deleteIsBatch: true
},
exportBtn: false,
exportBtnTitle: '导出',
dataForm: {
id: '',
name: '',
@ -158,6 +161,43 @@
this.getOrgList()
},
methods: {
async exportHandle() {
this.exportBtn = true
this.exportBtnTitle = '正在导出...'
let params = {
agencyId: this.$store.state.user.agencyId,
pageSize: 9999,
pageNo: this.currentPage,
...this.dataForm
}
await axios({
url: window.SITE_CONFIG['apiURL'] + '/resi/partymember/icPartyMemberPayRecordDetail/export',
method: 'post',
data: params,
responseType: 'blob'
})
.then(res => {
console.log('resllll', res)
let fileName = window.decodeURI(res.headers["content-disposition"].split(";")[1].split("=")[1])
console.log('filename', fileName)
let blob = new Blob([res.data], { type: 'application/vnd.ms-excel' })
var url = window.URL.createObjectURL(blob)
var aLink = document.createElement('a')
aLink.style.display = 'none'
aLink.href = url
aLink.setAttribute('download', fileName)
document.body.appendChild(aLink)
aLink.click()
document.body.removeChild(aLink) //
window.URL.revokeObjectURL(url) //blob
})
.catch((err) => {
console.log('获取导出情失败', err)
this.$message.error('获取导出失败')
})
this.exportBtn = false
this.exportBtnTitle = '导出'
},
resetForm(formName) {
for(const n in this.dataForm) {
this.dataForm[n] = ''

Loading…
Cancel
Save