城阳pc工作端前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

943 lines
29 KiB

4 years ago
<template>
<div class="div_main">
3 years ago
<div ref="div_search"
class="div_search">
4 years ago
<el-form :inline="true"
:model="searchForm"
ref="ref_searchform"
:label-width="'100px'">
<div>
<el-form-item label="所属网格"
prop="gridId">
3 years ago
<el-select v-model.trim="searchForm.gridId"
placeholder="请选择"
size="small"
clearable
class="resi-cell-select"
@change="handleChangeGrid">
<el-option v-for="item in optionsG"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
4 years ago
</el-form-item>
<el-form-item label="所属小区"
prop="neighborId">
3 years ago
<el-select v-model.trim="searchForm.neighborId"
placeholder="请选择小区"
size="small"
clearable
class="resi-cell-select"
@clear="handleClearVillage"
@change="handleChangeV">
<el-option v-for="item in optionsV"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-select v-model.trim="searchForm.buildingId"
placeholder="楼号"
size="small"
clearable
style="width: 120px;"
class="resi-cell-select"
@clear="handleClearBuild"
@change="handleChangeB">
<el-option v-for="item in optionsB"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-select v-model.trim="searchForm.unitId"
placeholder="单元"
size="small"
clearable
style="width: 120px;"
class="resi-cell-select"
@click="handleClearDan"
@change="handleChangeD">
<el-option v-for="item in optionsD"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-select v-model.trim="searchForm.houseId"
placeholder="房号"
size="small"
clearable
style="width: 120px;"
class="resi-cell-select">
<el-option v-for="item in optionsH"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
4 years ago
</el-form-item>
<el-form-item label="姓名"
prop="name">
<el-input v-model="searchForm.name"
size="small"
class="list_item_width_1"
clearable
placeholder="请输入姓名">
</el-input>
</el-form-item>
<el-form-item label="手机号"
prop="mobile">
<el-input v-model="searchForm.mobile"
size="small"
class="list_item_width_1"
clearable
placeholder="请输入手机号">
4 years ago
</el-input>
</el-form-item>
<el-form-item label="证件号"
4 years ago
prop="idCard">
<el-input v-model="searchForm.idCard"
size="small"
class="list_item_width_1"
clearable
placeholder="请输入身份证号或护照号">
4 years ago
</el-input>
3 years ago
</el-form-item>
<el-form-item label="年龄"
prop="age">
<inputRange v-model="searchForm.age"
3 years ago
type="num"
3 years ago
@change="handleAgeChange" />
4 years ago
</el-form-item>
<el-form-item label="疫苗接种针次"
3 years ago
style="margin-left:20px"
4 years ago
prop="vaccineCount">
<el-input v-model="searchForm.vaccineCount"
4 years ago
size="small"
class="list_item_width_1"
clearable
placeholder="请输入接种针次">
4 years ago
</el-input>
</el-form-item>
<el-form-item label="核酸检测次数"
4 years ago
prop="natCount">
<el-input v-model="searchForm.natCount"
4 years ago
size="small"
class="list_item_width_1"
clearable
placeholder="请输入检测次数">
4 years ago
</el-input>
</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 class="table"
:data="tableData"
border
3 years ago
ref="ref_table"
4 years ago
: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"
4 years ago
header-align="center"
align="center"
label="姓名"
4 years ago
width="120">
4 years ago
</el-table-column>
<el-table-column prop="gridName"
4 years ago
header-align="center"
align="center"
label="所属网格"
show-overflow-tooltip
4 years ago
min-width="180">
</el-table-column>
<el-table-column prop="houseName"
4 years ago
header-align="center"
align="center"
label="所属房屋"
show-overflow-tooltip
4 years ago
min-width="180">
4 years ago
</el-table-column>
<el-table-column prop="mobile"
header-align="center"
align="center"
label="手机号"
4 years ago
width="180">
4 years ago
</el-table-column>
<el-table-column prop="idCard"
header-align="center"
align="center"
label="证件号"
width="180">
</el-table-column>
3 years ago
<el-table-column prop="birthDay"
header-align="center"
align="center"
label="出生日期"
width="140">
</el-table-column>
<el-table-column prop="vaccineCount"
4 years ago
header-align="center"
align="center"
label="疫苗接种针次"
width="140">
</el-table-column>
<el-table-column prop="natCount"
4 years ago
header-align="center"
align="center"
label="核酸检测次数"
width="140">
</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-button type="text"
class="div-table-button--delete--noline "
size="small"
@click="handleDelete(scope.row)">删除</el-button> -->
</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>
<!-- 修改弹出框 -->
<el-dialog :visible.sync="formShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="formTitle"
width="50%"
4 years ago
top="5vh"
class="dialog-h"
4 years ago
@closed="handleCnalceForm">
<div class="dialog-h-content scroll-h">
<el-form :inline="true"
3 years ago
:model="formDetail"
ref="detail_form"
:label-width="'100px'">
<div>
<el-form-item label="姓名:"
prop="name">
<el-input v-model="formDetail.name"
size="small"
disabled
class="list_item_width_1"
clearable
placeholder="请输入姓名">
</el-input>
<!-- <span>{{ formDetail.name }}</span> -->
</el-form-item>
<el-form-item label="所属网格"
prop="gridName">
<el-input v-model="formDetail.gridName"
size="small"
class="list_item_width_1"
clearable
disabled
placeholder="" />
<!-- <span>{{ formDetail.gridName }}</span> -->
</el-form-item>
<el-form-item label="所属房屋"
prop="houseName">
3 years ago
<el-input v-model="formDetail.houseName"
size="small"
class="list_item_width_1 min-w180"
clearable
disabled
placeholder="" />
<!-- <span>{{ formDetail.houseName }}</span> -->
</el-form-item>
</div>
<div>
<el-form-item label="手机号"
prop="mobile">
<el-input v-model="formDetail.mobile"
size="small"
class="list_item_width_1"
clearable
disabled
placeholder="">
</el-input>
<!-- <span>{{ formDetail.mobile }}</span> -->
</el-form-item>
<el-form-item label="证件号"
prop="idCard">
<el-input v-model="formDetail.idCard"
size="small"
disabled
class="list_item_width_1"
clearable
placeholder="">
</el-input>
<!-- <span>{{ formDetail.idCard }}</span> -->
</el-form-item>
<el-form-item label="疫苗接种针次"
prop="vaccineCount">
<el-input v-model="formDetail.vaccineCount"
size="small"
class="list_item_width_1"
clearable
disabled
placeholder="">
</el-input>
<!-- <span>{{ formDetail.vaccineCount }}</span> -->
</el-form-item>
3 years ago
</div>
<div>
<el-form-item label="核酸检测次数"
prop="natCount">
<el-input v-model="formDetail.natCount"
size="small"
class="list_item_width_1"
clearable
disabled
placeholder="">
</el-input>
<!-- <span>{{ formDetail.natCount }}</span> -->
</el-form-item>
</div>
</el-form>
<div style="padding: 0 20px;">
<el-tabs v-model="activeName">
3 years ago
<el-tab-pane label="疫苗接种信息"
name="first">
<el-table class="table"
3 years ago
:data="vaccineList"
border
height="400"
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}"
style="width: 100%">
<el-table-column label="序号"
3 years ago
header-align="center"
align="center"
type="index"
width="50"></el-table-column>
<el-table-column prop="vaccinateTime"
3 years ago
header-align="center"
align="center"
label="接种时间"
width="140">
</el-table-column>
<el-table-column prop="address"
3 years ago
header-align="center"
align="center"
label="接种地点"
min-width="180">
</el-table-column>
<el-table-column prop="manufactor"
3 years ago
header-align="center"
align="center"
label="疫苗厂家"
width="240">
</el-table-column>
</el-table>
4 years ago
</el-tab-pane>
3 years ago
<el-tab-pane label="核酸检测信息"
name="second">
<el-table class="table"
3 years ago
:data="natList"
border
height="400"
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}"
style="width: 100%">
<el-table-column label="序号"
3 years ago
header-align="center"
align="center"
type="index"
width="50"></el-table-column>
<el-table-column prop="testTime"
3 years ago
header-align="center"
align="center"
label="检测时间"
width="150">
</el-table-column>
<el-table-column prop="address"
3 years ago
header-align="center"
align="center"
label="检测机构"
min-width="180">
</el-table-column>
<el-table-column prop="result"
3 years ago
header-align="center"
align="center"
label="检测结果"
width="240">
</el-table-column>
</el-table>
</el-tab-pane>
3 years ago
<el-tab-pane label="行程信息"
name="third">
<el-table class="table"
3 years ago
:data="tripList"
border
height="400"
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}"
style="width: 100%">
<el-table-column label="序号"
3 years ago
header-align="center"
align="center"
type="index"
width="50"></el-table-column>
<el-table-column prop="fromRegion"
3 years ago
header-align="center"
align="center"
label="来自地区"
show-overflow-tooltip
min-width="100">
</el-table-column>
<el-table-column prop="arrivalTime"
3 years ago
header-align="center"
align="center"
label="来到本地时间"
width="140">
</el-table-column>
<el-table-column prop="leaveTime"
3 years ago
header-align="center"
align="center"
label="离开本地时间"
width="140">
</el-table-column>
<el-table-column prop="noticeTime"
3 years ago
header-align="center"
align="center"
label="最近一次通知时间"
width="140">
</el-table-column>
<el-table-column prop="remark"
3 years ago
header-align="center"
align="center"
label="备注"
show-overflow-tooltip
width="120">
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
</div>
</div>
<div class="resi-btns">
<el-button size="small"
@click="handleCnalceForm">取消</el-button>
</div>
4 years ago
</el-dialog>
</div>
</template>
<script>
import natForm from './natInfo/natForm'
3 years ago
import inputRange from '@/views/components/rangeInput.vue'
4 years ago
import { requestPost } from "@/js/dai/request";
import { mapGetters } from 'vuex'
let loading // 加载动画
export default {
data () {
return {
loading: false,
total: 0,
pageSize: 20,
4 years ago
pageNo: 0,
tableLoading: false,
4 years ago
activeName: 'first',
4 years ago
agencyId: '',
4 years ago
sHeight: 0,
4 years ago
timeRange: [],
searchForm: {
agencyId: '',
gridId: '',
neighborId: '',
buildingId: '',
unitId: '',
houseId: '',
name: '',
mobile: '',
idCard: '',
4 years ago
vaccineCount: '',
3 years ago
natCount: '',
age: {},
startBirthDay: '',
endBirthDay: '',
4 years ago
},
formDetail: {
3 years ago
name: '',
gridName: '',
houseName: '',
mobile: '',
idCard: '',
vaccineCount: '',
natCount: ''
4 years ago
},
vaccineList: [], // 疫苗接种
natList: [], // 核酸检测
tripList: [], // 行程信息
4 years ago
optionsV: [],
optionsB: [],
optionsH: [],
optionsD: [],
optionsG: [],
tableData: [],
//form相关
formShow: false,
formTitle: '新增',
}
},
components: {
3 years ago
natForm, inputRange
4 years ago
},
async created () {
},
async mounted () {
//获取场所类型
const { user } = this.$store.state
this.agencyId = user.agencyId
this.getGridList()
this.getValiheList()
await this.loadTable()
4 years ago
this.sHeight = this.$refs.div_search.offsetHeight + 230
4 years ago
},
3 years ago
activated () {
this.$refs['ref_table'].doLayout()
},
4 years ago
methods: {
3 years ago
handleAgeChange (val) {
console.log('val----age---', val)
3 years ago
if (val.start) {
3 years ago
const e = this.computedBirth(val.start)
this.searchForm.endBirthDay = e
3 years ago
} else {
this.searchForm.endBirthDay = ''
}
if (val.end) {
const s = this.computedBirth(val.end)
this.searchForm.startBirthDay = s
} else {
this.searchForm.startBirthDay = ''
3 years ago
}
},
computedBirth (age) {
let now = new Date();
let nowYear = now.getFullYear();
let nowMonth = now.getMonth() + 1;
let nowDay = now.getDate(); // 按照减法原理,先day相减,不够向month借;然后month相减,不够向year借;最后year相减。
let subYear = nowYear - age
if (nowMonth < 10) {
nowMonth = '0' + nowMonth
}
if (nowDay < 10) {
nowDay = '0' + nowDay
}
console.log(subYear + '-' + nowMonth + '-' + nowDay);
return subYear + '-' + nowMonth + '-' + nowDay
},
3 years ago
handleCnalceForm () {
this.$refs.detail_form.resetFields()
this.vaccineList = []
this.natList = []
this.tripList = []
4 years ago
this.activeName = 'first'
this.formShow = false
},
4 years ago
handleSearch () {
this.loadTable()
},
3 years ago
handleClearVillage () {
4 years ago
this.searchForm.buildingId = ''
this.searchForm.unitId = ''
this.searchForm.houseId = ''
},
3 years ago
handleClearBuild () {
4 years ago
this.searchForm.buildingId = ''
this.searchForm.unitId = ''
this.searchForm.houseId = ''
},
3 years ago
handleClearDan () {
4 years ago
this.searchForm.unitId = ''
this.searchForm.houseId = ''
},
3 years ago
handleChangeGrid (val) {
4 years ago
console.log('val', val)
this.searchForm.neighborId = ''
this.searchForm.buildingId = ''
this.searchForm.unitId = ''
this.searchForm.houseId = ''
this.getValiheList()
},
3 years ago
handleChangeV (val) {
4 years ago
console.log('val', val)
this.searchForm.buildingId = ''
this.searchForm.unitId = ''
this.searchForm.houseId = ''
this.getBuildList()
},
3 years ago
handleChangeB (val) {
4 years ago
console.log('val', val)
this.searchForm.unitId = ''
this.searchForm.houseId = ''
this.getUniList()
},
3 years ago
handleChangeD (val) {
4 years ago
console.log('val', val)
this.searchForm.houseId = ''
this.getHouseList()
},
3 years ago
getGridList () {
4 years ago
const { user } = this.$store.state
this.$http
.post('/gov/org/customergrid/gridoption', { agencyId: user.agencyId, purpose: 'query' })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
console.log('获取查询详情成功', res.data)
this.optionsG = res.data
}
})
.catch(() => {
return this.$message.error('网络错误')
})
},
3 years ago
getValiheList () {
4 years ago
const { user } = this.$store.state
this.$http
.post('/gov/org/icneighborhood/neighborhoodoption', {
gridId: this.searchForm.gridId,
agencyId: ''
// 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('网络错误')
})
},
3 years ago
getBuildList () {
4 years ago
this.$http
.post('/gov/org/icbuilding/buildingoption', {
neighborHoodId: this.searchForm.neighborId
})
.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('网络错误')
})
},
3 years ago
getUniList () {
4 years ago
this.$http
.post('/gov/org/icbuildingunit/unitoption', {
buildingId: this.searchForm.buildingId
})
.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('网络错误')
})
},
3 years ago
getHouseList () {
4 years ago
this.$http
.post('/gov/org/ichouse/houseoption', { unitId: this.searchForm.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('网络错误')
})
},
async loadTable () {
this.tableLoading = true
const url = "/epmetuser/epidemicPrevention/page"
4 years ago
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/placeorg/getlist"
let params = {
pageSize: this.pageSize,
pageNo: this.pageNo,
...this.searchForm
4 years ago
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.total = data.total
this.tableData = data.list
this.tableData.forEach(item => {
if (item.time) {
let timeArray = item.time.split(' ')
item.time = timeArray[0]
}
});
} else {
this.$message.error(msg)
}
this.tableLoading = false
},
async getDetailInfo (id) {
4 years ago
const url = "/epmetuser/epidemicPrevention/detail"
let params = {
id
}
4 years ago
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.formDetail = data
4 years ago
} else {
this.$message.error(msg)
}
},
async getDetailList (id) {
4 years ago
const url = "/epmetuser/epidemicPrevention/info"
let params = {
id
4 years ago
}
const { data, code, msg } = await requestPost(url, params)
4 years ago
if (code === 0) {
const { vaccineList, natList, tripList } = data
this.vaccineList = vaccineList
this.natList = natList
this.tripList = tripList
} else {
this.$message.error(msg)
}
},
4 years ago
diaClose () {
// this.$refs.ref_form.resetData()
4 years ago
this.formShow = false
},
async handleDetail (row) {
3 years ago
await this.getDetailInfo(row.id)
await this.getDetailList(row.id)
4 years ago
this.formTitle = '详情'
this.formShow = true
// this.$nextTick(() => {
// this.$refs.ref_form.initForm('detail', row.natId, this.agencyId)
// })
4 years ago
},
addFormCancle () {
this.formShow = false
},
addFormOk () {
this.formShow = false
this.loadTable()
},
async handleDelete (row) {
this.$confirm("确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.deleteNat(row)
})
.catch(err => {
if (err == "cancel") {
}
});
},
async deleteNat (row) {
const url = "/gov/org/placepatrolteam/del"
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/placepatrolteam/del"
let params = {
natId: row.natId
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.$message({
type: "success",
message: "删除成功"
});
this.loadTable()
} else {
this.$message.error(msg)
}
},
//重置搜索条件
resetSearch () {
this.$refs.ref_searchform.resetFields()
this.searchForm.buildingId = ''
this.searchForm.unitId = ''
this.searchForm.houseId = ''
3 years ago
this.searchForm.age = {}
this.searchForm.startBirthDay = ''
this.searchForm.endBirthDay = ''
this.pageSize = 20
4 years ago
this.pageNo = 1
this.loadTable()
},
handleSizeChange (val) {
this.pageSize = val
this.pageNo = 1
this.loadTable()
},
handleCurrentChange (val) {
this.pageNo = val
this.loadTable()
},
},
computed: {
tableHeight () {
4 years ago
const h = this.clientHeight - this.sHeight + this.iframeHeigh
const _h = this.clientHeight - this.sHeight
return this.$store.state.inIframe ? h : _h
4 years ago
},
4 years ago
...mapGetters(['clientHeight', 'iframeHeight'])
4 years ago
},
watch: {
},
props: {
}
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/modules/management/epidemic.scss";
.resi-cell-select {
3 years ago
width: 170px;
box-sizing: border-box;
margin-right: 10px;
&-middle {
width: 130px;
4 years ago
}
3 years ago
&-small {
width: 88px;
}
3 years ago
}
.resi-cell-select:last-child {
margin-right: 0;
}
.min-w180 {
min-width: 170px;
}
4 years ago
</style>