Browse Source

查看党员

shibei_master
zhaoyongnian 3 years ago
parent
commit
405660c055
  1. 531
      src/views/modules/partymember/lookMember.vue

531
src/views/modules/partymember/lookMember.vue

@ -1,15 +1,126 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<div>
<div class="div_table">
<el-table ref="ref_table"
:data="tableData"
border
v-loading="tableLoading"
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}"
style="width: 100%"
highlight-current-row>
<div v-if="pageLoading" class="resi-container">
<el-card ref="searchCard" class="search-card">
<div class="">
<el-form ref="searchForm" :inline="true" :model="searchForm" size="small" label-width="100px" class="demo-form-inline">
<div>
<el-form-item label="所属党组织" prop="partyOrgId">
<!-- <el-select v-model="searchForm.partyOrgId" filterable placeholder="请选择" clearable>
<el-option
v-for="item in optionsG"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option> -->
<!-- </el-select> -->
<el-cascader
v-model="partyOrgRange"
:options="optionsG"
:props="partyProps"
clearable
@change="handlePartyChange"></el-cascader>
</el-form-item>
<el-form-item label="姓名" prop="name">
<el-input v-model="searchForm.name" placeholder="请输入" class="input-width" clearable></el-input>
</el-form-item>
<el-form-item label="手机号" prop="mobile">
<el-input v-model="searchForm.mobile" placeholder="请输入" class="input-width" clearable></el-input>
</el-form-item>
<el-form-item label="身份证" prop="idCard">
<el-input v-model="searchForm.idCard" placeholder="请输入" class="input-width" clearable></el-input>
</el-form-item>
<el-form-item label="地址" prop="address">
<el-input v-model="searchForm.address" placeholder="请输入" class="input-width" clearable></el-input>
</el-form-item>
</div>
<div>
<el-form-item label="流动党员" prop="isLd">
<el-select v-model="searchForm.isLd" filterable placeholder="请选择" clearable>
<el-option label="是" value="1" />
<el-option label="否" value="0" />
</el-select>
</el-form-item>
<el-form-item label="流动党员证号" prop="ldzh">
<el-input v-model="searchForm.ldzh" placeholder="请输入" class="input-width" clearable></el-input>
</el-form-item>
<el-form-item label="职务" prop="partyZw">
<el-select v-model="searchForm.partyZw" filterable placeholder="请选择" clearable>
<el-option
v-for="item in zwList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="是否缴费" prop="isPay">
<el-select v-model="searchForm.isPay" filterable placeholder="请选择" clearable>
<el-option label="是" value="1" />
<el-option label="否" value="0" />
</el-select>
</el-form-item>
<el-form-item label="党员中心户" prop="isDyzxh">
<el-select v-model="searchForm.isDyzxh" filterable placeholder="请选择" clearable>
<el-option label="是" value="1" />
<el-option label="否" value="0" />
</el-select>
</el-form-item>
</div>
<el-form-item label="免学习" prop="isMxx">
<el-select v-model="searchForm.isMxx" filterable placeholder="请选择" clearable>
<el-option label="是" value="1" />
<el-option label="否" value="0" />
</el-select>
</el-form-item>
<el-form-item label="最近一次缴费时间"
label-width="130px"
prop="startTime">
<el-date-picker v-model="timeRangePay"
size="small"
type="daterange"
value-format="yyyy-MM-dd"
@change="handleTimeChangePay"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="入党时间"
prop="startTime">
<el-date-picker v-model="timeRange"
size="small"
type="daterange"
value-format="yyyy-MM-dd"
@change="handleTimeChange"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button class="diy-button--search" size="small" @click="handleSearch">查询</el-button>
<el-button class="diy-button--reset" size="small" @click="resetForm('searchForm')">重置</el-button>
</el-form-item>
</el-form>
</div>
</el-card>
<el-card class="resi-card-table">
<el-table
:data="tableData"
row-key="id"
v-loading="tableLoading"
border
:height="tableHeight"
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}"
style="width: 100%"
class="resi-table"
>
<el-table-column label="序号" type="index" align="center" width="50">
</el-table-column>
<el-table-column
prop="name"
label="姓名"
@ -101,18 +212,51 @@
align="center"
min-width="180"
/>
<!-- <template slot-scope="scope">
<div class="div-content">{{ handleFilterSpan(scope.row, item) }}</div>
</template> -->
<!-- </el-table-column> -->
<el-table-column fixed="right" label="操作" align="center" width="200">
<template slot-scope="scope">
<el-button
@click="handleLook(scope.row)"
type="text"
size="small"
class="btn-color-look"
>查看</el-button
>
</template>
</el-table-column>
</el-table>
<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>
<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>
</el-card>
<el-dialog
title="党员信息"
:visible.sync="dialogVisible"
width="60%"
top="5vh"
class="dialog-h"
append-to-body
:close-on-click-modal="false"
:before-close="handlerCancle"
>
<crate-form v-if="dialogVisible" :info="detailInfo" :partyList="optionsG"
:disabled="disabled"
@saveBase="handleSearch" @cancle="handlerCancle" />
</el-dialog>
</div>
</div>
<div class="div_btn">
@ -123,68 +267,347 @@
</template>
<script>
import axios from 'axios'
import { mapGetters } from 'vuex'
import { requestPost } from "@/js/dai/request";
import crateForm from '../communityParty/members/crateForm.vue'
export default {
data () {
return {
btnDisable: false,
//
tableData: [],
uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2',
importBtnTitle: '导入',
importLoading: false,
exportBtn: false,
exportBtnTitle: '导出',
tableLoading: false,
agencyId: '',
partyOrgId: '',
pageNo: 1,
btnLoading: false,
uploading: false,
disabled: false,
pageLoading: false,
dialogVisible: false,
currentPage: 1,
pageSize: 20,
total: 1,
total: null,
tableData: [],
searchH: 0,
unloadPencent: 0,
addLevel: '1',
addType: 'add',
value: '',
optionsEditG: [],
optionsG: [],
optionsC: [],
optionsEditC: [],
options: [
{
label: '是',
value: 1
},{
label: '否',
value: 2
}
],
zwList: [
{
label: '普通党员',
value: '0'
},
{
label: '支部书记',
value: '1'
},
{
label: '支部委员',
value: '2'
},
{
label: '党委委员',
value: '3'
},
],
demandOptions: [],
tableHeader: [
{
label: '党员姓名',
columnName: 'name',
align: 'center',
width: '160',
options: []
}, {
label: '所属网格',
align: 'center',
columnName: 'gridName',
width: '200',
options: []
}, {
label: '分类类别',
align: 'center',
columnName: 'categoryName',
width: '160',
options: []
}, {
label: '主要事迹',
columnName: 'mainDeed',
align: 'center',
width: '',
options: []
}
],
partyOrgRange: [],
timeRangePay: [],
timeRange: [],
customerId: '',
partyOrgId: '', //
searchForm: {
partyOrgId: '',
mobile: '',
idCard: '',
name: '',
address: '',
isLd: '',
ldzh: '',
partyZw: '',
isDyzxh: '',
isMxx: '',
culture: '',
isPay: '',
rdsjStartDate: '',
rdsjEndDate: '',
payStatrDate: '',
payEndDate: ''
},
detailInfo: {},
partyProps: {
label: 'partyOrgName',
value: 'id',
checkStrictly: true
}
}
},
props: {
},
computed: {
...mapGetters(['clientHeight', 'iframeHeight'])
...mapGetters(['clientHeight', 'iframeHeight']),
tableHeight() {
const h = this.clientHeight - this.searchH - 280 + this.iframeHeigh
const _h = this.clientHeight - 280 - this.searchH
return this.$store.state.inIframe ? h : _h
}
},
components: {
crateForm
},
components: {},
methods: {
initForm (agencyId, id) {
this.agencyId = agencyId
this.searchForm.partyOrgId = id
this.partyOrgId = id
console.log('this.searchForm.partyOrgId:::::', this.searchForm.partyOrgId)
this.tableLoading = true
this.loadTable()
this.pageLoading = true
this.getTableData()
this.getGridList('query')
},
//
handleCancle () {
this.$emit('lookMemberCancle')
},
//
async loadTable () {
let params = {
agencyId: this.agencyId,
partyOrgId: this.partyOrgId,
pageNo: this.pageNo,
pageSize: this.pageSize
handleSizeChange(val) {
console.log(`每页 ${val}`)
this.pageSize = val
this.getTableData()
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`)
this.currentPage = val
this.getTableData()
},
handlePartyChange(val) {
console.log('val------pp', val)
this.searchForm.partyOrgId = val[val.length - 1]
},
handleFilterSpan(row, item) {
let _val = ''
if (item.options && item.options.length > 0) {
item.options.forEach((n) => {
if (n.value === row[item.columnName]) _val = n.label
})
}
const url = `/resi/partymember/icPartyMember/page`
const { data, code, internalMsg, msg } = await requestPost(url, params)
this.tableLoading = false
if (code !== 0) {
return this.$message.error(internalMsg ? internalMsg : msg ? msg : '查询失败')
return _val || row[item.columnName]
},
handleTimeChange (val) {
if (val.length > 0) {
this.searchForm.rdsjStartDate = val[0]
this.searchForm.rdsjEndDate = val[1]
} else {
this.searchForm.rdsjStartDate = ''
this.searchForm.rdsjEndDate = ''
}
if (code === 0) {
this.tableData = data.list ? data.list : []
this.total = data.total || 0;
},
handleTimeChangePay (val) {
if (val.length > 0) {
this.searchForm.payStatrDate = val[0]
this.searchForm.payEndDate = val[1]
} else {
this.searchForm.payStatrDate = ''
this.searchForm.payEndDate = ''
}
},
handleSizeChange (val) {
console.log(`每页 ${val}`)
this.pageSize = val
this.loadTable()
handleProgress(event, file, fileList) {
console.log('percentage', event, file.percentage)
this.uploading = true
this.unloadPencent = Number(file.percentage.toFixed(0))
},
handleCurrentChange (val) {
console.log(`当前页: ${val}`);
this.pageNo = val;
this.loadTable();
download (data, fileName) {
console.log('data', data)
if (!data) {
return
}
var csvData = new Blob([data])
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveOrOpenBlob(csvData, fileName)
}
// for Non-IE (chrome, firefox etc.)
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)
}
},
handleSearch(val) {
console.log('searchhh--', val)
this.currentPage = 1
this.getTableData()
},
resetForm(formName) {
this.timeRangePay = []
this.timeRange = []
this.searchForm.payStatrDate = ''
this.searchForm.payEndDate = ''
this.searchForm.rdsjStartDate = ''
this.searchForm.rdsjEndDate = ''
this.$refs[formName].resetFields()
this.searchForm.partyOrgId = this.partyOrgId
this.handleSearch()
},
handlerCancle() {
this.detailInfo = {}
this.disabled = false
this.dialogVisible = false
},
async handleLook(row) {
this.disabled = true
await this.getDetail(row.id)
},
async getDetail(id) {
let params = {
id,
}
this.$http
.post(`/resi/partymember/icPartyMember/${id}`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
this.detailInfo = { ...res.data }
this.dialogVisible = true
}
})
.catch((err) => {
console.log('row4', err)
return this.$message.error('网络错误')
})
},
async getGridList(type, agencyId) {
// addorupdate query
await this.$http
.get('/resi/partymember/icPartyOrg/getSearchTreelist', { params: {agencyId: agencyId} })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
console.log('获取查询详情成功', res.data)
this.optionsG = this.deepArrTOnull(res.data)
}
})
.catch(() => {
return this.$message.error('网络错误')
})
},
deepArrTOnull(arr) {
let a = []
a = arr.map(item => {
return {
...item,
children: (item.children.length > 0 && this.deepArrTOnull(item.children) )|| null
}
})
return a
},
async getCateList(type) {
const params = {
customerId: this.customerId,
type
}
// addorupdate query
await this.$http
.post('/resi/partymember/stylecategorydict/select-list', params)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
console.log('获取查询详情成功', res.data)
if (type === 'query') this.optionsC = res.data
else this.optionsEditC = res.data
}
})
.catch(() => {
return this.$message.error('网络错误')
})
},
async getTableData() {
this.tableLoading = true
let params = {
...this.searchForm,
agencyId: this.agencyId,
pageNo: this.currentPage,
pageSize: this.pageSize
}
await this.$http
.post('/resi/partymember/icPartyMember/page', params)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
this.tableData = res.data.list
this.total = res.data.total
}
})
.catch(() => {
return this.$message.error('网络错误')
})
this.tableLoading = false
}
},
}
</script>

Loading…
Cancel
Save