Browse Source

bug

shibei_master
zhaoyongnian 3 years ago
parent
commit
b23130d5cb
  1. 100
      src/views/modules/partymember/icpartyorg-add-or-update.vue
  2. 10
      src/views/modules/partymember/icpartyorgtree.vue

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

@ -8,7 +8,7 @@
@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 :disabled="dataForm.id ? true : false" v-model="dataForm.partyOrgType" @change="changePartyOrgType" clearable placeholder="请选择党组织类型"> <el-select :disabled="dataForm.id || dataForm.orgId ? 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"
@ -32,9 +32,10 @@
:props="{ emitPath:false, checkStrictly: true, label: 'name', value: 'id', children: 'children' }" :props="{ emitPath:false, checkStrictly: true, label: 'name', value: 'id', children: 'children' }"
:disabled="dataForm.id ? true : false" :disabled="dataForm.id ? true : false"
:show-all-levels="false" :show-all-levels="false"
@change="changeAgencyOrg"
clearable /> clearable />
</el-form-item> </el-form-item>
<el-form-item prop="mySelectOrg" label="上级党组织"> <el-form-item v-if="!dataForm.sjdzzName" prop="mySelectOrg" label="上级党组织">
<el-cascader <el-cascader
style="width:300px" style="width:300px"
v-model="dataForm.mySelectOrg" v-model="dataForm.mySelectOrg"
@ -45,6 +46,9 @@
:disabled="dataForm.id || dataForm.orgId ? true : false" :disabled="dataForm.id || dataForm.orgId ? true : false"
clearable /> clearable />
</el-form-item> </el-form-item>
<el-form-item v-if="dataForm.sjdzzName" label="上级党组织">
<el-input :disabled="true" v-model="dataForm.sjdzzName" style="width:300px"></el-input>
</el-form-item>
<el-form-item label="党组织介绍" prop="introduction"> <el-form-item label="党组织介绍" prop="introduction">
<el-input style="width:300px" v-model="dataForm.introduction" type="textarea" maxlength="500" placeholder="党组织介绍"></el-input> <el-input style="width:300px" v-model="dataForm.introduction" type="textarea" maxlength="500" placeholder="党组织介绍"></el-input>
</el-form-item> </el-form-item>
@ -129,7 +133,8 @@
staffId:'', staffId:'',
orgPidName: '', orgPidName: '',
agencyName:'', agencyName:'',
pid: '' pid: '',
sjdzzName: '' //
}, },
orgListVisible: false, orgListVisible: false,
agencyListVisible:false, agencyListVisible:false,
@ -151,27 +156,40 @@
this.agencyId = localStorage.getItem('agencyId') this.agencyId = localStorage.getItem('agencyId')
this.dataForm.customerId = localStorage.getItem('customerId') this.dataForm.customerId = localStorage.getItem('customerId')
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.dataForm.latitude = ''
// if (this.dataForm.id) {
this.setPartyOrgType() this.getInfo()
this.getOrgList().then(() => { } else {
if (this.dataForm.id) { this.initMap()
this.getInfo() if(this.dataForm.orgId) {
} else { this.dataForm.mySelectOrg = this.dataForm.orgId
this.initMap() this.dataForm.orgPid = this.dataForm.orgId
if(this.dataForm.orgId) { this.dataForm.orgPids = this.dataForm.orgPids ? this.dataForm.orgPids + ':' + this.dataForm.orgId : this.dataForm.orgId
this.dataForm.mySelectOrg = this.dataForm.orgId this.dataForm.partyOrgType = this.dataForm._partyOrgType
this.dataForm.orgPid = this.dataForm.orgId if (this.dataForm.partyOrgType === '0') { // 0,1,2,3,4,5
this.dataForm.orgPids = this.dataForm.orgPids ? this.dataForm.orgPids + ':' + this.dataForm.orgId : this.dataForm.orgId this.dataForm.partyOrgType = '1'
console.log(this.dataForm.orgPid) } else if (this.dataForm.partyOrgType === '1') {
console.log(this.dataForm.orgPids) this.dataForm.partyOrgType = '2'
} else { } else if (this.dataForm.partyOrgType === '2') {
this.dataForm.mySelectOrg = '' this.dataForm.partyOrgType = '3'
} else if (this.dataForm.partyOrgType === '3') {
this.dataForm.partyOrgType = '4'
} else if (this.dataForm.partyOrgType === '4') {
this.dataForm.partyOrgType = '5'
} }
console.log(this.dataForm.orgPid)
console.log(this.dataForm.orgPids)
// this.getOrgList()
} else {
this.dataForm.mySelectOrg = ''
} }
}) }
this.setPartyOrgType()
}) })
}, },
// //
@ -216,30 +234,37 @@
] ]
} }
}, },
//
changeAgencyOrg () {
console.log(this.dataForm.agencyId)
this.getOrgList()
},
// //
changePartyOrgType(value){ changePartyOrgType(value){
if(value != '5'){ // if(value != '5'){ //
this.dataForm.agencyId = '' this.dataForm.agencyId = ''
this.dataForm.agencyPids = '' this.dataForm.agencyPids = ''
} }
this.$http.get('/gov/org/customeragency/getOrgTreeByUserAndType', {params: {agencyId: this.agencyId, orgType:value}}).then(({data: res}) => { //
if (res.code !== 0) { this.getInfoAgencyLisy()
return this.$message.error(res.internalMsg ? res.internalMsg : res.msg ? res.msg : '查询失败') // this.$http.get('/gov/org/customeragency/getOrgTreeByUserAndType', {params: {agencyId: this.agencyId, orgType:value}}).then(({data: res}) => {
} // if (res.code !== 0) {
this.agencyOrgList = this.removeEmptyChildren(res.data) // return this.$message.error(res.internalMsg ? res.internalMsg : res.msg ? res.msg : '')
}).catch(() => {}) // }
// this.agencyOrgList = this.removeEmptyChildren(res.data)
// }).catch(() => {})
}, },
// //
getOrgList() { getOrgList() {
return this.$http.get('/resi/partymember/icPartyOrg/getTreelist', {params: {agencyId: this.agencyId, orgPid: this.dataForm.id ? this.dataForm.pid : ''}}).then(({data: res}) => { this.$http.get('/resi/partymember/icPartyOrg/getParentOrgList', {params: {agencyId: this.dataForm.agencyId, partyOrgType: this.dataForm.partyOrgType}}).then(({data: res}) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.internalMsg ? res.internalMsg : res.msg ? res.msg : '查询失败') return this.$message.error(res.internalMsg ? res.internalMsg : res.msg ? res.msg : '查询失败')
} }
this.orgList = this.removeEmptyChildren(res.data) this.orgList = this.removeEmptyChildren(res.data)
this.orgList.unshift({ // this.orgList.unshift({
partyOrgName: '一级组织', // partyOrgName: '',
id: '0' // id: '0'
}); // });
}).catch(() => { }).catch(() => {
}) })
}, },
@ -282,23 +307,20 @@
this.dataForm.mySelectOrg = this.dataForm.orgPid this.dataForm.mySelectOrg = this.dataForm.orgPid
// //
this.dataForm.agencyId = this.dataForm.agencyId this.dataForm.agencyId = this.dataForm.agencyId
//
this.getInfoAgencyLisy()
this.getOrgList()
console.log(':::::', JSON.stringify(this.dataForm))
this.initMap() this.initMap()
}).catch(() => { }).catch(() => {
}) })
//
this.getInfoAgencyLisy()
}, },
getInfoAgencyLisy(){ getInfoAgencyLisy(){
this.$http.get('/gov/org/customeragency/getOrgTreeByUserAndType', this.$http.get('/gov/org/customeragency/getOrgTreeByUserAndType', {params: {agencyId: this.agencyId, orgType: this.dataForm.partyOrgType}}).then(({data: res}) => {
{params:
{agencyId: this.agencyId,
orgType:this.dataForm.partyOrgType}
}).then(({data: res}) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.internalMsg ? res.internalMsg : res.msg ? res.msg : '查询失败') return this.$message.error(res.internalMsg ? res.internalMsg : res.msg ? res.msg : '查询失败')
} }
this.agencyOrgList = res.data this.agencyOrgList = this.removeEmptyChildren(res.data)
}).catch(() => { }).catch(() => {
}) })
}, },

10
src/views/modules/partymember/icpartyorgtree.vue

@ -24,12 +24,12 @@
size="small" size="small"
class="div-table-button--detail">{{'查看党员'}}</el-button> class="div-table-button--detail">{{'查看党员'}}</el-button>
<el-button v-if="(scope.row.agencyId == agencyId || scope.row.agencyPids.includes(agencyId)) && scope.row.partyOrgType != '5'" <el-button v-if="(scope.row.agencyId == agencyId || scope.row.agencyPids.includes(agencyId)) && scope.row.partyOrgType != '5'"
@click="addOrUpdateHandle('', scope.row.id, scope.row.orgPids)" @click="addOrUpdateHandle('', scope.row.id, scope.row.orgPids, '', scope.row.partyOrgType, scope.row.partyOrgName)"
type="text" type="text"
size="small" size="small"
class="div-table-button--add">新增下级</el-button> class="div-table-button--add">新增下级</el-button>
<el-button v-if="scope.row.agencyId == agencyId || scope.row.agencyPids.includes(agencyId)" <el-button v-if="scope.row.agencyId == agencyId || scope.row.agencyPids.includes(agencyId)"
@click="addOrUpdateHandle(scope.row.id, '', '', scope.row.pid)" @click="addOrUpdateHandle(scope.row.id, '', '', scope.row.pid, '', '')"
type="text" type="text"
size="small" size="small"
class="div-table-button--edit">修改</el-button> class="div-table-button--edit">修改</el-button>
@ -106,8 +106,7 @@
this.tableLoading = false this.tableLoading = false
}, },
// / // /
addOrUpdateHandle (id, orgId, orgPids, pid) { addOrUpdateHandle (id, orgId, orgPids, pid, partyOrgType, partyOrgName) {
console.log('pid:::::', pid)
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.dataForm.id = id this.$refs.addOrUpdate.dataForm.id = id
@ -115,7 +114,8 @@
this.$refs.addOrUpdate.dataForm.orgId = orgId // this.$refs.addOrUpdate.dataForm.orgId = orgId //
this.$refs.addOrUpdate.dataForm.orgPids = orgPids this.$refs.addOrUpdate.dataForm.orgPids = orgPids
this.$refs.addOrUpdate.dataForm.pid = pid this.$refs.addOrUpdate.dataForm.pid = pid
this.$refs.addOrUpdate.dataForm._partyOrgType = partyOrgType
this.$refs.addOrUpdate.dataForm.sjdzzName = partyOrgName
this.$refs.addOrUpdate.init() this.$refs.addOrUpdate.init()
}) })
}, },

Loading…
Cancel
Save