Browse Source

信息采集bug

shibei_master
dai 3 years ago
parent
commit
dade8bb9e3
  1. 396
      src/views/modules/base/collect.vue

396
src/views/modules/base/collect.vue

@ -1,144 +1,191 @@
<template> <template>
<div class="resi-container"> <div class="resi-container">
<el-card ref="searchCard" <el-card ref="searchCard" class="search-card">
class="search-card"> <el-form
<el-form ref="searchForm" ref="searchForm"
:inline="true" :inline="true"
:model="fmData" :model="fmData"
class="demo-form-inline"> class="demo-form-inline"
<el-form-item v-if="communityList.length > 0" >
<el-form-item
v-if="communityList.length > 0"
label="所在社区" label="所在社区"
prop="orgId"> prop="orgId"
<el-select v-model.trim="fmData.orgId" >
<el-select
v-model.trim="fmData.orgId"
placeholder="所在社区" placeholder="所在社区"
size="small" size="small"
clearable clearable
class="resi-cell-input"> class="resi-cell-input"
<el-option v-for="item in communityList" >
<el-option
v-for="item in communityList"
:key="item.orgId" :key="item.orgId"
:label="item.orgName" :label="item.orgName"
:value="item.orgId"> :value="item.orgId"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="居住地址" <el-form-item label="居住地址" prop="address">
prop="address"> <el-input
<el-input v-model="fmData.address" v-model="fmData.address"
class="resi-cell-input" class="resi-cell-input"
size="small" size="small"
clearable clearable
placeholder="请输入"> placeholder="请输入"
>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="填写时间" <el-form-item label="填写时间" prop="startTime">
prop="startTime"> <el-date-picker
<el-date-picker v-model="timeRange" v-model="timeRange"
type="daterange" type="daterange"
clearable clearable
size="small" size="small"
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
value-format="yyyy-MM-dd"> value-format="yyyy-MM-dd"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="户籍地址" <el-form-item label="户籍地址" prop="domicilePlace">
prop="domicilePlace"> <el-input
<el-input v-model="fmData.domicilePlace" v-model="fmData.domicilePlace"
class="resi-cell-input" class="resi-cell-input"
size="small" size="small"
clearable clearable
placeholder="请输入"> placeholder="请输入"
>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button class="diy-button--search" <el-button
class="diy-button--search"
size="small" size="small"
@click="handleSearch">查询</el-button> @click="handleSearch"
<el-button class="diy-button--reset" >查询</el-button
>
<el-button
class="diy-button--reset"
size="small" size="small"
@click="resetForm('searchForm')">重置</el-button> @click="resetForm('searchForm')"
>重置</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
<el-card class="resi-card-table"> <el-card class="resi-card-table">
<div class="resi-row-btn"> <div class="resi-row-btn">
<el-button @click="handleChu" class="diy-button--reset" size="small"
<el-button @click="handleChu" >导出</el-button
class="diy-button--reset" >
size="small">导出</el-button>
</div> </div>
<el-table :data="tableData" <el-table
:data="tableData"
border border
style="width: 100%" style="width: 100%"
class="resi-table" class="resi-table"
:height="tableHeight" :height="tableHeight"
:span-method="arraySpanMethod"> :span-method="arraySpanMethod"
<el-table-column label="序号" >
prop="desc" <el-table-column label="序号" prop="desc" align="center" width="50" />
align="center" <el-table-column
width="50" /> prop="houseHolderName"
<el-table-column prop="houseHolderName"
width="100" width="100"
label="户主姓名" label="户主姓名"
align="center" /> align="center"
<el-table-column prop="address" :show-overflow-tooltip="true"
/>
<el-table-column
prop="address"
align="center" align="center"
min-width="140" min-width="140"
label="居住地址" label="居住地址"
:show-overflow-tooltip="true" /> :show-overflow-tooltip="true"
<el-table-column prop="houseType" />
<el-table-column
prop="houseType"
align="center" align="center"
width="100" width="100"
label="自有/租住"> label="自有/租住"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span> <span v-if="scope.row.houseType == 1">出租</span>
{{ scope.row.houseType == '1' ? '自有' : '租住' }} <span v-if="scope.row.houseType == 2">闲置</span>
</span> <span v-if="scope.row.houseType == 3">未售出</span>
<span v-if="scope.row.houseType == 0">自住</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="totalResi" <el-table-column
prop="totalResi"
width="80" width="80"
align="center" align="center"
label="居住人数" /> label="居住人数"
<el-table-column prop="memberName" />
<el-table-column
prop="memberName"
width="100" width="100"
label="成员姓名" label="成员姓名"
align="center" align="center"
:show-overflow-tooltip="true" /> :show-overflow-tooltip="true"
<el-table-column prop="memberIdNum" />
<el-table-column
prop="memberIdNum"
width="180" width="180"
align="center" align="center"
label="成员身份证" /> label="成员身份证"
<el-table-column prop="memberMobile" :show-overflow-tooltip="true"
/>
<el-table-column
prop="memberMobile"
width="140" width="140"
align="center" align="center"
label="成员手机号" /> label="成员手机号"
<el-table-column prop="heSuanCount" :show-overflow-tooltip="true"
/>
<el-table-column
prop="heSuanCount"
width="120" width="120"
align="center" align="center"
label="核酸检测次数" /> label="核酸检测次数"
/>
<el-table-column prop="ymjz" <el-table-column
prop="ymjz"
width="140" width="140"
align="center" align="center"
label="疫苗接种情况"> label="疫苗接种情况"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.ymjz == 1">全程接种</span> <span v-if="scope.row.ymjz == 1">全程接种</span>
<span v-if="scope.row.ymjz == 2">未全程接种</span> <span v-if="scope.row.ymjz == 2">未全程接种</span>
<span v-if="scope.row.ymjz == 0">未接种</span> <span v-if="scope.row.ymjz == 0">未接种</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="domicilePlace" <el-table-column
prop="domicilePlace"
min-width="140" min-width="140"
align="center" align="center"
label="户籍所在地 " /> label="户籍所在地"
<el-table-column prop="workPlace" :show-overflow-tooltip="true"
/>
<el-table-column
prop="workPlace"
min-width="120" min-width="120"
align="center" align="center"
label="单位或学校 " /> label="单位或学校 "
<!-- <el-table-column prop="organizationCreatedTime" align="center" label="创建时间"> --> :show-overflow-tooltip="true"
/>
<el-table-column
prop="remark"
align="center"
label="备注"
:show-overflow-tooltip="true"
>
</el-table-column>
<el-table-column label="操作" align="center" width="100"> <el-table-column label="操作" align="center" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -152,113 +199,150 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<div> <div>
<el-pagination @size-change="handleSizeChange" <el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page.sync="pageNo" :current-page.sync="pageNo"
:page-sizes="[20, 50, 100, 200]" :page-sizes="[20, 50, 100, 200]"
:page-size="parseInt(pageSize)" :page-size="parseInt(pageSize)"
layout="sizes, prev, pager, next, total" layout="sizes, prev, pager, next, total"
:total="total"> :total="total"
>
</el-pagination> </el-pagination>
</div> </div>
</el-card> </el-card>
<!-- 修改弹出框 --> <!-- 修改弹出框 -->
<el-dialog :visible.sync="formShow" <el-dialog
:visible.sync="formShow"
:close-on-click-modal="false" :close-on-click-modal="false"
:close-on-press-escape="false" :close-on-press-escape="false"
title="信息详情" title="信息详情"
width="60%" width="1100px"
top="5vh" top="5vh"
class="dialog-h" class="dialog-h"
@closed="handleClose"> @closed="handleClose"
>
<div class="scroll-h"> <div class="scroll-h">
<el-form ref="ref_form" <el-form
ref="ref_form"
:inline="true" :inline="true"
:model="dataForm" :model="dataForm"
:disabled="true" :disabled="true"
class="form"> class="form"
<el-form-item label="户主姓名:" >
<el-form-item
label="户主姓名:"
prop="houseHolderName" prop="houseHolderName"
label-width="150px"> label-width="150px"
>
<!-- <el-input class="item_width_1" <!-- <el-input class="item_width_1"
v-model="dataForm.houseHolderName"> v-model="dataForm.houseHolderName">
</el-input> --> </el-input> -->
<div class="wd50">{{ dataForm.houseHolderName }}</div> <div class="wd50">{{ dataForm.houseHolderName }}</div>
</el-form-item> </el-form-item>
<el-form-item label="居住地址:" <el-form-item label="居住地址:" prop="address" label-width="150px">
prop="address"
label-width="150px">
<!-- <el-input class="wd50" v-model="dataForm.address"> <!-- <el-input class="wd50" v-model="dataForm.address">
</el-input> --> </el-input> -->
<div class="wd50">{{ dataForm.address }}</div> <div class="wd50">{{ dataForm.address }}</div>
</el-form-item> </el-form-item>
<div> <div>
<el-form-item label="自有/租住:" <el-form-item
label="自有/租住:"
prop="houseType" prop="houseType"
label-width="150px"> label-width="150px"
>
<!-- <el-input class="item_width_1" <!-- <el-input class="item_width_1"
v-model="dataForm.houseType"> v-model="dataForm.houseType">
</el-input> --> </el-input> -->
<div class="wd50">{{ dataForm.houseType }}</div> <div class="wd50">{{ dataForm.houseType }}</div>
</el-form-item> </el-form-item>
<el-form-item label="居住人数:" <el-form-item
label="居住人数:"
prop="totalResi" prop="totalResi"
label-width="150px"> label-width="150px"
>
<!-- <el-input class="item_width_1" <!-- <el-input class="item_width_1"
v-model="dataForm.totalResi"> v-model="dataForm.totalResi">
</el-input> --> </el-input> -->
<div class="wd50">{{ dataForm.totalResi }}</div> <div class="wd50">{{ dataForm.totalResi }}</div>
</el-form-item> </el-form-item>
</div> </div>
</el-form> </el-form>
<el-table :data="dataForm.list" <el-table
:data="dataForm.list"
border border
style="width: 100%" style="width: 1060px; margin: 20px"
class="resi-table" class="resi-table"
:height="tableHeight"> :height="tableHeight"
<el-table-column label="序号" >
<el-table-column
label="序号"
type="index" type="index"
align="center" align="center"
width="50" /> width="50"
<el-table-column prop="memberName" />
<el-table-column
prop="memberName"
width="100" width="100"
label="成员姓名" label="成员姓名"
align="center" align="center"
:show-overflow-tooltip="true" /> :show-overflow-tooltip="true"
<el-table-column prop="memberIdNum" />
<el-table-column
prop="memberIdNum"
width="180" width="180"
align="center" align="center"
label="成员身份证" /> label="成员身份证"
<el-table-column prop="memberMobile" :show-overflow-tooltip="true"
/>
<el-table-column
prop="memberMobile"
width="140" width="140"
align="center" align="center"
label="成员手机号" /> label="成员手机号"
<el-table-column prop="heSuanCount" :show-overflow-tooltip="true"
/>
<el-table-column
prop="heSuanCount"
width="120" width="120"
align="center" align="center"
label="核酸检测次数" /> label="核酸检测次数"
/>
<el-table-column prop="ymjz" <el-table-column
prop="ymjz"
width="140" width="140"
align="center" align="center"
label="疫苗接种情况"> label="疫苗接种情况"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.ymjz == 1">全程接种</span> <span v-if="scope.row.ymjz == 1">全程接种</span>
<span v-if="scope.row.ymjz == 2">未全程接种</span> <span v-if="scope.row.ymjz == 2">未全程接种</span>
<span v-if="scope.row.ymjz == 0">未接种</span> <span v-if="scope.row.ymjz == 0">未接种</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="domicilePlace" <el-table-column
prop="domicilePlace"
min-width="140" min-width="140"
align="center" align="center"
label="户籍所在地 " /> label="户籍所在地 "
<el-table-column prop="workPlace" :show-overflow-tooltip="true"
/>
<el-table-column
prop="workPlace"
min-width="120" min-width="120"
align="center" align="center"
label="单位或学校 " /> label="单位或学校 "
<!-- <el-table-column prop="organizationCreatedTime" align="center" label="创建时间"> --> :show-overflow-tooltip="true"
/>
<el-table-column
prop="remark"
align="center"
label="备注"
:show-overflow-tooltip="true"
>
</el-table-column>
</el-table> </el-table>
</div> </div>
</el-dialog> </el-dialog>
@ -284,13 +368,13 @@ export default {
total: 1, total: 1,
tableData: [], tableData: [],
timeRange: '', timeRange: "",
fmData: { fmData: {
orgId: '', orgId: "",
startTime: "", startTime: "",
endTime: "", endTime: "",
address: '', address: "",
domicilePlace: '' domicilePlace: "",
}, },
dataForm: {}, dataForm: {},
communityList: [], communityList: [],
@ -300,12 +384,12 @@ export default {
}; };
}, },
computed: { computed: {
...mapGetters(['clientHeight', 'iframeHeight']), ...mapGetters(["clientHeight", "iframeHeight"]),
tableHeight() { tableHeight() {
const h = this.clientHeight - 360 + this.iframeHeigh const h = this.clientHeight - 360 + this.iframeHeigh;
const _h = this.clientHeight - 360 const _h = this.clientHeight - 360;
return this.$store.state.inIframe ? h : _h return this.$store.state.inIframe ? h : _h;
} },
}, },
watch: { watch: {
timeRange(val) { timeRange(val) {
@ -319,31 +403,38 @@ export default {
}, },
}, },
mounted() { mounted() {
this.getcommunityList() this.getcommunityList();
this.getTableData(); this.getTableData();
}, },
methods: { methods: {
arraySpanMethod({ row, column, rowIndex, columnIndex }) { arraySpanMethod({ row, column, rowIndex, columnIndex }) {
// console.log('row-----r', row) // console.log('row-----r', row)
// console.log('column-----c', column) // console.log('column-----c', column)
if (columnIndex === 0 || columnIndex === 1 || columnIndex === 2 || columnIndex === 3 || columnIndex === 4) { if (
let index = this.spanIndex.findIndex(item => item.firstIndex === rowIndex) columnIndex === 0 ||
columnIndex === 1 ||
columnIndex === 2 ||
columnIndex === 3 ||
columnIndex === 4
) {
let index = this.spanIndex.findIndex(
(item) => item.firstIndex === rowIndex
);
if (index > -1) { if (index > -1) {
return { return {
rowspan: this.spanIndex[index].len, rowspan: this.spanIndex[index].len,
colspan: 1 colspan: 1,
}; };
} else { } else {
return { return {
rowspan: 0, rowspan: 0,
colspan: 0 colspan: 0,
}; };
} }
} }
}, },
async handleChu() { async handleChu() {
const url = const url = "/epmetuser/icresicollect/export";
"/epmetuser/icresicollect/export";
const { pageSize, pageNo, fmData } = this; const { pageSize, pageNo, fmData } = this;
axios({ axios({
url: window.SITE_CONFIG["apiURL"] + url, url: window.SITE_CONFIG["apiURL"] + url,
@ -397,9 +488,9 @@ export default {
this.getTableData(); this.getTableData();
}, },
resetForm(formName) { resetForm(formName) {
this.$refs[formName].resetFields() this.$refs[formName].resetFields();
this.timeRange = '' this.timeRange = "";
this.handleSearch() this.handleSearch();
}, },
async handleWatch(row) { async handleWatch(row) {
@ -412,8 +503,11 @@ export default {
}); });
if (code === 0) { if (code === 0) {
console.log('data----de', data) console.log("data----de", data);
this.dataForm = { ...data, houseType: data.houseType == '1' ? '自有' : '租住' } this.dataForm = {
...data,
houseType: data.houseType == "1" ? "自有" : "租住",
};
// this.getTableData(); // this.getTableData();
this.formShow = true; this.formShow = true;
} else { } else {
@ -449,18 +543,16 @@ export default {
} }
}, },
async getcommunityList() { async getcommunityList() {
const url = const url = "/gov/org/agency/community-list";
"/gov/org/agency/community-list";
const { data, code, msg } = await requestPost(url); const { data, code, msg } = await requestPost(url);
if (code === 0) { if (code === 0) {
console.log("列表请求成功!!!!!!!!!!!!!!"); console.log("列表请求成功!!!!!!!!!!!!!!");
this.communityList = data this.communityList = data;
} else { } else {
} }
}, },
async getTableData() { async getTableData() {
const url = const url = "/epmetuser/icresicollect/list";
"/epmetuser/icresicollect/list";
const { pageSize, pageNo, fmData } = this; const { pageSize, pageNo, fmData } = this;
const { data, code, msg } = await requestPost(url, { const { data, code, msg } = await requestPost(url, {
pageSize, pageSize,
@ -470,47 +562,51 @@ export default {
if (code === 0) { if (code === 0) {
console.log("列表请求成功!!!!!!!!!!!!!!"); console.log("列表请求成功!!!!!!!!!!!!!!");
this.total = data.total || 0; this.total = data.total || 0;
let _i = 0 let _i = 0;
let arr = [] let arr = [];
this.spanIndex = data.list && data.list.map((item, index) => { this.spanIndex =
if (index == 0) _i = 0 data.list &&
else _i = _i + data.list[index - 1].list.length data.list.map((item, index) => {
arr.push(_i) if (index == 0) _i = 0;
console.log('_i-----', _i, arr) else _i = _i + data.list[index - 1].list.length;
arr.push(_i);
console.log("_i-----", _i, arr);
// if (index === data.list.length - 1) firstIndex = _i - item.list.length // if (index === data.list.length - 1) firstIndex = _i - item.list.length
return { return {
firstIndex: _i, firstIndex: _i,
len: item.list.length len: item.list.length,
} };
}) });
this.tableData = data.list && this.formatArr(data.list) this.tableData = data.list && this.formatArr(data.list);
console.log('tableData----0', this.spanIndex) console.log("tableData----0", this.spanIndex);
} else { } else {
} }
}, },
// //
formatArr(arr) { formatArr(arr) {
let res = [] let res = [];
let arr1 = arr.map((n, index) => { let arr1 = arr.map((n, index) => {
return { return {
...n, ...n,
list: n.list.length > 0 ? n.list.map(i => { list:
n.list.length > 0
? n.list.map((i) => {
return { return {
...n, ...n,
...i, ...i,
desc: index + 1, desc: index + 1,
list: [] list: [],
} };
}) : []
}
}) })
arr1.forEach(item => { : [],
};
});
arr1.forEach((item) => {
if (item.list && item.list.length > 0) { if (item.list && item.list.length > 0) {
res = res.concat(this.formatArr(item.list)) res = res.concat(this.formatArr(item.list));
} else res.push(item) } else res.push(item);
}) });
return res return res;
}, },
}, },
}; };

Loading…
Cancel
Save