parent
577667a380
commit
3a5325039b
@ -0,0 +1,52 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询字典数据列表
|
||||||
|
export function listData(query) {
|
||||||
|
return request({
|
||||||
|
url: '/system/dict/data/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询字典数据详细
|
||||||
|
export function getData(dictCode) {
|
||||||
|
return request({
|
||||||
|
url: '/system/dict/data/' + dictCode,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据字典类型查询字典数据信息
|
||||||
|
export function getDicts(dictType) {
|
||||||
|
return request({
|
||||||
|
url: '/system/dict/data/type/' + dictType,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增字典数据
|
||||||
|
export function addData(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/dict/data',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改字典数据
|
||||||
|
export function updateData(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/dict/data',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除字典数据
|
||||||
|
export function delData(dictCode) {
|
||||||
|
return request({
|
||||||
|
url: '/system/dict/data/' + dictCode,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,60 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询字典类型列表
|
||||||
|
export function listType(query) {
|
||||||
|
return request({
|
||||||
|
url: '/system/dict/type/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询字典类型详细
|
||||||
|
export function getType(dictId) {
|
||||||
|
return request({
|
||||||
|
url: '/system/dict/type/' + dictId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增字典类型
|
||||||
|
export function addType(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/dict/type',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改字典类型
|
||||||
|
export function updateType(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/dict/type',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除字典类型
|
||||||
|
export function delType(dictId) {
|
||||||
|
return request({
|
||||||
|
url: '/system/dict/type/' + dictId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 刷新字典缓存
|
||||||
|
export function refreshCache() {
|
||||||
|
return request({
|
||||||
|
url: '/system/dict/type/refreshCache',
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取字典选择框列表
|
||||||
|
export function optionselect() {
|
||||||
|
return request({
|
||||||
|
url: '/system/dict/type/optionselect',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
@ -1,53 +1,53 @@
|
|||||||
import { request } from '@/api/request.js'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
// 查询居民管理列表
|
// 查询居民管理列表
|
||||||
export function listPerson(query) {
|
export function listPerson(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/taicangpop/person/list',
|
url: '/taicangpop/person/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query,
|
params: query,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询居民管理详细
|
// 查询居民管理详细
|
||||||
export function getPerson(id) {
|
export function getPerson(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/taicangpop/person/' + id,
|
url: '/taicangpop/person/' + id,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增居民管理
|
// 新增居民管理
|
||||||
export function addPerson(data) {
|
export function addPerson(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/taicangpop/person',
|
url: '/taicangpop/person',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data,
|
data: data,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改居民管理
|
// 修改居民管理
|
||||||
export function updatePerson(data) {
|
export function updatePerson(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/taicangpop/person',
|
url: '/taicangpop/person',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data,
|
data: data,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除居民管理
|
// 删除居民管理
|
||||||
export function delPerson(id) {
|
export function delPerson(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/taicangpop/person/' + id,
|
url: '/taicangpop/person/' + id,
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 导出居民管理
|
// 导出居民管理
|
||||||
export function exportPerson(query) {
|
export function exportPerson(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/taicangpop/person/export',
|
url: '/taicangpop/person/export',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query,
|
params: query,
|
||||||
})
|
})
|
||||||
}
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
<template>
|
||||||
|
<view class="bottom-btn">
|
||||||
|
<u-button :type="type" @click="handlerClick()">{{title}}</u-button>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
type: {
|
||||||
|
type: String,
|
||||||
|
default: 'success'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
name: "bottomBtn",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handlerClick() {
|
||||||
|
this.$emit('handlerClick')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.bottom-btn {
|
||||||
|
border-top: 1px solid #e4e7ed;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 20rpx 20rpx;
|
||||||
|
padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
|
||||||
|
background: #fff;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0%;
|
||||||
|
left: 0%;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,238 @@
|
|||||||
|
<template>
|
||||||
|
<navigation-general :title="title">
|
||||||
|
<u-form :model="form" ref="uForm" label-width="130rpx">
|
||||||
|
<u-form-item label="姓名" prop="name"><u-input v-model="form.name" /></u-form-item>
|
||||||
|
<u-form-item label="身份证"><u-input v-model="form.credentialNo" /></u-form-item>
|
||||||
|
<u-form-item label="手机号" prop="phone"><u-input v-model="form.phone" /></u-form-item>
|
||||||
|
<u-form-item label="人员类型">
|
||||||
|
<u-checkbox-group @change="checkboxGroupChange">
|
||||||
|
<u-checkbox v-model="item.checked" v-for="(item, index) in typeList" :key="index" :name="item.name">
|
||||||
|
{{ item.name }}
|
||||||
|
</u-checkbox>
|
||||||
|
</u-checkbox-group>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item label="户籍" prop="color">
|
||||||
|
<u-radio-group v-model="form.color">
|
||||||
|
<u-radio v-for="(item, index) in hujiList" :key="index" :name="item.dictLabel">
|
||||||
|
{{item.dictLabel}}
|
||||||
|
</u-radio>
|
||||||
|
</u-radio-group>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item label="流动" prop="color">
|
||||||
|
<u-radio-group v-model="form.color">
|
||||||
|
<u-radio v-for="(item, index) in liudList" :key="index" :name="item.dictLabel">
|
||||||
|
{{item.dictLabel}}
|
||||||
|
</u-radio>
|
||||||
|
</u-radio-group>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item label="工作单位"><u-input v-model="form.workunit" /></u-form-item>
|
||||||
|
<u-form-item label="备注"><u-input v-model="form.remark" /></u-form-item>
|
||||||
|
</u-form>
|
||||||
|
<bottom-btn type="primary" title="提交" @handlerClick="handlerClick"></bottom-btn>
|
||||||
|
|
||||||
|
|
||||||
|
</navigation-general>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
mapGetters
|
||||||
|
} from "vuex";
|
||||||
|
|
||||||
|
import {
|
||||||
|
addPerson,
|
||||||
|
getPerson,
|
||||||
|
updatePerson
|
||||||
|
} from "@/api/taicangpop/person.js";
|
||||||
|
import {
|
||||||
|
getDicts
|
||||||
|
} from "@/api/system/dict/data";
|
||||||
|
export default {
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
multiple: [],
|
||||||
|
hujiList: [],
|
||||||
|
liudList: [],
|
||||||
|
title: '',
|
||||||
|
form: {
|
||||||
|
buildingId: undefined,
|
||||||
|
color: undefined,
|
||||||
|
credentialNo: undefined,
|
||||||
|
deptId: undefined,
|
||||||
|
houseId: undefined,
|
||||||
|
id: null,
|
||||||
|
isD: 0,
|
||||||
|
isJ: 0,
|
||||||
|
isK: 0,
|
||||||
|
isX: 0,
|
||||||
|
name: undefined,
|
||||||
|
phone: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
type: null,
|
||||||
|
userId: null,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
name: [{
|
||||||
|
required: true,
|
||||||
|
message: '请输入姓名',
|
||||||
|
trigger: ['change', 'blur'],
|
||||||
|
},
|
||||||
|
|
||||||
|
],
|
||||||
|
phone: [{
|
||||||
|
required: true,
|
||||||
|
message: '请输入手机号',
|
||||||
|
trigger: ['change', 'blur'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
console.log("value:" + value);
|
||||||
|
if (!/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/.test(value)) {
|
||||||
|
callback(new Error("手机号只能为数字!"));
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
trigger: "blur"
|
||||||
|
},
|
||||||
|
],
|
||||||
|
color: [{
|
||||||
|
required: true,
|
||||||
|
message: '请选择分色',
|
||||||
|
trigger: ['change', 'blur'],
|
||||||
|
}],
|
||||||
|
},
|
||||||
|
typeList: [{
|
||||||
|
name: '中共党员',
|
||||||
|
key: 'isD',
|
||||||
|
checked: false,
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '帮扶对象',
|
||||||
|
key: 'isK',
|
||||||
|
checked: false,
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '重点人群',
|
||||||
|
checked: false,
|
||||||
|
key: 'isX',
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '退伍军人',
|
||||||
|
key: 'isJ',
|
||||||
|
checked: false,
|
||||||
|
|
||||||
|
},
|
||||||
|
]
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters(["userId"]),
|
||||||
|
},
|
||||||
|
onReady() {
|
||||||
|
this.$refs.uForm.setRules(this.rules);
|
||||||
|
},
|
||||||
|
onLoad(option) {
|
||||||
|
if (option.personId) {
|
||||||
|
this.title = '居民信息修改'
|
||||||
|
//获取人员详细信息
|
||||||
|
this.getPersonInfo(option.personId)
|
||||||
|
} else {
|
||||||
|
this.title = '新增居民'
|
||||||
|
this.form.buildingId = option.buildingId
|
||||||
|
this.form.houseId = option.houseId
|
||||||
|
this.form.deptId = option.deptId
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
this.getDictList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async getPersonInfo(personId) {
|
||||||
|
const res = await getPerson(personId)
|
||||||
|
for (let key in res.data) {
|
||||||
|
const item = res.data[key]
|
||||||
|
let index = this.typeList.findIndex(it => it.key == key)
|
||||||
|
if (index != -1) {
|
||||||
|
this.typeList[index].checked = item > 0 ? true : false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.form = res.data
|
||||||
|
},
|
||||||
|
handlerClick() {
|
||||||
|
this.$refs.uForm.validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.color == "HZ" || this.form.color == "HO") {
|
||||||
|
this.form.type = 1;
|
||||||
|
} else {
|
||||||
|
this.form.type = 2;
|
||||||
|
}
|
||||||
|
this.form.userId = this.userId
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updatePerson(this.form).then((response) => {
|
||||||
|
uni.showToast({
|
||||||
|
title: '修改成功',
|
||||||
|
success: () => {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack()
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addPerson(this.form).then((res) => {
|
||||||
|
uni.showToast({
|
||||||
|
title: '新增成功',
|
||||||
|
success: () => {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack()
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
console.log('没有痛苦')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
checkboxGroupChange(e) {
|
||||||
|
console.log(e)
|
||||||
|
this.form.isD = e.some((item) => item == "中共党员") ?
|
||||||
|
1 :
|
||||||
|
0;
|
||||||
|
this.form.isK = e.some((item) => item == "帮扶对象") ?
|
||||||
|
1 :
|
||||||
|
0;
|
||||||
|
this.form.isJ = e.some((item) => item == "退伍军人") ?
|
||||||
|
1 :
|
||||||
|
0;
|
||||||
|
this.form.isX = e.some((item) => item == "重点人群") ?
|
||||||
|
1 :
|
||||||
|
0;
|
||||||
|
},
|
||||||
|
//获取字典
|
||||||
|
async getDictList() {
|
||||||
|
const res = await getDicts('b_census_color_type')
|
||||||
|
this.hujiList = res.data
|
||||||
|
const result = await getDicts('b_flow_color_type')
|
||||||
|
this.liudList = result.data
|
||||||
|
console.log(this.hujiList)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.u-form {
|
||||||
|
background: #fff;
|
||||||
|
padding: 20rpx;
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,288 @@
|
|||||||
|
<template>
|
||||||
|
<navigation-general :title="title">
|
||||||
|
<view class="row-title">
|
||||||
|
<view class="main-title">住户信息</view>
|
||||||
|
<u-button type="primary" :plain="true" size="mini">房屋信息采集</u-button>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<u-cell-group>
|
||||||
|
<u-cell-item title="人数" :arrow="false" :value="personTotal + '人'"></u-cell-item>
|
||||||
|
<u-cell-item title="户籍类型" :arrow="false">
|
||||||
|
<view :style="{color:houseInfo.type !== 1 ? ' rgb(0, 140, 94)' : '#d13b69' }">{{houseInfo.typename}}
|
||||||
|
</view>
|
||||||
|
</u-cell-item>
|
||||||
|
<u-cell-item title="房屋类型" :arrow="false"
|
||||||
|
v-show="houseInfo.isD>0 || houseInfo.isJ>0 || houseInfo.isK>0 || houseInfo.isX>0">
|
||||||
|
<div class="is-type">
|
||||||
|
<view style="color:#e73388 ;border-color: #81204e;" v-show="houseInfo.isD>0">中共党员</view>
|
||||||
|
<view style="color:#734700 ;border-color: #e09100;" v-show="houseInfo.isK>0">帮扶对象</view>
|
||||||
|
<view style="color:#00694c ;border-color: #00c185;" v-show="houseInfo.isX>0">重点人群</view>
|
||||||
|
<view style="color:#006382 ;border-color: #02b4e7;" v-show="houseInfo.isJ>0">退伍军人</view>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</u-cell-item>
|
||||||
|
<u-cell-item title="分色" :arrow="false">
|
||||||
|
<color-item :item="houseInfo"></color-item>
|
||||||
|
</u-cell-item>
|
||||||
|
<u-cell-item title="更新时间" :arrow="false" :value="houseInfo.updateTime"></u-cell-item>
|
||||||
|
<u-cell-item title="公安地址" :arrow="false"
|
||||||
|
:value="publicAddress[houseInfo.xiaoquId] + houseInfo.deptname + houseInfo.buildingname"></u-cell-item>
|
||||||
|
</u-cell-group>
|
||||||
|
|
||||||
|
<view class="row-title">
|
||||||
|
<view class="main-title">居民信息</view>
|
||||||
|
<u-button type="primary" :plain="true" size="mini" @click="addPerson()">新增居民</u-button>
|
||||||
|
</view>
|
||||||
|
<view class="person-list">
|
||||||
|
<view class="person-item" v-for="item in personList" :key="item.id" @click="handlerInfo(item.id)">
|
||||||
|
<text>{{item.name}}</text>
|
||||||
|
<text>{{ filterCarId(item.credentialNo, "性别") }}</text>
|
||||||
|
<text>{{ filterCarId(item.credentialNo, "年龄") }} 岁</text>
|
||||||
|
<text>{{ filterCarId(item.credentialNo, "出生年月") }}</text>
|
||||||
|
<text
|
||||||
|
:style="{color:item.color !== 'NL' ? ' rgb(0, 140, 94)' : '#d13b69' }">{{personType[item.color]}}</text>
|
||||||
|
<color-item :item="item" :showColorName="false"></color-item>
|
||||||
|
|
||||||
|
<view class="circle-point">
|
||||||
|
<view class="point-item" v-show="filterPoint(item.updateTime)" style="background: green;">
|
||||||
|
</view>
|
||||||
|
<view class="point-item" v-show="!filterPoint(item.updateTime)" style="background: red;">
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="color-is-type">
|
||||||
|
<image src="../../static/images/isd.png" mode="" v-show="item.isD"></image>
|
||||||
|
<image src="../../static/images/isj.png" mode="" v-show="item.isJ"></image>
|
||||||
|
<image src="../../static/images/isx.png" mode="" v-show="item.isX"></image>
|
||||||
|
<image src="../../static/images/isk.png" mode="" v-show="item.isK"></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<u-loadmore :status="status" :load-text="loadText" />
|
||||||
|
</navigation-general>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
handleColor,
|
||||||
|
validateAndParseIDCard
|
||||||
|
} from '@/utils/handlerColor.js'
|
||||||
|
import {
|
||||||
|
getHouse
|
||||||
|
} from '@/api/taicangpop/house.js'
|
||||||
|
import {
|
||||||
|
listPerson
|
||||||
|
} from '@/api/taicangpop/person.js'
|
||||||
|
import moment from 'moment'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
status: 'loadmore',
|
||||||
|
loadText: {
|
||||||
|
loadmore: '轻轻上拉',
|
||||||
|
loading: '努力加载中',
|
||||||
|
nomore: '没有更多了~'
|
||||||
|
},
|
||||||
|
title: '',
|
||||||
|
queryParams: {},
|
||||||
|
houseInfo: {},
|
||||||
|
personList: [],
|
||||||
|
personTotal: 0,
|
||||||
|
publicAddress: {
|
||||||
|
202: "滨河路大庆锦绣新城",
|
||||||
|
215: "常胜路景瑞荣御蓝湾",
|
||||||
|
242: "东仓路星雨华府",
|
||||||
|
235: "兰州路华盛六园",
|
||||||
|
267: "太平北路森茂汽车城",
|
||||||
|
},
|
||||||
|
personType: {
|
||||||
|
HZ: '自住',
|
||||||
|
HO: '自住',
|
||||||
|
NZ: '自住',
|
||||||
|
NL: '租客',
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad(option) {
|
||||||
|
this.title = option.houseName
|
||||||
|
this.queryParams = option
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
this.getHouseInfo()
|
||||||
|
this.getPersonList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
//详情页
|
||||||
|
handlerInfo(id) {
|
||||||
|
this.$u.route({
|
||||||
|
url: 'pages/house/personInfo',
|
||||||
|
params: {
|
||||||
|
personId: id,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//添加居民
|
||||||
|
addPerson() {
|
||||||
|
this.$u.route({
|
||||||
|
url: 'pages/house/addAndEdit',
|
||||||
|
params: {
|
||||||
|
buildingId: this.houseInfo.buildingId,
|
||||||
|
houseId: this.houseInfo.id,
|
||||||
|
deptId: this.houseInfo.deptId,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//获取房屋信息
|
||||||
|
async getHouseInfo() {
|
||||||
|
const res = await getHouse(this.queryParams.houseId)
|
||||||
|
res.data.updateTime = moment(res.data.updateTime).format(
|
||||||
|
"YYYY-MM-DD"
|
||||||
|
);
|
||||||
|
this.houseInfo = handleColor([res.data])[0]
|
||||||
|
},
|
||||||
|
//获取house居民
|
||||||
|
async getPersonList() {
|
||||||
|
this.status = 'loading';
|
||||||
|
const res = await listPerson({
|
||||||
|
buildingId: this.queryParams.buildingId,
|
||||||
|
houseId: this.queryParams.houseId,
|
||||||
|
|
||||||
|
})
|
||||||
|
this.personList = handleColor(res.rows)
|
||||||
|
this.personTotal = res.total
|
||||||
|
this.status = 'nomore';
|
||||||
|
},
|
||||||
|
// 身份证过滤
|
||||||
|
filterCarId(carId, type) {
|
||||||
|
return validateAndParseIDCard(carId, type);
|
||||||
|
},
|
||||||
|
//人员预警
|
||||||
|
filterPoint(updateTime) {
|
||||||
|
if (!updateTime) return false
|
||||||
|
let update_m = moment(updateTime).format('MM')
|
||||||
|
let curent_m = moment().format('MM')
|
||||||
|
if (update_m == curent_m) {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.app-container {
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row-title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 15rpx;
|
||||||
|
|
||||||
|
.main-title {
|
||||||
|
font-size: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.person-list {
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
display: grid;
|
||||||
|
/* 启用 Grid 布局 */
|
||||||
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
/* 创建三列,列宽相等 */
|
||||||
|
gap: 25rpx;
|
||||||
|
|
||||||
|
.person-item {
|
||||||
|
position: relative;
|
||||||
|
/* 背景色,方便查看 */
|
||||||
|
padding: 20rpx;
|
||||||
|
/* 内边距 */
|
||||||
|
text-align: center;
|
||||||
|
/* 文本居中 */
|
||||||
|
background-color: #fff;
|
||||||
|
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.2);
|
||||||
|
border-radius: 3px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.circle-point {
|
||||||
|
position: absolute;
|
||||||
|
top: 10rpx;
|
||||||
|
left: 10rpx;
|
||||||
|
|
||||||
|
.point-item {
|
||||||
|
height: 15rpx;
|
||||||
|
width: 15rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-is-type {
|
||||||
|
position: absolute;
|
||||||
|
top: -10rpx;
|
||||||
|
right: 0;
|
||||||
|
|
||||||
|
&>image {
|
||||||
|
height: 25rpx;
|
||||||
|
width: 25rpx;
|
||||||
|
margin-left: 6rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.is-type {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
&>view {
|
||||||
|
margin-left: 6rpx;
|
||||||
|
border: 1px solid;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 0 6rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
line-height: 40rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .u-cell-box {
|
||||||
|
margin-bottom: 15rpx;
|
||||||
|
border-radius: 3px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .u-cell {
|
||||||
|
padding: 10rpx 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/.u-cell__value {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row-reverse;
|
||||||
|
|
||||||
|
.color-item {
|
||||||
|
margin-right: 40rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .u-load-more-wrap {
|
||||||
|
margin-top: 10rpx !important;
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,107 @@
|
|||||||
|
<template>
|
||||||
|
<navigation-general title="居民详情">
|
||||||
|
<template v-slot:right>
|
||||||
|
<u-button style="margin-right: 20rpx;" type="error" size="mini" @click="handlerDel">删除</u-button>
|
||||||
|
</template>
|
||||||
|
<u-cell-group>
|
||||||
|
<u-cell-item title="姓名" :arrow="false" :value="info.name"></u-cell-item>
|
||||||
|
<u-cell-item title="身份证" :arrow="false" :value="info.credentialNo || '/'"></u-cell-item>
|
||||||
|
<u-cell-item title="手机号" :arrow="false" :value="info.phone || '/'"></u-cell-item>
|
||||||
|
<u-cell-item title="类型" :arrow="false" :value="info.typename"></u-cell-item>
|
||||||
|
<u-cell-item title="分色" :arrow="false" :value="info.color"></u-cell-item>
|
||||||
|
<u-cell-item title="参保单位" :arrow="false" :value="info.qymc || '/'"></u-cell-item>
|
||||||
|
<u-cell-item title="社保电话" :arrow="false" :value="info.lxdh || '/'"></u-cell-item>
|
||||||
|
<u-cell-item title="参保类型" :arrow="false" :value="info.eacaabbff"></u-cell-item>
|
||||||
|
<u-cell-item title="民族" :arrow="false" :value="info.mzcgf"></u-cell-item>
|
||||||
|
<u-cell-item title="社保地址" :arrow="false" :value="info.lxdzDzmc || '/'"></u-cell-item>
|
||||||
|
<u-cell-item title="实际工作单位" :arrow="false" :value="info.workunit || '/'"></u-cell-item>
|
||||||
|
<u-cell-item title="数据更新时间" :arrow="false" :value="info.updateTime || '/'"></u-cell-item>
|
||||||
|
<u-cell-item title="备注" :arrow="false" :value="info.remark || '/'"></u-cell-item>
|
||||||
|
</u-cell-group>
|
||||||
|
<u-top-tips ref="uTips"></u-top-tips>
|
||||||
|
<bottom-btn title="修改信息" @handlerClick="handlerClick"></bottom-btn>
|
||||||
|
</navigation-general>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
getPerson,
|
||||||
|
delPerson
|
||||||
|
} from "@/api/taicangpop/person.js";
|
||||||
|
import {
|
||||||
|
getDicts
|
||||||
|
} from "@/api/system/dict/data";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
info: {},
|
||||||
|
personId: null,
|
||||||
|
nationList: [],
|
||||||
|
sbList: []
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad(option) {
|
||||||
|
this.personId = option.personId
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.getnationList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async getnationList() {
|
||||||
|
const res = await getDicts('sys_nationality')
|
||||||
|
this.nationList = res.data
|
||||||
|
const reslut = await getDicts('sys_sb_type')
|
||||||
|
this.sbList = reslut.data
|
||||||
|
this.getPersonInfo()
|
||||||
|
},
|
||||||
|
async getPersonInfo() {
|
||||||
|
const res = await getPerson(this.personId)
|
||||||
|
const mzcgf = this.nationList.find(item => item.dictValue == res.data.mzcgf)
|
||||||
|
res.data.mzcgf = mzcgf && mzcgf.dictLabel ? mzcgf.dictLabel : '/'
|
||||||
|
|
||||||
|
const eacaabbff = this.sbList.find(item => item.dictValue == res.data.eacaabbff)
|
||||||
|
res.data.eacaabbff = eacaabbff && eacaabbff.dictLabel ? eacaabbff.dictLabel : '/'
|
||||||
|
this.info = res.data
|
||||||
|
},
|
||||||
|
handlerDel() {
|
||||||
|
uni.showModal({
|
||||||
|
title: `删除操作`,
|
||||||
|
content: `确定要删除编号为${this.personId}的居民吗?`,
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
delPerson(this.personId).then(res => {
|
||||||
|
uni.showToast({
|
||||||
|
title: '删除成功',
|
||||||
|
success: () => {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack()
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
} else if (res.cancel) {
|
||||||
|
console.log('用户点击取消');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handlerClick() {
|
||||||
|
this.$u.route({
|
||||||
|
url: 'pages/house/addAndEdit',
|
||||||
|
params: {
|
||||||
|
personId: this.personId
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
/deep/ .u-cell {
|
||||||
|
padding: 15rpx 20rpx;
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
Reference in new issue