Browse Source

党员导入导出

dev-用户反馈
jiangyy 3 years ago
parent
commit
95723926ff
  1. 4
      src/assets/scss/modules/search.scss
  2. 176
      src/views/modules/partymember/lookMember.vue
  3. 694
      src/views/modules/shequ/index.vue
  4. 2
      src/views/modules/shequzhili/event/cpts/process-form.vue
  5. 2
      src/views/modules/shequzhili/event/eventList.vue

4
src/assets/scss/modules/search.scss

@ -218,7 +218,7 @@
align-items: center;
.notice-btn {
width: 50px;
width: 90px;
background-color: #3e8ef7;
color: #fff;
text-align: center;
@ -227,7 +227,7 @@
}
.notice-list {
// @include toe;
width: calc(100% - 70px);
width: calc(100% - 110px);
// height: 24px;
// overflow: hidden;
a {

176
src/views/modules/partymember/lookMember.vue

@ -146,6 +146,35 @@
</div>
</el-card>
<el-card class="resi-card-table">
<div class="resi-row-btn">
<el-button class="diy-button--export"
size="small"
@click="handleExportModule()">下载模板</el-button>
<el-upload :headers="$getElUploadHeaders()"
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>
</div>
<el-table :data="tableData"
row-key="id"
v-loading="tableLoading"
@ -495,6 +524,126 @@ export default {
window.URL.revokeObjectURL(url)
}
},
async handleExportModule () {
let url = "/resi/partymember/icPartyMember/downloadTemplate"
let params = {
}
await this.$http({
method: 'POST',
url,
responseType: 'blob',
data: params
})
.then(res => {
console.log('res-------dd', res)
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 => {
console.log('err', err)
return this.$message.error('网络错误')
})
},
//
handleExcelSuccess (res, file) {
if (res.code === 0 && res.msg === 'success') {
console.log('resss---ppp', res)
} else {
this.$message.error(res.msg)
}
},
beforeExcelUpload (file) {
console.log('file', file)
const isType = file.type === 'application/vnd.ms-excel'
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
const fileType = isType || isTypeComputer
const isLt1M = (file.size / 1024 / 1024) < 10
if (!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式!')
}
if (!isLt1M) {
this.$message.error('上传文件大小不能超过 10MB!')
}
return fileType && isLt1M
},
async uploadHttpRequest (file) {
this.importLoading = true
this.importBtnTitle = '正在上传中...'
this.$message({
showClose: true,
message: '导入中,请到系统管理-导入记录中查看进度',
duration: 0
})
const formData = new FormData() //FormDataappend('key', value)
formData.append('file', file.file) //
this.$http
.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('')
this.getTableData()
} else {
this.$message.error(res.data.msg)
}
}).catch(err => {
console.log('失败', err)
file.onError() //
// this.$message.error('')
})
this.importLoading = false
this.importBtnTitle = '导入'
this.$refs.upload.clearFiles()
},
async handleExport () {
this.exportBtn = true
this.exportBtnTitle = '正在导出...'
let params = {
...this.searchForm,
agencyId: this.agencyId,
pageSize: 9999,
pageNo: this.currentPage
}
// .post('epmetuser/icresiuser/exportExcel', params)
await axios({
url: window.SITE_CONFIG['apiURL'] + '/resi/partymember/icPartyMember/export',
// url: 'epmetuser/icresiuser/exportExcel',
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 = '导出'
},
handleSearch (val) {
console.log('searchhh--', val)
@ -623,6 +772,33 @@ export default {
@import "@/assets/scss/modules/visual/communityManage.scss";
</style>
<style lang="scss" scoped>
.resi-row-btn {
display: flex;
margin-bottom: 13px;
::v-deep .el-button {
// margin-left: 10px;
border: 0;
}
::v-deep .el-select {
margin-right: 10px;
}
.el-button--success {
background: rgba(34, 193, 195, 1);
}
.el-button {
margin-left: 10px;
border: 0;
}
.el-button--success {
background: rgba(34, 193, 195, 1);
}
.el-button--warning {
background: rgba(254, 179, 73, 1);
}
.el-button--danger {
background: rgba(254, 98, 82, 1);
}
}
.div_btn {
display: flex;
align-items: center;

694
src/views/modules/shequ/index.vue

File diff suppressed because it is too large

2
src/views/modules/shequzhili/event/cpts/process-form.vue

@ -18,7 +18,7 @@
label="">暂不处理</el-radio>
<el-radio label="0">回复</el-radio>
<el-radio label="1">立项</el-radio>
<el-radio label="2">转服务</el-radio>
<el-radio label="2">需求服务</el-radio>
<el-radio label="3">转议题</el-radio>
</el-radio-group>

2
src/views/modules/shequzhili/event/eventList.vue

@ -787,7 +787,7 @@ export default {
// this.tableData.forEach(item => {
// if (item.operationType === '2') {
// item.operationTypeShow = ''
// item.operationTypeShow = ''
// }
// if (item.operationType === '1') {
// item.operationTypeShow = ''

Loading…
Cancel
Save