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

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

@ -71,7 +71,7 @@
</el-card> </el-card>
<el-card class="resi-card-table"> <el-card class="resi-card-table">
<div class="resi-row-btn"> <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> </div>
<el-table class="resi-table" v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;"> <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>--> <!--<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>-->
@ -111,8 +111,9 @@
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import axios from 'axios'
import AddOrUpdate from './icpartymemberpayrecorddetail-add-or-update' import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './icpartymemberpayrecorddetail-add-or-update'
export default { export default {
mixins: [mixinViewModule], mixins: [mixinViewModule],
@ -124,6 +125,8 @@
deleteURL: '/resi/partymember/icPartyMemberPayRecordDetail', deleteURL: '/resi/partymember/icPartyMemberPayRecordDetail',
deleteIsBatch: true deleteIsBatch: true
}, },
exportBtn: false,
exportBtnTitle: '导出',
dataForm: { dataForm: {
id: '', id: '',
name: '', name: '',
@ -158,6 +161,43 @@
this.getOrgList() this.getOrgList()
}, },
methods: { 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) { resetForm(formName) {
for(const n in this.dataForm) { for(const n in this.dataForm) {
this.dataForm[n] = '' this.dataForm[n] = ''

Loading…
Cancel
Save