3 changed files with 1771 additions and 0 deletions
@ -0,0 +1,643 @@ |
|||||
|
<template> |
||||
|
<div class="div_main"> |
||||
|
<div class="div_search"> |
||||
|
<el-form :inline="true" |
||||
|
:model="searchForm" |
||||
|
ref="ref_searchform" |
||||
|
:label-width="'100px'"> |
||||
|
<div> |
||||
|
<el-form-item label="所属网格" |
||||
|
prop="gridId"> |
||||
|
<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> |
||||
|
|
||||
|
</el-form-item> |
||||
|
<el-form-item label="所属小区" |
||||
|
prop="neighborId"> |
||||
|
<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> |
||||
|
|
||||
|
</el-form-item> |
||||
|
|
||||
|
</div> |
||||
|
<div> |
||||
|
|
||||
|
<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="请输入身份证"> |
||||
|
</el-input> |
||||
|
|
||||
|
</el-form-item> |
||||
|
<el-form-item label="身份证" |
||||
|
prop="idCard"> |
||||
|
<el-input v-model="searchForm.idCard" |
||||
|
size="small" |
||||
|
class="list_item_width_1" |
||||
|
clearable |
||||
|
placeholder="请输入身份证"> |
||||
|
</el-input> |
||||
|
|
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="疫苗接种针次" |
||||
|
prop="vaccinateCount"> |
||||
|
<el-input v-model="searchForm.vaccinateCount" |
||||
|
size="small" |
||||
|
class="list_item_width_1" |
||||
|
clearable |
||||
|
placeholder="请输入身份证"> |
||||
|
</el-input> |
||||
|
|
||||
|
</el-form-item> |
||||
|
<el-form-item label="核酸检测次数" |
||||
|
prop="testCount"> |
||||
|
<el-input v-model="formData.testCount" |
||||
|
size="small" |
||||
|
class="list_item_width_1" |
||||
|
clearable |
||||
|
placeholder="请输入身份证"> |
||||
|
</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 |
||||
|
: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="personInCharge" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
label="姓名" |
||||
|
width="100"> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="gridNames" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
label="所属网格" |
||||
|
min-width="180"> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="gridNames" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
label="所属家庭" |
||||
|
width="180"> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="mobile" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
label="手机号" |
||||
|
width="110"> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="gridNames" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
label="疫苗接种针次" |
||||
|
width="140"> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="mobile" |
||||
|
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="850px" |
||||
|
top="5vh" |
||||
|
class="dialog-h" |
||||
|
@closed="diaClose"> |
||||
|
<nat-form ref="ref_form" |
||||
|
@dialogCancle="addFormCancle" |
||||
|
@dialogOk="addFormOk"></nat-form> |
||||
|
</el-dialog> |
||||
|
|
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
|
||||
|
import natForm from './natInfo/natForm' |
||||
|
|
||||
|
import { requestPost } from "@/js/dai/request"; |
||||
|
import { mapGetters } from 'vuex' |
||||
|
|
||||
|
let loading // 加载动画 |
||||
|
export default { |
||||
|
data () { |
||||
|
return { |
||||
|
loading: false, |
||||
|
total: 0, |
||||
|
pageSize: 10, |
||||
|
pageNo: 0, |
||||
|
tableLoading: false, |
||||
|
|
||||
|
agencyId: '', |
||||
|
|
||||
|
timeRange: [], |
||||
|
searchForm: { |
||||
|
agencyId: '', |
||||
|
gridId: '', |
||||
|
neighborId: '', |
||||
|
buildingId: '', |
||||
|
unitId: '', |
||||
|
houseId: '', |
||||
|
name: '', |
||||
|
mobile: '', |
||||
|
idCard: '', |
||||
|
vaccinateCount: '', |
||||
|
testCount: '' |
||||
|
}, |
||||
|
formData: { |
||||
|
personInCharge: '',//负责人 |
||||
|
mobile: '',//联系电话 |
||||
|
gridId: '',//负责区域【网格Id】 |
||||
|
ninePlaceVal: '',//场所类型【九小场所Value值】 |
||||
|
isPage: true,//是否分页(是:true 否:false) 有这个参数是给新增巡查记录时用的,默认是 |
||||
|
}, |
||||
|
optionsV: [], |
||||
|
optionsB: [], |
||||
|
optionsH: [], |
||||
|
optionsD: [], |
||||
|
optionsG: [], |
||||
|
tableData: [], |
||||
|
|
||||
|
//form相关 |
||||
|
formShow: false, |
||||
|
formTitle: '新增', |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
components: { |
||||
|
natForm |
||||
|
}, |
||||
|
async created () { |
||||
|
|
||||
|
}, |
||||
|
async mounted () { |
||||
|
//获取场所类型 |
||||
|
|
||||
|
|
||||
|
const { user } = this.$store.state |
||||
|
this.agencyId = user.agencyId |
||||
|
|
||||
|
this.getGridList() |
||||
|
this.getValiheList() |
||||
|
await this.loadTable() |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
handleSearch () { |
||||
|
this.loadTable() |
||||
|
}, |
||||
|
handleClearVillage() { |
||||
|
this.searchForm.buildingId = '' |
||||
|
this.searchForm.unitId = '' |
||||
|
this.searchForm.houseId = '' |
||||
|
}, |
||||
|
handleClearBuild() { |
||||
|
this.searchForm.buildingId = '' |
||||
|
this.searchForm.unitId = '' |
||||
|
this.searchForm.houseId = '' |
||||
|
}, |
||||
|
handleClearDan() { |
||||
|
this.searchForm.unitId = '' |
||||
|
this.searchForm.houseId = '' |
||||
|
}, |
||||
|
handleChangeGrid(val) { |
||||
|
console.log('val', val) |
||||
|
this.searchForm.neighborId = '' |
||||
|
this.searchForm.buildingId = '' |
||||
|
this.searchForm.unitId = '' |
||||
|
this.searchForm.houseId = '' |
||||
|
this.getValiheList() |
||||
|
}, |
||||
|
handleChangeV(val) { |
||||
|
console.log('val', val) |
||||
|
this.searchForm.buildingId = '' |
||||
|
this.searchForm.unitId = '' |
||||
|
this.searchForm.houseId = '' |
||||
|
this.getBuildList() |
||||
|
}, |
||||
|
handleChangeB(val) { |
||||
|
console.log('val', val) |
||||
|
this.searchForm.unitId = '' |
||||
|
this.searchForm.houseId = '' |
||||
|
this.getUniList() |
||||
|
}, |
||||
|
handleChangeD(val) { |
||||
|
console.log('val', val) |
||||
|
this.searchForm.houseId = '' |
||||
|
this.getHouseList() |
||||
|
}, |
||||
|
getGridList() { |
||||
|
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('网络错误') |
||||
|
}) |
||||
|
}, |
||||
|
getValiheList() { |
||||
|
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('网络错误') |
||||
|
}) |
||||
|
}, |
||||
|
getBuildList() { |
||||
|
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('网络错误') |
||||
|
}) |
||||
|
}, |
||||
|
getUniList() { |
||||
|
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('网络错误') |
||||
|
}) |
||||
|
}, |
||||
|
getHouseList() { |
||||
|
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 = "/gov/org/placepatrolteam/getlist" |
||||
|
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/placeorg/getlist" |
||||
|
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.tableData.forEach(item => { |
||||
|
if (item.time) { |
||||
|
let timeArray = item.time.split(' ') |
||||
|
item.time = timeArray[0] |
||||
|
} |
||||
|
|
||||
|
}); |
||||
|
} else { |
||||
|
this.$message.error(msg) |
||||
|
} |
||||
|
this.tableLoading = false |
||||
|
}, |
||||
|
|
||||
|
handleScheduledTimeChange (time) { |
||||
|
if (time) { |
||||
|
this.formData.scheduledStartTime = time[0] |
||||
|
this.formData.scheduledEndTime = time[1] |
||||
|
|
||||
|
} else { |
||||
|
this.formData.scheduledStartTime = '' |
||||
|
this.formData.scheduledEndTime = '' |
||||
|
|
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
diaClose () { |
||||
|
this.$refs.ref_form.resetData() |
||||
|
this.formShow = false |
||||
|
}, |
||||
|
|
||||
|
handleDetail (row) { |
||||
|
this.formTitle = '详情' |
||||
|
this.formShow = true |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.ref_form.initForm('detail', row.natId, this.agencyId) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
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 = '' |
||||
|
this.pageSize = 10 |
||||
|
this.pageNo = 1 |
||||
|
this.loadTable() |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
handleSizeChange (val) { |
||||
|
this.pageSize = val |
||||
|
this.pageNo = 1 |
||||
|
this.loadTable() |
||||
|
}, |
||||
|
handleCurrentChange (val) { |
||||
|
this.pageNo = val |
||||
|
this.loadTable() |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
computed: { |
||||
|
tableHeight () { |
||||
|
|
||||
|
return (this.clientHeight - 360) |
||||
|
|
||||
|
}, |
||||
|
rowHeight () { |
||||
|
return (this.clientHeight - 200) + 'px' |
||||
|
}, |
||||
|
...mapGetters(['clientHeight']) |
||||
|
}, |
||||
|
watch: { |
||||
|
|
||||
|
}, |
||||
|
props: { |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style lang="scss" scoped > |
||||
|
@import "@/assets/scss/modules/management/epidemic.scss"; |
||||
|
|
||||
|
.resi-cell-select { |
||||
|
width: 170px; |
||||
|
box-sizing: border-box; |
||||
|
margin-right: 10px; |
||||
|
&-middle { |
||||
|
width: 130px; |
||||
|
} |
||||
|
&-small { |
||||
|
width: 88px; |
||||
|
} |
||||
|
} |
||||
|
.resi-cell-select:last-child { |
||||
|
margin-right: 0; |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
|
|
@ -0,0 +1,564 @@ |
|||||
|
<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="personInCharge"> |
||||
|
<el-input v-model="formData.personInCharge" |
||||
|
size="small" |
||||
|
class="list_item_width_1" |
||||
|
clearable |
||||
|
placeholder="请输入姓名"> |
||||
|
</el-input> |
||||
|
|
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="身份证" |
||||
|
prop="mobile"> |
||||
|
<el-input v-model="formData.mobile" |
||||
|
size="small" |
||||
|
class="list_item_width_1" |
||||
|
clearable |
||||
|
placeholder="请输入身份证"> |
||||
|
</el-input> |
||||
|
|
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="接种时间" |
||||
|
prop="scheduledStartTime"> |
||||
|
<el-date-picker v-model="timeRange" |
||||
|
size="small" |
||||
|
type="daterange" |
||||
|
value-format="yyyy-MM-dd" |
||||
|
@change="handleScheduledTimeChange" |
||||
|
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"> |
||||
|
<div class="div_btn"> |
||||
|
<el-button class="diy-button--add" |
||||
|
size="small" |
||||
|
@click="handleAdd">新增</el-button> |
||||
|
|
||||
|
<el-button style="float:left" |
||||
|
class="diy-button--export" |
||||
|
size="small" |
||||
|
@click="handleExportModule">下载模板</el-button> |
||||
|
<el-upload ref="upload" |
||||
|
:multiple='false' |
||||
|
:show-file-list='false' |
||||
|
:before-upload="beforeUpload" |
||||
|
action="" |
||||
|
accept=".xls,.xlsx" |
||||
|
:limit="1" |
||||
|
:on-exceed="handleExceed" |
||||
|
:http-request="uploadFile"> |
||||
|
<el-button style="margin-left:10px" |
||||
|
size="small" |
||||
|
class="diy-button--delete">导入</el-button> |
||||
|
</el-upload> |
||||
|
|
||||
|
<el-button style="float:left;margin-left:10px" |
||||
|
class="diy-button--reset" |
||||
|
size="small" |
||||
|
@click="handleExport">导出</el-button> |
||||
|
</div> |
||||
|
|
||||
|
<el-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="personInCharge" |
||||
|
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="gridNames" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
label="身份证" |
||||
|
min-width="170"> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="time" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
label="检测时间" |
||||
|
width="120"> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="ninePlaceNames" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
show-overflow-tooltip |
||||
|
label="检测机构" |
||||
|
min-width="230"> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="ninePlaceNames" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
show-overflow-tooltip |
||||
|
label="检测结果" |
||||
|
min-width="80"> |
||||
|
</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="850px" |
||||
|
top="5vh" |
||||
|
class="dialog-h" |
||||
|
@closed="diaClose"> |
||||
|
<nat-form ref="ref_form" |
||||
|
@dialogCancle="addFormCancle" |
||||
|
@dialogOk="addFormOk"></nat-form> |
||||
|
</el-dialog> |
||||
|
|
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
|
||||
|
import natForm from './natInfo/natForm' |
||||
|
|
||||
|
import { requestPost } from "@/js/dai/request"; |
||||
|
import { mapGetters } from 'vuex' |
||||
|
|
||||
|
let loading // 加载动画 |
||||
|
export default { |
||||
|
data () { |
||||
|
return { |
||||
|
loading: false, |
||||
|
total: 0, |
||||
|
pageSize: 10, |
||||
|
pageNo: 0, |
||||
|
tableLoading: false, |
||||
|
|
||||
|
agencyId: '', |
||||
|
|
||||
|
timeRange: [], |
||||
|
formData: { |
||||
|
personInCharge: '',//负责人 |
||||
|
mobile: '',//联系电话 |
||||
|
gridId: '',//负责区域【网格Id】 |
||||
|
ninePlaceVal: '',//场所类型【九小场所Value值】 |
||||
|
isPage: true,//是否分页(是:true 否:false) 有这个参数是给新增巡查记录时用的,默认是 |
||||
|
}, |
||||
|
|
||||
|
tableData: [], |
||||
|
|
||||
|
//form相关 |
||||
|
formShow: false, |
||||
|
formTitle: '新增', |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
components: { |
||||
|
natForm |
||||
|
}, |
||||
|
async created () { |
||||
|
|
||||
|
}, |
||||
|
async mounted () { |
||||
|
//获取场所类型 |
||||
|
|
||||
|
|
||||
|
const { user } = this.$store.state |
||||
|
this.agencyId = user.agencyId |
||||
|
|
||||
|
|
||||
|
await this.loadTable() |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
handleSearch () { |
||||
|
this.loadTable() |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
async loadTable () { |
||||
|
this.tableLoading = true |
||||
|
|
||||
|
const url = "/gov/org/placepatrolteam/getlist" |
||||
|
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/placeorg/getlist" |
||||
|
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.tableData.forEach(item => { |
||||
|
if (item.time) { |
||||
|
let timeArray = item.time.split(' ') |
||||
|
item.time = timeArray[0] |
||||
|
} |
||||
|
|
||||
|
}); |
||||
|
} else { |
||||
|
this.$message.error(msg) |
||||
|
} |
||||
|
this.tableLoading = false |
||||
|
}, |
||||
|
|
||||
|
handleScheduledTimeChange (time) { |
||||
|
if (time) { |
||||
|
this.formData.scheduledStartTime = time[0] |
||||
|
this.formData.scheduledEndTime = time[1] |
||||
|
|
||||
|
} else { |
||||
|
this.formData.scheduledStartTime = '' |
||||
|
this.formData.scheduledEndTime = '' |
||||
|
|
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
diaClose () { |
||||
|
this.$refs.ref_form.resetData() |
||||
|
this.formShow = false |
||||
|
}, |
||||
|
|
||||
|
handleDetail (row) { |
||||
|
this.formTitle = '详情' |
||||
|
this.formShow = true |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.ref_form.initForm('detail', row.natId, this.agencyId) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
handleAdd () { |
||||
|
this.formTitle = '新增' |
||||
|
this.formShow = true |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.ref_form.initForm('add', null, this.agencyId) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
handleEdit (row) { |
||||
|
this.formTitle = '修改' |
||||
|
this.formShow = true |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.ref_form.initForm('edit', row.natId, this.agencyId) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
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.formData = { |
||||
|
personInCharge: '',//负责人 |
||||
|
mobile: '',//联系电话 |
||||
|
gridId: '',//负责区域【网格Id】 |
||||
|
ninePlaceVal: '',//场所类型【九小场所Value值】 |
||||
|
isPage: true,//是否分页(是:true 否:false) 有这个参数是给新增巡查记录时用的,默认是 |
||||
|
} |
||||
|
this.pageSize = 10 |
||||
|
this.pageNo = 0 |
||||
|
this.loadTable() |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
handleSizeChange (val) { |
||||
|
this.pageSize = val |
||||
|
this.pageNo = 1 |
||||
|
this.loadTable() |
||||
|
}, |
||||
|
handleCurrentChange (val) { |
||||
|
this.pageNo = val |
||||
|
this.loadTable() |
||||
|
}, |
||||
|
|
||||
|
//导出表格 |
||||
|
async handleExport () { |
||||
|
let title = this.agencyObj.label |
||||
|
title = title + '—房屋列表' |
||||
|
|
||||
|
const url = "/gov/org/house/exporthouseinfo" |
||||
|
let params = { |
||||
|
ownerName: this.ownerName, |
||||
|
ownerPhone: this.ownerPhone, |
||||
|
buildingId: this.agencyObj.id |
||||
|
} |
||||
|
|
||||
|
app.ajax.exportFilePost( |
||||
|
url, |
||||
|
params, |
||||
|
(data, rspMsg) => { |
||||
|
|
||||
|
this.download(data, title + '.xls') |
||||
|
}, |
||||
|
(rspMsg, data) => { |
||||
|
this.$message.error(rspMsg); |
||||
|
} |
||||
|
); |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
// 下载文件 |
||||
|
download (data, fileName) { |
||||
|
if (!data) { |
||||
|
return |
||||
|
} |
||||
|
|
||||
|
var csvData = new Blob([data]) |
||||
|
|
||||
|
if (window.navigator && window.navigator.msSaveOrOpenBlob) { |
||||
|
window.navigator.msSaveOrOpenBlob(csvData, fileName); |
||||
|
} |
||||
|
// for Non-IE (chrome, firefox etc.) |
||||
|
else { |
||||
|
var a = document.createElement('a'); |
||||
|
document.body.appendChild(a); |
||||
|
a.style = 'display: none'; |
||||
|
var url = window.URL.createObjectURL(csvData); |
||||
|
a.href = url; |
||||
|
a.download = fileName; |
||||
|
a.click(); |
||||
|
a.remove(); |
||||
|
window.URL.revokeObjectURL(url); |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
handleExportModule () { |
||||
|
let title = '' |
||||
|
title = '房屋模板' |
||||
|
|
||||
|
const url = "/gov/org/house/exporttemplate" |
||||
|
let params = {} |
||||
|
|
||||
|
app.ajax.exportFilePost( |
||||
|
url, |
||||
|
params, |
||||
|
(data, rspMsg) => { |
||||
|
|
||||
|
this.download(data, title + '.xls') |
||||
|
}, |
||||
|
(rspMsg, data) => { |
||||
|
this.$message.error(rspMsg); |
||||
|
} |
||||
|
); |
||||
|
}, |
||||
|
|
||||
|
// 上传文件之前的钩子 |
||||
|
beforeUpload (file) { |
||||
|
this.files = file; |
||||
|
|
||||
|
const isText = file.type === 'application/vnd.ms-excel' |
||||
|
const isTextComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' |
||||
|
|
||||
|
if (!isText && !isTextComputer) { |
||||
|
this.$message.error('请选择正确格式的文件') |
||||
|
return false |
||||
|
} else { |
||||
|
this.fileName = file.name; |
||||
|
return true |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
// 上传文件个数超过定义的数量 |
||||
|
handleExceed (files, fileList) { |
||||
|
this.$message.warning(`当前限制选择 1 个文件,请删除后继续上传`) |
||||
|
}, |
||||
|
|
||||
|
async uploadFile () { |
||||
|
if (this.fileName == "") { |
||||
|
this.$message.warning('请选择要上传的文件!') |
||||
|
return false |
||||
|
} |
||||
|
|
||||
|
this.$message({ |
||||
|
showClose: true, |
||||
|
message: '导入中,请到系统管理-导入记录中查看进度', |
||||
|
duration: 0 |
||||
|
}) |
||||
|
|
||||
|
//清空上传列表 |
||||
|
this.$refs['upload'].clearFiles() |
||||
|
|
||||
|
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是要传的文件名 |
||||
|
|
||||
|
this.importRoomLoading = true |
||||
|
window.app.ajax.post2(url, fileFormData, |
||||
|
(data, rspMsg) => { |
||||
|
|
||||
|
if (data.code === 0 && data.msg == 'success') { |
||||
|
// this.$message.success('导入成功') |
||||
|
} else { |
||||
|
// this.$message({ |
||||
|
// showClose: true, |
||||
|
// message: rspMsg, |
||||
|
// duration: 0, |
||||
|
// type: "error" |
||||
|
// }) |
||||
|
// this.$message.error(rspMsg) |
||||
|
} |
||||
|
this.$emit('refreshTree') |
||||
|
this.loadTable() |
||||
|
this.importRoomLoading = false |
||||
|
}, |
||||
|
(rspMsg, data) => { |
||||
|
this.importRoomLoading = false |
||||
|
}, { headers: { 'Content-Type': 'multipart/form-data' } }) |
||||
|
|
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
computed: { |
||||
|
tableHeight () { |
||||
|
|
||||
|
return (this.clientHeight - 360) |
||||
|
|
||||
|
}, |
||||
|
rowHeight () { |
||||
|
return (this.clientHeight - 200) + 'px' |
||||
|
}, |
||||
|
...mapGetters(['clientHeight']) |
||||
|
}, |
||||
|
watch: { |
||||
|
|
||||
|
}, |
||||
|
props: { |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style lang="scss" scoped > |
||||
|
@import "@/assets/scss/modules/management/epidemic.scss"; |
||||
|
</style> |
||||
|
|
||||
|
|
@ -0,0 +1,564 @@ |
|||||
|
<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="personInCharge"> |
||||
|
<el-input v-model="formData.personInCharge" |
||||
|
size="small" |
||||
|
class="list_item_width_1" |
||||
|
clearable |
||||
|
placeholder="请输入姓名"> |
||||
|
</el-input> |
||||
|
|
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="身份证" |
||||
|
prop="mobile"> |
||||
|
<el-input v-model="formData.mobile" |
||||
|
size="small" |
||||
|
class="list_item_width_1" |
||||
|
clearable |
||||
|
placeholder="请输入身份证"> |
||||
|
</el-input> |
||||
|
|
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="接种时间" |
||||
|
prop="scheduledStartTime"> |
||||
|
<el-date-picker v-model="timeRange" |
||||
|
size="small" |
||||
|
type="daterange" |
||||
|
value-format="yyyy-MM-dd" |
||||
|
@change="handleScheduledTimeChange" |
||||
|
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"> |
||||
|
<div class="div_btn"> |
||||
|
<el-button class="diy-button--add" |
||||
|
size="small" |
||||
|
@click="handleAdd">新增</el-button> |
||||
|
|
||||
|
<el-button style="float:left" |
||||
|
class="diy-button--export" |
||||
|
size="small" |
||||
|
@click="handleExportModule">下载模板</el-button> |
||||
|
<el-upload ref="upload" |
||||
|
:multiple='false' |
||||
|
:show-file-list='false' |
||||
|
:before-upload="beforeUpload" |
||||
|
action="" |
||||
|
accept=".xls,.xlsx" |
||||
|
:limit="1" |
||||
|
:on-exceed="handleExceed" |
||||
|
:http-request="uploadFile"> |
||||
|
<el-button style="margin-left:10px" |
||||
|
size="small" |
||||
|
class="diy-button--delete">导入</el-button> |
||||
|
</el-upload> |
||||
|
|
||||
|
<el-button style="float:left;margin-left:10px" |
||||
|
class="diy-button--reset" |
||||
|
size="small" |
||||
|
@click="handleExport">导出</el-button> |
||||
|
</div> |
||||
|
|
||||
|
<el-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="personInCharge" |
||||
|
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="gridNames" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
label="身份证" |
||||
|
min-width="170"> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="time" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
label="检测时间" |
||||
|
width="120"> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="ninePlaceNames" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
show-overflow-tooltip |
||||
|
label="检测机构" |
||||
|
min-width="230"> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="ninePlaceNames" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
show-overflow-tooltip |
||||
|
label="检测结果" |
||||
|
min-width="80"> |
||||
|
</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="850px" |
||||
|
top="5vh" |
||||
|
class="dialog-h" |
||||
|
@closed="diaClose"> |
||||
|
<nat-form ref="ref_form" |
||||
|
@dialogCancle="addFormCancle" |
||||
|
@dialogOk="addFormOk"></nat-form> |
||||
|
</el-dialog> |
||||
|
|
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
|
||||
|
import natForm from './natInfo/natForm' |
||||
|
|
||||
|
import { requestPost } from "@/js/dai/request"; |
||||
|
import { mapGetters } from 'vuex' |
||||
|
|
||||
|
let loading // 加载动画 |
||||
|
export default { |
||||
|
data () { |
||||
|
return { |
||||
|
loading: false, |
||||
|
total: 0, |
||||
|
pageSize: 10, |
||||
|
pageNo: 0, |
||||
|
tableLoading: false, |
||||
|
|
||||
|
agencyId: '', |
||||
|
|
||||
|
timeRange: [], |
||||
|
formData: { |
||||
|
personInCharge: '',//负责人 |
||||
|
mobile: '',//联系电话 |
||||
|
gridId: '',//负责区域【网格Id】 |
||||
|
ninePlaceVal: '',//场所类型【九小场所Value值】 |
||||
|
isPage: true,//是否分页(是:true 否:false) 有这个参数是给新增巡查记录时用的,默认是 |
||||
|
}, |
||||
|
|
||||
|
tableData: [], |
||||
|
|
||||
|
//form相关 |
||||
|
formShow: false, |
||||
|
formTitle: '新增', |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
components: { |
||||
|
natForm |
||||
|
}, |
||||
|
async created () { |
||||
|
|
||||
|
}, |
||||
|
async mounted () { |
||||
|
//获取场所类型 |
||||
|
|
||||
|
|
||||
|
const { user } = this.$store.state |
||||
|
this.agencyId = user.agencyId |
||||
|
|
||||
|
|
||||
|
await this.loadTable() |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
handleSearch () { |
||||
|
this.loadTable() |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
async loadTable () { |
||||
|
this.tableLoading = true |
||||
|
|
||||
|
const url = "/gov/org/placepatrolteam/getlist" |
||||
|
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/placeorg/getlist" |
||||
|
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.tableData.forEach(item => { |
||||
|
if (item.time) { |
||||
|
let timeArray = item.time.split(' ') |
||||
|
item.time = timeArray[0] |
||||
|
} |
||||
|
|
||||
|
}); |
||||
|
} else { |
||||
|
this.$message.error(msg) |
||||
|
} |
||||
|
this.tableLoading = false |
||||
|
}, |
||||
|
|
||||
|
handleScheduledTimeChange (time) { |
||||
|
if (time) { |
||||
|
this.formData.scheduledStartTime = time[0] |
||||
|
this.formData.scheduledEndTime = time[1] |
||||
|
|
||||
|
} else { |
||||
|
this.formData.scheduledStartTime = '' |
||||
|
this.formData.scheduledEndTime = '' |
||||
|
|
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
diaClose () { |
||||
|
this.$refs.ref_form.resetData() |
||||
|
this.formShow = false |
||||
|
}, |
||||
|
|
||||
|
handleDetail (row) { |
||||
|
this.formTitle = '详情' |
||||
|
this.formShow = true |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.ref_form.initForm('detail', row.natId, this.agencyId) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
handleAdd () { |
||||
|
this.formTitle = '新增' |
||||
|
this.formShow = true |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.ref_form.initForm('add', null, this.agencyId) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
handleEdit (row) { |
||||
|
this.formTitle = '修改' |
||||
|
this.formShow = true |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.ref_form.initForm('edit', row.natId, this.agencyId) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
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.formData = { |
||||
|
personInCharge: '',//负责人 |
||||
|
mobile: '',//联系电话 |
||||
|
gridId: '',//负责区域【网格Id】 |
||||
|
ninePlaceVal: '',//场所类型【九小场所Value值】 |
||||
|
isPage: true,//是否分页(是:true 否:false) 有这个参数是给新增巡查记录时用的,默认是 |
||||
|
} |
||||
|
this.pageSize = 10 |
||||
|
this.pageNo = 0 |
||||
|
this.loadTable() |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
handleSizeChange (val) { |
||||
|
this.pageSize = val |
||||
|
this.pageNo = 1 |
||||
|
this.loadTable() |
||||
|
}, |
||||
|
handleCurrentChange (val) { |
||||
|
this.pageNo = val |
||||
|
this.loadTable() |
||||
|
}, |
||||
|
|
||||
|
//导出表格 |
||||
|
async handleExport () { |
||||
|
let title = this.agencyObj.label |
||||
|
title = title + '—房屋列表' |
||||
|
|
||||
|
const url = "/gov/org/house/exporthouseinfo" |
||||
|
let params = { |
||||
|
ownerName: this.ownerName, |
||||
|
ownerPhone: this.ownerPhone, |
||||
|
buildingId: this.agencyObj.id |
||||
|
} |
||||
|
|
||||
|
app.ajax.exportFilePost( |
||||
|
url, |
||||
|
params, |
||||
|
(data, rspMsg) => { |
||||
|
|
||||
|
this.download(data, title + '.xls') |
||||
|
}, |
||||
|
(rspMsg, data) => { |
||||
|
this.$message.error(rspMsg); |
||||
|
} |
||||
|
); |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
// 下载文件 |
||||
|
download (data, fileName) { |
||||
|
if (!data) { |
||||
|
return |
||||
|
} |
||||
|
|
||||
|
var csvData = new Blob([data]) |
||||
|
|
||||
|
if (window.navigator && window.navigator.msSaveOrOpenBlob) { |
||||
|
window.navigator.msSaveOrOpenBlob(csvData, fileName); |
||||
|
} |
||||
|
// for Non-IE (chrome, firefox etc.) |
||||
|
else { |
||||
|
var a = document.createElement('a'); |
||||
|
document.body.appendChild(a); |
||||
|
a.style = 'display: none'; |
||||
|
var url = window.URL.createObjectURL(csvData); |
||||
|
a.href = url; |
||||
|
a.download = fileName; |
||||
|
a.click(); |
||||
|
a.remove(); |
||||
|
window.URL.revokeObjectURL(url); |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
handleExportModule () { |
||||
|
let title = '' |
||||
|
title = '房屋模板' |
||||
|
|
||||
|
const url = "/gov/org/house/exporttemplate" |
||||
|
let params = {} |
||||
|
|
||||
|
app.ajax.exportFilePost( |
||||
|
url, |
||||
|
params, |
||||
|
(data, rspMsg) => { |
||||
|
|
||||
|
this.download(data, title + '.xls') |
||||
|
}, |
||||
|
(rspMsg, data) => { |
||||
|
this.$message.error(rspMsg); |
||||
|
} |
||||
|
); |
||||
|
}, |
||||
|
|
||||
|
// 上传文件之前的钩子 |
||||
|
beforeUpload (file) { |
||||
|
this.files = file; |
||||
|
|
||||
|
const isText = file.type === 'application/vnd.ms-excel' |
||||
|
const isTextComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' |
||||
|
|
||||
|
if (!isText && !isTextComputer) { |
||||
|
this.$message.error('请选择正确格式的文件') |
||||
|
return false |
||||
|
} else { |
||||
|
this.fileName = file.name; |
||||
|
return true |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
// 上传文件个数超过定义的数量 |
||||
|
handleExceed (files, fileList) { |
||||
|
this.$message.warning(`当前限制选择 1 个文件,请删除后继续上传`) |
||||
|
}, |
||||
|
|
||||
|
async uploadFile () { |
||||
|
if (this.fileName == "") { |
||||
|
this.$message.warning('请选择要上传的文件!') |
||||
|
return false |
||||
|
} |
||||
|
|
||||
|
this.$message({ |
||||
|
showClose: true, |
||||
|
message: '导入中,请到系统管理-导入记录中查看进度', |
||||
|
duration: 0 |
||||
|
}) |
||||
|
|
||||
|
//清空上传列表 |
||||
|
this.$refs['upload'].clearFiles() |
||||
|
|
||||
|
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是要传的文件名 |
||||
|
|
||||
|
this.importRoomLoading = true |
||||
|
window.app.ajax.post2(url, fileFormData, |
||||
|
(data, rspMsg) => { |
||||
|
|
||||
|
if (data.code === 0 && data.msg == 'success') { |
||||
|
// this.$message.success('导入成功') |
||||
|
} else { |
||||
|
// this.$message({ |
||||
|
// showClose: true, |
||||
|
// message: rspMsg, |
||||
|
// duration: 0, |
||||
|
// type: "error" |
||||
|
// }) |
||||
|
// this.$message.error(rspMsg) |
||||
|
} |
||||
|
this.$emit('refreshTree') |
||||
|
this.loadTable() |
||||
|
this.importRoomLoading = false |
||||
|
}, |
||||
|
(rspMsg, data) => { |
||||
|
this.importRoomLoading = false |
||||
|
}, { headers: { 'Content-Type': 'multipart/form-data' } }) |
||||
|
|
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
computed: { |
||||
|
tableHeight () { |
||||
|
|
||||
|
return (this.clientHeight - 360) |
||||
|
|
||||
|
}, |
||||
|
rowHeight () { |
||||
|
return (this.clientHeight - 200) + 'px' |
||||
|
}, |
||||
|
...mapGetters(['clientHeight']) |
||||
|
}, |
||||
|
watch: { |
||||
|
|
||||
|
}, |
||||
|
props: { |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style lang="scss" scoped > |
||||
|
@import "@/assets/scss/modules/management/epidemic.scss"; |
||||
|
</style> |
||||
|
|
||||
|
|
Loading…
Reference in new issue