Browse Source

更换居民分类统计列表接口

v1.1
战立标 2 years ago
parent
commit
42b85fac36
  1. 648
      src/views/dataBoard/renfang/resi/class.vue

648
src/views/dataBoard/renfang/resi/class.vue

@ -1,344 +1,330 @@
<template> <template>
<div class="g-pgi"> <div class="g-pgi">
<!-- 组织路由 --> <!-- 组织路由 -->
<cpt-bread :separator="'/'" @tap="handleClickBreadItem" :breadList="breadList"></cpt-bread> <cpt-bread :breadList="breadList" :separator="'/'" @tap="handleClickBreadItem"></cpt-bread>
<div class="m-title"> <div class="m-title">
<img class="title_img" src="@/assets/images/index/list-logo.png" alt /> <img alt class="title_img" src="@/assets/images/index/list-logo.png"/>
<div class="tip_title">{{ tableTitle }}</div> <div class="tip_title">{{ tableTitle }}</div>
<div class="title_line"></div> <div class="title_line"></div>
<div class="second-select" v-if="type_id == 'special_popu'"> <div v-if="type_id == 'special_popu'" class="second-select">
<el-select v-model="subclassId" :popper-append-to-body="false" placeholder="请选择"> <el-select v-model="subclassId" :popper-append-to-body="false" placeholder="请选择">
<el-option v-for="item in subclassList" :key="item.value" :label="item.label" :value="item.value" @click.native="handleChangeDate(item.value)"></el-option> <el-option v-for="item in subclassList" :key="item.value" :label="item.label" :value="item.value"
</el-select> @click.native="handleChangeDate(item.value)"></el-option>
</div> </el-select>
</div> </div>
</div>
<div class="g-listbox">
<cpt-tb <div class="g-listbox">
:col-list="colList" <cpt-tb
:loading="loading" :col-list="colList"
:header="header" :header="header"
:list="list" :list="list"
:total="total" :loading="loading"
@handleSizeChange="handleSizeChange" :total="total"
@handlePageNoChange="handlePageNoChange" @handlePageNoChange="handlePageNoChange"
@operate="showInfo" @handleSizeChange="handleSizeChange"
></cpt-tb> @operate="showInfo"
</div> ></cpt-tb>
</div>
<resi-details @close="displayedResiId = ''" :resi-id="displayedResiId" :popupShow="popupShow" v-if="displayedResiId" />
</div> <resi-details v-if="displayedResiId" :popupShow="popupShow" :resi-id="displayedResiId"
@close="displayedResiId = ''"/>
</div>
</template> </template>
<script> <script>
import cptTb from '@/views/dataBoard/cpts/tb'; import cptTb from '@/views/dataBoard/cpts/tb';
import cptBread from '@/views/dataBoard/renfang/cpts/bread'; import cptBread from '@/views/dataBoard/renfang/cpts/bread';
import resiDetails from '@/views/dataBoard/cpts/resi-details'; import resiDetails from '@/views/dataBoard/cpts/resi-details';
import { requestPostBi } from '@/js/dai/request-bipass'; // import { requestPostBi } from '@/js/dai/request-bipass';
import getQueryPara from 'dai-js/modules/getQueryPara'; import getQueryPara from 'dai-js/modules/getQueryPara';
import {requestPost} from "@/js/dai/request";
export default { export default {
name: 'resi-list', name: 'resi-list',
components: { components: {
cptTb, cptTb,
cptBread, cptBread,
resiDetails resiDetails
}, },
data() { data() {
return { return {
breadList: [ breadList: [
{ {
type: 'back', type: 'back',
meta: { meta: {
title: '人房总览' title: '人房总览'
} }
}, },
{ {
meta: { meta: {
title: '居民类别' title: '居民类别'
} }
} }
], ],
tableTitle: '居民类别', tableTitle: '居民类别',
searchName: '', searchName: '',
pageType: '', pageType: '',
orgLevel: '', orgLevel: '',
org_id: '', org_id: '',
type_id: '', // type_id: '', //
type_name: '', type_name: '',
loading: true, loading: true,
pageSize: parseInt(localStorage.getItem('dataBoard_PageSize')) || 20, pageSize: parseInt(localStorage.getItem('dataBoard_PageSize')) || 20,
pageNo: 1, pageNo: 1,
total: 0, total: 0,
srcTableData: [], srcTableData: [],
list: [], list: [],
colList: [ colList: [
{ {
align: 'left', align: 'left',
width: '5%' width: '5%'
}, },
{ {
align: 'left', align: 'left',
width: '10%' width: '10%'
}, },
{ {
align: 'left', align: 'left',
width: '20%' width: '20%'
}, },
{ {
align: 'left', align: 'left',
width: '20%' width: '20%'
}, },
{ {
align: 'left', align: 'left',
width: '15%' width: '15%'
}, },
{ {
align: 'left', align: 'left',
width: '10%' width: '10%'
}, },
{ {
align: 'left', align: 'left',
width: '5%' width: '5%'
}, },
{ {
align: 'left', align: 'left',
width: '10%' width: '10%'
}, },
{ {
align: 'left', align: 'left',
width: '10%' width: '10%'
} }
], ],
header: ['序号', '姓名', '所属网格', '所属房屋', '联系电话', '证件号', '性别', '出生日期', '操作'], header: ['序号', '姓名', '所属网格', '所属房屋', '联系电话', '证件号', '性别', '出生日期', '操作'],
displayedResiId: '', displayedResiId: '',
subclassList: [], subclassList: [],
subclassId: '', subclassId: '',
popupShow:false popupShow: false
}; };
}, },
activated() { activated() {
this.org_id = getQueryPara('org_id'); this.org_id = getQueryPara('org_id');
this.type_id = getQueryPara('type_id'); this.type_id = getQueryPara('type_id');
this.pageType = getQueryPara('pageType'); this.pageType = getQueryPara('pageType');
this.type_name = getQueryPara('type_name'); this.type_name = getQueryPara('type_name');
const type_name = getQueryPara('type_name'); const type_name = getQueryPara('type_name');
this.breadList[1].meta.title = type_name + '居民列表'; this.breadList[1].meta.title = type_name + '居民列表';
this.tableTitle = type_name + '居民列表'; this.tableTitle = type_name + '居民列表';
this.pageNo = 1; this.pageNo = 1;
this.getList(); this.getList();
this.getCount(); // this.getCount();
if (this.type_id == 'special_popu') { if (this.type_id == 'special_popu') {
this.getSubclass(); this.getSubclass();
} }
}, },
created() { created() {
this.pageNo = 1; this.pageNo = 1;
}, },
watch: { watch: {
$route(to, from) { $route(to, from) {
this.$router.go(0); this.$router.go(0);
}, },
subclassId: { subclassId: {
handler(newVal, oldVal) { handler(newVal, oldVal) {
this.pageNo = 1; this.pageNo = 1;
this.getList(); this.getList();
this.getCount(); this.getCount();
} }
} }
}, },
methods: { methods: {
handleClickBreadItem({ item }) { handleClickBreadItem({item}) {
if (item.type == 'back') { if (item.type == 'back') {
this.$router.back(); this.$router.back();
} }
}, },
handleSearch() {}, handleSearch() {
},
showInfo(index) {
let item = this.srcTableData[index]; showInfo(index) {
this.displayedResiId = item.user_id; let item = this.srcTableData[index];
this.popupShow = true; this.displayedResiId = item.resiId;
}, this.popupShow = true;
},
handlePageNoChange(pageNo) {
this.pageNo = pageNo; handlePageNoChange(pageNo) {
this.getList(); this.pageNo = pageNo;
}, this.getList();
},
handleSizeChange(pageSize) {
localStorage.setItem('dataBoard_PageSize', pageSize); handleSizeChange(pageSize) {
this.pageSize = pageSize; localStorage.setItem('dataBoard_PageSize', pageSize);
this.getList(); this.pageSize = pageSize;
}, this.getList();
},
async getSubclass() {
console.log('=================getSubclass'); async getSubclass() {
const { org_id, type_id } = this; console.log('=================getSubclass');
this.loading = true; const {org_id, type_id} = this;
this.loading = true;
const url = 'special_type_list';
const url = 'special_type_list';
const { data, code, msg } = await requestPostBi(
url, const {data, code, msg} = await requestPostBi(
{ url,
queryParam: { {
org_id, queryParam: {
type_id org_id,
} type_id
}, }
{ },
// mockId: 62648939, {
} // mockId: 62648939,
); }
);
this.loading = false;
this.loading = false;
if (code === 0) {
this.subclassList = data.map((item, index) => { if (code === 0) {
return { this.subclassList = data.map((item, index) => {
label: item.type_name, return {
value: item.type_id label: item.type_name,
}; value: item.type_id
}); };
} else { });
this.$message.error(msg); } else {
} this.$message.error(msg);
}, }
},
async getList() {
const { org_id, type_id, subclassId, pageNo, pageSize } = this; async getList() {
this.loading = true; const {org_id, type_id, subclassId, pageNo, pageSize} = this;
let url = ''; this.loading = true;
let queryParam = {}; let url = '/actual/base/residentBaseInfo/page';
if (this.pageType == 'normal') { let queryParam = {
url = 'resident_class_list'; org_id,
queryParam = { categoryKey: subclassId || type_id,
org_id, pageNo,
type_id: subclassId || type_id, pageSize
pageNo, };
pageSize /* if (this.pageType == 'normal') {
}; url = 'resident_class_list';
} else { queryParam = {
url = 'resident_class_predict_list'; org_id,
queryParam = { type_id: subclassId || type_id,
org_id, pageNo,
resi_class_name: this.type_name, pageSize
page_num: pageNo, };
page_size: pageSize } else {
}; url = 'resident_class_predict_list';
} queryParam = {
org_id,
const { data, code, msg } = await requestPostBi( resi_class_name: this.type_name,
url, page_num: pageNo,
{ page_size: pageSize
queryParam };
}, }*/
{
// mockId: 60069169, const {data, code, msg} = await requestPost(
} url,
); queryParam
);
this.loading = false;
this.loading = false;
if (code === 0) {
this.srcTableData = data; if (code === 0) {
// this.total = data.total; this.srcTableData = data.list;
if (this.pageType == 'normal') { this.total = data.total;
this.list = data.map((item, index) => { this.list = data.list.map((item, index) => {
return [ return [
index + 1, index + 1,
item.user_name ? item.user_name : '--', item.name ? item.name : '--',
item.grid ? item.grid : '--', item.gridName ? item.gridName : '--',
item.house ? item.house : '--', item.homeName ? item.homeName : '--',
item.telephone ? item.telephone : '--', item.mobile ? item.mobile : '--',
item.idcard ? item.idcard : '--', item.idNum ? item.idNum : '--',
item.gender ? item.gender : '--', item.gender == 1 ? '男' : item.gender == '2' ? '女' : '--',
item.birthday ? item.birthday : '--', item.birthday ? item.birthday : '--',
{type: 'operate', list: ['查看']}
{ type: 'operate', list: ['查看'] } ];
]; });
}); } else {
} else { this.$message.error(msg);
this.list = data.map((item, index) => { }
return [ },
index + 1,
item.name ? item.name : '--', async getCount() {
item.grid ? item.grid : '--', const {org_id, type_id, subclassId, pageNo, pageSize} = this;
item.room ? item.room : '--',
item.telephone ? item.telephone : '--', let url = '';
item.idcard ? item.idcard : '--', let queryParam = {};
item.gender ? item.gender : '--',
item.birthday ? item.birthday : '--', if (this.pageType == 'normal') {
url = 'resident_class_list_total';
{ type: 'operate', list: ['查看'] } queryParam = {
]; org_id,
}); type_id: subclassId || type_id,
} pageNo,
} else { pageSize
this.$message.error(msg); };
} } else {
}, url = 'resident_class_predict_total';
queryParam = {
async getCount() { org_id,
const { org_id, type_id, subclassId, pageNo, pageSize } = this; resi_class_name: this.type_name,
page_num: pageNo,
let url = ''; page_size: pageSize
let queryParam = {}; };
}
if (this.pageType == 'normal') {
url = 'resident_class_list_total'; const {data, code, msg} = await requestPostBi(
queryParam = { url,
org_id, {
type_id: subclassId || type_id, queryParam
pageNo, },
pageSize {
}; // mockId: 63070913,
} else { }
url = 'resident_class_predict_total'; );
queryParam = {
org_id, if (code === 0) {
resi_class_name: this.type_name, this.total = parseInt(data[0].count);
page_num: pageNo, } else {
page_size: pageSize this.$message.error(msg);
}; }
} }
},
const { data, code, msg } = await requestPostBi(
url, destroyed() {
{ console.log('我已经离开了!');
queryParam }
},
{
// mockId: 63070913,
}
);
if (code === 0) {
this.total = parseInt(data[0].count);
} else {
this.$message.error(msg);
}
}
},
destroyed() {
console.log('我已经离开了!');
}
}; };
</script> </script>
<style lang="scss" src="@/assets/scss/dataBoard/listBox.scss" scoped></style> <style lang="scss" scoped src="@/assets/scss/dataBoard/listBox.scss"></style>

Loading…
Cancel
Save