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

1522 lines
52 KiB

<template>
<div class="g-main">
<div :style="{ height: rowHeight }" class="div_tree">
<el-input placeholder="输入关键字进行过滤" v-model.trim="filterText" @keydown.native.enter="handleChangeSerch()">
</el-input>
<el-scrollbar :style="{ height: treeHeight }" class="scrollar">
<el-tree ref="ref_tree" v-loading="treeLoading" class="filter_tree" :data="treeData" :props="defaultProps"
:highlight-current="true" node-key="id" :expand-on-click-node="false" :filter-node-method="filterNode"
@node-click="handleNodeClick" lazy :auto-expand-parent="true" :default-expanded-keys="autoOpenArr"
:load="lazyLoadTree" >
<div slot-scope="{ node, data }" class="custom-tree-node">
<!-- <img
v-if="showIcons(data)"
src="@/assets/images/index/abnormal.png"
style="
height: 14px;
width: 14px;
margin-right: 5px;
margin-top: -3px;
"
/> -->
<!-- <span v-if="data.level==='building'&&!data.showIcon"
style="padding-left:20px;">{{ ' ' }}</span> -->
<!-- <span v-if="data.showIcon" :id="data.id"
>{{ data.label + "(" }}
<span style="color: red">{{ data.showNum }}</span>
<span>{{ ")" }}</span>
</span> -->
<el-tooltip :content="tooltipTitle" :disabled="isShowTooltip" placement="top" effect="dark">
<span class="over-ellipsis" @mouseover="mouseOverNode($event)">
{{ node.label }}
</span>
</el-tooltip>
<!-- <span :id="data.id">{{ data.label }}</span> -->
</div>
</el-tree>
</el-scrollbar>
</div>
<section style="width: calc(100% - 200px)">
<div class="m-search">
<section :class="showSercahStatus ? 'm-form-box-height-auto' : 'm-form-box-height'
">
<resi-search ref="myResiSearch" @handleSearchFrom="handleSearchFrom" />
</section>
<el-row class="resi-search">
<el-col :span="24">
<el-button size="small" type="primary" @click="handleSearchFrom('search')">查询</el-button>
<el-button style="margin-left: 10px" size="small" plain class="f-right5 diy-button--white"
@click="resetSearchForm">重置</el-button>
<el-button type="text" size="small" style="margin-left: 10px" class="f-right5"
@click="showSercahStatus = !showSercahStatus">
<i :class="showSercahStatus ? 'el-icon-arrow-up' : 'el-icon-arrow-down'
"></i>
{{ showSercahStatus ? "收起" : "展开" }}
</el-button>
</el-col>
</el-row>
</div>
<div class="m-table">
<div class="div_btn">
<div class="div_btn_left">
<el-button
class="diy-button--add"
v-if="btnAuths.ic_resi_add"
size="small"
@click="handleAdd"
type="primary"
icon="el-icon-plus"
>
新增</el-button
>
<el-button
v-if="btnAuths.ic_resi_export"
style="margin-left: 10px"
size="small"
class="diy-button--white"
@click="diyExport"
:loading="exportLoading"
plain
>{{exportBtnTitle}}</el-button
>
<!-- <el-button v-if="btnAuths.ic_resi_export"
style="margin-left: 10px"
size="small"
class="diy-button--add"
@click=""
type="parimary"
plain>核对</el-button> -->
<!-- <el-button v-if="
btnAuths.ic_resi_smart_import && displayedBaobiaoBtn
"
style="margin-left: 10px"
size="small"
@click="reportForm"
class="diy-button--white">核对</el-button> -->
<el-button style="margin-left: 10px" v-if="btnAuths.ic_resi_batch_del" size="small" class="diy-button--add"
type="parimary" @click="deleteBatch">批量删除</el-button>
<!-- <el-button style="margin-left: 10px" v-if="btnAuths.ic_resi_batch_del" size="small" class="diy-button--add"
type="parimary" @click="confirmBatch"></el-button> -->
<el-dropdown size="small" split-button type="primary" style="margin: 0 10px; height: 30px"
@command="(command) => confirmBatch(command)" v-if="updeBtn" >
信息无误确认
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="1" >全部确认</el-dropdown-item>
<el-dropdown-item command="2">批量确认</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<!-- <el-button type="primary" size="small">下载人口模板</el-button> -->
</div>
</div>
<el-table ref="ref_table" class="m-table-item" :data="tableData" v-loading="tableLoading" border
style="width: 100%" :height="tableHeight" @select-all="selectAll" @selection-change="selectionChange">
<!-- :selectable="checkSelectable" -->
<el-table-column type="selection" fixed="left" align="center" width="50" />
<el-table-column label="序号" type="index" fixed="left" align="left" width="50">
</el-table-column>
<el-table-column v-for="item in tableHeader" :key="item.columnName" :prop="item.columnName"
:label="item.label" align="left" :show-overflow-tooltip="true" :width="item.width || ''">
<template slot-scope="scope">
<a v-if="item.columnName == 'NAME' && btnAuths.ic_resi_view" class="name-a">
{{ handleFilterSpan(scope.row, item) }}
</a>
<div v-else-if="item.columnName == 'gender'">
{{
scope.row.gender == null
? "--"
: scope.row.gender == 1
? "男"
: scope.row.gender == 2
? "女"
: "--"
}}
</div>
<div v-else-if="item.columnName == 'synthesizeScore'">
{{
scope.row.synthesizeScore
}}
</div>
<div v-else-if="item.columnName == 'gridName'">
<template>
<div class="resiCategoryInfoBox">
{{ scope.row.agencyName + scope.row.homeName }}
</div>
</template>
</div>
<div v-else-if="item.columnName == 'categoryNames'">
<template v-if="scope.row.categoryInfo">
<div class="resiCategoryInfoBox">
{{ scope.row.categoryInfo.categoryNames }}
</div>
</template>
</div>
<div v-else-if="item.columnName == 'householdSituationName'">
<template v-if="scope.row.home">
<div>
{{ scope.row.home.householdSituationName || "" }}
</div>
</template>
</div>
<div v-else-if="item.columnName == 'resiHouseRel'">
<template v-if="scope.row.home">
<div>
{{
scope.row.home.resiHouseRel != null
? scope.row.home.resiHouseRel == 0
? "自住"
: scope.row.home.resiHouseRel == 1
? "租住"
: ""
: ""
}}
</div>
</template>
</div>
<span v-else>{{ handleFilterSpan(scope.row, item) }}</span>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" align="center" width="200">
<template slot-scope="scope">
<el-button v-if="btnAuths.ic_resi_view" type="text" size="small"
@click="handleLook(scope.row)">查看</el-button>
<template v-if="filterEdit(scope.row.agencyId)">
<el-button v-if="btnAuths.ic_resi_update" style="margin-right: 10px"
@click="handelCLickShowCheckPassword(scope.row)" size="small" type="text">编辑</el-button>
<el-popconfirm v-if="btnAuths.ic_resi_del" title="删除之后无法回复,确认删除?" @onConfirm="handleDel(scope.row)">
<el-button size="small" type="text" slot="reference">删除</el-button>
</el-popconfirm>
<el-dropdown trigger="click" style="margin-left: 10px"
@command="(command) => handelRegister(command, scope.row)">
<el-button class="div-table-button--blue" size="small" type="text" style="font-size: 10px">
▪▪▪</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-if="false && btnAuths.ic_resi_change_rec" command="bgjl">变更记录</el-dropdown-item>
<el-dropdown-item v-if="btnAuths.ic_resi_update" command="swdj">死亡登记</el-dropdown-item>
<el-dropdown-item v-if="btnAuths.ic_resi_update" command="qcdj">迁出登记</el-dropdown-item>
<!-- <el-dropdown-item v-if="btnAuths.ic_resi_update" command="confirm">信息无误确认</el-dropdown-item> -->
</el-dropdown-menu>
</el-dropdown>
</template>
</template>
</el-table-column>
</el-table>
<div class="div-flex">
<div class="m-page">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:current-page.sync="currentPage" :page-sizes="[20, 50, 100, 200]" :page-size="pageSize"
layout="sizes, prev, pager, next, total" :total="total">
</el-pagination>
</div>
</div>
</div>
</section>
<!-- 变更记录 -->
<el-dialog :visible.sync="changeRecordShow" :close-on-click-modal="false" :close-on-press-escape="false"
:title="'变更记录'" width="1150px" top="5vh" @closed="diaClose">
<resi-change-record ref="ref_changerecord"></resi-change-record>
</el-dialog>
<baobiao ref="baobiao" />
<!-- 迁出登记 -->
<el-dialog :visible.sync="tranferShow" :close-on-click-modal="false" :close-on-press-escape="false" :title="'迁出登记'"
width="562px" top="5vh" class="dialog-h" @closed="diaClose">
<resi-change-transfer ref="ref_change_transfer" @dialogCancle="transferClose"></resi-change-transfer>
</el-dialog>
<!-- 死亡登记 -->
<el-dialog :visible.sync="deathShow" :close-on-click-modal="false" :close-on-press-escape="false" :title="'死亡登记'"
width="620px" top="5vh" class="dialog-h" @closed="diaClose">
<resideath-add ref="ref_death" @dialogCancle="deathClose"></resideath-add>
</el-dialog>
<el-dialog title="密码验证" :visible.sync="showCheckPassword">
<el-form :model="checkPasswordFrom" :rules="checkPasswordRulse" ref="checkPasswordFrom">
<el-form-item label="密码" prop="password">
<el-input v-model.trim="checkPasswordFrom.password" autocomplete="off" type="password" placeholder="请输入当前账号密码"
@keydown.native.enter="handelClickCheckPassword"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="showCheckPassword = false"> </el-button>
<el-button type="primary" @click="handelClickCheckPassword"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="diyDialog" :close-on-click-modal="false" :close-on-press-escape="false" width="1150px"
top="5vh" class="dialog-h">
<diy-info v-if="diyDialog" ref="ref_diy" :list="exportList" :search="searchForm"
@close="handleDiyClose"></diy-info>
</el-dialog>
<el-dialog :visible.sync="diyDialog" :close-on-click-modal="false" :close-on-press-escape="false" width="1150px"
top="5vh" class="dialog-h">
<diy-info v-if="diyDialog" ref="ref_diy" :list="exportList" :search="searchForm"
@close="handleDiyClose"></diy-info>
</el-dialog>
</div>
</template>
<script>
import nextTick from "dai-js/tools/nextTick";
import resiSearch from "../../components/resiSearch.vue";
import resiForm from "../../components/resiForm.vue";
import resiInfo from "../../components/resiInfo.vue";
import axios from "axios";
import { mapGetters } from "vuex";
import resiTransfer from "../../components/resiTransfer.vue";
import resiChangeRecord from "../../components/resiChangeRecord.vue";
import baobiao from "@/views/modules/cpts/baobiao";
import { requestPost, requestGet } from "@/js/dai/request";
import { Loading } from "element-ui"; // 引入Loading服务
import resiChangeTransfer from "../../components/resiChangeTransfer.vue";
import resideathAdd from "../plugins/change/resideathAdd.vue";
import diyInfo from "./diyInfo.vue";
let loading;
export default {
components: {
baobiao,
resiSearch,
resiForm,
resiInfo,
resiTransfer,
resiChangeRecord,
resiChangeTransfer,
resideathAdd,
diyInfo,
},
data() {
return {
updeBtn:false,
showSercahStatus: false,
exportLoading:false,
exportBtn: false,
exportBtnTitle: "导出",
importBtnTitle: "导入",
importLoading: false,
tableLoading: false,
btnLoading: false,
disabled: false,
selAllFlag: false,
selAllFlagDisabled: false,
isIndeterminate: false,
dialogEditVisible: false,
showCheckPassword: false,
checkPasswordFrom: {
password: "",
},
checkPasswordRulse: {
password: [
{ required: true, message: "请输入密码", trigger: "blur" },
{
min: 6,
max: 18,
message: "长度在 6 到 18 个字符",
trigger: "blur",
},
],
},
formType: "add",
// 显示人员详情
lookResiId: "",
uploadUlr:
window.SITE_CONFIG["apiURL"] + "/epmetuser/icresiuser/importExcel",
currentPage: 1,
pageSize: 20,
total: null,
conditions: [],
activeName: "",
tableData: [],
tableDataTow: [],
valueb: '',
searchList: [],
exportList: [],
diyDialog: false,
treeData: [],
autoOpenArr: [],
selTreeObj: {},
treeLoading: false,
filterText: "",
defaultProps: {
children: "children",
label: "showName",
isLeaf: "isLeaf",
},
treeIsOk: true, //树点击是否加载完成
editTableName: {},
formName: "",
tableHeader: [
{ columnName: "gridName", label: "地址", width: 180 },
// { columnName: "homeName", label: "所属房屋", width: 150 },
{ columnName: "doorName", label: "门牌号", width: 80 },
{ columnName: "name", label: "姓名", width: 80 },
{ columnName: "gender", label: "性别", width: 50 },
// { columnName: "agencyName", label: "所属组织", width: 150 },
{ columnName: "idTypeName", label: "证件类型", width: 80 },
{ columnName: "idNum", label: "证件号", width: 170 },
{ columnName: "synthesizeScore", label: "信息完整度", width: 95 },
{ columnName: "categoryNames", label: "居民分类" },
{ columnName: "nationalityName", label: "国籍", width: 50 },
{ columnName: "nationName", label: "民族", width: 50 },
{ columnName: "householdSituationName", label: "人户状况", width: 100 },
{ columnName: "careerStatusName", label: "就业状况", width: 100 },
{ columnName: "resiHouseRel", label: "人房关系", width: 80 },
// { columnName: "mobile", label: "联系电话", width: 110 },
{ columnName: "statisfactionNum", label: "满意度次数", width: 100},
{ columnName: "updatedTime", label: "更新时间", width: 180 },
{ columnName: "updatedByName", label: "更新人", width: 80 },
],
tabsList: [],
selection: [],
tranferShow: false,
deathShow: false,
changeRecordShow: false,
lookInfo: {
userId: "",
gridName: "",
},
editUserId: "",
displayedBaobiaoBtn: false,
btnAuths: {
ic_resi_add: true, //新增
ic_resi_import: true, //导入
ic_resi_export: true, //导出
ic_resi_batch_del: true, //批量删除
ic_resi_smart_import: true, //智能填表
ic_resi_del: true, //删除
ic_resi_view: true, //查看
ic_resi_update: true, //修改
ic_resi_change_rec: true, //变更记录
ic_resi_view_real_data: true, //显示脱敏信息
},
category: this.$route.query.category,
searchForm: {},
isShowTooltip: false,
tooltipTitle: null,
};
},
props: {},
computed: {
...mapGetters(["clientHeight", "iframeHeight"]),
tableHeight() {
return this.$store.state.inIframe
? this.clientHeight - 450 + this.iframeHeigh
: this.clientHeight - 450;
},
treeHeight() {
return this.$store.state.inIframe
? this.clientHeight - 245 + this.iframeHeight + "px"
: this.clientHeight - 245 + "px";
},
rowHeight() {
return this.$store.state.inIframe
? this.clientHeight - 140 + this.iframeHeight + "px"
: this.clientHeight - 140 + "px";
},
},
async created() {
this.updateBtnAuths();
},
async mounted() {
this.searchH = this.$refs.myResiSearch.offsetHeight;
await this.loadTree();
if (this.treeData.length > 0) {
this.$nextTick(() => {
this.$refs.ref_tree.setCurrentKey(this.treeData[0].id);
});
}
this.displayedBaobiaoBtn = await this.$refs.baobiao.existsTemplate({
elseParams: {
categoryKeys: ["resi_info"],
categoryKey: "resi_info",
},
});
},
activated() {
},
methods: {
mouseOverNode(event) {
var target = event.target;
let textLength = target.clientWidth;
let containerLength = target.scrollWidth;
if (textLength < containerLength) {
this.tooltipTitle = event.target.innerText;
this.isShowTooltip = false;
} else {
this.isShowTooltip = true;
}
},
// 更新按钮权限
updateBtnAuths() {
let rot = this.$route;
if (Array.isArray(rot.meta.btns)) {
rot.meta.btns.forEach((item) => {
this.btnAuths[item.permissions] = true;
});
}
},
handelRegister(command, row) {
if (command == "bgjl") {
this.handleChangeRecord(row);
} else if (command == "swdj") {
this.handleDeath(row);
} else if (command == "qcdj") {
this.handleChangeTransfer(row);
}else if(command=="confirm"){
this.handleConfirm(row);
}
},
reportForm() {
this.$refs.baobiao.init({
elseParams: {
categoryKeys: ["resi_info"],
categoryKey: "resi_info",
paramMap: {
searchForm: {
formCode: "resident_base_info",
pageNo: this.currentPage,
pageSize: this.pageSize,
conditions: this.conditions,
},
},
},
});
},
handleSearchFrom(type) {
this.valueb = this.$route.query.param1;
// 使用解构赋值获取需要的属性
const { categoryKey, agencyId, level } = this.$refs.myResiSearch.form;
// 深复制对象
let _obj = JSON.parse(JSON.stringify(this.$refs.myResiSearch.form));
_obj.attentionCrowds = _obj.attentionCrowds.flat()
switch (this.valueb) {
case '党员':
_obj.partyFlag = 1
_obj.integrityScoreFrom = 0
_obj.integrityScoreTo = 60
this.getTableData(_obj);
break;
case '残疾人':
_obj.healthStatus.push('DISABILITY_FLAG');
// _obj.integrityScoreFrom = parseInt(0)
// _obj.integrityScoreTo = parseInt(60)
_obj.integrityScoreFrom = 0
_obj.integrityScoreTo = 60
this.getTableData(_obj);
break;
case '退役军人':
_obj.attentionCrowds.push('VETERAN_FLAG');
_obj.integrityScoreFrom = 0
_obj.integrityScoreTo = 60
_obj.partyFlag = 1;
this.getTableData(_obj);
break;
case '失业人员':
_obj.careerStatus = 0
_obj.integrityScoreFrom = 0
_obj.integrityScoreTo = 60
this.getTableData(_obj);
break;
case '低保人员':
_obj.attentionCrowds.push('SUBSISTENCE_ALLOW');
_obj.integrityScoreFrom = 0
_obj.integrityScoreTo = 60
this.getTableData(_obj);
break;
case '保障房人员':
_obj.attentionCrowds.push('ENSURE_HOUSE_FLAG');
_obj.integrityScoreFrom = 0
_obj.integrityScoreTo = 60
this.getTableData(_obj);
break;
case '特殊人员':
_obj.attentionCrowds.push('ENSURE_HOUSE_FLAG');
_obj.integrityScoreFrom = 0
_obj.integrityScoreTo = 60
this.getTableData(_obj);
break;
case '大病人员':
_obj.healthStatus.push('SERIOUS_ILLNESS_F');
_obj.integrityScoreFrom = 0
_obj.integrityScoreTo = 60
this.getTableData(_obj);
break;
case '慢病人员':
_obj.healthStatus.push('CHRONIC_DISEASE_F');
_obj.integrityScoreFrom = 0
_obj.integrityScoreTo = 60
this.getTableData(_obj);
break;
case '老年人':
_obj.attentionCrowds.push('OLD_PEOPLE_FLAG');
_obj.integrityScoreFrom = 0
_obj.integrityScoreTo = 60
this.getTableData(_obj);
break;
case '特扶人员':
_obj.attentionCrowds.push('SPECIAL_SUPPORT_F');
_obj.integrityScoreFrom = 0
_obj.integrityScoreTo = 60
this.getTableData(_obj);
break;
default:
// 处理 categoryKey
if (Array.isArray(categoryKey) && categoryKey.length) {
_obj.categoryKey = categoryKey.join(",");
} else {
_obj.categoryKey = "";
}
// 处理 agencyId
if (Array.isArray(agencyId) && agencyId.length) {
_obj.agencyId = agencyId[agencyId.length - 1];
}else if(agencyId){
_obj.agencyId = agencyId;
} else {
_obj.agencyId = "";
}
_obj.level = level || "";
_obj.orgType = level || "";
_obj = { ...this.searchAgencyObj , ..._obj};
if (type) {
this.currentPage = 1;
}
this.getTableData(_obj);
this.searchForm = _obj;
// 还原form的值
this.$refs.myResiSearch.form.categoryKey = categoryKey;
this.$refs.myResiSearch.form.agencyId = agencyId;
}
},
// 居民多选是否禁止选中
// checkSelectable (row, index) {
// return this.filterEdit(row.agencyId);
// },
//迁出记录
async handleChangeTransfer(row) {
this.tranferShow = true;
await nextTick(200);
this.$refs.ref_change_transfer.initForm(row);
},
//确认信息
async handleConfirm(row){
if (row) {
this.$confirm("是否确认信息", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.confirresi(row);
})
.catch((err) => {
if (err == "cancel") {
}
});
}
},
//死亡记录
async handleDeath(row) {
this.deathShow = true;
await nextTick(200);
this.$refs.ref_death.initForm(row);
},
//变更记录
async handleChangeRecord(row) {
this.changeRecordShow = true;
await nextTick(200);
this.$refs.ref_changerecord.initForm(row);
},
async diyExport() {
await this.getExportList();
},
handleDiyClose() {
this.diyDialog = false;
},
async getExportList(type) {
const url = "/oper/customize/icformitemgroup/list";
let params = {
formCode: "resident_base_info,community_info",
display:1
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
data.forEach((item) => {
(async (id) => {
// item.queryItemList = await this.getExportChildList(id)
item.queryItemList = [];
})(item.id);
});
this.exportList = [...data];
this.$nextTick(() => {
this.diyDialog = true;
});
} else {
this.$message.error(msg);
}
},
diaClose() {
this.tranferShow = false;
this.deathShow = false;
this.changeRecordShow = false;
},
transferClose() {
this.tranferShow = false;
this.handleSearchFrom();
},
deathClose() {
this.deathShow = false;
this.handleSearchFrom();
},
computedWidth(label, type) {
let wd = "";
if (type == "input" || type == "select") wd = 40 * label.length;
else if (type == "radio") wd = 20 * label.length;
return wd > 80 ? wd : 80;
},
filterEdit(id) {
const { user } = this.$store.state;
return true; //临时放开权限,正式需要注释掉
// return id === user.agencyId;
},
selectionChange(selection) {
this.selection = selection;
if (selection.length === this.tableData.length) {
this.selAllFlag = true;
this.isIndeterminate = false;
} else if (selection.length > 0) {
this.selAllFlag = false;
this.isIndeterminate = true;
} else {
this.selAllFlag = false;
this.isIndeterminate = false;
}
},
handleSelectAll(selectAllFlag) {
// if (this.tableData.length == 0) {
// this.selAllFlag = false
// return
// }
this.$refs.ref_table.clearSelection();
if (selectAllFlag) {
this.tableData.forEach((row) => {
// this.$refs.ref_table.toggleRowSelection(row);
if (row.isChecked) {
this.$refs.ref_table.toggleRowSelection(row);
}
});
}
},
selectAll(selection) {
this.selection = selection;
if (selection.length > 0) {
this.selAllFlag = true;
} else {
this.selAllFlag = false;
}
},
deleteBatch() {
if (this.selection.length > 0) {
this.$confirm("删除之后无法恢复,确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.deleteresiBatch();
})
.catch((err) => {
if (err == "cancel") {
}
});
} else {
this.$message.warning("请先选择要删除的居民");
}
},
// 确认无误居民信息提交
confirmBatch(command) {
if(command === '1'){
this.$confirm("是否全部确认信息", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.confirresiBatch();
this.handleSearchFrom();
})
.catch((err) => {
if (err == "cancel") {
}
});
}else{
if (this.selection.length === 0)
return this.$message.error("请选择之后进行操作");
this.$confirm("是否批量确认信息", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.confirresiBatch(this.selection.map(item=>item.resiId));
this.handleSearchFrom();
})
.catch((err) => {
if (err == "cancel") {
}
});
}
},
handleSizeChange(val) {
this.pageSize = val;
this.handleSearchFrom();
},
handleCurrentChange(val) {
this.currentPage = val;
this.handleSearchFrom();
},
handleFilterSpan(row, item) {
let _val = "";
if (item.itemType === "radio" && item.options.length > 0) {
item.options.forEach((n) => {
if (n.value === row[item.columnName]) _val = n.label;
});
if (row[item.columnName] == "0") return (_val = "");
}
return _val || row[item.columnName];
},
resetSearchForm() {
for (const n in this.$refs.myResiSearch.form) {
this.$refs.myResiSearch.form[n] = "";
}
this.$refs.myResiSearch.form.healthStatus = [];
this.$refs.myResiSearch.categoryAll = [];
this.$refs.myResiSearch.form.attentionCrowds = [];
this.$refs.myResiSearch.form.specialCategoryCodes = [];
this.currentPage = 1;
this.$refs.myResiSearch.level = "";
this.searchForm = null;
this.getTableData();
},
async handleExport() {
this.exportLoading = true;
this.exportBtnTitle = '正在导出中'
let url = "/actual/base/residentBaseInfo/fixedExport ";
// 使用解构赋值获取需要的属性
const { categoryKey, agencyId, level } = this.$refs.myResiSearch.form;
// 深复制对象
let _obj = JSON.parse(JSON.stringify(this.$refs.myResiSearch.form));
// 处理 categoryKey
if (Array.isArray(categoryKey) && categoryKey.length) {
_obj.categoryKey = categoryKey.join(",");
} else {
_obj.categoryKey = "";
}
// 处理 agencyId
if (Array.isArray(agencyId) && agencyId.length) {
_obj.agencyId = agencyId[agencyId.length - 1];
} else {
_obj.agencyId = "";
}
_obj.level = level || "";
_obj.orgType = level || "";
await this.$http({
method: "POST",
url,
responseType: "blob",
data: _obj,
})
.then((res) => {
// this.download(res.data, title + '.xls')
if (res.headers["content-disposition"]) {
let fileName = window.decodeURI(
res.headers["content-disposition"].split(";")[1].split("=")[1]
);
let blob = new Blob([res.data], {
type: "application/vnd.ms-excel",
});
var url = window.URL.createObjectURL(blob);
var aLink = document.createElement("a");
aLink.style.display = "none";
aLink.href = url;
aLink.setAttribute("download", fileName);
document.body.appendChild(aLink);
aLink.click();
document.body.removeChild(aLink); //下载完成移除元素
window.URL.revokeObjectURL(url); //释放掉blob对象
} else this.$message.error("下载失败");
this.exportLoading = false;
this.exportBtnTitle = '导出'
})
.catch((err) => {
this.exportLoading = false;
this.exportBtnTitle = '导出'
return this.$message.error("网络错误");
});
},
// 下载文件
download(data, fileName) {
if (!data) {
return;
}
var csvData = new Blob([data]);
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveOrOpenBlob(csvData, fileName);
} else {
var a = document.createElement("a");
document.body.appendChild(a);
a.style = "display: none";
var url = window.URL.createObjectURL(csvData);
a.href = url;
a.download = fileName;
a.click();
a.remove();
window.URL.revokeObjectURL(url);
}
},
// 上传大图标成功
handleExcelSuccess(res, file) {
if (res.code === 0 && res.msg === "success") {
} else {
this.$message.error(res.msg);
}
},
handleProgress(event, file, fileList) {
},
beforeExcelUpload(file) {
const isType = file.type === "application/vnd.ms-excel";
const isTypeComputer =
file.type ===
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
const fileType = isType || isTypeComputer;
const isLt1M = file.size / 1024 / 1024 < 100;
if (!fileType) {
this.$message.error("上传文件只能是xls/xlsx格式!");
}
if (!isLt1M) {
this.$message.error("上传文件大小不能超过 100MB!");
}
return fileType && isLt1M;
},
async uploadHttpRequest(file) {
this.importLoading = true;
this.importBtnTitle = "正在上传中...";
this.$message({
showClose: true,
dangerouslyUseHTMLString: true,
message:
"导入中,请到系统管理-<a id='clickA' style='cursor: pointer;'>导入记录</a>中查看进度",
duration: 3000,
});
let than = this;
document.getElementById("clickA").addEventListener("click", function () {
than.$router.replace("/main/importRecord-index");
});
const formData = new FormData(); //FormData对象,添加参数只能通过append('key', value)的形式添加
formData.append("file", file.file); //添加文件对象
await this.$http
.post("/epmetuser/icresiuser/importExcel", formData)
.then((res) => {
if (res.data.code == 0 && res.data.msg == "success") {
// this.$message.success('导入成功')
this.getTableData();
} else this.$message.error(res.data.msg);
})
.catch((err) => {
console.log("失败", err);
file.onError(); //上传失败的文件会从文件列表中删除
// this.$message.error('导入失败')
});
this.importLoading = false;
this.importBtnTitle = "导入";
this.$refs.upload.clearFiles();
},
// 查看
async handleLook(row) {
this.lookResiId = row.resiId;
let {
agencyId,
gridId,
gridName,
gender,
homeId,
homeName,
name,
resiId,
} = row;
this.$store.dispatch("saveData", {
agencyId,
gridId,
gridName,
gender,
homeId,
homeName,
name,
resiId,
});
this.$router.push({ name: "jumin-huaxiang" });
this.$store.state.contentTabs = this.$store.state.contentTabs.map(
(item) => {
if (item.name === "jumin-huaxiang") {
return { ...item, title: name };
}
return item;
}
);
},
async handelCLickShowCheckPassword(row) {
const url = `/actual/base/residentCategoryUpdateInfo/isUpdater/${row.resiId}`;
const { data, code, msg } = await requestPost(url);
if(code==0){
if(data==true){
this.editUserId = row.resiId;
this.saveCheckPassword()
}
else{
this.editUserId = row.resiId;
this.showCheckPassword = true;
}
}
else{
this.$message.error(msg);
}
},
handelClickCheckPassword() {
this.$refs.checkPasswordFrom.validate((vali) => {
if (vali) {
this.saveCheckPassword(this.checkPasswordFrom.password);
} else {
return false;
}
});
},
async saveCheckPassword(password){
const url = `/actual/base/residentBaseInfo/getResiUserInfo/${this.editUserId}`;
let parm = {
password,
};
const { data, code, msg } = await requestPost(url, parm);
if (code === 0) {
this.showCheckPassword = false;
this.$router.push({
name: "edit-resi",
query: { id: this.editUserId },
params: { idNum: data.idNum, mobile: data.mobile, name: data.name, nationality: data.nationality },
});
this.checkPasswordFrom.password = "";
} else {
this.$message.error(msg);
}
},
handleAdd() {
this.$router.push({ name: "add-resi" });
},
handleDel(row) {
this.$http
.post("/actual/base/residentBaseInfo/batchdel", [row.resiId])
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
this.$message.success("删除成功");
this.getTableData();
}
})
.catch((err) => {
return this.$message.error("网络错误");
});
},
async getTableData(obj) {
let params = {
pageNo: this.currentPage,
pageSize: this.pageSize,
...obj,
};
this.tableLoading = true;
const { data } = await this.$http.post(
"/actual/base/residentBaseInfo/page",
params
);
this.tableLoading = false;
if (data.code === 0) {
this.total = data.data.total;
this.tableData = data.data.list;
} else {
this.$message.error(data.msg);
}
},
async getOptionsList(url) {
let options = [];
await this.$http
.post(url, { formCode: "resident_base_info" })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
options = res.data;
}
})
.catch(() => {
return this.$message.error("网络错误");
});
return options;
},
async confirresi(row) {
let userIds = row.resiId;
this.$http
.post(`/actual/base/residentCategoryUpdateInfo/unchangeSingleUpdate/${userIds}` )
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
this.$message.success("信息确定成功");
this.handleSearchFrom();//
}
})
},
//处理参数
extractSpecificKeys(obj, keys) {
const resultArray = [];
keys.forEach(key => {
if (key in obj) {
const value = obj[key];
if (Array.isArray(value)) {
resultArray.push(...value); // 展开数组并加入结果数组
} else if(value){
resultArray.push(value); // 将非数组的值加入结果数组
}
}
});
return resultArray;
},
async confirresiBatch(ids) {
this.valueb = this.$route.query.param1;
let _obj = JSON.parse(JSON.stringify(this.$refs.myResiSearch.form));
_obj.attentionCrowds = _obj.attentionCrowds.flat()
let updateCategorys = this.extractSpecificKeys(_obj,['attentionCrowds','healthStatus','specialCategoryCodes','identity'])
const url = `/actual/base/residentCategoryUpdateInfo/${ids?'unchangePartUpdate':'unchangeMultiUpdate'}`;
let params = {ids,partyFlag:_obj.partyFlag,updateCategorys};
if(!ids){
params = { ..._obj,updateCategorys}
}
const { data, code, msg } = await requestPost(url, params);
if (code !== 0) {
return this.$message.error(msg);
} else {
this.$message.success("确认成功");
this.handleSearchFrom();
}
},
async deleteresiBatch() {
if (this.selection.length === 0)
return this.$message.error("请选择之后进行操作");
let userIds = this.selection.map((item) => item.resiId);
this.$http
.post("/actual/base/residentBaseInfo/batchdel", userIds)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
this.$message.success("删除成功");
this.handleSearchFrom();
}
})
.catch((err) => {
return this.$message.error("网络错误");
});
},
startLoading() {
loading = Loading.service({
lock: true, // 是否锁定
text: "正在加载……", // 加载中需要显示的文字
background: "rgba(0,0,0,.7)", // 背景颜色
});
},
endLoading() {
if (loading) {
loading.close();
}
},
async handleChangeSerch() {
this.startLoading();
this.$refs.ref_tree.$data.store.lazy = !this.filterText;
if (this.filterText.length > 0 && this.filterText != "") {
const url = `/actual/base/communityBuilding/tree/search?keyword=${this.filterText}`;
const { data, code, msg } = await requestGet(url);
if (data[0].children.length > 0) {
this.treeData = data;
for (let i in this.treeData[0].children) {
if(this.treeData[0].children[0].children[0]){
this.autoOpenArr.push(
this.treeData[0].id,
this.treeData[0].children[i].id,
this.treeData[0].children[0].children[0].id
);
}else{
this.autoOpenArr.push(
this.treeData[0].id,
this.treeData[0].children[i].id,
);
}
}
} else {
this.treeData = [];
this.$message.error("暂未找到!");
}
} else {
this.treeData = [];
this.autoOpenArr = [];
this.loadTree();
}
this.endLoading();
},
async lazyLoadTree(node, resolve) {
const url = `/actual/base/communityBuilding/tree/nextTreeNode?id=${node.data.id}&level=${node.data.level}`;
const { data, code, msg } = await requestGet(url);
if (code === 0) {
data.forEach((element) => {
if (element.level === "building") {
element.isLeaf = true;
}
});
resolve(data);
} else {
this.$message.error(msg);
}
// }
},
async loadTree(isRefresh) {
const url = "/actual/base/communityBuilding/tree/initTree";
const { data, code, msg } = await requestGet(url);
if (code === 0) {
this.treeData = [];
this.treeData.push(data);
this.autoOpenArr.push(data.id);
if (!isRefresh && data) {
this.selTreeObj = data;
}
} else {
this.$message.error(msg);
}
},
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
extractData(node) {
const result = [];
let currentNode = node;
while (currentNode) {
result.push({ id: currentNode.data.id, level: currentNode.data.level });
currentNode = currentNode.parent;
}
return result;
},
traverseTree(tree) {
const results = [];
tree.forEach(node => {
results.push(...this.extractData(node));
if (node.children && node.children.length > 0) {
results.push(...this.traverseTree(node.children));
}
});
return results;
},
async handleNodeClick(obj,node) {
this.selObj = JSON.parse(JSON.stringify(obj));
this.selTreeObj = obj;
await nextTick(1000);
this.$nextTick(async ()=>{
if(obj.level === "building" || obj.level === "neighborHood"){
const gridNode = this.traverseTree([node]);
const gridResult = gridNode.find(item => item.level === 'grid');
const neighborHoodResult = gridNode.find(item => item.level === "neighborHood");
const buildingResult = gridNode.find(item => item.level === "building");
const gridId = gridResult ? gridResult.id : null;
const neighborHoodId = neighborHoodResult ? neighborHoodResult.id : null;
const buildingId = buildingResult ? buildingResult.id : null;
if (gridId) {
await this.$EventBus.$emit('handleClickResiTree', { type: 'agency', id: gridId });
}
await nextTick(500);
if (neighborHoodId) {
await this.$EventBus.$emit('handleClickResiTree', { type: 'neighborHood', id: neighborHoodId });
}
await nextTick(500);
if (buildingId) {
await this.$EventBus.$emit('handleClickResiTree', { type: 'building', id: buildingId });
}
}else{
this.$EventBus.$emit('handleClickResiTree',{id:obj.id,type:obj.level})
}
await nextTick(500);
this.handleSearchFrom("type")
})
},
},
watch: {
$route: {
handler: function (newVal, oldVal) {
if(newVal.name == "base-resi" && newVal.query.type === 'residentCategory'){
this.updeBtn = true
}else {
this.updeBtn = false
}
if((newVal.name == "base-resi" || oldVal.name === 'home') && newVal.query.type ==='updateResi'){
this.$nextTick(()=>{
this.$refs.myResiSearch.form.updateCategory = newVal.query.category;
this.handleSearchFrom();
})
return
}else{
if (newVal.name == "base-resi" && (!oldVal ||oldVal.name === 'home'||oldVal.name === 'base-classification'||oldVal.name === 'home-notice')) {
this.$nextTick(() => {
this.$refs.myResiSearch.form.updateCategory = null;
this.$refs.myResiSearch.form.attentionCrowds = [];
this.$refs.myResiSearch.form.healthStatus = [];
this.$refs.myResiSearch.form.specialCategoryCodes = [];
this.$refs.myResiSearch.form.partyFlag=null;
if (newVal.query.category === 'SPECIAL_SUPPORT_FLAG' ||newVal.query.category === 'SUBSISTENCE_ALLOWANCE_FLAG'|| newVal.query.category === 'VETERAN_FLAG'|| newVal.query.category === 'ENSURE_HOUSE_FLAG'|| newVal.query.category === 'OLD_PEOPLE_FLAG'|| newVal.query.category === 'FERTILE_WOMAN_FLAG' || newVal.query.category === 'FLOATING_FLAG' || newVal.query.category === 'NEW_STRATUM_FLAG' || newVal.query.category === 'permanentFlag' || newVal.query.category === 'UNEMPLOYED_FLAG' || newVal.query.category === 'LBC_FLAG' || newVal.query.category === 'AIDS_FLAG' || newVal.query.category === 'NEG_FLAG' ) {
this.$refs.myResiSearch.form.attentionCrowds.push(
newVal.query.category
);
} else if(newVal.query.category === 'CHRONIC_DISEASE_FLAG' ||newVal.query.category === 'SERIOUS_ILLNESS_FLAG'||newVal.query.category === 'DISABILITY_FLAG'){
this.$refs.myResiSearch.form.healthStatus.push(
newVal.query.category
);
}else if(newVal.query.category === 'SQJZ_FLAG' || newVal.query.category === 'AZBJ_FLAG' || newVal.query.category === 'DRUG_FLAG' || newVal.query.category === 'XJRY_FLAG' || newVal.query.category === 'ZSZHJSB_FLAG' || newVal.query.category === 'UNITED_FRONT_FLAG'|| newVal.query.category === 'PETITION_OFFICER_FLAG' || newVal.query.category === 'BLQSN_FLAG'){
let obj = {
SQJZ_FLAG:'shequjiaozheng',
AZBJ_FLAG:'anzhibangjiao',
DRUG_FLAG:'xidurenyuan',
XJRY_FLAG:'xiejiaorenyuan',
ZSZHJSB_FLAG:'zhaoshizhaohuojingshenbing',
UNITED_FRONT_FLAG:'tongzhanrenyuan',
PETITION_OFFICER_FLAG:'xinfangrenyaun',
BLQSN_FLAG:'buliangqingshaonian'
}
this.$refs.myResiSearch.form.specialCategoryCodes = [obj[newVal.query.category]];
}else if(newVal.query.category === 'PARTY_FLAG'){
this.$refs.myResiSearch.form.partyFlag =1;
}else if(newVal.query.category === 'BUILDING_CHIEF_FLAG' || newVal.query.category === 'VOLUNTEER_FLAG' || newVal.query.category === 'UNIT_CHIEF_FLAG' || newVal.query.category ==='PUBLIC_WELFARE_FLAG'){
this.$refs.myResiSearch.form.identity = newVal.query.category;
}else if(newVal.query.category === 'MASS_FLAG'){
this.$refs.myResiSearch.form.partyFlag = 0;
}else if(newVal.query.category === 'LEAGUE_FLAG'){
this.$refs.myResiSearch.form.partyFlag = 2;
}
this.handleSearchFrom();
});
}
}
},
deep: true,
immediate: true,
},
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/scss/modules/management/list-main.scss";
@import "@/assets/scss/buttonstyle.scss";
.g-main {
display: flex;
}
.div_tree {
margin: 7px 8px 7px 7px;
width: 200px;
padding: 24px 15px;
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: 5px;
overflow-y: hidden;
.scrollar {
margin-top: 30px;
}
/deep/ .el-scrollbar__wrap {
overflow-x: hidden !important;
}
/deep/ .el-scrollbar__bar {
right: -2px;
}
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
overflow: hidden;
}
.over-ellipsis {
display: block;
width: 140PX;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
-webkit-line-clamp: 1;
}
//搜索输入框样式
/deep/ .el-input--medium .el-input__inner {
height: 32px;
background: rgba(0, 0, 0, 0.05);
border-radius: 4px;
}
// flex: 0 0 280px;
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: 5px;
overflow-y: hidden;
}
.dialog-h {
.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 70px;
overflow: auto;
}
}
}
.resi-container ::v-deep .el-row {
margin-right: 0;
}
.tabs-other-info {
// ::v-deep .el-tabs__nav-wrap::after,
::v-deep .el-tabs__active-bar_active {
background-color: #0055d7;
}
}
::v-deep .el-tabs__item {
// width: 50px;
box-sizing: border-box;
padding: 0 10px !important;
font-size: 14px;
font-weight: 600;
color: #666666;
border-radius: 2px;
&:hover {
color: #0056d6;
}
}
::v-deep .el-tabs__item.is-active {
color: #0056d6;
}
::v-deep .el-tabs__active-bar {
background-color: #0056d6;
}
.resi-container .resi-card {
position: relative;
overflow: visible;
}
::v-deep .el-button--primary.is-plain {
color: #0055d7;
background: #ffffff;
border-color: #0055d7;
}
.resi-container .resi-card-table {
::v-deep .el-table th {
color: #fff;
background-color: rgba(33, 149, 254, 1);
// border-right: 1px solid rgba(33, 149, 254, 1);
}
}
.collapse-title {
font-weight: bold;
}
.resi-table {
::v-deep .el-button--text {
text-decoration: underline;
}
::v-deep .btn-color-del {
margin-left: 10px;
color: rgba(213, 16, 16, 1);
}
::v-deep .btn-color-edit {
color: rgba(0, 167, 169, 1);
}
}
.resi-search {
// padding-right: 20px;
margin-top: 10px;
.el-col {
text-align: right;
}
}
.resi-down {
position: absolute;
left: 50%;
bottom: -10px;
display: flex;
justify-content: center;
align-items: center;
width: 46px;
height: 12px;
box-sizing: border-box;
margin-left: -23rpx;
cursor: pointer;
background: #ffffff;
border-radius: 0 0 10px 10px;
img {
display: block;
}
}
.resi-card-table {
margin-top: 20px;
}
.resi-row-btn {
display: flex;
margin-bottom: 13px;
.el-button {
margin-left: 10px;
border: 0;
}
}
.resi-other {
width: 100%;
display: flex;
.resi-other-title {
flex-shrink: 0;
// display: inline-block;
width: 100px;
box-sizing: border-box;
margin-bottom: 10px;
// padding: 6px 12px 0 0;
font-size: 16px;
font-weight: 500;
color: #333;
text-align: center;
}
.tabs-other-info {
// display: inline-block;
// flex: 1;
// padding-left: 60px;
width: calc(100% - 100px);
}
}
.div-flex {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
.div_del {
margin-top: 15px;
}
.m-page {
margin-left: auto;
}
}
.el-dropdown-menu {
::v-deep .el-dropdown-menu__item {
&:hover {
color: #0056d6;
}
}
}
.resiCategoryInfoBox {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
word-wrap: normal;
}
</style>