提交 06520d8d authored 作者: 宋雄's avatar 宋雄

增加业委会

上级 da9cef67
NODE_ENV=development
# VUE_APP_API_BASE_URL='http://192.168.0.119:9999'
# VUE_APP_API_BASE_URL='http://192.168.0.100:9999'
VUE_APP_API_BASE_URL='http://220.203.25.212:9999'
VUE_APP_API_BASE_URL='http://192.168.0.103:9999'
# VUE_APP_API_BASE_URL='http://220.203.25.212:9999'
VUE_APP_CAS_BASE_URL=http://cas.example.org:8443/cas
VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview
......
......@@ -44,6 +44,7 @@ const queryPermissionsByUser = ()=>getAction("/sys/permission/getUserPermissionB
const loadAllRoleIds = (params)=>getAction("/sys/permission/loadAllRoleIds",params);
const getPermissionRuleList = (params)=>getAction("/sys/permission/getPermRuleListByPermId",params);
const queryPermissionRule = (params)=>getAction("/sys/permission/queryPermissionRule",params);
const queryTreeListByTypeForRole = (params)=>getAction("/sys/role/queryTreeListByType",{...params, platformType: 'committee'});
// 部门管理
const queryDepartTreeList = (params)=>getAction("/sys/sysDepart/queryTreeList",params);
......@@ -78,6 +79,10 @@ const addCommunityOwner = (params)=>postAction("/property-community/info/communi
const geCommunityOwnertInfoApi = (params)=>getAction("/property-community/info/communityOwner/queryById",params);
const auditCommunityOwnerApi = (params)=>postAction("/property-community/info/communityOwner/audit",params);
const downloadOwnerTemplate = (params)=>postAction("/property-community/info/communityOwner/downloadOwnerTemplate",params);
const setOwnerLabelApi = (params)=>postAction("/property-community/ownerlabel/ownerLabel/add",params);
const setCommunityOwnerLabelApi = (params)=>postAction("/property-community/info/communityOwner/setLabel",params);
const geQueryByOwnerIdApi = (params)=>getAction("/property-community/info/communityOwner/queryByOwnerId",params);
const geCommunityDeleteApi = (params)=>getAction("/property-community/ownerlabel/ownerLabel/delete",params);
// 生活缴费-费用规则
const companyPropertyChargerulesApi = (params)=>getAction("/property-company/system/companyChargerule/companyPropertyChargerules",params);
......@@ -97,6 +102,12 @@ const dispatchCommunityRepairApi = (params)=>postAction("/property-community/pro
// 投诉管理
const querycommunityComplaintApi = (params)=>getAction("/property-community/property/communityComplaint/queryById",params);
const auditCommunityComplaintApi = (params)=>postAction("/property-community/property/communityComplaint/edit",params);
const auditMoveComplaintApi = (params)=>getAction("/property-community/property/communityComplaint/moveComplaint",params);
// 对账管理
const auditPropertyApi = (params)=>postAction("/property-central/property/propertySettled/audit",params);
const freezeOrPropertyApi = (params)=>getAction(`/property-central/property/propertySettled/freezeOrThaw/${params.id}/${params.status}`,{});
const getPropertyChargruleListApi = (params)=>getAction("/property-central/property/propertyChargrule/propertyChargruleList",params);
//数据字典
const addDict = (params)=>postAction("/sys/dict/add",params);
......@@ -170,6 +181,7 @@ export {
loadAllRoleIds,
getPermissionRuleList,
queryPermissionRule,
queryTreeListByTypeForRole,
queryDepartTreeList,
queryDepartTreeSync,
queryIdTree,
......@@ -225,6 +237,14 @@ export {
dispatchCommunityRepairApi,
querycommunityComplaintApi,
auditCommunityComplaintApi,
auditMoveComplaintApi,
getPropertyChargruleListApi,
auditPropertyApi,
freezeOrPropertyApi,
setOwnerLabelApi,
setCommunityOwnerLabelApi,
geQueryByOwnerIdApi,
geCommunityDeleteApi
}
......
......@@ -57,6 +57,26 @@ export const COMPLAINT_STATUS = [
{label: '处理完成', value: 'finish'}
]
// 业委会职位
export const INDUSTRY_JOB = [
{label: '业委会主任', value: 'labelCommitteeDirector'},
{label: '业委会副主任', value: 'labelCommitteeDeputy'},
{label: '委员', value: 'labelCommitteeMember'},
{label: '文员', value: 'labelCommitteeClerk'}
]
// 投诉状态
export const OWNER_LEBEL = [
{label: '留守儿童', value: 'labelDestituteEt'},
{label: '留守老人', value: 'labelDestituteLr'},
{label: '孤', value: 'labelDestituteGu'},
{label: '寡', value: 'labelDestituteGua'},
{label: '病', value: 'labelDestituteBing'},
{label: '弱', value: 'labelDestituteRuo'},
{label: '老', value: 'labelDestituteLao'},
{label: '残', value: 'labelDestituteCan'}
]
/**
* 翻译字段值对应的文本
* @param children
......
......@@ -67,15 +67,13 @@
fullscreen:false
}
},
created(){
this.loadDepart();
},
watch:{
departId(){
this.initDepartComponent()
},
visible: {
handler() {
this.loadDepart();
this.initDepartComponent(true)
}
}
......
......@@ -136,7 +136,7 @@
},
compareToFirstPassword (rule, value, callback) {
const form = this.form;
if (value && value !== form.getFieldValue('password')) {
if (value && form.getFieldValue('password') && value !== form.getFieldValue('password')) {
callback('两次输入的密码不一样!');
} else {
callback()
......
......@@ -62,8 +62,8 @@
</div>
<div class="item">
<p>业主报修待处理</p>
<p>{{pageForm.waitDispatch}}</p><a-button type="primary" size="small" @click="toOperation(4)"
:disabled="pageForm.waitDispatch == 0">去处理</a-button>
<p>{{pageForm.repairWaitHandle}}</p><a-button type="primary" size="small" @click="toOperation(4)"
:disabled="pageForm.repairWaitHandle == 0">去处理</a-button>
</div>
</div>
</div>
......@@ -241,7 +241,7 @@ export default {
this.loading = !this.loading
},
async companyNotice() {
let { result } = await companyNoticeList({ pageNo: 1, pageSize: 5, order: 'desc', column: 'createTime' })
let { result } = await companyNoticeList({ pageNo: 1, pageSize: 5, order: 'desc', column: 'createTime', noticeStatus: 'published' })
this.noticeList = result.records
},
toOperation(type) {
......
<template>
<a-drawer
title="数据规则/按钮权限配置"
width="365"
:closable="false"
@close="onClose"
:visible="visible"
>
<a-tabs defaultActiveKey="1">
<a-tab-pane tab="数据规则" key="1">
<a-checkbox-group v-model="dataruleChecked" v-if="dataruleList.length>0">
<a-row>
<a-col :span="24" v-for="(item,index) in dataruleList" :key=" 'dr'+index ">
<a-checkbox :value="item.id">{{ item.ruleName }}</a-checkbox>
</a-col>
<a-col :span="24">
<div style="width: 100%;margin-top: 15px">
<a-button @click="saveDataruleForRole" type="primary" size="small" icon="save">点击保存</a-button>
</div>
</a-col>
</a-row>
</a-checkbox-group>
<div v-else><h3>无配置信息!</h3></div>
</a-tab-pane>
<!--<a-tab-pane tab="按钮权限" key="2">敬请期待!!!</a-tab-pane>-->
</a-tabs>
</a-drawer>
</template>
<script>
import { getAction,postAction } from '@/api/manage'
export default {
name: 'RoleDataruleModal',
data(){
return {
functionId:'',
roleId:'',
visible:false,
tabList: [{
key: '1',
tab: '数据规则',
}, {
key: '2',
tab: '按钮权限',
}],
activeTabKey: '1',
url:{
datarule:"/sys/role/datarule",
},
dataruleList:[],
dataruleChecked:[]
}
},
methods:{
loadData(){
getAction(`${this.url.datarule}/${this.functionId}/${this.roleId}`).then(res=>{
console.log(res)
if(res.success){
this.dataruleList = res.result.datarule
let drChecked = res.result.drChecked
if(drChecked){
this.dataruleChecked = drChecked.split(",")
}
}
})
},
saveDataruleForRole(){
if(!this.dataruleChecked || this.dataruleChecked.length==0){
this.$message.warning("请注意,现未勾选任何数据权限!")
}
let params = {
permissionId:this.functionId,
roleId:this.roleId,
dataRuleIds:this.dataruleChecked.join(",")
}
console.log("保存数据权限",params)
postAction(this.url.datarule,params).then(res=>{
if(res.success){
this.$message.success(res.message)
}else{
this.$message.error(res.message)
}
})
},
show(functionId,roleId){
this.onReset()
this.functionId = functionId
this.roleId = roleId
this.visible=true
this.loadData()
},
onClose(){
this.visible=false
this.onReset()
},
onTabChange (key) {
this.activeTabKey = key
},
onReset(){
this.functionId=''
this.roleId=''
this.dataruleList=[]
this.dataruleChecked=[]
}
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<a-drawer
:title="title"
:maskClosable="true"
width=650
placement="right"
:closable="true"
@close="close"
:visible="visible"
style="overflow: auto;padding-bottom: 53px;">
<a-form>
<a-form-item label='所拥有的权限'>
<a-tree
checkable
@check="onCheck"
:checkedKeys="checkedKeys"
:treeData="treeData"
@expand="onExpand"
@select="onTreeNodeSelect"
:selectedKeys="selectedKeys"
:expandedKeys="expandedKeysss"
:checkStrictly="checkStrictly">
<span slot="hasDatarule" slot-scope="{slotTitle,ruleFlag}">
{{ slotTitle }}<a-icon v-if="ruleFlag" type="align-left" style="margin-left:5px;color: red;"></a-icon>
</span>
</a-tree>
</a-form-item>
</a-form>
<div class="drawer-bootom-button">
<a-dropdown style="float: left" :trigger="['click']" placement="topCenter">
<a-menu slot="overlay">
<a-menu-item key="1" @click="switchCheckStrictly(1)">父子关联</a-menu-item>
<a-menu-item key="2" @click="switchCheckStrictly(2)">取消关联</a-menu-item>
<a-menu-item key="3" @click="checkALL">全部勾选</a-menu-item>
<a-menu-item key="4" @click="cancelCheckALL">取消全选</a-menu-item>
<a-menu-item key="5" @click="expandAll">展开所有</a-menu-item>
<a-menu-item key="6" @click="closeAll">合并所有</a-menu-item>
</a-menu>
<a-button>
树操作 <a-icon type="up" />
</a-button>
</a-dropdown>
<a-popconfirm title="确定放弃编辑?" @confirm="close" okText="确定" cancelText="取消">
<a-button style="margin-right: .8rem">取消</a-button>
</a-popconfirm>
<a-button @click="handleSubmit(false)" type="primary" :loading="loading" ghost style="margin-right: 0.8rem">仅保存</a-button>
<a-button @click="handleSubmit(true)" type="primary" :loading="loading">保存并关闭</a-button>
</div>
<role-datarule-modal ref="datarule"></role-datarule-modal>
</a-drawer>
</template>
<script>
import {queryTreeListByTypeForRole,queryRolePermission,saveRolePermission} from '@/api/api'
import RoleDataruleModal from './RoleDataruleModal.vue'
export default {
name: "RoleModal",
components:{
RoleDataruleModal
},
data(){
return {
roleId:"",
treeData: [],
defaultCheckedKeys:[],
checkedKeys:[],
expandedKeysss:[],
allTreeKeys:[],
autoExpandParent: true,
checkStrictly: false,
title:"物业权限配置",
visible: false,
loading: false,
selectedKeys:[]
}
},
methods: {
onTreeNodeSelect(id){
if(id && id.length>0){
this.selectedKeys = id
}
this.$refs.datarule.show(this.selectedKeys[0],this.roleId)
},
onCheck (o) {
if(this.checkStrictly){
this.checkedKeys = o.checked;
}else{
this.checkedKeys = o
}
},
show(roleId){
this.roleId=roleId
this.visible = true;
},
close () {
this.reset()
this.$emit('close');
this.visible = false;
},
onExpand(expandedKeys){
this.expandedKeysss = expandedKeys;
this.autoExpandParent = false
},
reset () {
this.expandedKeysss = []
this.checkedKeys = []
this.defaultCheckedKeys = []
this.loading = false
},
expandAll () {
this.expandedKeysss = this.allTreeKeys
},
closeAll () {
this.expandedKeysss = []
},
checkALL () {
this.checkedKeys = this.allTreeKeys
},
cancelCheckALL () {
//this.checkedKeys = this.defaultCheckedKeys
this.checkedKeys = []
},
switchCheckStrictly (v) {
if(v==1){
this.checkStrictly = false
}else if(v==2){
this.checkStrictly = true
}
},
handleCancel () {
this.close()
},
handleSubmit(exit) {
let that = this;
let params = {
roleId:that.roleId,
permissionIds:that.checkedKeys.join(","),
lastpermissionIds:that.defaultCheckedKeys.join(","),
};
that.loading = true;
console.log("请求参数:",params);
saveRolePermission(params).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.loading = false;
if (exit) {
that.close()
}
}else {
that.$message.error(res.message);
that.loading = false;
if (exit) {
that.close()
}
}
this.loadData();
})
},
loadData(){
queryTreeListByTypeForRole().then((res) => {
this.treeData = res.result.treeList
this.allTreeKeys = res.result.ids
queryRolePermission({roleId: this.roleId}).then((res)=>{
this.checkedKeys = [...res.result];
this.defaultCheckedKeys = [...res.result];
this.expandedKeysss = this.allTreeKeys;
console.log(this.defaultCheckedKeys)
})
})
}
},
watch: {
visible () {
if (this.visible) {
this.loadData();
}
}
}
}
</script>
<style lang="less" scoped>
.drawer-bootom-button {
position: absolute;
bottom: 0;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>
\ No newline at end of file
......@@ -194,7 +194,6 @@
})
},
onSelectRoom(value, node) {
console.log(node)
let data = node.dataRef
this.model.roomId = data.value
this.model.roomName = data.label
......
差异被折叠。
......@@ -81,6 +81,14 @@
<span slot="buildingName" slot-scope="text, record">
<span>{{record.buildingName}}{{record.unitName}}{{record.roomName}}</span>
</span>
<span slot="label" slot-scope="text, record">
<!-- <span>{{record.label | filterLabel}}</span> -->
<div>
<a-tag color="blue">业主</a-tag>
<a-tag color="red" v-if="record.labelCommitteeDesc">{{record.labelCommitteeDesc}}</a-tag>
<a-tag color="orange" v-if="record.labelDestituteDesc">{{record.labelDestituteDesc}}</a-tag>
</div>
</span>
<span slot="action" slot-scope="text, record">
<template v-if="record.auditStatus === 'waitAudit'">
<a @click="onRoutetAdd(record.id)">审核</a>
......@@ -101,12 +109,25 @@
更多 <a-icon type="down" />
</a>
<a-menu slot="overlay">
<a-menu-item v-if="!!record.labelCommitteeCode">
<a @click="handlePerssion(record.id)">授权</a>
</a-menu-item>
<a-menu-item>
<a href="javascript:;" @click="handleDetail(record)">详情</a>
</a-menu-item>
<a-menu-item v-if="!record.labelCommitteeCode">
<a href="javascript:;" @click="onHandleSetting(record.id, '1')">设置业委会</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)" placement="topLeft">
<a href="javascript:;" @click="onHandleSetting(record.id, '2')">设置特困人员</a>
</a-menu-item>
<a-menu-item v-if="!!record.labelCommitteeCode">
<a-popconfirm title="确定撤销业委会吗?" @confirm="()=> onDeleteIndustry(record.id)" placement="topLeft">
<a>撤销业委会</a>
</a-popconfirm>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="()=> handleDelete(record.id)" placement="topLeft">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
......@@ -122,18 +143,21 @@
</div>
<notice-modal ref="modalForm" @ok="modalFormOk"></notice-modal>
<!-- 右侧的角色权限配置 -->
<user-role-modal ref="modalUserRole"></user-role-modal>
</a-card>
</template>
<script>
import { getBuildingListApi, getUnitListApi, getRoomListApi, downloadOwnerTemplate } from '@/api/api'
import { getBuildingListApi, getUnitListApi, getRoomListApi, geQueryByOwnerIdApi, geCommunityDeleteApi } from '@/api/api'
import { downFile } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import NoticeModal from './modules/NoticeModal'
import UserRoleModal from './modules/UserRoleModal'
import { filterDictTextByCache } from '@/components/dict/JDictSelectUtil'
import { RELATION_SHIP, filterDictTextByStatic } from '@/assets/static.js'
import { RELATION_SHIP, filterDictTextByStatic, INDUSTRY_JOB, OWNER_LEBEL } from '@/assets/static.js'
import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api'
const labelAllList = [{label: '业主', value: 'owner'}].concat(INDUSTRY_JOB, OWNER_LEBEL)
const columns = [
{
title: '业主',
......@@ -196,7 +220,23 @@ const columns = [
align: 'center',
customRender: function (text) {
return filterDictTextByCache('auditStatus', text)
},
}
},
{
title: '特困人员审批',
dataIndex: 'destituteAuditStatus',
key: 'destituteAuditStatus',
align: 'center',
customRender: function (text) {
return filterDictTextByCache('auditStatus', text)
}
},
{
title: '标签',
dataIndex: 'label',
key: 'label',
align: 'center',
scopedSlots: { customRender: 'label' }
},
{
title: '操作',
......@@ -213,6 +253,7 @@ export default {
mixins: [JeecgListMixin],
components: {
NoticeModal,
UserRoleModal
},
data() {
return {
......@@ -233,6 +274,21 @@ export default {
treeData: [],
}
},
filters: {
filterLabel(value) {
if(value) {
let labelList = value.split(',')
let valueList = []
labelList.forEach(item=> {
let findValue = labelAllList.find(row=>row.value === item)
valueList.push(findValue.label)
})
return valueList.join(',')
} else {
return ''
}
}
},
created() {
this.getBuildingList()
this.initDictData()
......@@ -329,7 +385,12 @@ export default {
},
onRoutetAdd(id) {
this.$router.push({
path: '/information/owner-add?id=' + id,
path: '/information/owner-add?id=' + id
})
},
onHandleSetting(id, type) {
this.$router.push({
path: `/information/owner-setting?id=${id}&type=${type}`
})
},
downloadExportXls() {
......@@ -354,9 +415,27 @@ export default {
}
})
},
},
handlePerssion(ownerId) {
geQueryByOwnerIdApi({ownerId}).then(res=> {
let roleId = res.result.roleId
this.$refs.modalUserRole.show(roleId)
})
},
onDeleteIndustry(id) {
geCommunityDeleteApi({id}).then(res=> {
this.$message.success(res.message);
this.loadData()
})
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
.auditPass {
color: #67C23A;
}
.refuse {
color: #F56C6C;
}
</style>
\ No newline at end of file
......@@ -49,6 +49,17 @@
:disabled="model.handleStatus == 'finish'">
<a-form-model ref="form" :model="form" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="处理状态" :labelCol="{ xs: { span: 24 }, sm: { span: 2 } }" :wrapperCol="wrapperCol"
prop="type">
<a-radio-group name="radioGroup" v-model="form.type">
<a-radio :value="1">内部处理</a-radio>
<a-radio :value="2">外部处理(转给社区)</a-radio>
</a-radio-group>
</a-form-model-item>
</a-col>
</a-row>
<a-row v-if="form.type === 1">
<a-col :span="24">
<a-form-model-item label="处理状态" :labelCol="{ xs: { span: 24 }, sm: { span: 2 } }" :wrapperCol="wrapperCol"
prop="handleStatus">
......@@ -77,7 +88,7 @@
</template>
<script>
import { querycommunityComplaintApi, auditCommunityComplaintApi } from '@/api/api'
import { querycommunityComplaintApi, auditCommunityComplaintApi, auditMoveComplaintApi } from '@/api/api'
export default {
name: 'PropertyChargruleForm',
inject: ['closeCurrent'],
......@@ -88,6 +99,7 @@ export default {
form: {
handleStatus: 'pending',
handleResult: '',
type: 1
},
labelCol: {
xs: { span: 24 },
......@@ -129,12 +141,19 @@ export default {
this.closeCurrent()
},
async onSubmit() {
let res = await auditCommunityComplaintApi({
id: this.$route.query.id,
handleStatus: this.form.handleStatus,
handleResult: this.form.handleResult,
})
this.$message.success(res.message)
if(this.form.type === 1) {
let res = await auditCommunityComplaintApi({
id: this.$route.query.id,
handleStatus: this.form.handleStatus,
handleResult: this.form.handleResult,
})
this.$message.success(res.message)
} else {
let res = await auditMoveComplaintApi({
id: this.$route.query.id
})
this.$message.success(res.message)
}
this.closeCurrent()
},
},
......
......@@ -56,9 +56,8 @@
</template>
<script>
import { getPropertyChargruleListApi, getPropertyDetailApi, auditPropertyApi } from '@/api/api'
import { httpAction, getAction } from '@/api/manage'
import { isMobile, validateCreditCode } from '@/utils/validate'
import { isMobile } from '@/utils/validate'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
const columns = [
......@@ -136,13 +135,6 @@ export default {
callback('请输入正确的联系人电话!')
}
}
const validateCode = (rule, value, callback) => {
if (value && validateCreditCode(value)) {
callback()
} else {
callback('社会统一信用代码输入错误')
}
}
return {
title: '',
......@@ -167,7 +159,7 @@ export default {
confirmLoading: false,
validatorRules: {
propertyName: [{ required: true, message: '请输入物业集团名称', trigger: 'blur' }],
creditCode: [{ required: true, message: '请输入统一信用代码', trigger: 'blur' }, { validator: validateCode }],
creditCode: [{ required: true, message: '请输入统一信用代码', trigger: 'blur' }],
legalName: [{ required: true, message: '请输入法人代表', trigger: 'blur' }],
registCapital: [{ required: true, message: '请输入注册资本', trigger: 'blur' }],
contactName: [{ required: true, message: '请输入联系人', trigger: 'blur' }],
......@@ -193,8 +185,6 @@ export default {
list: '/property-central/property/communityReconciliation/communityAccountPage'
},
costList: [],
mapRef: null,
columns: columns,
......@@ -209,20 +199,16 @@ export default {
}
},
methods: {
async onLoadCostList() {
let data = await getPropertyChargruleListApi()
this.costList = data.result
},
async getPageDetail() {
let { result } = await getPropertyDetailApi({ id: this.$route.query.id })
this.edit(result)
if (result.provinceName) {
this.getLongitude(
result.provinceName,
result.provinceName + result.cityName + result.countyName + result.addressInfo,
mapZoom[3]
)
}
// let { result } = await getPropertyDetailApi({ id: this.$route.query.id })
// this.edit(result)
// if (result.provinceName) {
// this.getLongitude(
// result.provinceName,
// result.provinceName + result.cityName + result.countyName + result.addressInfo,
// mapZoom[3]
// )
// }
},
onCancel() {
this.closeCurrent()
......@@ -239,115 +225,6 @@ export default {
},
onExamine(type) {
this.closeCurrent()
// const that = this
// if (type == 1) {
// return auditPropertyApi({
// id: this.$route.query.id,
// auditStatus: 'auditPass',
// }).then((res) => {
// that.$message.success('审核通过成功')
// that.$emit('ok')
// this.closeCurrent()
// })
// } else if (type == 2) {
// return auditPropertyApi({
// id: this.$route.query.id,
// auditStatus: 'refuse',
// }).then((res) => {
// that.$message.success('审核驳回成功')
// this.closeCurrent()
// })
// }
},
addressChange(val) {
const province = Object.keys(val[0])[0]
const city = Object.keys(val[1])[0]
const county = Object.keys(val[2])[0]
this.model.provinceName = val[0][province]
this.model.provinceCode = province
this.model.cityName = val[1][city]
this.model.cityCode = city
this.model.countyName = val[2][county]
this.model.countyCode = county
if (this.model.addressInfo) {
this.getLongitude(
this.model.provinceName,
this.model.provinceName + this.model.cityName + this.model.countyName + this.model.addressInfo,
mapZoom[3]
)
}
},
addressBlur(val) {
if (this.model.provinceName) {
this.getLongitude(
this.model.provinceName,
this.model.provinceName + this.model.cityName + this.model.countyName + val.target.value,
mapZoom[3]
)
}
},
getAddress(e) {
let _this = this
// 创建地理编码实例
var myGeo = new BMapGL.Geocoder()
// 根据坐标得到地址描述
myGeo.getLocation(new BMapGL.Point(e.latlng.lng, e.latlng.lat), function (result) {
if (result) {
_this.mapRef.clearOverlays()
_this.model.registAdress = [
result.addressComponents.province,
result.addressComponents.city,
result.addressComponents.district,
]
_this.model.addressInfo = result.addressComponents.street + result.addressComponents.streetNumber
_this.model.longitude = result.point.lng
_this.model.latitude = result.point.lat
_this.positionMap(e.latlng.lng, e.latlng.lat, mapZoom[3], result.address)
console.log(result)
}
})
},
positionMap(mapCenterLng, mapCenterLat, mapzoom, address) {
var point = new BMapGL.Point(mapCenterLng, mapCenterLat) // 创建点坐标
this.mapRef.centerAndZoom(point, mapzoom)
var marker = new BMapGL.Marker(point, { title: address }) // 创建标注
this.mapRef.addOverlay(marker) // 将标注添加到地图中
let _this = this
// marker.addEventListener("click", function(){
var label = new BMapGL.Label(address, {
// 创建文本标注
position: point, // 设置标注的地理位置
offset: new BMapGL.Size(0, -55), // 设置标注的偏移量
})
_this.mapRef.addOverlay(label) // 将标注添加到地图中
label.setStyle({
// 设置label的样式
color: '#333',
fontSize: '14px',
padding: '4px 10px',
border: '1px solid #1E90FF',
borderRadius: '4px',
transform: 'translateX(-40%)',
})
// });
},
getLongitude(city, address, zoom) {
let _this = this
var myGeo = new BMapGL.Geocoder()
myGeo.getPoint(
address,
function (point) {
if (point) {
_this.mapRef.clearOverlays()
_this.model.longitude = point.lng
_this.model.latitude = point.lat
_this.positionMap(point.lng, point.lat, zoom, address)
} else {
console.log('您选择的地址没有解析到结果!')
}
},
city
)
},
submitForm() {
const that = this
......@@ -388,7 +265,6 @@ export default {
mounted() {
//备份model原始值
//this.modelDefault = JSON.parse(JSON.stringify(this.model))
// this.onLoadCostList()
this.pageType = this.$route.query.type
if (this.$route.query.type == '1') {
this.title = '详情'
......
<template>
<a-drawer
title="数据规则/按钮权限配置"
width="365"
:closable="false"
@close="onClose"
:visible="visible"
>
<a-tabs defaultActiveKey="1">
<a-tab-pane tab="数据规则" key="1">
<a-checkbox-group v-model="dataruleChecked" v-if="dataruleList.length>0">
<a-row>
<a-col :span="24" v-for="(item,index) in dataruleList" :key=" 'dr'+index ">
<a-checkbox :value="item.id">{{ item.ruleName }}</a-checkbox>
</a-col>
<a-col :span="24">
<div style="width: 100%;margin-top: 15px">
<a-button @click="saveDataruleForRole" type="primary" size="small" icon="save">点击保存</a-button>
</div>
</a-col>
</a-row>
</a-checkbox-group>
<div v-else><h3>无配置信息!</h3></div>
</a-tab-pane>
<!--<a-tab-pane tab="按钮权限" key="2">敬请期待!!!</a-tab-pane>-->
</a-tabs>
</a-drawer>
</template>
<script>
import ARow from 'ant-design-vue/es/grid/Row'
import ACol from 'ant-design-vue/es/grid/Col'
import { getAction,postAction } from '@/api/manage'
export default {
name: 'RoleDataruleModal',
components: { ACol, ARow },
data(){
return {
functionId:'',
roleId:'',
visible:false,
tabList: [{
key: '1',
tab: '数据规则',
}, {
key: '2',
tab: '按钮权限',
}],
activeTabKey: '1',
url:{
datarule:"/sys/role/datarule",
},
dataruleList:[],
dataruleChecked:[]
}
},
methods:{
loadData(){
getAction(`${this.url.datarule}/${this.functionId}/${this.roleId}`).then(res=>{
console.log(res)
if(res.success){
this.dataruleList = res.result.datarule
let drChecked = res.result.drChecked
if(drChecked){
this.dataruleChecked = drChecked.split(",")
}
}
})
},
saveDataruleForRole(){
if(!this.dataruleChecked || this.dataruleChecked.length==0){
this.$message.warning("请注意,现未勾选任何数据权限!")
}
let params = {
permissionId:this.functionId,
roleId:this.roleId,
dataRuleIds:this.dataruleChecked.join(",")
}
console.log("保存数据权限",params)
postAction(this.url.datarule,params).then(res=>{
if(res.success){
this.$message.success(res.message)
}else{
this.$message.error(res.message)
}
})
},
show(functionId,roleId){
this.onReset()
this.functionId = functionId
this.roleId = roleId
this.visible=true
this.loadData()
},
onClose(){
this.visible=false
this.onReset()
},
onTabChange (key) {
this.activeTabKey = key
},
onReset(){
this.functionId=''
this.roleId=''
this.dataruleList=[]
this.dataruleChecked=[]
}
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<a-drawer
:title="title"
:maskClosable="true"
width=650
placement="right"
:closable="true"
@close="close"
:visible="visible"
style="overflow: auto;padding-bottom: 53px;">
<a-form>
<a-form-item label='所拥有的权限'>
<a-tree
checkable
@check="onCheck"
:checkedKeys="checkedKeys"
:treeData="treeData"
@expand="onExpand"
@select="onTreeNodeSelect"
:selectedKeys="selectedKeys"
:expandedKeys="expandedKeysss"
:checkStrictly="checkStrictly">
<span slot="hasDatarule" slot-scope="{slotTitle,ruleFlag}">
{{ slotTitle }}<a-icon v-if="ruleFlag" type="align-left" style="margin-left:5px;color: red;"></a-icon>
</span>
</a-tree>
</a-form-item>
</a-form>
<div class="drawer-bootom-button">
<a-dropdown style="float: left" :trigger="['click']" placement="topCenter">
<a-menu slot="overlay">
<a-menu-item key="1" @click="switchCheckStrictly(1)">父子关联</a-menu-item>
<a-menu-item key="2" @click="switchCheckStrictly(2)">取消关联</a-menu-item>
<a-menu-item key="3" @click="checkALL">全部勾选</a-menu-item>
<a-menu-item key="4" @click="cancelCheckALL">取消全选</a-menu-item>
<a-menu-item key="5" @click="expandAll">展开所有</a-menu-item>
<a-menu-item key="6" @click="closeAll">合并所有</a-menu-item>
</a-menu>
<a-button>
树操作 <a-icon type="up" />
</a-button>
</a-dropdown>
<a-popconfirm title="确定放弃编辑?" @confirm="close" okText="确定" cancelText="取消">
<a-button style="margin-right: .8rem">取消</a-button>
</a-popconfirm>
<a-button @click="handleSubmit(false)" type="primary" :loading="loading" ghost style="margin-right: 0.8rem">仅保存</a-button>
<a-button @click="handleSubmit(true)" type="primary" :loading="loading">保存并关闭</a-button>
</div>
<role-datarule-modal ref="datarule"></role-datarule-modal>
</a-drawer>
</template>
<script>
import {queryTreeListByTypeForRole,queryRolePermission,saveRolePermission} from '@/api/api'
import RoleDataruleModal from './RoleDataruleModal.vue'
export default {
name: "RoleModal",
components:{
RoleDataruleModal
},
data(){
return {
roleId:"",
treeData: [],
defaultCheckedKeys:[],
checkedKeys:[],
expandedKeysss:[],
allTreeKeys:[],
autoExpandParent: true,
checkStrictly: false,
title:"物业权限配置",
visible: false,
loading: false,
selectedKeys:[]
}
},
methods: {
onTreeNodeSelect(id){
if(id && id.length>0){
this.selectedKeys = id
}
this.$refs.datarule.show(this.selectedKeys[0],this.roleId)
},
onCheck (o) {
if(this.checkStrictly){
this.checkedKeys = o.checked;
}else{
this.checkedKeys = o
}
},
show(roleId){
this.roleId=roleId
this.visible = true;
},
close () {
this.reset()
this.$emit('close');
this.visible = false;
},
onExpand(expandedKeys){
this.expandedKeysss = expandedKeys;
this.autoExpandParent = false
},
reset () {
this.expandedKeysss = []
this.checkedKeys = []
this.defaultCheckedKeys = []
this.loading = false
},
expandAll () {
this.expandedKeysss = this.allTreeKeys
},
closeAll () {
this.expandedKeysss = []
},
checkALL () {
this.checkedKeys = this.allTreeKeys
},
cancelCheckALL () {
//this.checkedKeys = this.defaultCheckedKeys
this.checkedKeys = []
},
switchCheckStrictly (v) {
if(v==1){
this.checkStrictly = false
}else if(v==2){
this.checkStrictly = true
}
},
handleCancel () {
this.close()
},
handleSubmit(exit) {
let that = this;
let params = {
roleId:that.roleId,
permissionIds:that.checkedKeys.join(","),
lastpermissionIds:that.defaultCheckedKeys.join(","),
};
that.loading = true;
console.log("请求参数:",params);
saveRolePermission(params).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.loading = false;
if (exit) {
that.close()
}
}else {
that.$message.error(res.message);
that.loading = false;
if (exit) {
that.close()
}
}
this.loadData();
})
},
loadData(){
queryTreeListByTypeForRole({platformType: 'company'}).then((res) => {
this.treeData = res.result.treeList
this.allTreeKeys = res.result.ids
queryRolePermission({roleId:this.roleId}).then((res)=>{
this.checkedKeys = [...res.result];
this.defaultCheckedKeys = [...res.result];
this.expandedKeysss = this.allTreeKeys;
console.log(this.defaultCheckedKeys)
})
})
}
},
watch: {
visible () {
if (this.visible) {
this.loadData();
}
}
}
}
</script>
<style lang="less" scoped>
.drawer-bootom-button {
position: absolute;
bottom: 0;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>
\ No newline at end of file
......@@ -160,7 +160,7 @@ export default {
num = item.unPaidOwnerNum
}
return {
x: item.yearNum + '年' + item.monthNum + '月',
x: item.monthNum + '月',
y: num,
min: 700
}
......
......@@ -26,8 +26,8 @@
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="8">
<a-form-item label="真实名字">
<a-input placeholder="请输入真实名字" v-model="queryParam.realname"></a-input>
<a-form-item label="用户姓名">
<a-input placeholder="请输入用户姓名" v-model="queryParam.realname"></a-input>
</a-form-item>
</a-col>
......
......@@ -31,8 +31,8 @@
<div class="drawer-bootom-button">
<a-dropdown style="float: left" :trigger="['click']" placement="topCenter">
<a-menu slot="overlay">
<a-menu-item key="1" @click="switchCheckStrictly(1)">父子关联</a-menu-item>
<a-menu-item key="2" @click="switchCheckStrictly(2)">取消关联</a-menu-item>
<!-- <a-menu-item key="1" @click="switchCheckStrictly(1)">父子关联</a-menu-item>
<a-menu-item key="2" @click="switchCheckStrictly(2)">取消关联</a-menu-item> -->
<a-menu-item key="3" @click="checkALL">全部勾选</a-menu-item>
<a-menu-item key="4" @click="cancelCheckALL">取消全选</a-menu-item>
<a-menu-item key="5" @click="expandAll">展开所有</a-menu-item>
......
......@@ -88,7 +88,7 @@ module.exports = {
devServer: {
port: 3000,
// hot: true,
// disableHostCheck: true,
disableHostCheck: true,
// overlay: {
// warnings: false,
// errors: true,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论