Browse Source

楼长

jly/task002
tianqian 3 years ago
parent
commit
25f085a692
  1. 125
      src/views/modules/housemaster/cpts/detail.vue
  2. 621
      src/views/modules/housemaster/cpts/edit.vue
  3. 806
      src/views/modules/housemaster/housemaster .vue

125
src/views/modules/housemaster/cpts/detail.vue

@ -4,16 +4,24 @@
<div class="m-row">
<div class="m-info">
<div class="info-prop">
<span class="info-title-2">联系电话</span>
<span class="info-title-2">姓名 </span>
<span>{{ villageList.name || '--' }}</span>
</div>
</div>
</div>
<div class="m-row">
<div class="m-info">
<div class="info-prop">
<span class="info-title-2">联系电话</span>
<span>{{ villageList.phone|| '--' }}</span>
</div>
</div>
</div>
<div class="m-row">
<div class="m-info">
<div class="info-prop">
<span class="info-title-2">证件号</span>
<span>{{ villageList.name || '--' }}</span>
<span>{{ villageList.idCard|| '--' }}</span>
</div>
</div>
</div>
@ -21,15 +29,47 @@
<div class="m-info">
<div class="info-prop">
<span class="info-title-2">类型</span>
<span>{{ villageList.name || '--' }}</span>
<span>{{ villageList.type=='0'?"楼长":"单元长"|| '--' }}</span>
</div>
</div>
</div>
<div class="m-row">
<div class="m-info">
<div class="info-prop">
<span class="info-title-2">所属组织</span>
<span>{{ villageList.name || '--' }}</span>
<span class="info-title-2">所属区市 </span>
<span>{{ villageList.districtName|| '--' }}</span>
</div>
</div>
</div>
<div class="m-row">
<div class="m-info">
<div class="info-prop">
<span class="info-title-2">所属镇街 </span>
<span>{{ villageList.streetName|| '--' }}</span>
</div>
</div>
</div>
<div class="m-row">
<div class="m-info">
<div class="info-prop">
<span class="info-title-2">社区/民居 </span>
<span>{{ villageList.communityName|| '--' }}</span>
</div>
</div>
</div>
<div class="m-row">
<div class="m-info">
<div class="info-prop">
<span class="info-title-2">所属网格 </span>
<span>{{ villageList.gridName|| '--' }}</span>
</div>
</div>
</div>
<div class="m-row">
<div class="m-info">
<div class="info-prop">
<span class="info-title-2">所属小区 </span>
<span>{{ villageList.viliageName|| '--' }}</span>
</div>
</div>
</div>
@ -37,7 +77,7 @@
<div class="m-info">
<div class="info-prop">
<span class="info-title-2">楼栋</span>
<span>{{ villageList.name || '--' }}</span>
<span>{{ villageList.buildingName|| '--' }}</span>
</div>
</div>
</div>
@ -45,7 +85,7 @@
<div class="m-info">
<div class="info-prop">
<span class="info-title-2">单元</span>
<span>{{ villageList.name || '--' }}</span>
<span>{{ villageList.unitName || '--' }}</span>
</div>
</div>
</div>
@ -53,43 +93,44 @@
<div class="div-btn"><el-button size="small" @click="handleCancle"> </el-button></div>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { requestPost } from '@/js/dai/request';
import fileList from '@/views/components/fileList';
export default {
props: {
formId: {
type: String,
default: ''
import {
mapGetters
} from 'vuex';
import {
requestPost
} from '@/js/dai/request';
import fileList from '@/views/components/fileList';
export default {
props: {
formId: {
type: String,
default: ''
},
villageList: {
type: Object,
default: () => {}
}
},
villageList: {
type: Object,
default: () => {}
}
},
data() {
return {
customerId: localStorage.getItem('customerId'),
initLoading: false,
fmData: {}
};
},
components: { fileList },
computed: {},
watch: {},
methods: {
handleCancle() {
this.$emit('diaDetailClose');
data() {
return {
customerId: localStorage.getItem('customerId'),
initLoading: false,
fmData: {}
};
},
components: {
fileList
},
computed: {},
watch: {},
methods: {
handleCancle() {
this.$emit('diaDetailClose');
}
}
}
};
};
</script>
<style lang="scss" scoped>
@import '@/assets/scss/modules/management/detail-main.scss';
</style>
@import '@/assets/scss/modules/management/detail-main.scss';
</style>

621
src/views/modules/housemaster/cpts/edit.vue

@ -1,216 +1,527 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<el-form ref="ref_form" :model="fmData" :rules="dataRule" :disabled="formType === 'watch'" class="form" label-width="150px">
<el-form ref="ref_form" :inline="true" :model="fmData" :rules="dataRule" :disabled="formType === 'watch'"
class="form" label-width="150px">
<el-form-item label="姓名" prop="name" style="display: block">
<el-input v-model="fmData.name" class="item_width_2" size="small" clearable placeholder="请输入"></el-input>
<el-input v-model="fmData.name" class="item_width_2" size="small" clearable
placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="联系电话" prop="phone">
<el-input v-model="fmData.phone" class="item_width_2" size="small" clearable placeholder="请输入"></el-input>
<el-input v-model="fmData.phone" class="item_width_2" size="small" clearable
placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="身份证号" prop="idCard">
<el-input v-model="fmData.idCard" class="item_width_2" size="small" clearable placeholder="请输入"></el-input>
<el-input v-model="fmData.idCard" class="item_width_2" size="small" clearable
placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="类型" prop="type">
<el-select class="item_width_2" v-model="fmData.type" placeholder="请选择" filterable clearable>
<el-option v-for="item in typeList" :key="item.value" :label="item.label" :value="item.value"></el-option>
<el-option v-for="item in typeList" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="所属区市" prop="districtId">
<el-input v-model="fmData.districtId" class="item_width_2" size="small" clearable placeholder="请输入"></el-input>
<el-select class="item_width_2" v-model="fmData.districtId" placeholder="请选择" filterable
clearable @change="getstreetList(1)">
<el-option v-for="item in districtList" :key="item.id" :label="item.organizationName"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="所属镇街" prop="streetId">
<el-input v-model="fmData.streetId" class="item_width_2" size="small" clearable placeholder="请输入"></el-input>
<el-select class="item_width_2" v-model="fmData.streetId" placeholder="请选择" filterable :disabled="streetList.length==0"
clearable @change="getcommunityList(1)">
<el-option v-for="item in streetList" :key="item.id" :label="item.organizationName"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="所属社区/民居" prop="communityId">
<el-input v-model="fmData.communityId" class="item_width_2" size="small" clearable placeholder="请输入"></el-input>
<el-select class="item_width_2" v-model="fmData.communityId" placeholder="请选择" :disabled="communityList.length==0"
filterable clearable @change="
getgridList(1);
getviliageList(1);
">
<el-option v-for="item in communityList" :key="item.id" :label="item.organizationName"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="所属网格" prop="gridId">
<el-input v-model="fmData.gridId" class="item_width_2" size="small" clearable placeholder="请输入"></el-input>
<el-select class="item_width_2" v-model="fmData.gridId" placeholder="请选择" filterable :disabled="gridList.length==0"
clearable @change="getviliageList(1)">
<el-option v-for="item in gridList" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="所属小区" prop="viliageId">
<el-input v-model="fmData.viliageId" class="item_width_2" size="small" clearable placeholder="请输入"></el-input>
<el-select class="item_width_2" v-model="fmData.viliageId" placeholder="请选择" filterable :disabled="viliageList.length==0"
clearable @change="getbuildingList(1)">
<el-option v-for="item in viliageList" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="楼栋" prop="buildingId">
<el-input v-model="fmData.buildingId" class="item_width_2" size="small" clearable placeholder="请输入"></el-input>
<el-select class="item_width_2" v-model="fmData.buildingId" placeholder="请选择" filterable :disabled="buildingList.length==0"
clearable @change="getunitList(1)">
<el-option v-for="item in buildingList" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="单元" prop="unitId">
<el-input v-model="fmData.unitId" class="item_width_2" size="small" clearable placeholder="请输入"></el-input>
<el-select class="item_width_2" v-model="fmData.unitId" placeholder="请选择" filterable :disabled="unitList.length==0"
clearable>
<el-option v-for="item in unitList" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</el-form>
</div>
<div class="div_btn resi-btns">
<el-button size="small" @click="handleCancle"> </el-button>
<el-button v-if="formType != 'watch'" type="primary" size="small" :disabled="btnDisable" @click="handleComfirm"> </el-button>
<el-button v-if="formType != 'watch'" type="primary" size="small" :disabled="btnDisable"
@click="handleComfirm"> </el-button>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { requestPost } from '@/js/dai/request';
import formVltHelper from 'dai-js/tools/formVltHelper';
export default {
props: {
formId: {
type: String,
default: ''
},
formType: {
type: String,
default: 'info'
},
villageList: {
type: Object,
default: {}
}
},
data() {
return {
uploadUrl: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2',
customerId: localStorage.getItem('customerId'),
btnDisable: false,
fmData: {
name: ''
import {
mapGetters
} from 'vuex';
import {
requestPost
} from '@/js/dai/request';
import formVltHelper from 'dai-js/tools/formVltHelper';
export default {
props: {
formId: {
type: String,
default: ''
},
formType: {
type: String,
default: 'info'
},
typeList: [
{
villageList: {
type: Object,
default: {}
}
},
data() {
const checkPhone = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入手机号'));
} else if (!/^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(1[|6|7|8][0-9]))\d{8}$/.test(value)) {
callback(new Error('请输入正确的手机号格式'));
} else {
callback();
}
};
const checkCardId = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入身份证号'));
} else if (!/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(value)) {
callback(new Error('请输入正确的身份证号'));
} else {
callback();
}
};
return {
uploadUrl: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2',
customerId: localStorage.getItem('customerId'),
btnDisable: false,
fmData: {
name: '',
phone: '',
idCard: '',
type: '',
districtId: '',
streetId: '',
communityId: '',
gridId: '',
viliageId: '',
buildingId: '',
unitId: '',
},
typeList: [{
value: '0',
label: '楼长'
},
{
}, {
value: '1',
label: '单元长'
}
],
levelOptions: [
{
}],
levelOptions: [{
value: '0',
label: '市级'
},
{
}, {
value: '1',
label: '区级'
},
{
}, {
value: '2',
label: '街道级'
}],
categoryOptions: [],
districtList: [],
streetList: [],
communityList: [],
gridList: [],
viliageList: [],
buildingList: [],
unitList: [],
dataRule: {
name: [{
required: true,
message: '姓名不能为空',
trigger: 'blur'
}],
phone: [{
required: true,
validator: checkPhone,
trigger: 'blur'
}],
idCard: [{
required: true,
validator: checkCardId,
trigger: 'blur'
}],
type: [{
required: true,
message: '类型不能为空',
trigger: 'blur'
}],
districtId: [{
required: true,
message: '所属区市不能为空',
trigger: 'blur'
}],
streetId: [{
required: true,
message: '所属镇街不能为空',
trigger: 'blur'
}],
communityId: [{
required: true,
message: '所属社区/民居不能为空',
trigger: 'blur'
}],
gridId: [{
required: true,
message: '所属网格不能为空',
trigger: 'blur'
}],
viliageId: [{
required: true,
message: '所属小区不能为空',
trigger: 'blur'
}],
buildingId: [{
required: true,
message: '楼栋不能为空',
trigger: 'blur'
}],
unitId: [{
required: true,
message: '单元不能为空',
trigger: 'blur'
}],
}
],
categoryOptions: []
};
},
components: {},
computed: {
dataRule() {
return {
name: [{ required: true, message: '物业名字不能为空', trigger: 'blur' }]
};
}
},
watch: {},
async mounted() {
this.initForm();
},
methods: {
async initForm() {
if (this.formType != 'add') {
this.getInfo();
}
},
async getInfo() {
this.fmData.name = this.villageList.name;
components: {},
computed: {},
watch: {},
async mounted() {
this.initForm();
},
async handleComfirm() {
this.btnDisable = true;
setTimeout(() => {
this.btnDisable = false;
}, 10000);
this.$refs['ref_form'].validate((valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj);
methods: {
async initForm() {
this.getdistrictList(2);
if (this.formType != 'add') {
this.getInfo();
}
},
async getdistrictList(type) {
//
const url = '/gov/org/customeragency/districtList';
const {
data,
code,
msg
} = await requestPost(url);
if (code === 0) {
this.districtList = data;
if (type == 1) {
this.streetList = [];
this.communityList = [];
this.gridList = [];
this.viliageList = [];
this.buildingList = [];
this.unitList = [];
this.fmData.districtId = '';
this.fmData.streetId = '';
this.fmData.communityId = '';
this.fmData.gridId = '';
this.fmData.viliageId = '';
this.fmData.buildingId = '';
this.fmData.unitId = '';
}
} else {
this.$message.error(msg);
}
this.$forceUpdate();
},
async getstreetList(type) {
//
const url = `/gov/org/customeragency/streetList/${this.fmData.districtId}`;
const {
data,
code,
msg
} = await requestPost(url);
if (code === 0) {
this.streetList = data;
if (type == 1) {
this.communityList = [];
this.gridList = [];
this.viliageList = [];
this.buildingList = [];
this.unitList = [];
this.fmData.streetId = '';
this.fmData.communityId = '';
this.fmData.gridId = '';
this.fmData.viliageId = '';
this.fmData.buildingId = '';
this.fmData.unitId = '';
}
} else {
this.$message.error(msg);
}
this.$forceUpdate();
},
async getcommunityList(type) {
// /
const url = `/gov/org/customeragency/communityList/${this.fmData.streetId}`;
const {
data,
code,
msg
} = await requestPost(url);
if (code === 0) {
this.communityList = data;
if (type == 1) {
this.gridList = [];
this.viliageList = [];
this.buildingList = [];
this.unitList = [];
this.fmData.communityId = '';
this.fmData.gridId = '';
this.fmData.viliageId = '';
this.fmData.buildingId = '';
this.fmData.unitId = '';
}
} else {
this.$message.error(msg);
}
this.$forceUpdate();
},
async getgridList(type) {
//
const url = `/gov/org/customergrid/gridoption`;
const {
data,
code,
msg
} = await requestPost(url, {
agencyId: this.fmData.communityId,
purpose: 'query'
});
if (code === 0) {
this.gridList = data;
if (type == 1) {
this.viliageList = [];
this.buildingList = [];
this.unitList = [];
this.fmData.gridId = '';
this.fmData.viliageId = '';
this.fmData.buildingId = '';
this.fmData.unitId = '';
}
} else {
this.$message.error(msg);
}
this.$forceUpdate();
},
async getviliageList(type) {
//
const url = `/gov/org/icneighborhood/neighborhood-options`;
const {
data,
code,
msg
} = await requestPost(url, {
agencyId: this.fmData.communityId,
gridId: this.fmData.gridId
});
if (code === 0) {
this.viliageList = data;
if (type == 1) {
this.buildingList = [];
this.unitList = [];
this.fmData.viliageId = '';
this.fmData.buildingId = '';
this.fmData.unitId = '';
}
} else {
this.$message.error(msg);
}
this.$forceUpdate();
},
async getbuildingList(type) {
const url = `/gov/org/icbuilding/buildingoption`;
const {
data,
code,
msg
} = await requestPost(url, {
neighborHoodId: this.fmData.viliageId
});
if (code === 0) {
this.buildingList = data;
if (type == 1) {
this.unitList = [];
this.fmData.buildingId = '';
this.fmData.unitId = '';
}
} else {
this.$message.error(msg);
}
this.$forceUpdate();
},
async getunitList(type) {
const url = `/gov/org/icbuildingunit/unitoption`;
const {
data,
code,
msg
} = await requestPost(url, {
buildingId: this.fmData.buildingId
});
if (code === 0) {
this.unitList = data;
if (type == 1) {
this.fmData.unitId = '';
}
} else {
this.$message.error(msg);
}
this.$forceUpdate();
},
async getInfo() {
const url = `/gov/org/communityBuildingManager/detail/${this.formId}`;
const {
data,
code,
msg
} = await requestPost(url);
if (code === 0) {
this.$nextTick(() => {
this.fmData = data;
this.getstreetList(2);
this.getcommunityList(2);
this.getgridList(2);
this.getviliageList(2);
this.getbuildingList(2);
this.getunitList(2);
})
} else {
this.$message.error(msg);
}
},
async handleComfirm() {
this.btnDisable = true;
setTimeout(() => {
this.btnDisable = false;
}, 10000);
this.$refs['ref_form'].validate((valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj);
this.btnDisable = false;
} else {
this.submit();
}
});
},
async submit() {
let url = '';
let params = {
...this.fmData
};
if (this.formType === 'add') {
url = '/gov/org/communityBuildingManager/save';
} else {
this.submit();
url = '/gov/org/communityBuildingManager/update';
this.$set(params, 'id', this.villageList.id);
}
});
},
async submit() {
let url = '';
let params = { ...this.fmData };
if (this.formType === 'add') {
url = '/gov/org/communityBuildingManager/save';
} else {
url = '/gov/org/communityBuildingManager/update';
this.$set(params, 'id', this.villageList.id);
const {
data,
code,
msg
} = await requestPost(url, params);
if (code === 0) {
this.$message({
type: 'success',
message: '操作成功'
});
this.$emit('afterEdit');
this.btnDisable = false;
} else {
this.btnDisable = false;
this.$message.error(msg);
}
},
handleCancle() {
this.$emit('close');
}
const { data, code, msg } = await requestPost(url, params);
}
};
</script>
<style lang="scss" scoped>
.item_width_1 {
width: 500px;
}
if (code === 0) {
this.$message({
type: 'success',
message: '操作成功'
});
this.$emit('afterEdit');
this.btnDisable = false;
} else {
this.btnDisable = false;
this.$message.error(msg);
}
},
.item_width_2 {
width: 400px;
}
handleCancle() {
this.$emit('close');
}
.item_width_3 {
margin-left: 10px;
width: 200px;
}
};
</script>
<style lang="scss" scoped>
.item_width_1 {
width: 500px;
}
.item_width_2 {
width: 400px;
}
.item_width_3 {
margin-left: 10px;
width: 200px;
}
.item_width_4 {
width: 200px;
}
.item_width_4 {
width: 200px;
}
.div_map {
margin-top: 10px;
}
.div_map {
margin-top: 10px;
}
.div_btn {
// display: flex;
// justify-content: flex-end;
}
.el-tabs {
margin: 0 20px;
}
.div_btn {
// display: flex;
// justify-content: flex-end;
}
.el-tabs {
margin: 0 20px;
}
.el-upload__tip {
color: rgb(155, 155, 155);
margin: 0;
}
.form {
margin-top: 30px;
}
.el-upload__tip {
color: rgb(155, 155, 155);
margin: 0;
}
.form {
margin-top: 30px;
}
.attachement-list {
}
</style>
.attachement-list {}
</style>

806
src/views/modules/housemaster/housemaster .vue

@ -2,77 +2,90 @@
<div class="div_main">
<div v-show="true">
<div class="div_search">
<el-form :inline="true" :model="searchData" ref="ref_searchform" :label-width="'80px'">
<el-form :inline="true" :model="searchData" ref="ref_searchform" :label-width="'120px'">
<div>
<!-- 姓名 联系电话 证件号 类型 所属组织 楼栋 单元 tianqian -->
<el-form-item label="姓名" prop="serviceContent">
<el-input v-model="searchData.name" class="item_width_2" size="small" clearable placeholder="请输入"></el-input>
<el-form-item label="姓名" prop="name">
<el-input v-model="searchData.name" class="item_width_2" size="small" clearable
placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="联系电话" prop="serviceContent">
<el-input v-model="searchData.name" class="item_width_2" size="small" clearable placeholder="请输入"></el-input>
<el-form-item label="联系电话" prop="phone">
<el-input v-model="searchData.phone" class="item_width_2" size="small" clearable
placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="证件号" prop="idCard">
<el-input v-model="searchData.idCard" class="item_width_2" size="small" clearable placeholder="请输入"></el-input>
<el-input v-model="searchData.idCard" class="item_width_2" size="small" clearable
placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="类型" prop="type">
<el-input v-model="searchData.type" class="item_width_2" size="small" clearable placeholder="请输入"></el-input>
<el-select class="item_width_2" v-model="searchData.type" placeholder="请选择" filterable
clearable>
<el-option v-for="item in typeList" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="所属区市" prop="districtId">
<el-select class="item_width_2" v-model="searchData.districtId" placeholder="请选择" filterable clearable @change="getstreetList">
<el-option v-for="item in districList" :key="item.id" :label="item.organizationName" :value="item.id"></el-option>
<el-select class="item_width_2" v-model="searchData.districtId" placeholder="请选择" filterable
clearable @change="getstreetList">
<el-option v-for="item in districtList" :key="item.id" :label="item.organizationName"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="所属镇街" prop="streetId">
<el-select class="item_width_2" v-model="searchData.streetId" placeholder="请选择" filterable clearable @change="getcommunityList">
<el-option v-for="item in streetList" :key="item.id" :label="item.organizationName" :value="item.id"></el-option>
<el-select class="item_width_2" v-model="searchData.streetId" placeholder="请选择" filterable
:disabled="streetList.length==0" clearable @change="getcommunityList">
<el-option v-for="item in streetList" :key="item.id" :label="item.organizationName"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="所属社区/民居" prop="communityId">
<el-select
class="item_width_2"
v-model="searchData.communityId"
placeholder="请选择"
filterable
clearable
@change="
<el-select class="item_width_2" v-model="searchData.communityId" placeholder="请选择"
:disabled="communityList.length==0" filterable clearable @change="
getgridList();
getviliageList();
"
>
<el-option v-for="item in communityList" :key="item.id" :label="item.organizationName" :value="item.id"></el-option>
">
<el-option v-for="item in communityList" :key="item.id" :label="item.organizationName"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="所属网格" prop="gridId">
<el-select class="item_width_2" v-model="searchData.gridId" placeholder="请选择" filterable clearable @change="getviliageList">
<el-option v-for="item in gridList" :key="item.value" :label="item.label" :value="item.value"></el-option>
<el-select class="item_width_2" v-model="searchData.gridId" placeholder="请选择" filterable
:disabled="gridList.length==0" clearable @change="getviliageList">
<el-option v-for="item in gridList" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="所属小区" prop="viliageId">
<el-select class="item_width_2" v-model="searchData.viliageId" placeholder="请选择" filterable clearable @change="getbuildingList">
<el-option v-for="item in viliageList" :key="item.value" :label="item.label" :value="item.value"></el-option>
<el-select class="item_width_2" v-model="searchData.viliageId" placeholder="请选择" filterable
:disabled="viliageList.length==0" clearable @change="getbuildingList">
<el-option v-for="item in viliageList" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="楼栋" prop="buildingId">
<el-select class="item_width_2" v-model="searchData.buildingId" placeholder="请选择" filterable clearable @change="getunitList">
<el-option v-for="item in buildingList" :key="item.value" :label="item.label" :value="item.value"></el-option>
<el-select class="item_width_2" v-model="searchData.buildingId" placeholder="请选择" filterable
:disabled="buildingList.length==0" clearable @change="getunitList">
<el-option v-for="item in buildingList" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="单元" prop="unitId">
<el-select class="item_width_2" v-model="searchData.unitId" placeholder="请选择" filterable clearable>
<el-option v-for="item in unitList" :key="item.value" :label="item.label" :value="item.value"></el-option>
<el-select class="item_width_2" v-model="searchData.unitId" placeholder="请选择" filterable
:disabled="unitList.length==0" clearable>
<el-option v-for="item in unitList" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
<el-button style="margin-left: 30px" size="small" class="diy-button--search" @click="handleSearch">查询</el-button>
<el-button style="margin-left: 10px" size="small" class="diy-button--reset" @click="resetSearch">重置</el-button>
<el-button style="margin-left: 30px" size="small" class="diy-button--search"
@click="handleSearch">查询</el-button>
<el-button style="margin-left: 10px" size="small" class="diy-button--reset"
@click="resetSearch">重置</el-button>
</div>
</el-form>
</div>
<div class="div_table">
<div class="div_btn">
<el-button class="diy-button--add" size="small" @click="handleAdd">新增</el-button>
<!-- <el-button
@click="handleExport"
class="diy-button--reset"
@ -80,281 +93,333 @@
>导出</el-button
> -->
</div>
<el-table :data="tableData" border :header-cell-style="{ background: '#2195FE', color: '#FFFFFF' }" class="table" style="width: 100%" :height="maxTableHeight">
<el-table :data="tableData" border :header-cell-style="{ background: '#2195FE', color: '#FFFFFF' }"
class="table" style="width: 100%" :height="maxTableHeight">
<el-table-column label="序号" fixed="left" type="index" align="center" width="50" />
<!-- 姓名 联系电话 证件号 所属组织 楼栋 单元 tianqian -->
<el-table-column prop="name" align="center" label="姓名" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="phone" align="center" label="联系电话" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="idCard" align="center" label="证件号" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="districtName" align="center" label="所属区市" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="streetName" align="center" label="所属镇街" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="communityName" align="center" label="所属社区/民居" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="gridName" align="center" label="所属网格" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="viliageName" align="center" label="所属小区" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="buildingName" align="center" label="楼栋" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="unitName" align="center" label="单元" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="name" align="center" label="姓名"
:show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="phone" align="center" label="联系电话"
:show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="idCard" align="center" label="证件号"
:show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="districtName" align="center" label="所属区市"
:show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="streetName" align="center" label="所属镇街"
:show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="communityName" align="center" label="所属社区/民居"
:show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="gridName" align="center" label="所属网格"
:show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="viliageName" align="center" label="所属小区"
:show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="buildingName" align="center" label="楼栋"
:show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="unitName" align="center" label="单元"
:show-overflow-tooltip="true"></el-table-column>
<el-table-column fixed="right" label="操作" align="center" width="200">
<template slot-scope="scope">
<el-button @click="handleWatch(scope.row)" type="text" size="small" class=".div-table-button--detail">查看</el-button>
<el-button @click="handleEdit(scope.row)" type="text" size="small" class="div-table-button--edit">编辑</el-button>
<el-popconfirm title="删除之后无法回复,确认删除?" @onConfirm="handleDelete(scope.row, scope.$index)" @confirm="handleDelete(scope.row, scope.$index)">
<el-button slot="reference" type="text" size="small" style="margin-left: 10px" class="div-table-button--delete">删除</el-button>
<el-button @click="handleWatch(scope.row)" type="text" size="small"
class=".div-table-button--detail">查看</el-button>
<el-button @click="handleEdit(scope.row)" type="text" size="small"
class="div-table-button--edit">编辑</el-button>
<el-popconfirm title="删除之后无法回复,确认删除?" @onConfirm="handleDelete(scope.row, scope.$index)"
@confirm="handleDelete(scope.row, scope.$index)">
<el-button slot="reference" type="text" size="small" style="margin-left: 10px"
class="div-table-button--delete">删除</el-button>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
<div>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="pageNo"
:page-sizes="[20, 50, 100, 200]"
:page-size="parseInt(pageSize)"
layout="sizes, prev, pager, next, total"
:total="total"
></el-pagination>
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:current-page.sync="pageNo" :page-sizes="[20, 50, 100, 200]" :page-size="parseInt(pageSize)"
layout="sizes, prev, pager, next, total" :total="total"></el-pagination>
</div>
</div>
</div>
<!-- 修改弹出框 -->
<el-dialog
v-if="formShow"
:visible.sync="formShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="formTitle"
width="850px"
top="5vh"
class="dialog-h"
@closed="handleClose"
>
<edit-form ref="eleEditForm" :formId="formId" :formType="formType" @close="handleClose" :villageList="villageList" @afterEdit="handleEditSuccess"></edit-form>
<el-dialog v-if="formShow" :visible.sync="formShow" :close-on-click-modal="false" :close-on-press-escape="false"
:title="formTitle" width="850px" top="5vh" class="dialog-h" @closed="handleClose">
<edit-form ref="eleEditForm" :formId="formId" :formType="formType" @close="handleClose"
:villageList="villageList" @afterEdit="handleEditSuccess"></edit-form>
</el-dialog>
<!-- 详情弹出框 -->
<el-dialog
v-if="detailShow"
:visible.sync="detailShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="'详情'"
width="850px"
top="5vh"
class="dialog-h"
@closed="handleClose"
>
<detail-form ref="ref_form_detail" :formId="formId" :villageList="villageList" @diaDetailClose="handleClose"></detail-form>
<el-dialog v-if="detailShow" :visible.sync="detailShow" :close-on-click-modal="false"
:close-on-press-escape="false" :title="'详情'" width="850px" top="5vh" class="dialog-h" @closed="handleClose">
<detail-form ref="ref_form_detail" :formId="formId" :villageList="villageList"
@diaDetailClose="handleClose"></detail-form>
</el-dialog>
</div>
</template>
<script>
import { requestPost } from '@/js/dai/request';
import nextTick from 'dai-js/tools/nextTick';
import { mapGetters } from 'vuex';
import axios from 'axios';
import editForm from './cpts/edit';
import detailForm from './cpts/detail';
function iniSearchData() {
return {
name: ''
};
}
export default {
components: { editForm, detailForm },
data() {
import {
requestPost
} from '@/js/dai/request';
import nextTick from 'dai-js/tools/nextTick';
import {
mapGetters
} from 'vuex';
import axios from 'axios';
import editForm from './cpts/edit';
import detailForm from './cpts/detail';
function iniSearchData() {
return {
tableData: [],
villageList: {},
searchData: iniSearchData(),
categoryOptions: [],
pageNo: 1,
pageSize: window.localStorage.getItem('pageSize') || 20,
total: 1,
formId: '',
formShow: false,
formTitle: '服务项目',
formType: '', // list add edit info
detailShow: false,
districList: [],
streetList: [],
communityList: [],
gridList: [],
viliageList: [],
buildingList: [],
unitList: [],
grid: '',
viliageid: ''
name: '',
phone: '',
idCard: '',
type: '',
districtId: '',
streetId: '',
communityId: '',
gridId: '',
viliageId: '',
buildingId: '',
unitId: '',
};
},
computed: {
maxTableHeight() {
return this.$store.state.inIframe ? this.clientHeight - 410 + this.iframeHeigh : this.clientHeight - 410;
},
...mapGetters(['clientHeight', 'iframeHeight'])
},
mounted() {
console.log(this.$store.state);
this.user = this.$store.state.user;
this.getTableData();
this.getdistricList();
},
methods: {
// districList
// streetList
// communityList
// gridList
// viliageList
// buildingList
// unitList
// getdistricList
// getstreetList
// getcommunityList
// getgridList
// getviliageList
// getbuildingList
// getunitList
//
async getdistricList() {
//
const url = '/gov/org/customeragency/districtList';
const { data, code, msg } = await requestPost(url);
if (code === 0) {
this.districList = data;
this.searchData.streetId = '';
this.searchData.communityId = '';
this.searchData.gridId = '';
this.searchData.viliageId = '';
this.searchData.buildingId = '';
this.searchData.unitId = '';
} else {
this.$message.error(msg);
}
this.$forceUpdate();
},
async getstreetList(id) {
//
const url = `/gov/org/customeragency/streetList/${id}`;
const { data, code, msg } = await requestPost(url);
if (code === 0) {
this.streetList = data;
this.searchData.communityId = '';
this.searchData.gridId = '';
this.searchData.viliageId = '';
this.searchData.buildingId = '';
this.searchData.unitId = '';
} else {
this.$message.error(msg);
}
this.$forceUpdate();
},
async getcommunityList(id) {
// /
const url = `/gov/org/customeragency/communityList/${id}`;
const { data, code, msg } = await requestPost(url);
if (code === 0) {
this.communityList = data;
this.searchData.gridId = '';
this.searchData.viliageId = '';
this.searchData.buildingId = '';
this.searchData.unitId = '';
} else {
this.$message.error(msg);
}
this.$forceUpdate();
},
async getgridList(id) {
//
const url = `/gov/org/customergrid/gridoption`;
const { data, code, msg } = await requestPost(url, { agencyId: this.searchData.communityId, purpose: 'query' });
if (code === 0) {
this.gridList = data;
this.searchData.viliageId = '';
this.searchData.buildingId = '';
this.searchData.unitId = '';
} else {
this.$message.error(msg);
}
this.$forceUpdate();
},
async getviliageList(id) {
//
const url = `/gov/org/icneighborhood/neighborhood-options`;
const { data, code, msg } = await requestPost(url, { agencyId: this.searchData.communityId, gridId: this.searchData.gridId });
if (code === 0) {
this.viliageList = data;
this.searchData.buildingId = '';
this.searchData.unitId = '';
} else {
this.$message.error(msg);
}
this.$forceUpdate();
}
export default {
components: {
editForm,
detailForm
},
async getbuildingList(id) {
const url = `/gov/org/icbuilding/buildingoption`;
const { data, code, msg } = await requestPost(url, { neighborHoodId: this.searchData.viliageId });
if (code === 0) {
this.buildingList = data;
this.searchData.unitId = '';
} else {
this.$message.error(msg);
}
this.$forceUpdate();
data() {
return {
typeList: [{
value: '0',
label: '楼长'
}, {
value: '1',
label: '单元长'
}],
tableData: [],
villageList: {},
searchData: iniSearchData(),
categoryOptions: [],
pageNo: 1,
pageSize: window.localStorage.getItem('pageSize') || 20,
total: 1,
formId: '',
formShow: false,
formTitle: '服务项目',
formType: '', // list add edit info
detailShow: false,
districtList: [],
streetList: [],
communityList: [],
gridList: [],
viliageList: [],
buildingList: [],
unitList: [],
grid: '',
viliageid: ''
};
},
async getunitList(id) {
const url = `/gov/org/icbuildingunit/unitoption`;
const { data, code, msg } = await requestPost(url, { buildingId: id });
if (code === 0) {
this.unitList = data;
} else {
this.$message.error(msg);
}
this.$forceUpdate();
computed: {
maxTableHeight() {
return this.$store.state.inIframe ? this.clientHeight - 410 + this.iframeHeigh : this.clientHeight - 410;
},
...mapGetters(['clientHeight', 'iframeHeight'])
},
handleSearch(val) {
console.log(this.searchData);
this.pageNo = 1;
mounted() {
console.log(this.$store.state);
this.user = this.$store.state.user;
this.getTableData();
this.getdistrictList();
},
async handleExport() {
const url = '/gov/project/icEvent/export';
const { pageSize, pageNo, searchData } = this;
axios({
url: window.SITE_CONFIG['apiURL'] + url,
method: 'post',
data: {
methods: {
//
async getdistrictList() {
//
const url = '/gov/org/customeragency/districtList';
const {
data,
code,
msg
} = await requestPost(url);
if (code === 0) {
this.districtList = data;
this.streetList = [];
this.communityList = [];
this.gridList = [];
this.viliageList = [];
this.buildingList = [];
this.unitList = [];
this.searchData.districtId = '';
this.searchData.streetId = '';
this.searchData.communityId = '';
this.searchData.gridId = '';
this.searchData.viliageId = '';
this.searchData.buildingId = '';
this.searchData.unitId = '';
} else {
this.$message.error(msg);
}
this.$forceUpdate();
},
async getstreetList(id) {
//
const url = `/gov/org/customeragency/streetList/${id}`;
const {
data,
code,
msg
} = await requestPost(url);
if (code === 0) {
this.streetList = data;
this.communityList = [];
this.gridList = [];
this.viliageList = [];
this.buildingList = [];
this.unitList = [];
this.searchData.streetId = '';
this.searchData.communityId = '';
this.searchData.gridId = '';
this.searchData.viliageId = '';
this.searchData.buildingId = '';
this.searchData.unitId = '';
} else {
this.$message.error(msg);
}
this.$forceUpdate();
},
async getcommunityList(id) {
// /
const url = `/gov/org/customeragency/communityList/${id}`;
const {
data,
code,
msg
} = await requestPost(url);
if (code === 0) {
this.communityList = data;
this.gridList = [];
this.viliageList = [];
this.buildingList = [];
this.unitList = [];
this.searchData.communityId = '';
this.searchData.gridId = '';
this.searchData.viliageId = '';
this.searchData.buildingId = '';
this.searchData.unitId = '';
} else {
this.$message.error(msg);
}
this.$forceUpdate();
},
async getgridList(id) {
//
const url = `/gov/org/customergrid/gridoption`;
const {
data,
code,
msg
} = await requestPost(url, {
agencyId: this.searchData.communityId,
purpose: 'query'
});
if (code === 0) {
this.gridList = data;
this.viliageList = [];
this.buildingList = [];
this.unitList = [];
this.searchData.gridId = '';
this.searchData.viliageId = '';
this.searchData.buildingId = '';
this.searchData.unitId = '';
} else {
this.$message.error(msg);
}
this.$forceUpdate();
},
async getviliageList(id) {
//
const url = `/gov/org/icneighborhood/neighborhood-options`;
const {
data,
code,
msg
} = await requestPost(url, {
agencyId: this.searchData.communityId,
gridId: this.searchData.gridId
});
if (code === 0) {
this.viliageList = data;
this.buildingList = [];
this.unitList = [];
this.searchData.viliageId = '';
this.searchData.buildingId = '';
this.searchData.unitId = '';
} else {
this.$message.error(msg);
}
this.$forceUpdate();
},
async getbuildingList(id) {
const url = `/gov/org/icbuilding/buildingoption`;
const {
data,
code,
msg
} = await requestPost(url, {
neighborHoodId: this.searchData.viliageId
});
if (code === 0) {
this.buildingList = data;
this.unitList = [];
this.searchData.buildingId = '';
this.searchData.unitId = '';
} else {
this.$message.error(msg);
}
this.$forceUpdate();
},
async getunitList(id) {
const url = `/gov/org/icbuildingunit/unitoption`;
const {
data,
code,
msg
} = await requestPost(url, {
buildingId: id
});
if (code === 0) {
this.unitList = data;
this.searchData.unitId = '';
} else {
this.$message.error(msg);
}
this.$forceUpdate();
},
handleSearch(val) {
console.log(this.searchData);
this.pageNo = 1;
this.getTableData();
},
async handleExport() {
const url = '/gov/project/icEvent/export';
const {
pageSize,
pageNo,
...searchData
},
responseType: 'blob'
})
.then(res => {
let fileName = window.decodeURI(res.headers['content-disposition'].split(';')[1].split('=')[1]);
searchData
} = this;
axios({
url: window.SITE_CONFIG['apiURL'] + url,
method: 'post',
data: {
pageSize,
pageNo,
...searchData
},
responseType: 'blob'
}).then(res => {
let fileName = window.decodeURI(res.headers['content-disposition'].split(';')[1].split(
'=')[1]);
console.log('filename', fileName);
let blob = new Blob([res.data], { type: 'application/vnd.ms-excel' });
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';
@ -364,105 +429,102 @@ export default {
aLink.click();
document.body.removeChild(aLink); //
window.URL.revokeObjectURL(url); //blob
})
.catch(err => {
}).catch(err => {
console.log('获取导出情失败', err);
return this.$message.error('网络错误');
});
},
handleAdd() {
this.formType = 'add';
this.formTitle = '新增';
this.formShow = true;
},
handleWatch(row) {
// this.formType = "watch";
this.villageList = row;
// this.formTitle = "";
// this.formShow = true;
console.log(this.villageList);
this.detailShow = true;
},
handleEdit(row) {
this.formType = 'edit';
this.formId = row.villageId;
this.villageList = row;
this.formTitle = '编辑';
this.formShow = true;
},
handleClose() {
this.formShow = false;
this.detailShow = false;
},
handleEditSuccess() {
this.handleClose();
this.getTableData();
},
async handleDelete(rowData, rowIndex) {
console.log(rowData, rowIndex);
const url = '/gov/org/communityBuildingManager/delete';
let params = { id: rowData.id };
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.$message.success('删除成功!');
},
handleAdd() {
this.formType = 'add';
this.formTitle = '新增';
this.formShow = true;
},
handleWatch(row) {
// this.formType = "watch";
this.villageList = row;
// this.formTitle = "";
// this.formShow = true;
console.log(this.villageList);
this.detailShow = true;
},
handleEdit(row) {
this.formType = 'edit';
this.formId = row.id;
this.villageList = row;
this.formTitle = '编辑';
this.formShow = true;
},
handleClose() {
this.formShow = false;
this.detailShow = false;
},
handleEditSuccess() {
this.handleClose();
this.getTableData();
} else {
if (code >= 8000) {
this.$message.error(msg);
},
async handleDelete(rowData, rowIndex) {
console.log(rowData, rowIndex);
const url = '/gov/org/communityBuildingManager/delete';
let params = [rowData.id];
const {
data,
code,
msg
} = await requestPost(url, params);
if (code === 0) {
this.$message.success('删除成功!');
this.getTableData();
} else {
this.$message.error('操作失败!');
if (code >= 8000) {
this.$message.error(msg);
} else {
this.$message.error('操作失败!');
}
}
},
async getTableData() {
const url = '/gov/org/communityBuildingManager/page';
const {
pageSize,
pageNo,
searchData
} = this;
const {
data,
code,
msg
} = await requestPost(url, {
pageSize,
pageNo,
...searchData
});
if (code === 0) {
this.total = data.total || 0;
this.tableData = data.list ? data.list.map(item => {
return item;
}) : [];
} else {
this.$message.error(msg);
}
},
handleSizeChange(val) {
this.pageSize = val;
window.localStorage.setItem('pageSize', val);
this.getTableData();
},
handleCurrentChange(val) {
this.pageNo = val;
this.getTableData();
},
resetSearch() {
this.searchData = iniSearchData();
this.getTableData();
}
},
async getTableData() {
const url = '/gov/org/communityBuildingManager/page';
const { pageSize, pageNo, searchData } = this;
const { data, code, msg } = await requestPost(url, {
pageSize,
pageNo,
...searchData
});
if (code === 0) {
this.total = data.total || 0;
this.tableData = data.list
? data.list.map(item => {
return item;
})
: [];
} else {
this.$message.error(msg);
}
},
handleSizeChange(val) {
this.pageSize = val;
window.localStorage.setItem('pageSize', val);
this.getTableData();
},
handleCurrentChange(val) {
this.pageNo = val;
this.getTableData();
},
resetSearch() {
this.searchData = iniSearchData();
this.getTableData();
}
}
};
};
</script>
<style lang="scss" scoped>
@import '@/assets/scss/buttonstyle.scss';
@import '@/assets/scss/modules/management/list-main.scss';
@import '@/assets/scss/modules/shequzhili/event-info.scss';
</style>
@import '@/assets/scss/buttonstyle.scss';
@import '@/assets/scss/modules/management/list-main.scss';
@import '@/assets/scss/modules/shequzhili/event-info.scss';
</style>
Loading…
Cancel
Save