Browse Source

Merge branch 'feature/dev_party_mange' into test

test
HAHA 3 years ago
parent
commit
1e880e5ad1
  1. 10
      src/views/modules/communityParty/members/index.vue
  2. 52
      src/views/modules/partymember/icpartymemberpayrecorddetail.vue
  3. 6
      src/views/modules/partymember/icpartymemberpoint.vue
  4. 97
      src/views/modules/partymember/icpartyorg-add-or-update.vue

10
src/views/modules/communityParty/members/index.vue

@ -110,7 +110,7 @@
<div class="resi-row-btn"> <div class="resi-row-btn">
<el-button class="diy-button--add" size="small" @click="handleAdd">新增</el-button> <el-button class="diy-button--add" size="small" @click="handleAdd">新增</el-button>
<!-- <el-button <el-button
class="diy-button--export" class="diy-button--export"
size="small" size="small"
@click="handleExportModule('room')">下载模板</el-button> @click="handleExportModule('room')">下载模板</el-button>
@ -129,7 +129,7 @@
> >
<el-button size="small" class="diy-button--delete" :loading="importLoading">{{importBtnTitle}}</el-button> <el-button size="small" class="diy-button--delete" :loading="importLoading">{{importBtnTitle}}</el-button>
</el-upload> </el-upload>
<el-button class="diy-button--reset" size="small" :loading="exportBtn" @click="handleExport">{{ exportBtnTitle }}</el-button> --> <el-button class="diy-button--reset" size="small" :loading="exportBtn" @click="handleExport">{{ exportBtnTitle }}</el-button>
</div> </div>
@ -540,7 +540,7 @@ export default {
} }
}, },
async handleExportModule () { async handleExportModule () {
let url = "/resi/partymember/icpartymemberstyle/import/template-download" let url = "/resi/partymember/icPartyMember/downloadTemplate"
let params = {} let params = {}
@ -590,7 +590,7 @@ export default {
const formData = new FormData() //FormDataappend('key', value) const formData = new FormData() //FormDataappend('key', value)
formData.append('file', file.file) // formData.append('file', file.file) //
this.$http this.$http
.post('/resi/partymember/icpartymemberstyle/import', formData).then(res => { .post('/resi/partymember/icPartyMember/import', formData).then(res => {
console.log('res-up', res) console.log('res-up', res)
if (res.data.code == 0 && res.data.msg == 'success') { if (res.data.code == 0 && res.data.msg == 'success') {
// this.$message.success('') // this.$message.success('')
@ -618,7 +618,7 @@ export default {
} }
// .post('epmetuser/icresiuser/exportExcel', params) // .post('epmetuser/icresiuser/exportExcel', params)
await axios({ await axios({
url: window.SITE_CONFIG['apiURL'] + '/resi/partymember/icpartymemberstyle/export', url: window.SITE_CONFIG['apiURL'] + '/resi/partymember/icPartyMember/export',
// url: 'epmetuser/icresiuser/exportExcel', // url: 'epmetuser/icresiuser/exportExcel',
method: 'post', method: 'post',
data: params, data: params,

52
src/views/modules/partymember/icpartymemberpayrecorddetail.vue

@ -1,6 +1,6 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <!-- <el-card shadow="never" class="aui-card--fill"> -->
<div class="mod-rent__rentDeath} resi-container"> <div class="mod-rent__rentDeath resi-container">
<el-card ref="searchCard" class="search-card"> <el-card ref="searchCard" class="search-card">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item prop="mySelectOrg" label="所属党组织"> <el-form-item prop="mySelectOrg" label="所属党组织">
@ -71,7 +71,7 @@
</el-card> </el-card>
<el-card class="resi-card-table"> <el-card class="resi-card-table">
<div class="resi-row-btn"> <div class="resi-row-btn">
<el-button type="warning" size="small" class="diy-button--reset" @click="exportHandle()">{{ $t('export') }}</el-button> <el-button type="warning" size="small" :loading="exportBtn" class="diy-button--reset" @click="exportHandle()">{{ $t('export') }}</el-button>
</div> </div>
<el-table class="resi-table" v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;"> <el-table class="resi-table" v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<!--<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>--> <!--<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>-->
@ -107,12 +107,13 @@
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div> </div>
</el-card> <!-- </el-card> -->
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import axios from 'axios'
import AddOrUpdate from './icpartymemberpayrecorddetail-add-or-update' import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './icpartymemberpayrecorddetail-add-or-update'
export default { export default {
mixins: [mixinViewModule], mixins: [mixinViewModule],
@ -124,6 +125,8 @@
deleteURL: '/resi/partymember/icPartyMemberPayRecordDetail', deleteURL: '/resi/partymember/icPartyMemberPayRecordDetail',
deleteIsBatch: true deleteIsBatch: true
}, },
exportBtn: false,
exportBtnTitle: '导出',
dataForm: { dataForm: {
id: '', id: '',
name: '', name: '',
@ -158,6 +161,43 @@
this.getOrgList() this.getOrgList()
}, },
methods: { methods: {
async exportHandle() {
this.exportBtn = true
this.exportBtnTitle = '正在导出...'
let params = {
agencyId: this.$store.state.user.agencyId,
pageSize: 9999,
pageNo: this.currentPage,
...this.dataForm
}
await axios({
url: window.SITE_CONFIG['apiURL'] + '/resi/partymember/icPartyMemberPayRecordDetail/export',
method: 'post',
data: params,
responseType: 'blob'
})
.then(res => {
console.log('resllll', 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' })
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
})
.catch((err) => {
console.log('获取导出情失败', err)
this.$message.error('获取导出失败')
})
this.exportBtn = false
this.exportBtnTitle = '导出'
},
resetForm(formName) { resetForm(formName) {
for(const n in this.dataForm) { for(const n in this.dataForm) {
this.dataForm[n] = '' this.dataForm[n] = ''

6
src/views/modules/partymember/icpartymemberpoint.vue

@ -1,6 +1,6 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <!-- <el-card shadow="never" class="aui-card--fill"> -->
<div class="mod-rent__rentDeath} resi-container"> <div class="mod-rent__rentDeath resi-container">
<el-card ref="searchCard" class="search-card"> <el-card ref="searchCard" class="search-card">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item prop="mySelectOrg" label="所属党组织"> <el-form-item prop="mySelectOrg" label="所属党组织">
@ -88,7 +88,7 @@
</el-pagination> </el-pagination>
</el-card> </el-card>
</div> </div>
</el-card> <!-- </el-card> -->
</template> </template>
<script> <script>

97
src/views/modules/partymember/icpartyorg-add-or-update.vue

@ -7,8 +7,8 @@
ref="dataForm" ref="dataForm"
@keyup.enter.native="dataFormSubmitHandle()" @keyup.enter.native="dataFormSubmitHandle()"
:label-width="$i18n.locale === 'en-US' ? '120px' : '100px'"> :label-width="$i18n.locale === 'en-US' ? '120px' : '100px'">
<el-form-item prop="partyOrgType" label="组织类型"> <el-form-item prop="partyOrgType" label="组织类型">
<el-select v-model="dataForm.partyOrgType" @change="changePartyOrgType" clearable placeholder="请选择组织类型"> <el-select :disabled="dataForm.id ? true : false" v-model="dataForm.partyOrgType" @change="changePartyOrgType" clearable placeholder="请选择组织类型">
<el-option <el-option
v-for="item in partyOrgTypeList" v-for="item in partyOrgTypeList"
:key="item.value" :key="item.value"
@ -17,28 +17,29 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="partyOrgName" label="组织名称"> <el-form-item prop="partyOrgName" label="组织名称">
<el-input v-model="dataForm.partyOrgName" placeholder="请输入组织名称" style="width:300px"></el-input> <el-input v-model="dataForm.partyOrgName" placeholder="请输入组织名称" style="width:300px"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="组织编码" prop="partyOrgCode"> <el-form-item label="组织编码" prop="partyOrgCode">
<el-input v-model="dataForm.partyOrgCode" placeholder="组织编码" style="width:300px"></el-input> <el-input v-model="dataForm.partyOrgCode" placeholder="组织编码" style="width:300px"></el-input>
</el-form-item> </el-form-item>
<el-form-item v-if="dataForm.partyOrgType != '5'" prop="maSelectAgency" label="行政组织"> <el-form-item v-if="dataForm.partyOrgType != '5'" prop="agencyId" label="行政组织">
<el-cascader <el-cascader
style="width:300px" style="width:300px"
v-model="dataForm.maSelectAgency" v-model="dataForm.agencyId"
:options="agencyOrgList" :options="agencyOrgList"
placeholder="请选择行政组织" placeholder="请选择行政组织"
:props="{ checkStrictly: true, label: 'name', value: 'id', children: 'children' }" :props="{ emitPath:false, checkStrictly: true, label: 'name', value: 'id', children: 'children' }"
@change="handleChangeAgency" :disabled="dataForm.id ? true : false"
:show-all-levels="false"
clearable /> clearable />
</el-form-item> </el-form-item>
<el-form-item prop="mySelectOrg" label="上级组织"> <el-form-item prop="mySelectOrg" label="上级组织">
<el-cascader <el-cascader
style="width:300px" style="width:300px"
v-model="dataForm.mySelectOrg" v-model="dataForm.mySelectOrg"
:options="orgList" :options="orgList"
placeholder="请选择上级组织" placeholder="请选择上级组织"
:props="{ checkStrictly: true, label: 'partyOrgName', value: 'id', children: 'children' }" :props="{ checkStrictly: true, label: 'partyOrgName', value: 'id', children: 'children' }"
@change="handleChangeOrg" @change="handleChangeOrg"
clearable /> clearable />
@ -116,11 +117,10 @@
mySelectOrg:'', // mySelectOrg:'', //
orgPid: '', // ID,0 orgPid: '', // ID,0
orgPids: '', // ID,0 orgPids: '', // ID,0
maSelectAgency: '', //
agencyId: '', // id agencyId: '', // id
agencyPids:'', // ids() agencyPids:'', // ids()
longitude: 36.0722275, // longitude: '', //
latitude: 120.38945519, // latitude: '', //
address: '', address: '',
introduction: '', // introduction: '', //
@ -137,11 +137,12 @@
agencyOrgList:[] agencyOrgList:[]
} }
}, },
mounted () { // mounted () {
setTimeout(() => { // setTimeout(() => {
this.initMap() // console.log(':::::::::::::::::::::::')
}, 800); // this.initMap()
}, // }, 800);
// },
methods: { methods: {
init() { init() {
this.visible = true this.visible = true
@ -150,12 +151,14 @@
this.dataForm.staffId = localStorage.getItem('staffId') this.dataForm.staffId = localStorage.getItem('staffId')
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
this.dataForm.latitude = ''
// //
this.setPartyOrgType() this.setPartyOrgType()
this.getOrgList().then(() => { this.getOrgList().then(() => {
if (this.dataForm.id) { if (this.dataForm.id) {
this.getInfo() this.getInfo()
} else { } else {
this.initMap()
if(this.dataForm.orgPids) { if(this.dataForm.orgPids) {
this.dataForm.mySelectOrg = this.dataForm.orgPids.split(':') this.dataForm.mySelectOrg = this.dataForm.orgPids.split(':')
} else { } else {
@ -214,13 +217,12 @@
if(value != '5'){ // if(value != '5'){ //
this.dataForm.agencyId = '' this.dataForm.agencyId = ''
this.dataForm.agencyPids = '' this.dataForm.agencyPids = ''
this.dataForm.maSelectAgency = ''
} }
this.$http.get('/gov/org/customeragency/getOrgTreeByUserAndType', {params: {agencyId: this.agencyId, orgType:value}}).then(({data: res}) => { this.$http.get('/gov/org/customeragency/getOrgTreeByUserAndType', {params: {agencyId: this.agencyId, orgType:value}}).then(({data: res}) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
this.agencyOrgList = res.data this.agencyOrgList = this.removeEmptyChildren(res.data)
}).catch(() => {}) }).catch(() => {})
}, },
// //
@ -229,7 +231,7 @@
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
this.orgList = res.data this.orgList = this.removeEmptyChildren(res.data)
this.orgList.unshift({ this.orgList.unshift({
partyOrgName: '一级组织', partyOrgName: '一级组织',
id: '0' id: '0'
@ -237,6 +239,18 @@
}).catch(() => { }).catch(() => {
}) })
}, },
removeEmptyChildren (orgArray) {
orgArray.forEach((orgInfo) => {
if (orgInfo && orgInfo.children) {
if (orgInfo.children.length === 0) {
orgInfo.children = undefined
} else {
this.removeEmptyChildren(orgInfo.children)
}
}
})
return orgArray;
},
// //
handleChangeOrg(e) { handleChangeOrg(e) {
if (this.dataForm.mySelectOrg.length > 0 && this.dataForm.mySelectOrg) { if (this.dataForm.mySelectOrg.length > 0 && this.dataForm.mySelectOrg) {
@ -250,20 +264,6 @@
this.dataForm.orgPids = '' this.dataForm.orgPids = ''
} }
}, },
//
handleChangeAgency(e){
console.log(this.dataForm.maSelectAgency)
if (this.dataForm.maSelectAgency.length > 0 && this.dataForm.maSelectAgency) {
this.dataForm.agencyId = this.dataForm.maSelectAgency[this.dataForm.maSelectAgency.length - 1]
this.dataForm.agencyPids = ''
this.dataForm.maSelectAgency.forEach(element => {
this.dataForm.agencyPids = this.dataForm.agencyPids ? this.dataForm.agencyPids + ':' + element : element
});
} else {
this.dataForm.agencyId = ''
this.dataForm.agencyPids = ''
}
},
// //
getInfo() { getInfo() {
this.$http.get(`/resi/partymember/icPartyOrg/${this.dataForm.id}`).then(({data: res}) => { this.$http.get(`/resi/partymember/icPartyOrg/${this.dataForm.id}`).then(({data: res}) => {
@ -275,10 +275,10 @@
...res.data ...res.data
} }
// //
this.dataForm.mySelectOrg = this.dataForm.orgPids this.dataForm.mySelectOrg = this.dataForm.orgPids.split(':')
// //
this.dataForm.maSelectAgency = this.dataForm.agencyId this.dataForm.agencyId = this.dataForm.agencyId
this.initMap()
}).catch(() => { }).catch(() => {
}) })
@ -305,13 +305,14 @@
}, },
// init // init
initMap () { initMap () {
document.getElementById('app').innerHTML = ''
if (document.getElementById('app')) { if (document.getElementById('app')) {
document.getElementById('mapSeach_id').style.display = "block" document.getElementById('mapSeach_id').style.display = "block"
document.getElementById('lon_lat_id').style.display = "block" document.getElementById('lon_lat_id').style.display = "block"
} }
// //
var center = new window.TMap.LatLng(36.0722275, 120.38945519) var center = new window.TMap.LatLng( this.dataForm.latitude ? this.dataForm.latitude : 36.0722275, this.dataForm.longitude ? this.dataForm.longitude : 120.38945519)
// map TMap.Map() // map TMap.Map()
map = new window.TMap.Map(document.getElementById('app'), { map = new window.TMap.Map(document.getElementById('app'), {
center: center, // center: center, //
@ -380,8 +381,13 @@
const center = map.getCenter() const center = map.getCenter()
const lat = center.getLat() const lat = center.getLat()
const lng = center.getLng() const lng = center.getLng()
this.dataForm.latitude = lat if (lng === 120.38945519) {
this.dataForm.longitude = lng this.dataForm.latitude = ''
this.dataForm.longitude = ''
} else {
this.dataForm.latitude = lat
this.dataForm.longitude = lng
}
this.setMarker(lat, lng) this.setMarker(lat, lng)
this.convert(lat, lng) this.convert(lat, lng)
}, },
@ -435,6 +441,9 @@
computed: { computed: {
dataRule() { dataRule() {
return { return {
partyOrgName: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
mySelectOrg: [ mySelectOrg: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'} {required: true, message: this.$t('validate.required'), trigger: 'blur'}
], ],
@ -448,7 +457,7 @@
latitude: [ latitude: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'} {required: true, message: this.$t('validate.required'), trigger: 'blur'}
], ],
maSelectAgency: [ agencyId: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'} {required: true, message: this.$t('validate.required'), trigger: 'blur'}
] ]
} }

Loading…
Cancel
Save