Browse Source

信息采集bug

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

666
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" >
label="所在社区" <el-form-item
prop="orgId"> v-if="communityList.length > 0"
<el-select v-model.trim="fmData.orgId" label="所在社区"
placeholder="所在社区" prop="orgId"
size="small" >
clearable <el-select
class="resi-cell-input"> v-model.trim="fmData.orgId"
<el-option v-for="item in communityList" placeholder="所在社区"
:key="item.orgId" size="small"
:label="item.orgName" clearable
:value="item.orgId"> class="resi-cell-input"
>
<el-option
v-for="item in communityList"
:key="item.orgId"
:label="item.orgName"
: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
size="small" class="diy-button--search"
@click="handleSearch">查询</el-button> size="small"
<el-button class="diy-button--reset" @click="handleSearch"
size="small" >查询</el-button
@click="resetForm('searchForm')">重置</el-button> >
<el-button
class="diy-button--reset"
size="small"
@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
border :data="tableData"
style="width: 100%" border
class="resi-table" style="width: 100%"
:height="tableHeight" class="resi-table"
:span-method="arraySpanMethod"> :height="tableHeight"
<el-table-column label="序号" :span-method="arraySpanMethod"
prop="desc" >
align="center" <el-table-column label="序号" prop="desc" align="center" width="50" />
width="50" /> <el-table-column
<el-table-column prop="houseHolderName" prop="houseHolderName"
width="100" width="100"
label="户主姓名" label="户主姓名"
align="center" /> align="center"
<el-table-column prop="address" :show-overflow-tooltip="true"
align="center" />
min-width="140" <el-table-column
label="居住地址" prop="address"
:show-overflow-tooltip="true" /> align="center"
<el-table-column prop="houseType" min-width="140"
align="center" label="居住地址"
width="100" :show-overflow-tooltip="true"
label="自有/租住"> />
<el-table-column
prop="houseType"
align="center"
width="100"
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
width="80" prop="totalResi"
align="center" width="80"
label="居住人数" /> align="center"
<el-table-column prop="memberName" label="居住人数"
width="100" />
label="成员姓名" <el-table-column
align="center" prop="memberName"
:show-overflow-tooltip="true" /> width="100"
<el-table-column prop="memberIdNum" label="成员姓名"
width="180" align="center"
align="center" :show-overflow-tooltip="true"
label="成员身份证" /> />
<el-table-column prop="memberMobile" <el-table-column
width="140" prop="memberIdNum"
align="center" width="180"
label="成员手机号" /> align="center"
<el-table-column prop="heSuanCount" label="成员身份证"
width="120" :show-overflow-tooltip="true"
align="center" />
label="核酸检测次数" /> <el-table-column
prop="memberMobile"
width="140"
align="center"
label="成员手机号"
:show-overflow-tooltip="true"
/>
<el-table-column
prop="heSuanCount"
width="120"
align="center"
label="核酸检测次数"
/>
<el-table-column prop="ymjz" <el-table-column
width="140" prop="ymjz"
align="center" width="140"
label="疫苗接种情况"> align="center"
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
min-width="140" prop="domicilePlace"
align="center" min-width="140"
label="户籍所在地 " /> align="center"
<el-table-column prop="workPlace" label="户籍所在地"
min-width="120" :show-overflow-tooltip="true"
align="center" />
label="单位或学校 " /> <el-table-column
<!-- <el-table-column prop="organizationCreatedTime" align="center" label="创建时间"> --> prop="workPlace"
min-width="120"
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,115 +199,152 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<div> <div>
<el-pagination @size-change="handleSizeChange" <el-pagination
@current-change="handleCurrentChange" @size-change="handleSizeChange"
:current-page.sync="pageNo" @current-change="handleCurrentChange"
:page-sizes="[20, 50, 100, 200]" :current-page.sync="pageNo"
:page-size="parseInt(pageSize)" :page-sizes="[20, 50, 100, 200]"
layout="sizes, prev, pager, next, total" :page-size="parseInt(pageSize)"
:total="total"> layout="sizes, prev, pager, next, total"
:total="total"
>
</el-pagination> </el-pagination>
</div> </div>
</el-card> </el-card>
<!-- 修改弹出框 --> <!-- 修改弹出框 -->
<el-dialog :visible.sync="formShow" <el-dialog
:close-on-click-modal="false" :visible.sync="formShow"
:close-on-press-escape="false" :close-on-click-modal="false"
title="信息详情" :close-on-press-escape="false"
width="60%" title="信息详情"
top="5vh" width="1100px"
class="dialog-h" top="5vh"
@closed="handleClose"> class="dialog-h"
<div class="scroll-h"> @closed="handleClose"
<el-form ref="ref_form" >
:inline="true" <div class="scroll-h">
:model="dataForm" <el-form
:disabled="true" ref="ref_form"
class="form"> :inline="true"
<el-form-item label="户主姓名:" :model="dataForm"
prop="houseHolderName" :disabled="true"
label-width="150px"> class="form"
<!-- <el-input class="item_width_1" >
<el-form-item
label="户主姓名:"
prop="houseHolderName"
label-width="150px"
>
<!-- <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" <!-- <el-input class="wd50" v-model="dataForm.address">
label-width="150px">
<!-- <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
prop="houseType" label="自有/租住:"
label-width="150px"> prop="houseType"
<!-- <el-input class="item_width_1" label-width="150px"
>
<!-- <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
prop="totalResi" label="居住人数:"
label-width="150px"> prop="totalResi"
<!-- <el-input class="item_width_1" label-width="150px"
>
<!-- <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
<el-table :data="dataForm.list" :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="序号" >
type="index" <el-table-column
align="center" label="序号"
width="50" /> type="index"
<el-table-column prop="memberName" align="center"
width="100" width="50"
label="成员姓名" />
align="center" <el-table-column
:show-overflow-tooltip="true" /> prop="memberName"
<el-table-column prop="memberIdNum" width="100"
width="180" label="成员姓名"
align="center" align="center"
label="成员身份证" /> :show-overflow-tooltip="true"
<el-table-column prop="memberMobile" />
width="140" <el-table-column
align="center" prop="memberIdNum"
label="成员手机号" /> width="180"
<el-table-column prop="heSuanCount" align="center"
width="120" label="成员身份证"
align="center" :show-overflow-tooltip="true"
label="核酸检测次数" /> />
<el-table-column
prop="memberMobile"
width="140"
align="center"
label="成员手机号"
:show-overflow-tooltip="true"
/>
<el-table-column
prop="heSuanCount"
width="120"
align="center"
label="核酸检测次数"
/>
<el-table-column prop="ymjz" <el-table-column
width="140" prop="ymjz"
align="center" width="140"
label="疫苗接种情况"> align="center"
<template slot-scope="scope"> label="疫苗接种情况"
<span v-if="scope.row.ymjz == 1">全程接种</span> >
<span v-if="scope.row.ymjz == 2">未全程接种</span> <template slot-scope="scope">
<span v-if="scope.row.ymjz == 0">未接种</span> <span v-if="scope.row.ymjz == 1">全程接种</span>
</template> <span v-if="scope.row.ymjz == 2">未全程接种</span>
</el-table-column> <span v-if="scope.row.ymjz == 0">未接种</span>
<el-table-column prop="domicilePlace" </template>
min-width="140" </el-table-column>
align="center" <el-table-column
label="户籍所在地 " /> prop="domicilePlace"
<el-table-column prop="workPlace" min-width="140"
min-width="120" align="center"
align="center" label="户籍所在地 "
label="单位或学校 " /> :show-overflow-tooltip="true"
<!-- <el-table-column prop="organizationCreatedTime" align="center" label="创建时间"> --> />
</el-table> <el-table-column
</div> prop="workPlace"
min-width="120"
align="center"
label="单位或学校 "
:show-overflow-tooltip="true"
/>
<el-table-column
prop="remark"
align="center"
label="备注"
:show-overflow-tooltip="true"
>
</el-table-column>
</el-table>
</div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@ -272,7 +356,7 @@ import { mapGetters } from "vuex";
import axios from "axios"; import axios from "axios";
export default { export default {
data () { data() {
return { return {
openSearch: false, openSearch: false,
@ -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,15 +384,15 @@ 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) {
if (Array.isArray(val) && val.length == 2) { if (Array.isArray(val) && val.length == 2) {
this.fmData.startTime = val[0]; this.fmData.startTime = val[0];
this.fmData.endTime = val[1]; this.fmData.endTime = val[1];
@ -318,32 +402,39 @@ 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,
@ -376,33 +467,33 @@ export default {
return this.$message.error("网络错误"); return this.$message.error("网络错误");
}); });
}, },
handleSizeChange (val) { handleSizeChange(val) {
console.log(`每页 ${val}`); console.log(`每页 ${val}`);
this.pageSize = val; this.pageSize = val;
window.localStorage.setItem("pageSize", val); window.localStorage.setItem("pageSize", val);
this.getTableData(); this.getTableData();
}, },
handleCurrentChange (val) { handleCurrentChange(val) {
console.log(`当前页: ${val}`); console.log(`当前页: ${val}`);
this.pageNo = val; this.pageNo = val;
this.getTableData(); this.getTableData();
}, },
handleClose () { handleClose() {
this.formShow = false; this.formShow = false;
}, },
handleSearch (val) { handleSearch(val) {
console.log(this.fmData); console.log(this.fmData);
this.pageNo = 1; this.pageNo = 1;
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) {
// this.formShow = true; // this.formShow = true;
await nextTick(); await nextTick();
const url = "/epmetuser/icresicollect/detail"; const url = "/epmetuser/icresicollect/detail";
@ -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 {
@ -421,17 +515,17 @@ export default {
} }
}, },
async handleEdit (rowIndex) { async handleEdit(rowIndex) {
this.formShow = true; this.formShow = true;
await nextTick(); await nextTick();
this.$refs.eleEditForm.initForm("edit", this.tableData[rowIndex]); this.$refs.eleEditForm.initForm("edit", this.tableData[rowIndex]);
}, },
handleEditSuccess () { handleEditSuccess() {
this.handleClose(); this.handleClose();
this.getTableData(); this.getTableData();
}, },
async handleDel (rowData, rowIndex) { async handleDel(rowData, rowIndex) {
console.log(rowData, rowIndex); console.log(rowData, rowIndex);
const url = const url =
"/heart/iccommunityselforganization/delcommunityselforganization"; "/heart/iccommunityselforganization/delcommunityselforganization";
@ -448,19 +542,17 @@ export default {
this.$message.success("操作失败!"); this.$message.success("操作失败!");
} }
}, },
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;
// if (index === data.list.length - 1) firstIndex = _i - item.list.length arr.push(_i);
return { console.log("_i-----", _i, arr);
firstIndex: _i, // if (index === data.list.length - 1) firstIndex = _i - item.list.length
len: item.list.length return {
} firstIndex: _i,
}) len: item.list.length,
this.tableData = data.list && this.formatArr(data.list) };
console.log('tableData----0', this.spanIndex) });
this.tableData = data.list && this.formatArr(data.list);
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:
return { n.list.length > 0
? n.list.map((i) => {
...n, return {
...i, ...n,
desc: index + 1, ...i,
list: [] desc: index + 1,
} 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