城阳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.

945 lines
25 KiB

3 years ago
<template>
3 years ago
<div class="g-cnt-wrap">
<div class="m-box m-search">
<div class="wrap">
<div class="title">
<span>社区查询</span>
</div>
3 years ago
3 years ago
<div class="tabs">
3 years ago
<div
:class="{ 'z-on': searchData.type == 'jumin' }"
@click="searchData.type = 'jumin'"
>
3 years ago
查居民
</div>
3 years ago
<div
:class="{ 'z-on': searchData.type == 'fangwu' }"
@click="searchData.type = 'fangwu'"
>
3 years ago
查房屋
</div>
</div>
3 years ago
3 years ago
<div class="search">
<div class="search-input">
<div class="input">
3 years ago
<input
type="text"
:placeholder="typePlaceholder[searchData.type]"
v-model="searchData.searchKey"
@keyup.enter="handleClickSearchBtn"
/>
3 years ago
3 years ago
<div
class="close-btn"
v-if="searchData.searchKey != ''"
@click="searchData.searchKey = ''"
>
3 years ago
<img src="@/assets/img/shequ/close.png" />
3 years ago
</div>
</div>
3 years ago
<div class="btn" @click="handleClickSearchBtn">查一下</div>
3 years ago
</div>
3 years ago
<div class="btn2" @click="handleClickSearchBtn">
3 years ago
<img src="@/assets/images/index/i-search.png" />
智能搜索
</div>
</div>
</div>
</div>
3 years ago
3 years ago
<div class="m-box" v-if="searchStatus == 'ing'">
<div
class="m-tb"
v-if="
3 years ago
searchData.type == 'jumin' &&
3 years ago
searchData.searchKey != '' &&
3 years ago
searchStatus == 'ing'
3 years ago
"
>
3 years ago
<div class="tb">
3 years ago
<el-table
class="m-table"
v-loading="searchJumin.loading"
:data="searchJumin.list"
border
style="width: 100%"
:max-height="1000"
>
<el-table-column
label="序号"
type="index"
align="center"
width="50"
/>
<el-table-column
v-for="item in searchJumin.header"
:key="item.columnName"
:prop="item.columnName"
:label="item.label"
align="center"
:show-overflow-tooltip="true"
:width="
3 years ago
item.itemType === 'radio' ? computedWidth(item.label) : 180
3 years ago
"
>
3 years ago
<template slot-scope="scope">
<span>{{ handleFilterSpan(scope.row, item) }}</span>
</template>
</el-table-column>
3 years ago
<el-table-column fixed="right" label="操作" align="center">
3 years ago
<template slot-scope="scope">
3 years ago
<el-button
class="f-fc"
@click="handleWatchSearchJumin(scope.$index)"
type="text"
size="small"
>查看</el-button
>
3 years ago
</template>
</el-table-column>
</el-table>
<div>
3 years ago
<el-pagination
@size-change="handleSizeChangeSearchJumin"
@current-change="handleCurrentChangeSearchJumin"
:current-page.sync="searchJumin.pageNo"
:page-sizes="[20, 50, 100, 200]"
:page-size="parseInt(searchJumin.pageSize)"
layout="sizes, prev, pager, next, total"
:total="searchJumin.total"
>
3 years ago
</el-pagination>
3 years ago
</div>
</div>
3 years ago
</div>
3 years ago
3 years ago
<div
class="m-tb"
v-if="
3 years ago
searchData.type == 'fangwu' &&
3 years ago
searchData.searchKey != '' &&
3 years ago
searchStatus == 'ing'
3 years ago
"
>
3 years ago
<div class="tb">
3 years ago
<el-table
class="m-table"
:data="searchFangwu.list"
v-loading="searchFangwu.loading"
border
:max-height="1000"
style="width: 100%"
>
<el-table-column
label="序号"
type="index"
align="center"
width="50"
/>
<el-table-column prop="houseName" label="房屋名称" width="120">
3 years ago
</el-table-column>
3 years ago
<el-table-column prop="quartersName" label="所属小区" width="160">
3 years ago
</el-table-column>
3 years ago
<el-table-column prop="buildingName" label="所属楼栋">
3 years ago
</el-table-column>
3 years ago
<el-table-column prop="buildingUnitName" label="单元号">
3 years ago
</el-table-column>
3 years ago
<el-table-column prop="doorName" label="门牌号"> </el-table-column>
<el-table-column prop="houseType" label="类型"> </el-table-column>
<el-table-column prop="purpose" label="用途"> </el-table-column>
<el-table-column prop="rentFlag" label="房屋状态">
3 years ago
</el-table-column>
3 years ago
<el-table-column prop="ownerName" label="房主姓名">
3 years ago
</el-table-column>
3 years ago
<el-table-column prop="ownerPhone" label="房主电话" width="110">
3 years ago
</el-table-column>
3 years ago
<el-table-column prop="ownerIdCard" label="身份证" width="170">
</el-table-column>
<el-table-column
label="操作"
fixed="right"
header-align="center"
align="center"
class="operate"
>
3 years ago
<template slot-scope="scope">
3 years ago
<el-button
class="f-fc"
type="text"
size="small"
@click="handleWatchSearchFangwu(scope.$index)"
3 years ago
>查看</el-button
>
3 years ago
</template>
</el-table-column>
</el-table>
<div>
3 years ago
<el-pagination
@size-change="handleSizeChangeSearchFangwu"
@current-change="handleCurrentChangeSearchFangwu"
:current-page.sync="searchFangwu.pageNo"
:page-sizes="[20, 50, 100, 200]"
:page-size="parseInt(searchFangwu.pageSize)"
layout="sizes, prev, pager, next"
:total="searchFangwu.total"
>
3 years ago
</el-pagination>
3 years ago
</div>
</div>
</div>
</div>
<resi-info
v-if="showedResiInfo && currentResiId"
:resi-id="currentResiId"
@close="showedResiInfo = false"
/>
3 years ago
<house-info
v-if="showedHouseInfo && currentHouseId"
:house-id="currentHouseId"
@close="showedHouseInfo = false"
/>
3 years ago
</div>
</template>
<script>
import { requestPost } from "@/js/dai/request";
import { mapGetters } from "vuex";
import nextTick from "dai-js/tools/nextTick";
3 years ago
import getQueryPara from "dai-js/modules/getQueryPara";
import resiInfo from "@/views/modules/cpts/resi/info";
import houseInfo from "@/views/modules/cpts/house/info";
3 years ago
export default {
components: {
3 years ago
resiInfo,
houseInfo,
3 years ago
},
3 years ago
props: {
type: {
type: String,
default: "",
},
3 years ago
searchKey: {
3 years ago
type: String,
default: "",
},
},
3 years ago
data() {
3 years ago
return {
searchStatus: "ini", //ing over
searchData: {
type: "jumin",
3 years ago
searchKey: "",
3 years ago
},
typePlaceholder: {
jumin: "请输入姓名或电话或身份证号",
fangwu: "请输入“小区名称,楼号”,如:亿联小区,1号楼",
xuqiu: "请输入需求人或需求内容或服务方",
},
searchJumin: {
3 years ago
loading: false,
3 years ago
header: [
{
itemId: "20220422102809_1006",
label: "姓名",
columnName: "name",
itemType: "input",
width: 80,
options: [],
},
{
itemId: "20220422102809_1001",
label: "所属网格",
columnName: "gridName",
itemType: "select",
width: 190,
options: [],
},
{
itemId: "20220422102809_1004",
label: "所属房屋",
columnName: "homeName",
itemType: "select",
width: 190,
options: [],
},
{
itemId: "20220422102809_1007",
label: "联系电话",
columnName: "mobile",
itemType: "input",
width: 120,
options: [],
},
{
itemId: "20220422102809_1009",
label: "证件号",
columnName: "idNum",
itemType: "input",
width: 180,
options: [],
},
{
itemId: "20220422102809_1008",
label: "性别",
columnName: "gender",
itemType: "select",
width: 54,
options: [
{ label: "男", value: "1" },
{ label: "女", value: "2" },
],
},
{
itemId: "20220422102809_1010",
label: "出生日期",
columnName: "birthday",
itemType: "datepicker",
width: 110,
options: [],
},
{
itemId: "20220422102809_1011",
label: "备注",
columnName: "remark",
itemType: "textarea",
width: 110,
options: [],
},
{
itemId: "20220422102809_1015",
label: "党员",
columnName: "partyFlag",
itemType: "radio",
width: 80,
options: [
{ label: "是", value: "1" },
{ label: "否", value: "0" },
],
},
{
itemId: "20220422102809_1016",
label: "低保人员",
columnName: "subsistenceAllowanceFlag",
itemType: "radio",
width: 80,
options: [
{ label: "是", value: "1" },
{ label: "否", value: "0" },
],
},
{
itemId: "20220422102809_1017",
label: "保障房人员",
columnName: "ensureHouseFlag",
itemType: "radio",
width: 100,
options: [
{ label: "是", value: "1" },
{ label: "否", value: "0" },
],
},
{
itemId: "20220422102809_1018",
label: "失业人员",
columnName: "unemployedFlag",
itemType: "radio",
width: 80,
options: [
{ label: "是", value: "1" },
{ label: "否", value: "0" },
],
},
{
itemId: "20220422102809_1019",
label: "育龄妇女",
columnName: "fertileWomanFlag",
itemType: "radio",
width: 80,
options: [
{ label: "是", value: "1" },
{ label: "否", value: "0" },
],
},
{
itemId: "20220422102809_1020",
label: "退役军人",
columnName: "veteranFlag",
itemType: "radio",
width: 80,
options: [
{ label: "是", value: "1" },
{ label: "否", value: "0" },
],
},
{
itemId: "20220422102809_1021",
label: "统战人员",
columnName: "unitedFrontFlag",
itemType: "radio",
width: 80,
options: [
{ label: "是", value: "1" },
{ label: "否", value: "0" },
],
},
{
itemId: "20220422102809_1022",
label: "信访人员",
columnName: "petitionOfficerFlag",
itemType: "radio",
width: 80,
options: [
{ label: "是", value: "1" },
{ label: "否", value: "0" },
],
},
{
itemId: "20220422102809_1023",
label: "志愿者",
columnName: "volunteerFlag",
itemType: "radio",
width: 80,
options: [
{ label: "是", value: "1" },
{ label: "否", value: "0" },
],
},
{
itemId: "20220422102809_1024",
label: "老年人",
columnName: "oldPeopleFlag",
itemType: "radio",
width: 80,
options: [
{ label: "是", value: "1" },
{ label: "否", value: "0" },
],
},
{
itemId: "20220422102809_1025",
label: "空巢",
columnName: "emptyNesterFlag",
itemType: "radio",
width: 80,
options: [
{ label: "是", value: "1" },
{ label: "否", value: "0" },
],
},
{
itemId: "20220422102809_1026",
label: "失独人员",
columnName: "bereavedPersonFlag",
itemType: "radio",
width: 80,
options: [
{ label: "是", value: "1" },
{ label: "否", value: "0" },
],
},
{
itemId: "20220422102809_1027",
label: "失能",
columnName: "disabledFlag",
itemType: "radio",
width: 80,
options: [
{ label: "是", value: "1" },
{ label: "否", value: "0" },
],
},
{
itemId: "20220422102809_1028",
label: "失智",
columnName: "dementedFlag",
itemType: "radio",
width: 80,
options: [
{ label: "是", value: "1" },
{ label: "否", value: "0" },
],
},
{
itemId: "20220422102809_1029",
label: "残疾",
columnName: "disabilityFlag",
itemType: "radio",
width: 80,
options: [
{ label: "是", value: "1" },
{ label: "否", value: "0" },
],
},
{
itemId: "20220422102809_1030",
label: "大病",
columnName: "seriousIllnessFlag",
itemType: "radio",
width: 80,
options: [
{ label: "是", value: "1" },
{ label: "否", value: "0" },
],
},
{
itemId: "20220422102809_1031",
label: "慢病",
columnName: "chronicDiseaseFlag",
itemType: "radio",
width: 80,
options: [
{ label: "是", value: "1" },
{ label: "否", value: "0" },
],
},
{
itemId: "20220422102809_10310",
label: "特殊人群",
columnName: "specialCrowdFlag",
itemType: "radio",
width: 80,
options: [
{ label: "是", value: "1" },
{ label: "否", value: "0" },
],
},
{
itemId: "20220422102809_202204141504102",
label: "流动人口",
columnName: "floatingFlag",
itemType: "radio",
width: 80,
options: [
{ label: "是", value: "1" },
{ label: "否", value: "0" },
],
},
{
itemId: "20220422102809_202204141504101",
label: "租户",
columnName: "tenantFlag",
itemType: "radio",
width: 80,
options: [
{ label: "是", value: "1" },
{ label: "否", value: "0" },
],
},
{
itemId: "202208111008491",
label: "独居老人",
columnName: "liveAloneFlag",
itemType: "radio",
width: 100,
options: [
{ label: "是", value: "1" },
{ label: "否", value: "0" },
],
},
],
3 years ago
pageNo: 1,
pageSize: window.localStorage.getItem("pageSize") || 20,
total: 1,
list: [],
},
searchFangwu: {
3 years ago
loading: false,
3 years ago
pageNo: 1,
pageSize: window.localStorage.getItem("pageSize") || 20,
total: 1,
list: [],
},
// 显示人员详情
3 years ago
showedResiInfo: false,
3 years ago
3 years ago
currentResiId: "",
3 years ago
// 显示人员详情
showedHouseInfo: false,
currentHouseId: "",
3 years ago
3 years ago
currentPage: "chaxun", //查询 预警,
3 years ago
};
},
computed: {
3 years ago
maxTableHeight() {
3 years ago
// return this.clientHeight - 450;
return 420;
},
...mapGetters(["clientHeight"]),
},
watch: {
3 years ago
"searchData.searchKey": function (val) {
3 years ago
if (val == "") {
this.searchStatus = "ini";
}
},
},
3 years ago
activated() {
3 years ago
this.getApiData();
3 years ago
3 years ago
this.firstSearch();
3 years ago
},
methods: {
3 years ago
firstSearch() {
this.searchData.searchKey = getQueryPara("searchKey");
3 years ago
this.searchData.type = getQueryPara("type");
this.handleClickSearchBtn();
3 years ago
},
3 years ago
computedWidth(label) {
3 years ago
const wd = 20 * label.length;
return wd > 80 ? wd : 80;
},
3 years ago
handleFilterSpan(row, item) {
3 years ago
let _val = "";
if (item.options && item.options.length > 0) {
item.options.forEach((n) => {
3 years ago
if (n.value == row[item.columnName]) _val = n.label;
3 years ago
});
}
return _val || row[item.columnName];
},
3 years ago
handleClickSearchBtn() {
3 years ago
const {
3 years ago
searchData: { type, searchKey },
3 years ago
} = this;
3 years ago
if (!searchKey) return this.$message.error("请输入搜索条件");
3 years ago
if (type == "jumin") {
this.searchJumin.pageNo = 1;
this.searchJumin.total = 0;
this.getSearchJumin();
} else if (type == "fangwu") {
this.searchFangwu.pageNo = 1;
this.searchFangwu.total = 0;
this.getSearchFangwu();
} else if (type == "xuqiu") {
this.searchXuqiu.pageNo = 1;
this.searchXuqiu.total = 0;
this.getSearchXuqiu();
}
this.searchStatus = "ing";
},
3 years ago
handleSizeChangeSearchJumin(val) {
3 years ago
console.log(`每页 ${val}`);
this.searchJumin.pageSize = val;
window.localStorage.setItem("pageSize", val);
this.getSearchJumin();
},
3 years ago
handleCurrentChangeSearchJumin(val) {
3 years ago
console.log(`当前页: ${val}`);
this.searchJumin.pageNo = val;
this.getSearchJumin();
},
3 years ago
async handleWatchSearchJumin(rowIndex) {
3 years ago
let item = this.searchJumin.list[rowIndex];
3 years ago
this.currentResiId = item.resiId;
3 years ago
await nextTick();
3 years ago
this.showedResiInfo = true;
3 years ago
},
3 years ago
handleSizeChangeSearchFangwu(val) {
3 years ago
console.log(`每页 ${val}`);
this.searchFangwu.pageSize = val;
window.localStorage.setItem("pageSize", val);
this.getSearchFangwu();
},
3 years ago
handleCurrentChangeSearchFangwu(val) {
3 years ago
console.log(`当前页: ${val}`);
this.searchFangwu.pageNo = val;
this.getSearchFangwu();
},
async handleWatchSearchFangwu(rowIndex) {
let item = this.searchFangwu.list[rowIndex];
this.currentHouseId = item.id;
3 years ago
await nextTick();
this.showedHouseInfo = true;
3 years ago
},
3 years ago
getApiData() {},
3 years ago
3 years ago
async getSearchJumin() {
const url = "/actual/base/residentBaseInfo/communitySearch";
3 years ago
const {
3 years ago
searchData: { searchKey },
3 years ago
searchJumin: { pageSize, pageNo },
} = this;
3 years ago
this.searchJumin.loading = true;
3 years ago
const { data, code, msg } = await requestPost(url, {
3 years ago
searchKey,
3 years ago
pageSize,
pageNo,
});
3 years ago
this.searchJumin.loading = false;
3 years ago
if (code === 0) {
console.log("列表请求成功!!!!!!!!!!!!!!");
this.searchJumin.total = data.total || 0;
this.searchJumin.list = data.list
? data.list.map((item) => {
3 years ago
item = { ...item, ...item.categoryInfo };
return item;
})
3 years ago
: [];
} else {
}
},
3 years ago
async getSearchFangwu() {
const url = "/actual/base/communityHouse/communitySearch";
3 years ago
const {
3 years ago
searchData: { searchKey },
3 years ago
searchFangwu: { pageSize, pageNo },
} = this;
3 years ago
this.searchFangwu.loading = true;
3 years ago
const { data, code, msg } = await requestPost(url, {
3 years ago
searchKey,
3 years ago
pageSize,
pageNo,
});
3 years ago
this.searchFangwu.loading = false;
3 years ago
if (code === 0) {
console.log("列表请求成功!!!!!!!!!!!!!!");
this.searchFangwu.total = data.total || 0;
this.searchFangwu.list = data.list
? data.list.map((item) => {
3 years ago
const { houseType, rentFlag, purpose } = item;
item.houseType = {
1: "楼房",
2: "平房",
3: "别墅",
}[houseType];
item.rentFlag = {
0: "自住",
1: "出租",
2: "闲置",
3: "未售出",
}[rentFlag];
item.purpose = {
1: "住宅",
2: "商业",
3: "办公",
4: "工业",
5: "存储",
6: "商住混用",
7: "其它",
}[purpose];
return item;
})
3 years ago
: [];
} else {
}
},
},
};
</script>
3 years ago
<style lang="scss" scoped>
3 years ago
@import "@/assets/scss/modules/management/list-main.scss";
3 years ago
@import "@/assets/scss/c/function";
3 years ago
3 years ago
.m-box {
position: relative;
padding: 24px 16px;
background: #ffffff;
box-shadow: 0px 6px 16px 0px rgba(0, 0, 0, 0.08),
0px 3px 6px -4px rgba(0, 0, 0, 0.12);
border-radius: 2px;
}
3 years ago
.m-dialog {
.el-dialog__body {
position: relative;
max-height: 83vh;
box-sizing: border-box;
padding: 0 0 20px !important;
.dialog-h-content {
max-height: calc(83vh - 80px);
box-sizing: border-box;
padding: 50px 80px;
overflow: auto;
}
}
.resi-btns {
margin-top: 20px;
text-align: center;
text-align: right;
margin-right: 16px;
}
}
3 years ago
.m-search {
box-sizing: border-box;
padding: 40px 80px;
margin-bottom: 16px;
background-size: 100%;
.title {
height: 47px;
font-size: 32px;
font-family: SourceHanSansSC-Medium, SourceHanSansSC;
font-weight: 500;
color: #0056d6;
line-height: 47px;
text-align: center;
}
.tabs {
width: 692px;
margin: 24px auto 0;
display: flex;
align-items: center;
> div {
position: relative;
margin-right: 30px;
width: 56px;
height: 24px;
font-size: 14px;
line-height: 24px;
border-radius: 2px;
color: #0056d6;
text-align: center;
cursor: pointer;
3 years ago
&:hover {
color: $c1_on;
}
3 years ago
&.z-on {
color: #ffffff;
3 years ago
background: $c1;
&:hover {
color: #ffffff;
}
3 years ago
&::after {
content: "";
display: block;
position: absolute;
bottom: -10px;
left: 0;
right: 0;
margin: 0 auto;
width: 0;
height: 0;
border: 5px solid transparent;
3 years ago
border-top: 5px solid $c1;
3 years ago
}
}
}
}
.search {
width: 692px;
margin: 15px auto 0;
display: flex;
align-items: center;
.search-input {
position: relative;
width: 560px;
height: 48px;
background: #ffffff;
border-radius: 4px;
border: 1px solid #0056d6;
display: flex;
.input {
position: relative;
width: calc(100% - 100px);
input {
margin-left: 20px;
width: calc(100% - 10px);
border: none;
height: 44px;
line-height: 44px;
font-family: "思源宋体";
font-size: 16px;
font-weight: 400;
color: #333;
}
.close-btn {
position: absolute;
right: 0;
top: 0;
bottom: 0;
margin: auto 0;
width: 18px;
height: 18px;
background-color: #eee;
border-radius: 100%;
cursor: pointer;
img {
display: block;
margin: 4px auto;
width: 10px;
height: 10px;
opacity: 0.3;
}
}
}
.btn {
margin: 7px 9px 0 auto;
line-height: 32px;
width: 66px;
height: 32px;
background: #0056d6;
border-radius: 2px;
text-align: center;
font-size: 15px;
font-family: Source Han Serif CN;
font-weight: 500;
color: #ffffff;
color: #ffffff;
cursor: pointer;
3 years ago
&:hover {
background: $c1_on;
}
3 years ago
}
}
.btn2 {
margin-left: 35px;
width: 100px;
height: 39px;
line-height: 39px;
border-radius: 6px;
text-align: center;
font-size: 16px;
font-family: Source Han Serif CN;
font-weight: 500;
color: #0056d6;
cursor: pointer;
img {
width: 20px;
height: 20px;
margin-right: 8px;
}
3 years ago
&:hover {
color: $c1_on;
}
3 years ago
}
}
}
</style>