Browse Source

绑定党员

shibei_master
zhaoyongnian 3 years ago
parent
commit
d68d30b492
  1. BIN
      src/views/modules/plugins/assets/boy.png
  2. BIN
      src/views/modules/plugins/assets/girl.png
  3. 136
      src/views/modules/plugins/power/kernelhouseholdAddMember.vue
  4. 55
      src/views/modules/plugins/power/kernelhouseholdTable.vue
  5. 11
      src/views/modules/plugins/power/poweraxis_add_leader.vue

BIN
src/views/modules/plugins/assets/boy.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
src/views/modules/plugins/assets/girl.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

136
src/views/modules/plugins/power/kernelhouseholdAddMember.vue

@ -0,0 +1,136 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<div>
<div class="div_table">
<el-table ref="ref_table"
:data="tableData"
border
:height="tableHeight"
v-loading="tableLoading"
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}"
style="width: 100%"
highlight-current-row
@selection-change="selectionChange">
<el-table-column type="selection"
width="55">
</el-table-column>
<el-table-column prop="name"
label="姓名">
</el-table-column>
<el-table-column prop="mobile"
label="联系方式">
</el-table-column>
<el-table-column prop="idCard"
label="身份证号">
</el-table-column>
</el-table>
</div>
</div>
</div>
<div class="div_btn">
<el-button size="small"
@click="handleCancle"> </el-button>
<el-button size="small"
type="primary"
:disabled="btnDisable"
@click="handleComfirm"> </el-button>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { requestPost } from "@/js/dai/request";
export default {
data () {
return {
btnDisable: false,
//
tableData: [],
tableLoading: false,
selection: [],
houseId: '',
ownerName: ''
}
},
props: {
},
computed: {
tableHeight () {
return this.$store.state.inIframe ? this.clientHeight - 410 + this.iframeHeight : this.clientHeight - 410
},
...mapGetters(['clientHeight', 'iframeHeight'])
},
components: {},
// mounted () {
// this.tableLoading = true
// this.loadTable()
// },
methods: {
initForm (id, ownerName) {
this.houseId = id
this.ownerName = ownerName
this.tableLoading = true
this.loadTable()
},
selectionChange (selection) {
// console.log(selection)
this.selection = []
selection.forEach(element => {
this.selection.push({
kernelMemberId: element.id,
kernelMemberName: element.name
})
});
},
//
async handleComfirm () {
if (this.selection.length === 0 || !this.selection) {
return this.$message.error('请选择党员')
}
const url = "/pli/power/kernelMember/bind";
let params = {
houseId: this.houseId,
ownerName: this.ownerName,
kernelMemberList: this.selection
}
const { data, code, msg } = await requestPost(url, params);
this.tableLoading = false
if (code === 0) {
this.$refs.ref_table.clearSelection();
this.$emit('addMemberOk')
}
},
//
handleCancle () {
this.$refs.ref_table.clearSelection();
this.$emit('addMemberCancle')
},
//
async loadTable () {
const url = `/epmetuser/icresiuser/listhomeuserbrief/${this.houseId}`
const { data, code, msg } = await requestPost(url)
this.tableLoading = false
if (code === 0) {
this.tableData = data ? data.map((item) => { return item }) : []
}
}
},
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/modules/visual/communityManage.scss";
</style>
<style lang="scss" scoped>
.div_btn{
display: flex;
align-items: center;
justify-content: center;
}
</style>

55
src/views/modules/plugins/power/kernelhouseholdTable.vue

@ -2,7 +2,7 @@
<div> <div>
<div class="div_search"> <div class="div_search">
<div class="resi-cell"> <div class="resi-cell">
<div class="resi-cell-label">房主姓名</div> <div class="resi-cell-label">党员名称</div>
<div class="resi-cell-value"> <div class="resi-cell-value">
<el-input v-model="ownerName" <el-input v-model="ownerName"
class="resi-cell-input" class="resi-cell-input"
@ -32,7 +32,11 @@
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}" :header-cell-style="{background:'#2195FE',color:'#FFFFFF'}"
style="width: 100%"> style="width: 100%">
<el-table-column prop="ownerName" <el-table-column prop="ownerName"
label="姓名" label="户主"
width="100">
</el-table-column>
<el-table-column prop="kernelMemberNameConcat"
label="中心党员"
width="100"> width="100">
</el-table-column> </el-table-column>
<el-table-column prop="address" <el-table-column prop="address"
@ -48,7 +52,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" <el-table-column label="操作"
fixed="right" fixed="right"
width="80" width="150"
header-align="center" header-align="center"
align="center" align="center"
class="operate"> class="operate">
@ -57,6 +61,10 @@
class="div-table-button--delete" class="div-table-button--delete"
size="small" size="small"
@click="handleDelete(scope.row.id)">删除</el-button> @click="handleDelete(scope.row.id)">删除</el-button>
<el-button type="text"
class="div-table-button--edit"
size="small"
@click="handleAddMember(scope.row.houseId, scope.row.ownerName)">添加党员</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -86,12 +94,26 @@
:axisStructId="axisStructId"></kernelhousehold-form> :axisStructId="axisStructId"></kernelhousehold-form>
</el-dialog> </el-dialog>
<!-- 添加党员 -->
<el-dialog :visible.sync="addMemberShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="addMemberTitle"
width="850px"
top="5vh"
class="dialog-h"
@closed="addMemberClose">
<kernelhousehold-Add-Member ref="ref_table_Member"
@addMemberCancle="addMemberCancle"
@addMemberOk="addMemberOk"></kernelhousehold-Add-Member>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import KernelhouseholdForm from './kernelhouseholdForm' import KernelhouseholdForm from './kernelhouseholdForm'
import KernelhouseholdAddMember from './kernelhouseholdAddMember'
import { requestPost, requestGet } from "@/js/dai/request"; import { requestPost, requestGet } from "@/js/dai/request";
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
export default { export default {
@ -105,11 +127,15 @@ export default {
tableData: [], tableData: [],
//form //form
formShow: false, formShow: false,
formTitle: '绑定' formTitle: '绑定',
addMemberShow: false,
addMemberTitle: '绑定'
} }
}, },
components: { components: {
KernelhouseholdForm KernelhouseholdForm,
KernelhouseholdAddMember
}, },
computed: { computed: {
tableHeight () { tableHeight () {
@ -125,7 +151,7 @@ export default {
limit: this.pageSize, limit: this.pageSize,
page: this.pageNo, page: this.pageNo,
axisStructId: this.axisStructId, axisStructId: this.axisStructId,
ownerName: this.ownerName kernelMemberName: this.ownerName
} }
const { data, code, msg, total } = await requestGet(url, params) const { data, code, msg, total } = await requestGet(url, params)
if (code === 0) { if (code === 0) {
@ -149,6 +175,13 @@ export default {
}) })
}, },
handleAddMember(id, ownerName) {
this.addMemberShow = true
this.$nextTick(() => {
this.$refs.ref_table_Member.initForm(id, ownerName)
})
},
async deleteKernelhousehold (id) { async deleteKernelhousehold (id) {
const url = "/pli/power/kernelHousehold/delete" const url = "/pli/power/kernelHousehold/delete"
const { data, code, msg } = await requestPost(url, [id]) const { data, code, msg } = await requestPost(url, [id])
@ -181,6 +214,9 @@ export default {
// this.$refs.ref_form.resetData() // this.$refs.ref_form.resetData()
this.formShow = false this.formShow = false
}, },
addMemberClose () {
this.addMemberShow = false
},
handleAdd () { handleAdd () {
if (this.axisStructId) { if (this.axisStructId) {
this.formShow = true this.formShow = true
@ -191,10 +227,17 @@ export default {
addFormCancle () { addFormCancle () {
this.formShow = false this.formShow = false
}, },
addMemberCancle () {
this.addMemberShow = false
},
addFormOk () { addFormOk () {
this.formShow = false this.formShow = false
this.loadTable() this.loadTable()
}, },
addMemberOk () {
this.addMemberShow = false
this.loadTable()
},
}, },
props: { props: {
axisStructId: { axisStructId: {

11
src/views/modules/plugins/power/poweraxis_add_leader.vue

@ -82,9 +82,13 @@
<script> <script>
import debounce from 'lodash/debounce' import debounce from 'lodash/debounce'
import { requestPost } from "@/js/dai/request"; import { requestPost } from "@/js/dai/request";
import boy from '../assets/boy.png'
import girl from '../assets/girl.png'
export default { export default {
data () { data () {
return { return {
boy: boy,
girl: girl,
tagTab: 'add', tagTab: 'add',
btnDisable: false, btnDisable: false,
uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2', uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2',
@ -164,8 +168,6 @@ export default {
}, },
handleImgSuccess (type, res, file) { handleImgSuccess (type, res, file) {
if (res.code === 0 && res.msg === 'success') { if (res.code === 0 && res.msg === 'success') {
// console.log('type', type)
// console.log('res.data.url', res.data.url)
this.dataForm.avatar = res.data.url this.dataForm.avatar = res.data.url
} else { } else {
this.$message.error(res.msg) this.$message.error(res.msg)
@ -202,6 +204,11 @@ export default {
...this.dataForm, ...this.dataForm,
...data ...data
} }
if (this.dataForm.gender === '1') {
this.dataForm.avatar = this.dataForm.avatar ? this.dataForm.avatar : this.boy
} else {
this.dataForm.avatar = this.dataForm.avatar ? this.dataForm.avatar : this.girl
}
} else { } else {
this.$message.error(msg) this.$message.error(msg)
} }

Loading…
Cancel
Save