|
|
@ -1,7 +1,12 @@ |
|
|
|
<template> |
|
|
|
<div class="resi-container"> |
|
|
|
<el-card ref="searchCard" class="search-card"> |
|
|
|
<el-form ref="searchForm" :inline="true" :model="fmData" class="demo-form-inline"> |
|
|
|
<el-form |
|
|
|
ref="searchForm" |
|
|
|
:inline="true" |
|
|
|
:model="fmData" |
|
|
|
class="demo-form-inline" |
|
|
|
> |
|
|
|
<el-form-item label="组织名称" prop="organizationName"> |
|
|
|
<el-input |
|
|
|
v-model="fmData.organizationName" |
|
|
@ -24,11 +29,20 @@ |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button class="diy-button--search" size="small" @click="handleSearch">查询</el-button> |
|
|
|
<el-button class="diy-button--reset" size="small" @click="resetForm('searchForm')">重置</el-button> |
|
|
|
<el-button |
|
|
|
class="diy-button--search" |
|
|
|
size="small" |
|
|
|
@click="handleSearch" |
|
|
|
>查询</el-button |
|
|
|
> |
|
|
|
<el-button |
|
|
|
class="diy-button--reset" |
|
|
|
size="small" |
|
|
|
@click="resetForm('searchForm')" |
|
|
|
>重置</el-button |
|
|
|
> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
</el-card> |
|
|
|
<el-card class="resi-card-table"> |
|
|
|
<div class="resi-row-btn"> |
|
|
@ -38,7 +52,9 @@ |
|
|
|
<el-button |
|
|
|
class="diy-button--export" |
|
|
|
size="small" |
|
|
|
@click="handleExportModule('room')">下载模板</el-button> |
|
|
|
@click="handleExportModule('room')" |
|
|
|
>下载模板</el-button |
|
|
|
> |
|
|
|
<el-upload |
|
|
|
ref="upload" |
|
|
|
class="upload-btn" |
|
|
@ -53,9 +69,12 @@ |
|
|
|
:before-upload="beforeExcelUpload" |
|
|
|
:http-request="uploadHttpRequest" |
|
|
|
> |
|
|
|
<el-button size="small" class="diy-button--delete" :loading="importLoading">{{ |
|
|
|
importBtnTitle |
|
|
|
}}</el-button> |
|
|
|
<el-button |
|
|
|
size="small" |
|
|
|
class="diy-button--delete" |
|
|
|
:loading="importLoading" |
|
|
|
>{{ importBtnTitle }}</el-button |
|
|
|
> |
|
|
|
</el-upload> |
|
|
|
|
|
|
|
<el-button @click="handleChu" class="diy-button--reset" size="small" |
|
|
@ -70,22 +89,41 @@ |
|
|
|
:height="maxTableHeight" |
|
|
|
> |
|
|
|
<el-table-column label="序号" type="index" align="center" width="50" /> |
|
|
|
<el-table-column prop="organizationName" label="组织名称" align="center"> |
|
|
|
<el-table-column |
|
|
|
prop="organizationName" |
|
|
|
label="组织名称" |
|
|
|
align="center" |
|
|
|
> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<a class="name-a" @click="handleWatch(scope.row)"> |
|
|
|
{{ scope.row.organizationName }} |
|
|
|
</a> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="organizationPersonCount" align="center" label="组织人数"> |
|
|
|
<el-table-column |
|
|
|
prop="organizationPersonCount" |
|
|
|
align="center" |
|
|
|
label="组织人数" |
|
|
|
> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="serviceItem" |
|
|
|
label="服务事项" |
|
|
|
align="center" |
|
|
|
:show-overflow-tooltip="true" |
|
|
|
> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="serviceItem" label="服务事项" align="center" :show-overflow-tooltip="true"> </el-table-column> |
|
|
|
<el-table-column prop="score" width="100" align="center" label="积分"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="principalName" align="center" label="负责人"> </el-table-column> |
|
|
|
<el-table-column prop="principalName" align="center" label="负责人"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="principalPhone" align="center" label="联系电话"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="organizationCreatedTime" align="center" label="创建时间"> |
|
|
|
<el-table-column |
|
|
|
prop="organizationCreatedTime" |
|
|
|
align="center" |
|
|
|
label="创建时间" |
|
|
|
> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column fixed="right" label="操作" align="center" width="160"> |
|
|
|
<template slot-scope="scope"> |
|
|
@ -121,7 +159,7 @@ |
|
|
|
type="text" |
|
|
|
size="small" |
|
|
|
class="div-table-button--delete" |
|
|
|
style="margin-left: 10px;" |
|
|
|
style="margin-left: 10px" |
|
|
|
>删除</el-button |
|
|
|
> |
|
|
|
</el-popconfirm> |
|
|
@ -218,7 +256,9 @@ export default { |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
maxTableHeight() { |
|
|
|
return this.clientHeight - 360; |
|
|
|
return this.$store.state.inIframe |
|
|
|
? this.clientHeight - 360 + 120 |
|
|
|
: this.clientHeight - 360; |
|
|
|
}, |
|
|
|
...mapGetters(["clientHeight"]), |
|
|
|
}, |
|
|
@ -238,37 +278,40 @@ export default { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
async handleExportModule() { |
|
|
|
let url = "/heart/iccommunityselforganization/import-template-download" |
|
|
|
let url = "/heart/iccommunityselforganization/import-template-download"; |
|
|
|
|
|
|
|
|
|
|
|
let params = {} |
|
|
|
let params = {}; |
|
|
|
await this.$http({ |
|
|
|
method: 'POST', |
|
|
|
method: "POST", |
|
|
|
url, |
|
|
|
responseType: 'blob', |
|
|
|
data: params |
|
|
|
responseType: "blob", |
|
|
|
data: params, |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
.then((res) => { |
|
|
|
// this.download(res.data, title + '.xls') |
|
|
|
if (res.headers["content-disposition"]) { |
|
|
|
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对象 |
|
|
|
} else this.$message.error('下载失败') |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
console.log('err', err) |
|
|
|
return this.$message.error('网络错误') |
|
|
|
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对象 |
|
|
|
} else this.$message.error("下载失败"); |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
console.log("err", err); |
|
|
|
return this.$message.error("网络错误"); |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 上传大图标成功 |
|
|
|
handleExcelSuccess(res, file) { |
|
|
@ -304,23 +347,28 @@ export default { |
|
|
|
this.importBtnTitle = "正在上传中..."; |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
message: '导入中,请到系统管理-导入记录中查看进度', |
|
|
|
duration: 0 |
|
|
|
}) |
|
|
|
message: "导入中,请到系统管理-导入记录中查看进度", |
|
|
|
duration: 0, |
|
|
|
}); |
|
|
|
const formData = new FormData(); //FormData对象,添加参数只能通过append('key', value)的形式添加 |
|
|
|
formData.append("file", file.file); //添加文件对象 |
|
|
|
await this.$http |
|
|
|
.post('/heart/iccommunityselforganization/importcommunityselforganization', formData).then(res => { |
|
|
|
console.log('res-up', res) |
|
|
|
if (res.data.code == 0 && res.data.msg == 'success') { |
|
|
|
.post( |
|
|
|
"/heart/iccommunityselforganization/importcommunityselforganization", |
|
|
|
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.getTableData(); |
|
|
|
} else this.$message.error(res.data.msg); |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
console.log("失败", err); |
|
|
|
file.onError(); //上传失败的文件会从文件列表中删除 |
|
|
|
// this.$message.error('导入失败') |
|
|
|
}); |
|
|
|
// axios({ |
|
|
|
// url: |
|
|
|
// window.SITE_CONFIG["apiURL"] + |
|
|
@ -344,8 +392,8 @@ export default { |
|
|
|
// .catch((err) => { |
|
|
|
// console.log("失败", err); |
|
|
|
// }); |
|
|
|
this.importLoading = false |
|
|
|
this.importBtnTitle = '导入' |
|
|
|
this.importLoading = false; |
|
|
|
this.importBtnTitle = "导入"; |
|
|
|
this.$refs.upload.clearFiles(); |
|
|
|
}, |
|
|
|
|
|
|
@ -370,8 +418,8 @@ export default { |
|
|
|
this.getTableData(); |
|
|
|
}, |
|
|
|
resetForm(formName) { |
|
|
|
this.$refs[formName].resetFields() |
|
|
|
this.handleSearch() |
|
|
|
this.$refs[formName].resetFields(); |
|
|
|
this.handleSearch(); |
|
|
|
}, |
|
|
|
async handleAdd() { |
|
|
|
this.formShow = true; |
|
|
@ -521,5 +569,4 @@ export default { |
|
|
|
position: relative; |
|
|
|
overflow: visible; |
|
|
|
} |
|
|
|
|
|
|
|
</style> |
|
|
|