Browse Source

1

shibei_master
jiangyy 3 years ago
parent
commit
a0c2b2ce9c
  1. 570
      src/views/modules/base/houseChange/houseChangeList.vue

570
src/views/modules/base/houseChange/houseChangeList.vue

@ -0,0 +1,570 @@
<template>
<div class="div_main">
<div class="div_search">
<el-form :inline="true"
:model="formData"
ref="ref_searchform"
:label-width="'90px'">
<div>
<el-form-item label="所属网格"
prop="gridId">
<el-select class="item_width_1"
v-model="formData.gridId"
placeholder="全部"
size="small"
@change="handleChangeG"
clearable>
<el-option v-for="item in gridList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="所属房屋">
<div class="resi-cell-value">
<div class="resi-cell-col">
<el-form-item prop="villageId">
<el-select v-model.trim="formData.villageId"
:disabled="!this.formData.gridId"
placeholder="小区"
size="small"
clearable
class="resi-cell-select"
@change="handleChangeV">
<el-option v-for="item in optionsV"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="buildId">
<el-select v-model.trim="formData.buildId"
placeholder="楼号"
:disabled="!this.formData.villageId"
size="small"
clearable
class="resi-cell-select resi-cell-select-middle list_item_width_1"
@change="handleChangeB">
<el-option v-for="item in optionsB"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="unitId">
<el-select v-model.trim="formData.unitId"
placeholder="单元"
size="small"
:disabled="!this.formData.buildId"
clearable
class="resi-cell-select resi-cell-select-middle list_item_width_1"
@change="handleChangeD">
<el-option v-for="item in optionsD"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="homeId">
<el-select v-model.trim="formData.homeId"
placeholder="房号"
:disabled="!this.formData.unitId"
size="small"
clearable
class="resi-cell-select resi-cell-select-middle list_item_width_1">
<el-option v-for="item in optionsH"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</div>
</div>
</el-form-item>
</div>
<div>
<el-form-item label="变更时间"
prop="startTime">
<el-date-picker v-model="timeRange"
size="small"
type="daterange"
value-format="yyyy-MM-dd HH:mm:ss"
@change="handleTimeChange"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间">
</el-date-picker>
</el-form-item>
<el-button style="margin-left:30px"
size="small"
class="diy-button--search"
@click="handleSearch">查询</el-button>
<el-button style="margin-left:10px"
size="small"
class="diy-button--reset"
@click="resetSearch">重置</el-button>
</div>
</el-form>
</div>
<div class="div_table">
<el-table ref="ref_table"
class="table"
:data="tableData"
border
:height="tableHeight"
v-loading="tableLoading"
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}"
style="width: 100%">
<el-table-column label="序号"
header-align="center"
align="center"
type="index"
width="50"></el-table-column>
<el-table-column prop="name"
header-align="center"
align="center"
label="姓名"
width="90">
</el-table-column>
<el-table-column prop="mobile"
header-align="center"
align="center"
label="手机号"
width="110">
</el-table-column>
<el-table-column prop="idCard"
header-align="center"
align="center"
label="身份证"
width="170">
</el-table-column>
<el-table-column prop="allName"
header-align="center"
align="center"
label="所属房屋"
min-width="200">
</el-table-column>
<el-table-column prop="reason"
header-align="center"
align="center"
label="关注原因"
width="180">
</el-table-column>
<el-table-column prop="remark"
header-align="center"
align="center"
show-overflow-tooltip
label="备注"
min-width="180">
</el-table-column>
<el-table-column prop="lastInformTime"
header-align="center"
align="center"
show-overflow-tooltip
label="最后一次通知时间"
width="170">
</el-table-column>
<el-table-column label="操作"
fixed="right"
width="140"
header-align="center"
align="center"
class="operate">
<template slot-scope="scope">
<el-button type="text"
class="div-table-button--detail"
size="small"
@click="handleDetail(scope.row)">查看</el-button>
<el-button type="text"
class="div-table-button--edit"
size="small"
@click="handleEdit(scope.row)">修改</el-button>
<el-popover popper-class="btn-popper"
placement="bottom"
style="margin-left:10px"
width="20"
trigger="hover">
<div class="table-more-btn">
<el-button type="text"
class="div-table-button--detail--noline"
size="small"
@click="handleNoticeList(scope.row)">通知记录</el-button>
</div>
<div class="table-more-btn">
<el-button type="text"
class="div-table-button--detail--noline"
size="small"
@click="handleVisiteList(scope.row) ">随访记录</el-button>
</div>
<el-button type="text"
size="small"
class="div-table-button--more"
slot="reference">更多<i class="el-icon-caret-bottom"></i></el-button>
</el-popover>
</template>
</el-table-column>
</el-table>
<div>
<el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="pageNo"
:page-sizes="[20, 50, 100, 200]"
:page-size="pageSize"
layout="sizes, prev, pager, next, total"
:total="total">
</el-pagination>
</div>
</div>
</div>
</template>
<script>
import { requestPost } from "@/js/dai/request";
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
let loading //
export default {
data () {
return {
loading: false,
total: 0,
pageSize: 20,
pageNo: 1,
tableLoading: false,
// formData: {
// attentionType: 2,//21
// name: '',
// mobile: '',
// idCard: '',
// remark: '',
// reason: '',
// },
optionsV: [],
optionsB: [],
optionsH: [],
optionsD: [],
tableData: [],
agencyId: '',
gridList: [],//list--
timeRange: [],
formData: {
gridId: '',//Id
villageId: '',
buildId: '',
unitId: '',
homeId: '',
startTime: '',
endTime: '',
}
}
},
components: {
},
async created () {
},
activated () {
this.$refs['ref_table'].doLayout()
},
async mounted () {
const { user } = this.$store.state
this.agencyId = user.agencyId
//
await this.loadGrid()
await this.loadTable()
},
methods: {
handleSearch () {
this.loadTable()
},
async loadGrid () {
const url = "/gov/org/customergrid/gridoption"
let params = {
agencyId: this.agencyId
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.gridList = data
} else {
this.$message.error(msg)
}
},
async loadTable () {
this.tableLoading = true
const url = "/epmetuser/icEpidemicSpecialAttention/list"
// const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/icEpidemicSpecialAttention/list"
let params = {
pageSize: this.pageSize,
pageNo: this.pageNo,
...this.formData
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.total = data.total
this.tableData = data.list
this.analysisTableSelection()
this.tableData.forEach(item => {
if (!item.allName) {
item.allName = '--'
}
item.roomShow = ''
if (!item.villageName && !item.buildName && !item.unitName && !item.homeName) {
item.roomShow = '--'
} else {
if (item.villageName) {
item.roomShow = item.roomShow + item.villageName
}
if (item.buildName) {
item.roomShow = item.roomShow + item.buildName
}
if (item.unitName) {
item.roomShow = item.roomShow + item.unitName
}
if (item.villageName) {
item.roomShow = item.roomShow + item.homeName
}
}
});
} else {
this.$message.error(msg)
}
this.tableLoading = false
},
handleChangeG (val) {
console.log('val', val)
this.formData.villageId = ''
this.formData.buildId = ''
this.formData.unitId = ''
this.formData.homeId = ''
this.getValiheList()
this.getBuildList()
this.getUniList()
this.getHouseList()
},
handleChangeV (val) {
console.log('val', val)
this.formData.buildId = ''
this.formData.unitId = ''
this.formData.homeId = ''
this.getBuildList()
this.getUniList()
this.getHouseList()
},
handleChangeB (val) {
console.log('val', val)
this.formData.unitId = ''
this.formData.homeId = ''
this.getUniList()
this.getHouseList()
},
handleChangeD () {
this.formData.homeId = ''
this.getHouseList()
},
getValiheList () {
const { user } = this.$store.state
this.$http
.post('/gov/org/icneighborhood/neighborhoodoption', { gridId: this.formData.gridId, agencyId: user.agencyId })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
console.log('获取查询详情成功', res.data)
this.optionsV = res.data
}
})
.catch(() => {
return this.$message.error('网络错误')
})
},
getBuildList () {
this.$http
.post('/gov/org/icbuilding/buildingoption', { neighborHoodId: this.formData.villageId })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
console.log('获取查询详情成功', res.data)
this.optionsB = res.data
}
})
.catch(() => {
return this.$message.error('网络错误')
})
},
getUniList () {
this.$http
.post('/gov/org/icbuildingunit/unitoption', { buildingId: this.formData.buildId })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
console.log('获取查询详情成功', res.data)
this.optionsD = res.data
}
})
.catch(() => {
return this.$message.error('网络错误')
})
},
getHouseList () {
this.$http
.post('/gov/org/ichouse/houseoption', { unitId: this.formData.unitId })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
console.log('获取查询详情成功', res.data)
this.optionsH = res.data
}
})
.catch(() => {
return this.$message.error('网络错误')
})
},
handleTimeChange (time) {
if (time) {
const startTimeArray = util.dateFormatter(time[0], 'date').split('-')
const endTimeArray = util.dateFormatter(time[1], 'date').split('-')
this.formData.startTime = startTimeArray[0] + '-' + startTimeArray[1] + '-' + startTimeArray[2] + ' 00:00:00'
this.formData.endTime = endTimeArray[0] + '-' + endTimeArray[1] + '-' + endTimeArray[2] + ' 23:59:59'
// this.startTimeShow = startTimeArray[0] + '' + startTimeArray[1] + '' + startTimeArray[2] + ''
// this.endTimeShow = endTimeArray[0] + '' + endTimeArray[1] + '' + endTimeArray[2] + ''
} else {
this.formData.startTime = ''
this.formData.endTime = ''
// this.startTimeShow = ''
// this.endTimeShow = ''
}
},
//
resetSearch () {
this.timeRange = []
this.formData = {
attentionType: 2,//21
name: '',
mobile: '',
idCard: '',
vaccinationCount: '',
}
this.pageNo = 1
// this.loadTable()
},
handleSizeChange (val) {
this.pageSize = val
this.pageNo = 1
this.loadTable()
},
handleCurrentChange (val) {
this.pageNo = val
this.loadTable()
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
tableHeight () {
return this.$store.state.inIframe ? this.clientHeight - 415 + this.iframeHeight : this.clientHeight - 415
},
...mapGetters(['clientHeight', 'iframeHeight'])
},
watch: {
},
props: {
}
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/modules/management/epidemic.scss";
</style>
Loading…
Cancel
Save