|
|
@ -42,6 +42,7 @@ |
|
|
|
:data="tableData" |
|
|
|
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}" |
|
|
|
v-loading="tableLoading" |
|
|
|
@sort-change="handleSortOrderChange" |
|
|
|
border |
|
|
|
:height="tableHeight" |
|
|
|
style="width: 100%" |
|
|
@ -51,6 +52,26 @@ |
|
|
|
:selectable="checkSelect" |
|
|
|
width="55"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="sort" |
|
|
|
sortable="custom" |
|
|
|
min-width="140" |
|
|
|
label="序号"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div @click="handleEditSort(scope.row)"> |
|
|
|
<span v-if="!scope.row.isChange">{{scope.row.sort}}</span> |
|
|
|
<el-input-number v-else |
|
|
|
@change="handleChangeSort(scope.row)" |
|
|
|
v-model="scope.row.sort" |
|
|
|
class="item_width_4" |
|
|
|
:precision="2" |
|
|
|
size="mini" |
|
|
|
:min="1" |
|
|
|
:max="9999" |
|
|
|
label="描述文字"></el-input-number> |
|
|
|
</div> |
|
|
|
|
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="houseNameShow" |
|
|
|
label="房屋名称" |
|
|
|
min-width="160"> |
|
|
@ -168,6 +189,7 @@ export default { |
|
|
|
total: 0, |
|
|
|
pageSize: 20, |
|
|
|
pageNo: 0, |
|
|
|
sortType: 'asc',//asc:正,desc:倒 |
|
|
|
tableLoading: true, |
|
|
|
|
|
|
|
// showImportBtn: false,//是否显示操作按钮,根据登录人所属组织判断 |
|
|
@ -220,7 +242,53 @@ export default { |
|
|
|
...mapGetters(['clientHeight', 'iframeHeight']) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
handleSortOrderChange (value) { |
|
|
|
console.log(value.column, value.prop, value.order) |
|
|
|
this.sortType = value.order === 'ascending' ? 'asc' : 'desc' |
|
|
|
this.loadTable() |
|
|
|
|
|
|
|
}, |
|
|
|
handleSortChange (value) { |
|
|
|
console.log(value.column, value.prop, value.order) |
|
|
|
this.sortType = value.order === 'ascending' ? 'asc' : 'desc' |
|
|
|
this.loadTable() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleEditSort (row) { |
|
|
|
if (!row.isChange) { |
|
|
|
row.isChange = true |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
async handleChangeSort (row, index) { |
|
|
|
// row.isChange = false |
|
|
|
console.log(row.sort) |
|
|
|
let params = { |
|
|
|
id: row.houseId, |
|
|
|
sort: row.sort, |
|
|
|
type: 'house', |
|
|
|
} |
|
|
|
|
|
|
|
let url = '/gov/org/house/update-sort' |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
this.$message({ |
|
|
|
type: 'success', |
|
|
|
message: '操作成功' |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.$message.error(msg) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
checkSelect (row, index) { |
|
|
|
let isChecked = false; |
|
|
@ -242,6 +310,7 @@ export default { |
|
|
|
this.tableLoading = true |
|
|
|
|
|
|
|
if (source === 'tree') {//来源于tree,查询数据清空 |
|
|
|
this.sortType = 'asc' |
|
|
|
this.agencyObj = treeObj |
|
|
|
this.ownerName = null |
|
|
|
this.ownerPhone = null |
|
|
@ -265,6 +334,7 @@ export default { |
|
|
|
ownerName: this.ownerName, |
|
|
|
ownerPhone: this.ownerPhone, |
|
|
|
rentFlag: this.rentFlag, |
|
|
|
sortType: this.sortType, |
|
|
|
} |
|
|
|
|
|
|
|
const url = "/gov/org/house/houselist" |
|
|
@ -275,6 +345,8 @@ export default { |
|
|
|
this.total = data.total |
|
|
|
this.validTableDataNum = 0 |
|
|
|
data.list.forEach(item => { |
|
|
|
item.sort = item.sort.toFixed(2) |
|
|
|
item.isChange = false |
|
|
|
item.houseNameShow = item.neighborHoodName + item.buildingName + item.unitNum + item.doorName |
|
|
|
|
|
|
|
if (item.agencyId === this.staffAgencyId) { |
|
|
@ -650,4 +722,17 @@ export default { |
|
|
|
</script> |
|
|
|
<style lang="scss" scoped > |
|
|
|
@import "@/assets/scss/modules/visual/communityManage.scss"; |
|
|
|
|
|
|
|
.item_width_4 { |
|
|
|
width: 120px; |
|
|
|
} |
|
|
|
|
|
|
|
// /deep/.el-input-number--medium .el-input-number__decrease, |
|
|
|
// /deep/.el-input-number--medium .el-input-number__increase { |
|
|
|
// width: 26px; |
|
|
|
// } |
|
|
|
// /deep/.el-input-number--medium .el-input__inner { |
|
|
|
// padding-left: 0px; |
|
|
|
// padding-right: 0px; |
|
|
|
// } |
|
|
|
</style> |
|
|
|