|
|
@ -41,47 +41,49 @@ |
|
|
|
size="small" |
|
|
|
icon="el-icon-plus" |
|
|
|
@click="handleAdd">新增楼宇</el-button> |
|
|
|
|
|
|
|
<el-button style=";margin-left:10px" |
|
|
|
type="blue" |
|
|
|
size="small" |
|
|
|
icon="el-icon-download" |
|
|
|
@click="handleExportModule('building')">下载楼宇模板</el-button> |
|
|
|
|
|
|
|
<el-upload style="" |
|
|
|
ref="upload_building" |
|
|
|
:multiple='false' |
|
|
|
:show-file-list='false' |
|
|
|
:before-upload="((file)=>{beforeUpload(file, 'building')})" |
|
|
|
action="" |
|
|
|
accept=".xls,.xlsx" |
|
|
|
:http-request="(()=>{uploadFile( 'building')})"> |
|
|
|
<el-button style="margin-left:10px" |
|
|
|
<div class="btn_upload" |
|
|
|
v-if="showImportBtn"> |
|
|
|
<el-button style=";margin-left:10px" |
|
|
|
type="blue" |
|
|
|
size="small" |
|
|
|
icon="el-icon-upload2" |
|
|
|
:loading="importBuildingLoading" |
|
|
|
type="red">导入楼宇数据</el-button> |
|
|
|
</el-upload> |
|
|
|
<el-button style=";margin-left:10px" |
|
|
|
type="blue" |
|
|
|
size="small" |
|
|
|
icon="el-icon-download" |
|
|
|
@click="handleExportModule('room')">下载房屋模板</el-button> |
|
|
|
|
|
|
|
<el-upload style="" |
|
|
|
ref="upload_room" |
|
|
|
:multiple='false' |
|
|
|
:show-file-list='false' |
|
|
|
:before-upload="((file)=>{beforeUpload(file, 'room')})" |
|
|
|
action="" |
|
|
|
accept=".xls,.xlsx" |
|
|
|
:http-request="(()=>{uploadFile( 'room')})"> |
|
|
|
<el-button style="margin-left:10px" |
|
|
|
icon="el-icon-download" |
|
|
|
@click="handleExportModule('building')">下载楼宇模板</el-button> |
|
|
|
|
|
|
|
<el-upload style="" |
|
|
|
ref="upload_building" |
|
|
|
:multiple='false' |
|
|
|
:show-file-list='false' |
|
|
|
:before-upload="((file)=>{beforeUpload(file, 'building')})" |
|
|
|
action="" |
|
|
|
accept=".xls,.xlsx" |
|
|
|
:http-request="(()=>{uploadFile( 'building')})"> |
|
|
|
<el-button style="margin-left:10px" |
|
|
|
size="small" |
|
|
|
icon="el-icon-upload2" |
|
|
|
:loading="importBuildingLoading" |
|
|
|
type="red">导入楼宇数据</el-button> |
|
|
|
</el-upload> |
|
|
|
<el-button style=";margin-left:10px" |
|
|
|
type="blue" |
|
|
|
size="small" |
|
|
|
icon="el-icon-upload2" |
|
|
|
:loading="importRoomLoading" |
|
|
|
type="red">导入房屋数据</el-button> |
|
|
|
</el-upload> |
|
|
|
icon="el-icon-download" |
|
|
|
@click="handleExportModule('room')">下载房屋模板</el-button> |
|
|
|
|
|
|
|
<el-upload style="" |
|
|
|
ref="upload_room" |
|
|
|
:multiple='false' |
|
|
|
:show-file-list='false' |
|
|
|
:before-upload="((file)=>{beforeUpload(file, 'room')})" |
|
|
|
action="" |
|
|
|
accept=".xls,.xlsx" |
|
|
|
:http-request="(()=>{uploadFile( 'room')})"> |
|
|
|
<el-button style="margin-left:10px" |
|
|
|
size="small" |
|
|
|
icon="el-icon-upload2" |
|
|
|
:loading="importRoomLoading" |
|
|
|
type="red">导入房屋数据</el-button> |
|
|
|
</el-upload> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="div_table"> |
|
|
@ -134,12 +136,14 @@ |
|
|
|
style="color:#1C6AFD;text-decoration: underline;" |
|
|
|
size="small" |
|
|
|
@click="handleDetail(scope.row)">查看</el-button> |
|
|
|
<el-button type="text" |
|
|
|
<el-button v-if="scope.row.showBtn" |
|
|
|
type="text" |
|
|
|
style="color:#00A7A9;text-decoration: underline;" |
|
|
|
size="small" |
|
|
|
@click="handleEdit(scope.row)">修改</el-button> |
|
|
|
|
|
|
|
<el-button type="text" |
|
|
|
<el-button v-if="scope.row.showBtn" |
|
|
|
type="text" |
|
|
|
style="color:#D51010;text-decoration: underline;" |
|
|
|
size="small" |
|
|
|
@click="handleDelete(scope.row)">删除</el-button> |
|
|
@ -206,6 +210,7 @@ export default { |
|
|
|
tableLoading: true, |
|
|
|
selAllFlag: false, |
|
|
|
isIndeterminate: false,//复选框的不确定状态 |
|
|
|
// showImportBtn: false,//是否显示操作按钮,根据登录人所属组织判断 |
|
|
|
|
|
|
|
agencyObj: {},//树所选的小区对象 |
|
|
|
ownerName: '', |
|
|
@ -242,8 +247,17 @@ export default { |
|
|
|
async loadTable (fromTree, treeObj) { |
|
|
|
this.tableLoading = true |
|
|
|
if (fromTree) { |
|
|
|
|
|
|
|
this.agencyObj = treeObj |
|
|
|
|
|
|
|
// if (this.agencyObj.pid === this.staffAgencyId) {//如果所选树的父级组织id和登录人员id相同,有权限 |
|
|
|
// this.showImportBtn = true |
|
|
|
// } else { |
|
|
|
// this.showImportBtn = false |
|
|
|
// } |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
console.log(this.agencyObj) |
|
|
|
const url = "/gov/org/building/buildinglist" |
|
|
|
let params = { |
|
|
@ -258,6 +272,14 @@ export default { |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
this.total = data.total |
|
|
|
data.list.forEach(item => { |
|
|
|
if (item.agencyId === this.staffAgencyId) { |
|
|
|
item.showBtn = true |
|
|
|
} else { |
|
|
|
item.showBtn = false |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
this.tableData = data.list |
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
@ -410,10 +432,11 @@ export default { |
|
|
|
this.$emit('refreshTree') |
|
|
|
this.loadTable() |
|
|
|
} else if (code > 8000) { |
|
|
|
// this.$message({ |
|
|
|
// type: "success", |
|
|
|
// message: msg |
|
|
|
// }); |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
message: msg, |
|
|
|
duration: 0 |
|
|
|
}) |
|
|
|
this.$emit('refreshTree') |
|
|
|
this.loadTable() |
|
|
|
} else { |
|
|
@ -590,12 +613,12 @@ export default { |
|
|
|
if (data.code === 0 && data.msg == 'success') { |
|
|
|
// this.$message.success('导入成功') |
|
|
|
} else { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
message: rspMsg, |
|
|
|
duration: 0, |
|
|
|
type: "error" |
|
|
|
}) |
|
|
|
// this.$message({ |
|
|
|
// showClose: true, |
|
|
|
// message: rspMsg, |
|
|
|
// duration: 0, |
|
|
|
// type: "error" |
|
|
|
// }) |
|
|
|
// this.$message.error(rspMsg) |
|
|
|
} |
|
|
|
this.$emit('refreshTree') |
|
|
@ -660,7 +683,14 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
props: { |
|
|
|
|
|
|
|
staffAgencyId: { |
|
|
|
type: String, |
|
|
|
default: '', |
|
|
|
}, |
|
|
|
showImportBtn: { |
|
|
|
type: Boolean, |
|
|
|
default: false, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|