@@ -84,7 +102,7 @@
label="层数">
+ label="总户数">
{
+ this.endLoading()
+ if (data.code === 0 || data.code > 8000) {
+ // this.$message({
+ // type: "success",
+ // message: "导入成功"
+ // });
+ // this.$message.success(rspMsg)
+ // this.$emit('refreshTree')
+ // this.loadTable()
+ }
+ this.showMessage(rspMsg)
+ },
+ (rspMsg, data) => {
+ this.endLoading()
+ this.$message.error(rspMsg)
+ }, { headers: { 'Content-Type': 'multipart/form-data' } })
},
+ showMessage (msg) {
+ this.$alert(msg, '操作结果', {
+ confirmButtonText: '关闭',
+ callback: action => {
+ this.$emit('refreshTree')
+ this.loadTable()
+ }
+ });
+ },
handleSizeChange (val) {
this.pageSize = val
@@ -510,6 +574,7 @@ export default {
}
.div_btn {
+ display: flex;
margin-top: 20px;
}
diff --git a/src/views/modules/base/community/community.vue b/src/views/modules/base/community/community.vue
index 41005ba13..14254aa9d 100644
--- a/src/views/modules/base/community/community.vue
+++ b/src/views/modules/base/community/community.vue
@@ -27,7 +27,7 @@
-
@@ -151,7 +151,7 @@ export default {
if (obj.level === 'building') {//点击楼栋
this.$refs['ref_buildingTable'].loadTable(true, this.selTreeObj)
- } else if (obj.level === 'neighbourHood') {//点击小区
+ } else if (obj.level === 'neighborHood') {//点击小区
this.$refs['ref_neighTable'].loadTable(true, this.selTreeObj)
} else {
@@ -200,7 +200,7 @@ export default {
obj.communityId = communityNode.data.id
obj.communityName = communityNode.data.label
- } else if (obj.level === 'neighbourHood') {//点击小区
+ } else if (obj.level === 'neighborHood') {//点击小区
let gridNode = this.$refs.ref_tree.getNode(obj.pid)
let agencyNode = this.$refs.ref_tree.getNode(gridNode.data.pid)
diff --git a/src/views/modules/base/community/communityTable.vue b/src/views/modules/base/community/communityTable.vue
index 4608b461c..c33c02465 100644
--- a/src/views/modules/base/community/communityTable.vue
+++ b/src/views/modules/base/community/communityTable.vue
@@ -31,32 +31,69 @@
@click="handleSearch">查询
- 导出
- 新增小区
- 下载小区模板
-
-
-
+ 下载小区模板
+
+
+ 导入小区数据
+
+
+ 下载楼宇模板
+
+
+ 导入楼宇数据
+
+ 导入小区数据
-
+ @click="handleExportModule('room')">下载房屋模板
+
+
+ 导入房屋数据
+
+
@@ -203,9 +240,9 @@ export default {
if (fromTree) {
this.agencyObj = treeObj
}
-
+ console.log(this.agencyObj)
const url = "/gov/org/neighborhood/neighborhoodlist"
- // const url = "http://yapi.elinkservice.cn/mock/245/gov/org/neighborhood/neighborhoodlist"
+
let params = {
pageSize: this.pageSize,
pageNo: this.pageNo,
@@ -338,7 +375,7 @@ export default {
},
// 下载文件
- download (data, fileName) {
+ download (data, downFileName) {
if (!data) {
return
}
@@ -346,7 +383,7 @@ export default {
var csvData = new Blob([data])
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
- window.navigator.msSaveOrOpenBlob(csvData, fileName);
+ window.navigator.msSaveOrOpenBlob(csvData, downFileName);
}
// for Non-IE (chrome, firefox etc.)
else {
@@ -355,7 +392,7 @@ export default {
a.style = 'display: none';
var url = window.URL.createObjectURL(csvData);
a.href = url;
- a.download = fileName;
+ a.download = downFileName;
a.click();
a.remove();
window.URL.revokeObjectURL(url);
@@ -363,11 +400,22 @@ export default {
},
- handleExportModule () {
+ handleExportModule (type) {
let title = ''
- title = '小区模板'
+ let url = ""
+ if (type === 'community') {
+ title = '小区导入模板'
+ url = '/gov/org/neighborhood/exporttemplate'
+
+ } else if (type === 'building') {
+ title = '楼宇导入模板'
+ url = '/gov/org/building/exporttemplate'
+
+ } else if (type === 'room') {
+ title = '房间导入模板'
+ url = '/gov/org/house/exporttemplate'
+ }
- const url = "/gov/org/neighborhood/exporttemplate"
let params = {}
app.ajax.exportFilePost(
@@ -384,7 +432,7 @@ export default {
},
// 上传文件之前的钩子
- beforeUpload (file) {
+ beforeUpload (file, type) {
this.files = file;
const isText = file.type === 'application/vnd.ms-excel'
@@ -392,6 +440,8 @@ export default {
if (!isText && !isTextComputer) {
this.$message.error('请选择正确格式的文件')
+ this.files = null
+ this.fileName = ''
return false
} else {
this.fileName = file.name;
@@ -404,36 +454,65 @@ export default {
this.$message.warning(`当前限制选择 1 个文件,请删除后继续上传`)
},
- async uploadFile () {
- this.loading = true
+ async uploadFile (type) {
if (this.fileName == "") {
- this.$message.warning('请选择要上传的文件!')
+
return false
}
+ this.loading = true
//清空上传列表
- this.$refs['upload'].clearFiles()
+ let url = ''
- var url = '/gov/org/neighborhood/import'
let fileFormData = new FormData();
fileFormData.append('file', this.files);//filename是键,file是值,就是要传的文件,test.zip是要传的文件名
+ fileFormData.append('orgId', this.agencyObj.id);//filename是键,file是值,就是要传的文件,test.zip是要传的文件名
+ fileFormData.append('orgType', this.agencyObj.level === 'grid' ? 'grid' : 'agency');//filename是键,file是值,就是要传的文件,test.zip是要传的文件名
+
+ if (type === 'community') {
+ this.$refs['upload_community'].clearFiles()
+ url = '/gov/org/icneighborhood/neighborhoodimport'
+
+
+ } else if (type === 'building') {
+ this.$refs['upload_building'].clearFiles()
+ url = '/gov/org/building/buildingimport'
+
+
+ } else if (type === 'room') {
+ this.$refs['upload_room'].clearFiles()
+ url = '/gov/org/house/houseimport'
- const { data, code, msg } = await requestPost(url, fileFormData)
- if (code === 0) {
- this.$message({
- type: "success",
- message: "导入成功"
- });
- this.$emit('refreshTree')
- this.loadTable()
- } else {
- this.$message.error(msg)
}
+ this.startLoading()
+ window.app.ajax.post2(url, fileFormData,
+ (data, rspMsg) => {
+ this.endLoading()
+ if (data.code === 0 || data.code > 8000) {
+
+
+
+ }
+ this.showMessage(rspMsg)
+ },
+ (rspMsg, data) => {
+ this.endLoading()
+ this.$message.error(rspMsg)
+ }, { headers: { 'Content-Type': 'multipart/form-data' } })
},
+ showMessage (msg) {
+ this.$alert(msg, '操作结果', {
+ confirmButtonText: '关闭',
+ callback: action => {
+ this.$emit('refreshTree')
+ this.loadTable()
+ }
+ });
+ },
handleSizeChange (val) {
this.pageSize = val
this.pageNo = 1
@@ -516,7 +595,13 @@ export default {
}
.div_btn {
+ display: flex;
margin-top: 20px;
+
+ .btn_upload {
+ margin-left: 10px;
+ display: flex;
+ }
}
.el-row {
diff --git a/src/views/modules/base/community/roomTable.vue b/src/views/modules/base/community/roomTable.vue
index 7aacb8352..ac654ced1 100644
--- a/src/views/modules/base/community/roomTable.vue
+++ b/src/views/modules/base/community/roomTable.vue
@@ -210,6 +210,7 @@ export default {
if (fromTree) {
this.agencyObj = treeObj
}
+
const url = "/gov/org/house/houselist"
let params = {
@@ -416,23 +417,45 @@ export default {
//清空上传列表
this.$refs['upload'].clearFiles()
- var url = '/gov/org/house/import'
+ var url = '/gov/org/house/houseimport'
+
let fileFormData = new FormData();
fileFormData.append('file', this.files);//filename是键,file是值,就是要传的文件,test.zip是要传的文件名
+ fileFormData.append('orgId', this.agencyObj.id);//filename是键,file是值,就是要传的文件,test.zip是要传的文件名
+ fileFormData.append('orgType', this.agencyObj.level);//filename是键,file是值,就是要传的文件,test.zip是要传的文件名
- const { data, code, msg } = await requestPost(url, fileFormData)
- if (code === 0) {
- this.$message({
- type: "success",
- message: "导入成功"
- });
- this.$emit('refreshTree')
- this.loadTable()
- } else {
- this.$message.error(msg)
- }
+ this.startLoading()
+ window.app.ajax.post2(url, fileFormData,
+ (data, rspMsg) => {
+ this.endLoading()
+ if (data.code === 0 || data.code > 8000) {
+ // this.$message({
+ // type: "success",
+ // message: "导入成功"
+ // });
+ // this.$emit('refreshTree')
+ // this.loadTable()
+ }
+ this.showMessage(rspMsg)
+ },
+ (rspMsg, data) => {
+ this.endLoading()
+ this.$message.error(rspMsg)
+ }, { headers: { 'Content-Type': 'multipart/form-data' } })
+
+ },
+
+ showMessage (msg) {
+ this.$alert(msg, '操作结果', {
+ confirmButtonText: '关闭',
+ callback: action => {
+ this.$emit('refreshTree')
+ this.loadTable()
+
+ }
+ });
},
handleSizeChange (val) {
diff --git a/src/views/modules/base/resi.vue b/src/views/modules/base/resi.vue
index 4f9c4663b..0959dc878 100644
--- a/src/views/modules/base/resi.vue
+++ b/src/views/modules/base/resi.vue
@@ -444,13 +444,13 @@ export default {
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
+ const isLt1M = (file.size / 1024 / 1024) < 100
if (!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式!')
}
if (!isLt1M) {
- this.$message.error('上传文件大小不能超过 10MB!')
+ this.$message.error('上传文件大小不能超过 100MB!')
}
return fileType && isLt1M
},
@@ -463,6 +463,7 @@ export default {
url: window.SITE_CONFIG['apiURL'] + '/epmetuser/icresiuser/importExcel',
method: 'post',
data: formData,
+ timeout: '300000',
responseType: 'blob'
})
.then((res) => {
diff --git a/src/views/modules/communityParty/elegant/index.vue b/src/views/modules/communityParty/elegant/index.vue
index 422df400c..e7d9257b8 100644
--- a/src/views/modules/communityParty/elegant/index.vue
+++ b/src/views/modules/communityParty/elegant/index.vue
@@ -13,15 +13,26 @@