sasp-admin 0.2.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +227 -0
- package/package.json +19 -0
- package/router.js +83 -0
- package/src/assets/font/iconfont.css +1346 -0
- package/src/assets/font/iconfont.eot +0 -0
- package/src/assets/font/iconfont.js +1 -0
- package/src/assets/font/iconfont.svg +827 -0
- package/src/assets/font/iconfont.ttf +0 -0
- package/src/assets/font/iconfont.woff +0 -0
- package/src/assets/images/loading-bar.gif +0 -0
- package/src/assets/js/adminInstall.js +36 -0
- package/src/assets/js/api/apiAdmin.js +613 -0
- package/src/assets/js/global/dataGlobal.js +260 -0
- package/src/assets/js/global/logGlobal.js +22 -0
- package/src/assets/js/global/paramGlobal.js +67 -0
- package/src/assets/js/global/resGlobal.js +91 -0
- package/src/assets/js/global/userGlobal.js +283 -0
- package/src/components/complexViewRendering.vue +601 -0
- package/src/components/ifmLink.vue +71 -0
- package/src/components/public/data/plDataCascader.vue +85 -0
- package/src/components/public/data/plDataRadio.vue +73 -0
- package/src/components/public/data/plDataRadioGroup.vue +70 -0
- package/src/components/public/data/plDataSelect.vue +856 -0
- package/src/components/public/data/plDatePicker.vue +159 -0
- package/src/components/public/org/bg.png +0 -0
- package/src/components/public/org/sysOrgPosUserSelect.vue +1237 -0
- package/src/components/public/org/sysOrgPosUserSelectDark.vue +1402 -0
- package/src/components/public/org/sysOrgPosUserSelectNew.vue +1527 -0
- package/src/components/public/upload/images/compress.png +0 -0
- package/src/components/public/upload/images/emipty.png +0 -0
- package/src/components/public/upload/images/excel.png +0 -0
- package/src/components/public/upload/images/file.png +0 -0
- package/src/components/public/upload/images/pdf.png +0 -0
- package/src/components/public/upload/images/powerpoint.png +0 -0
- package/src/components/public/upload/images/project.png +0 -0
- package/src/components/public/upload/images/sound.png +0 -0
- package/src/components/public/upload/images/txt.png +0 -0
- package/src/components/public/upload/images/video.png +0 -0
- package/src/components/public/upload/images/visio.png +0 -0
- package/src/components/public/upload/images/word.png +0 -0
- package/src/components/public/upload/plImage.vue +287 -0
- package/src/components/public/upload/plImgUpload.vue +137 -0
- package/src/components/public/upload/plUpload.vue +1124 -0
- package/src/components/public/upload/uploadImg.js +8 -0
- package/src/main.js +0 -0
- package/src/views/VueMenuView.vue +143 -0
- package/src/views/cloudMenuView.vue +125 -0
- package/src/views/complex/config/complex.vue +501 -0
- package/src/views/complex/config/complexSetting.vue +1250 -0
- package/src/views/complex/rendering/complexShow.vue +16 -0
- package/src/views/data/dataManage.vue +560 -0
- package/src/views/data/sysData.vue +292 -0
- package/src/views/event/eventManager/vueEventDiy.vue +1184 -0
- package/src/views/event/eventManager/vueEventMain.vue +108 -0
- package/src/views/event/eventManager/vueEventSys.vue +296 -0
- package/src/views/event/js/apiEvent.js +22 -0
- package/src/views/fileLog/fileDownloadLog.vue +437 -0
- package/src/views/initData/initData.vue +4316 -0
- package/src/views/log/dblog/logdbDevelop.vue +306 -0
- package/src/views/log/dblog/logdbEnt.vue +331 -0
- package/src/views/log/dblog/logdbGov.vue +395 -0
- package/src/views/log/error/logError.vue +553 -0
- package/src/views/log/loginlog/logManageDevOrSup.vue +357 -0
- package/src/views/log/loginlog/logManageEnt.vue +343 -0
- package/src/views/log/loginlog/logManageGov.vue +328 -0
- package/src/views/log/sms/logSms.vue +308 -0
- package/src/views/menu/component/menuManageComponent.vue +2402 -0
- package/src/views/menu/component/menuModule.vue +449 -0
- package/src/views/menu/menuLocal.vue +223 -0
- package/src/views/menu/menuManage.vue +1135 -0
- package/src/views/menu/tenantMenuManage.vue +1132 -0
- package/src/views/menuRouter/cview/cviewShow.vue +18 -0
- package/src/views/menuRouter/cviewMenuRouter.vue +183 -0
- package/src/views/menuRouter/menuView.vue +132 -0
- package/src/views/menuRouter/urlMenuRouter.vue +160 -0
- package/src/views/org/entOrgTree.vue +1050 -0
- package/src/views/org/ownerMenu/ownerMenuTree.vue +269 -0
- package/src/views/org/safeValidate/safeValidate.vue +469 -0
- package/src/views/org/sysEntOrgUserDetail.vue +3390 -0
- package/src/views/org/sysOrgDimension.vue +832 -0
- package/src/views/org/sysOrgPosUserDetail.vue +1648 -0
- package/src/views/org/sysOrgPosUserTree.vue +1101 -0
- package/src/views/org/sysOrgTree.vue +864 -0
- package/src/views/param/sysParam.vue +987 -0
- package/src/views/preview/pdfViewer.vue +82 -0
- package/src/views/resources/js/resourcesCommon.js +137 -0
- package/src/views/resources/resRouter/resView.vue +161 -0
- package/src/views/resources/resourcesTabs.vue +82 -0
- package/src/views/resources/tabs/comp/pageResPreview.vue +309 -0
- package/src/views/resources/tabs/comp/pageResRegister.vue +1120 -0
- package/src/views/resources/tabs/dataResources.vue +843 -0
- package/src/views/resources/tabs/pageResources.vue +970 -0
- package/src/views/role/allowMenu.vue +148 -0
- package/src/views/role/authRole/authRole.vue +427 -0
- package/src/views/role/authRole/component/allocateSetting.vue +1056 -0
- package/src/views/role/authRole/component/authSetting.vue +1196 -0
- package/src/views/role/commonRole/commonRole.vue +677 -0
- package/src/views/role/commonRole/compoment/allocateRoleMenuSetting.vue +335 -0
- package/src/views/role/commonRole/compoment/authLinkMenuTree.vue +55 -0
- package/src/views/role/commonRole/compoment/authSettingNew.vue +190 -0
- package/src/views/role/commonRole/compoment/commonSetting.vue +1576 -0
- package/src/views/role/commonRole/compoment/commonSettingAdjust.vue +584 -0
- package/src/views/role/commonRole/compoment/commonSettingNew.vue +572 -0
- package/src/views/role/commonRole/compoment/roleMenuPower.vue +226 -0
- package/src/views/role/commonRole/compoment/roleMenuPowerSetting.vue +69 -0
- package/src/views/role/commonRole/compoment/roleMenuSetting.vue +365 -0
- package/src/views/role/commonRole/compoment/roleSourceSetting.vue +229 -0
- package/src/views/role/commonRole/tenantCommonRole.vue +768 -0
- package/src/views/role/role.vue +135 -0
- package/src/views/role/roleMenuOption.vue +898 -0
- package/src/views/role/roleSynchroRemind.vue +399 -0
- package/src/views/role/sysRole.vue +1525 -0
- package/src/views/role/viewMenuOptDetail.vue +182 -0
- package/src/views/sms/sendSms.vue +164 -0
- package/src/views/station/orgStation.vue +561 -0
- package/src/views/tenant/appContentManager.vue +938 -0
- package/src/views/tenant/appManager.vue +642 -0
- package/src/views/tenant/tenantRoleManager.vue +670 -0
- package/src/views/tenant/tenantUserManager.vue +615 -0
- package/src/views/threeinone/compoment/safeCascadeSelect.vue +327 -0
- package/src/views/threeinone/init/safeInitRegion.vue +203 -0
- package/src/views/threeinone/safeManager.vue +927 -0
- package/src/views/threeinone/safeMenuManage.vue +565 -0
- package/src/views/threeinone/safeOrgSpv.vue +364 -0
- package/src/views/threeinone/safeSpv/safeSpvLeftTree.vue +109 -0
- package/src/views/threeinone/safeSpv/safeSpvMain.vue +335 -0
- package/src/views/threeinone/safeSpvEconView.vue +569 -0
- package/src/views/threeinone/safeValidateRegion.vue +328 -0
- package/src/views/urlResource/urlResource.vue +856 -0
- package/src/views/user/empowerUser/empowerEntUserManage.vue +415 -0
- package/src/views/user/empowerUser/empowerOrgTree.vue +167 -0
- package/src/views/user/empowerUser/empowerUserList.vue +633 -0
- package/src/views/user/empowerUser/empowerUserListMenuDeatil.vue +656 -0
- package/src/views/user/empowerUser/empowerUserListViewMenuTree.vue +257 -0
- package/src/views/user/empowerUser/empowerUserManage.vue +99 -0
- package/src/views/user/stationUserManage.vue +934 -0
- package/src/views/user/userManage.vue +737 -0
- package/src/views/user/userMangement.vue +938 -0
- package/src/views/user/viewMenu/viewMenu.vue +113 -0
- package/src/views/versionupdatetool/versionUpdateTool.vue +225 -0
- package/src/views/versionupdatetool/versioninfomation/verisonInfomationManagement.vue +68 -0
|
@@ -0,0 +1,3390 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div style="width: 100%;height: 100%" @click="menuVisible=false">
|
|
3
|
+
<el-container style="height: 100%;padding: 10px 5px;overflow-y: hidden;" class="detail-main">
|
|
4
|
+
<el-header style="height: auto;">
|
|
5
|
+
<el-collapse accordion style="width: 100%" >
|
|
6
|
+
<el-collapse-item name="1">
|
|
7
|
+
<template slot="title">
|
|
8
|
+
<i class="header-icon el-icon-info"></i> 组织基本信息
|
|
9
|
+
</template>
|
|
10
|
+
<el-form :model="orgObj" size="small">
|
|
11
|
+
<el-row>
|
|
12
|
+
<el-col :span="12">
|
|
13
|
+
<el-form-item label="组织名称" label-width="120px">
|
|
14
|
+
<el-input v-model="formOrgName"></el-input>
|
|
15
|
+
</el-form-item>
|
|
16
|
+
</el-col>
|
|
17
|
+
<el-col :span="12">
|
|
18
|
+
<el-form-item label="组织类型" label-width="120px">
|
|
19
|
+
<el-input v-model="orgTypeObj[orgObj.orgType]" disabled ></el-input>
|
|
20
|
+
</el-form-item>
|
|
21
|
+
</el-col>
|
|
22
|
+
<el-col :span="12">
|
|
23
|
+
<el-form-item label="上级组织" label-width="120px">
|
|
24
|
+
<el-input v-model="orgObj.orgParentName" disabled></el-input>
|
|
25
|
+
</el-form-item>
|
|
26
|
+
</el-col>
|
|
27
|
+
<el-col :span="12" v-if="showOrgEntType && orgObj.orgType == 'ogn'">
|
|
28
|
+
<el-form-item label="是否是企业" label-width="120px">
|
|
29
|
+
<el-radio-group v-model="orgObj.entType">
|
|
30
|
+
<el-radio label="1">是</el-radio>
|
|
31
|
+
<el-radio label="0">否</el-radio>
|
|
32
|
+
</el-radio-group>
|
|
33
|
+
</el-form-item>
|
|
34
|
+
|
|
35
|
+
</el-col>
|
|
36
|
+
</el-row>
|
|
37
|
+
<el-row>
|
|
38
|
+
<el-col :span="12" v-if="orgObj.orgType == 'dept'">
|
|
39
|
+
<el-form-item label="部门分类" label-width="120px">
|
|
40
|
+
<el-select style="width: 100%" v-model="orgObj.orgClassify">
|
|
41
|
+
<el-option v-for="item in deptTypeArr"
|
|
42
|
+
:label="item.label" :value="item.value" :key="item.value">
|
|
43
|
+
</el-option>
|
|
44
|
+
</el-select>
|
|
45
|
+
</el-form-item>
|
|
46
|
+
</el-col>
|
|
47
|
+
<el-col :span="12">
|
|
48
|
+
<el-form-item label="顺序" label-width="120px">
|
|
49
|
+
<el-input v-model="orgObj.sort"></el-input>
|
|
50
|
+
</el-form-item>
|
|
51
|
+
</el-col>
|
|
52
|
+
</el-row>
|
|
53
|
+
<el-row style="text-align: center">
|
|
54
|
+
<el-button type="primary" @click="updateOrgName" icon="el-icon-success"
|
|
55
|
+
size="small">保存
|
|
56
|
+
</el-button>
|
|
57
|
+
</el-row>
|
|
58
|
+
</el-form>
|
|
59
|
+
</el-collapse-item>
|
|
60
|
+
</el-collapse>
|
|
61
|
+
</el-header>
|
|
62
|
+
<el-main style="height: 100%;overflow-y: hidden" v-loading="loading">
|
|
63
|
+
<el-tabs type="border-card" style="height: 100%" v-model="activeTabs">
|
|
64
|
+
<el-tab-pane label="组织直属用户" name="1" >
|
|
65
|
+
<el-container style="height: 100%;" v-if="activeTabs == '1'">
|
|
66
|
+
<el-main style="height: 100%;padding: 0">
|
|
67
|
+
<el-container style="height: 100%">
|
|
68
|
+
<el-header style="height: auto;">
|
|
69
|
+
<div class="search-form-parent el-card">
|
|
70
|
+
<el-form :inline="true" :model="crud.searchForm" size="small"
|
|
71
|
+
class="demo-form-inline"
|
|
72
|
+
@keyup.enter.native="crud.doSearch()" onSubmit="return false;">
|
|
73
|
+
<el-form-item label="用户名称">
|
|
74
|
+
<el-input v-model="crud.searchForm.userNameUnified"
|
|
75
|
+
placeholder="中文、拼音全拼、简拼"></el-input>
|
|
76
|
+
</el-form-item>
|
|
77
|
+
<el-form-item label="用户状态">
|
|
78
|
+
<el-select v-model="crud.searchForm.userStatus" clearable>
|
|
79
|
+
<el-option v-for="(value,key) in userStatusMap" :key="key" :value="key"
|
|
80
|
+
:label="value">
|
|
81
|
+
</el-option>
|
|
82
|
+
</el-select>
|
|
83
|
+
</el-form-item>
|
|
84
|
+
<!--所属岗位-->
|
|
85
|
+
<el-form-item label="所属岗位">
|
|
86
|
+
<el-select v-model="crud.searchForm.posDevId" v-if="devUser"
|
|
87
|
+
clearable filterable
|
|
88
|
+
style="width: 100%">
|
|
89
|
+
<el-option v-for="(stationName,stationId) in allowStationObj" :key="stationId" :value="stationId"
|
|
90
|
+
:label="stationName">
|
|
91
|
+
</el-option>
|
|
92
|
+
</el-select>
|
|
93
|
+
<el-select v-model="crud.searchForm.posId" v-else
|
|
94
|
+
clearable filterable
|
|
95
|
+
style="width: 100%">
|
|
96
|
+
<el-option v-for="(stationName,stationId) in allowStationObj" :key="stationId" :value="stationId"
|
|
97
|
+
:label="stationName">
|
|
98
|
+
</el-option>
|
|
99
|
+
</el-select>
|
|
100
|
+
</el-form-item>
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
<el-form-item>
|
|
104
|
+
<el-button type="primary" icon="el-icon-search"
|
|
105
|
+
@click="crud.doSearch()">查询
|
|
106
|
+
</el-button>
|
|
107
|
+
<el-button icon="el-icon-close" @click="crud.resetSearch()">清空
|
|
108
|
+
</el-button>
|
|
109
|
+
</el-form-item>
|
|
110
|
+
</el-form>
|
|
111
|
+
</div>
|
|
112
|
+
</el-header>
|
|
113
|
+
|
|
114
|
+
<el-main id="tableMain" style="height: 100%;">
|
|
115
|
+
<el-container style="height:100%" class="table-list-container">
|
|
116
|
+
<el-header style="height: auto;">
|
|
117
|
+
<el-button type="primary" size="small" icon="el-icon-check"
|
|
118
|
+
@click="addUser()">添加用户
|
|
119
|
+
</el-button>
|
|
120
|
+
|
|
121
|
+
<el-button type="primary" size="small" icon="el-icon-check"
|
|
122
|
+
@click="chooseUser">从用户列表选择
|
|
123
|
+
</el-button>
|
|
124
|
+
<el-button type="primary" size="small" icon="el-icon-edit"
|
|
125
|
+
@click="adjustOrder">调整用户顺序
|
|
126
|
+
</el-button>
|
|
127
|
+
<el-button type="success" size="small"
|
|
128
|
+
style="margin-left: 10px"
|
|
129
|
+
icon="el-icon-setting"
|
|
130
|
+
@click="settingRole()">设置角色
|
|
131
|
+
</el-button>
|
|
132
|
+
<el-popover style="margin-left: 10px"
|
|
133
|
+
placement="bottom" width="260" trigger="click">
|
|
134
|
+
<el-button size="small" type="primary" @click="exportUserData('local')">当前数据</el-button>
|
|
135
|
+
<el-button size="small" type="primary" @click="exportUserData('select')">选择数据</el-button>
|
|
136
|
+
<el-button size="small" type="primary" @click="exportUserData('all')">全部数据</el-button>
|
|
137
|
+
<el-button slot="reference" icon="saspiconfont pl-icon-moban" type="warning" size="small" >导出</el-button>
|
|
138
|
+
</el-popover>
|
|
139
|
+
|
|
140
|
+
<el-button type="danger" size="small" icon="el-icon-delete"
|
|
141
|
+
style="margin-left: 10px"
|
|
142
|
+
@click="deleteUser()">删除
|
|
143
|
+
</el-button>
|
|
144
|
+
|
|
145
|
+
<el-button type="success" size="small" icon="el-icon-plus"
|
|
146
|
+
style="margin-left: 10px" v-if="devUser"
|
|
147
|
+
@click="openBatchAddPosUser()">批量插入岗位
|
|
148
|
+
</el-button>
|
|
149
|
+
|
|
150
|
+
</el-header>
|
|
151
|
+
<el-main style="height: 100%;" ref="tableMain">
|
|
152
|
+
<el-table :data="crud.dataStore.records" :ref="crud.tableRef" stripe border
|
|
153
|
+
height="100%"
|
|
154
|
+
row-key="id"
|
|
155
|
+
:row-class-name="tableRowClassName"
|
|
156
|
+
style="width: 100%;" @row-click="activeOrgRow">
|
|
157
|
+
<el-table-column type="selection" width="40"
|
|
158
|
+
align="center"></el-table-column>
|
|
159
|
+
<el-table-column type="index" label="序号" align="center"
|
|
160
|
+
width="60"></el-table-column>
|
|
161
|
+
<el-table-column label="用户账号" prop="userAccount"
|
|
162
|
+
show-overflow-tooltip
|
|
163
|
+
align="center"></el-table-column>
|
|
164
|
+
<el-table-column label="用户名称" prop="userName"
|
|
165
|
+
show-overflow-tooltip
|
|
166
|
+
align="center">
|
|
167
|
+
<template slot-scope="scope">
|
|
168
|
+
<span>{{scope.row.userName}}</span>
|
|
169
|
+
</template>
|
|
170
|
+
</el-table-column>
|
|
171
|
+
<el-table-column label="所属部门" prop="orgName"
|
|
172
|
+
show-overflow-tooltip
|
|
173
|
+
align="center"></el-table-column>
|
|
174
|
+
<el-table-column label="所属岗位" prop="stationId"
|
|
175
|
+
show-overflow-tooltip
|
|
176
|
+
align="center" v-if="devUser">
|
|
177
|
+
<template slot-scope="scope">
|
|
178
|
+
{{formatterStationDev(scope.row)}}
|
|
179
|
+
</template>
|
|
180
|
+
</el-table-column>
|
|
181
|
+
<el-table-column label="所属岗位" prop="stationId"
|
|
182
|
+
show-overflow-tooltip
|
|
183
|
+
align="center" v-if="!devUser">
|
|
184
|
+
<template slot-scope="scope">
|
|
185
|
+
{{formatterStation(scope.row.posId)}}
|
|
186
|
+
</template>
|
|
187
|
+
</el-table-column>
|
|
188
|
+
<el-table-column label="工号"
|
|
189
|
+
show-overflow-tooltip
|
|
190
|
+
prop="jobNum" align="center" width="80">
|
|
191
|
+
</el-table-column>
|
|
192
|
+
|
|
193
|
+
<el-table-column label="所属角色"
|
|
194
|
+
width="180"
|
|
195
|
+
show-overflow-tooltip
|
|
196
|
+
prop="userRoleId" show-overflow-tooltip
|
|
197
|
+
align="center">
|
|
198
|
+
<template slot-scope="scope">
|
|
199
|
+
{{formatterRole(scope.row.userRoleId)}}
|
|
200
|
+
</template>
|
|
201
|
+
</el-table-column>
|
|
202
|
+
<!--<el-table-column label="用户状态" prop="userStatus"-->
|
|
203
|
+
<!--align="center">-->
|
|
204
|
+
<!--<template slot-scope="scope">-->
|
|
205
|
+
<!--<el-switch-->
|
|
206
|
+
<!--@change="changeUserStatus(scope.row)"-->
|
|
207
|
+
<!--v-model="scope.row.userStatus"-->
|
|
208
|
+
<!--active-value="10"-->
|
|
209
|
+
<!--inactive-value="20">-->
|
|
210
|
+
<!--</el-switch>-->
|
|
211
|
+
<!--</template>-->
|
|
212
|
+
<!--</el-table-column>-->
|
|
213
|
+
<el-table-column label="是否负责人" prop="principal"
|
|
214
|
+
align="center">
|
|
215
|
+
<template slot-scope="scope">
|
|
216
|
+
<el-switch
|
|
217
|
+
:disabled="scope.row.principal == '1'"
|
|
218
|
+
@change="changePrincipal(scope.row)"
|
|
219
|
+
v-model="scope.row.principal"
|
|
220
|
+
active-value="1"
|
|
221
|
+
inactive-value="0">
|
|
222
|
+
</el-switch>
|
|
223
|
+
</template>
|
|
224
|
+
</el-table-column>
|
|
225
|
+
<el-table-column label="操作" width="320" align="center" prop="operate">
|
|
226
|
+
<template slot-scope="scope">
|
|
227
|
+
<el-button size="small" icon="el-icon-edit" type="primary"
|
|
228
|
+
@click="updateData(scope.row)">
|
|
229
|
+
修改
|
|
230
|
+
</el-button>
|
|
231
|
+
<!--修改密码-->
|
|
232
|
+
<el-button size="small" icon="el-icon-setting" type="danger"
|
|
233
|
+
v-if="scope.row.created == loginUser.id || mayOperate"
|
|
234
|
+
@click="resetPwd(scope.row)">
|
|
235
|
+
重置密码
|
|
236
|
+
</el-button>
|
|
237
|
+
<!--查询菜单-->
|
|
238
|
+
<el-button size="small" icon="el-icon-zoom-in" type="warning"
|
|
239
|
+
@click="viewMenu(scope.row)">
|
|
240
|
+
查看菜单
|
|
241
|
+
</el-button>
|
|
242
|
+
</template>
|
|
243
|
+
</el-table-column>
|
|
244
|
+
</el-table>
|
|
245
|
+
</el-main>
|
|
246
|
+
</el-container>
|
|
247
|
+
</el-main>
|
|
248
|
+
</el-container>
|
|
249
|
+
</el-main>
|
|
250
|
+
<el-footer style="height: 30px">
|
|
251
|
+
<el-pagination
|
|
252
|
+
:ref="crud.pageRef"
|
|
253
|
+
:page-sizes="crud.pageSizes"
|
|
254
|
+
:page-size="crud.pageSize"
|
|
255
|
+
:current-page="crud.page"
|
|
256
|
+
:total="crud.dataStore.total"
|
|
257
|
+
@size-change="crud.sizeChange()"
|
|
258
|
+
@current-change="crud.currentPage()"
|
|
259
|
+
layout="total, sizes, prev, pager, next, jumper">
|
|
260
|
+
</el-pagination>
|
|
261
|
+
</el-footer>
|
|
262
|
+
</el-container>
|
|
263
|
+
</el-tab-pane>
|
|
264
|
+
<el-tab-pane label="组织所有用户" name="2" >
|
|
265
|
+
<el-container style="height: 100%;" v-if="activeTabs == '2'">
|
|
266
|
+
<el-main style="height: 100%;padding: 0">
|
|
267
|
+
<el-container style="height: 100%">
|
|
268
|
+
<el-header style="height: auto;">
|
|
269
|
+
<div class="search-form-parent el-card">
|
|
270
|
+
<el-form :inline="true" :model="crud.searchForm" size="small"
|
|
271
|
+
class="demo-form-inline"
|
|
272
|
+
@keyup.enter.native="crud.doSearch()" onSubmit="return false;">
|
|
273
|
+
<el-form-item label="用户名称">
|
|
274
|
+
<el-input v-model="crud.searchForm.userNameUnified"
|
|
275
|
+
placeholder="中文、拼音全拼、简拼"></el-input>
|
|
276
|
+
</el-form-item>
|
|
277
|
+
<el-form-item label="用户状态">
|
|
278
|
+
<el-select v-model="crud.searchForm.userStatus" clearable>
|
|
279
|
+
<el-option v-for="(value,key) in userStatusMap" :key="key" :value="key"
|
|
280
|
+
:label="value">
|
|
281
|
+
</el-option>
|
|
282
|
+
</el-select>
|
|
283
|
+
</el-form-item>
|
|
284
|
+
<!--所属岗位-->
|
|
285
|
+
<!--<el-form-item label="所属岗位">-->
|
|
286
|
+
<!--<el-select v-model="crud.searchForm.posId"-->
|
|
287
|
+
<!--clearable filterable-->
|
|
288
|
+
<!--style="width: 100%">-->
|
|
289
|
+
<!--<el-option v-for="(stationName,stationId) in allowStationObj" :key="stationId" :value="stationId"-->
|
|
290
|
+
<!--:label="stationName">-->
|
|
291
|
+
<!--</el-option>-->
|
|
292
|
+
<!--</el-select>-->
|
|
293
|
+
<!--</el-form-item>-->
|
|
294
|
+
|
|
295
|
+
<el-form-item label="所属岗位">
|
|
296
|
+
<el-select v-model="crud.searchForm.posDevId" v-if="devUser"
|
|
297
|
+
clearable filterable
|
|
298
|
+
style="width: 100%">
|
|
299
|
+
<el-option v-for="(stationName,stationId) in allowStationObj" :key="stationId" :value="stationId"
|
|
300
|
+
:label="stationName">
|
|
301
|
+
</el-option>
|
|
302
|
+
</el-select>
|
|
303
|
+
<el-select v-model="crud.searchForm.posId" v-else
|
|
304
|
+
clearable filterable
|
|
305
|
+
style="width: 100%">
|
|
306
|
+
<el-option v-for="(stationName,stationId) in allowStationObj" :key="stationId" :value="stationId"
|
|
307
|
+
:label="stationName">
|
|
308
|
+
</el-option>
|
|
309
|
+
</el-select>
|
|
310
|
+
</el-form-item>
|
|
311
|
+
|
|
312
|
+
<el-form-item>
|
|
313
|
+
<el-button type="primary" icon="el-icon-search"
|
|
314
|
+
@click="crud.doSearch()">查询
|
|
315
|
+
</el-button>
|
|
316
|
+
<el-button icon="el-icon-close" @click="crud.resetSearch()">清空
|
|
317
|
+
</el-button>
|
|
318
|
+
</el-form-item>
|
|
319
|
+
</el-form>
|
|
320
|
+
</div>
|
|
321
|
+
</el-header>
|
|
322
|
+
|
|
323
|
+
<el-main id="tableMain" style="height: 100%;">
|
|
324
|
+
<el-container style="height:100%" class="table-list-container">
|
|
325
|
+
<el-header style="height: auto;">
|
|
326
|
+
<el-button type="primary" size="small" icon="el-icon-check"
|
|
327
|
+
@click="addUser()">添加用户
|
|
328
|
+
</el-button>
|
|
329
|
+
|
|
330
|
+
<el-button type="primary" size="small" icon="el-icon-check"
|
|
331
|
+
@click="chooseUser">从用户列表选择
|
|
332
|
+
</el-button>
|
|
333
|
+
|
|
334
|
+
<el-button type="success" size="small"
|
|
335
|
+
style="margin-left: 10px"
|
|
336
|
+
icon="el-icon-setting"
|
|
337
|
+
@click="settingRole()">设置角色
|
|
338
|
+
</el-button>
|
|
339
|
+
|
|
340
|
+
<el-popover placement="bottom" width="260" trigger="click"
|
|
341
|
+
style="margin-left: 10px">
|
|
342
|
+
<el-button size="small" type="primary" @click="exportUserData('local')">当前数据</el-button>
|
|
343
|
+
<el-button size="small" type="primary" @click="exportUserData('select')">选择数据</el-button>
|
|
344
|
+
<el-button size="small" type="primary" @click="exportUserData('all')">全部数据</el-button>
|
|
345
|
+
<el-button slot="reference" icon="saspiconfont pl-icon-moban" type="warning" size="small" >导出</el-button>
|
|
346
|
+
</el-popover>
|
|
347
|
+
|
|
348
|
+
<el-button type="danger" size="small" icon="el-icon-delete"
|
|
349
|
+
style="margin-left: 10px"
|
|
350
|
+
@click="deleteUser()">删除
|
|
351
|
+
</el-button>
|
|
352
|
+
|
|
353
|
+
<el-button type="success" size="small" icon="el-icon-plus"
|
|
354
|
+
style="margin-left: 10px" v-if="devUser"
|
|
355
|
+
@click="openBatchAddPosUser()">批量插入岗位
|
|
356
|
+
</el-button>
|
|
357
|
+
</el-header>
|
|
358
|
+
|
|
359
|
+
<el-main style="height: 100%;" ref="tableMain">
|
|
360
|
+
<el-table :data="crud.dataStore.records" :ref="crud.tableRef" stripe border
|
|
361
|
+
height="100%"
|
|
362
|
+
style="width: 100%;" @row-click="activeOrgRow">
|
|
363
|
+
<el-table-column type="selection" width="40"
|
|
364
|
+
align="center"></el-table-column>
|
|
365
|
+
<el-table-column type="index" label="序号" align="center"
|
|
366
|
+
width="60"></el-table-column>
|
|
367
|
+
<el-table-column label="用户账号" prop="userAccount"
|
|
368
|
+
show-overflow-tooltip
|
|
369
|
+
align="center"></el-table-column>
|
|
370
|
+
<el-table-column label="用户名称" prop="userName"
|
|
371
|
+
show-overflow-tooltip
|
|
372
|
+
align="center">
|
|
373
|
+
<template slot-scope="scope">
|
|
374
|
+
<span>{{scope.row.userName}}</span>
|
|
375
|
+
</template>
|
|
376
|
+
</el-table-column>
|
|
377
|
+
<el-table-column label="所属部门" prop="orgName"
|
|
378
|
+
show-overflow-tooltip
|
|
379
|
+
align="center" >
|
|
380
|
+
<template slot-scope="scope">
|
|
381
|
+
{{formatterOrgDept(scope.row)}}
|
|
382
|
+
</template>
|
|
383
|
+
</el-table-column>
|
|
384
|
+
<el-table-column label="所属岗位" prop="posId" v-if="devUser"
|
|
385
|
+
show-overflow-tooltip
|
|
386
|
+
align="center">
|
|
387
|
+
<template slot-scope="scope">
|
|
388
|
+
{{formatterStationDev(scope.row)}}
|
|
389
|
+
</template>
|
|
390
|
+
</el-table-column>
|
|
391
|
+
<el-table-column label="所属岗位" prop="posId" v-if="!devUser"
|
|
392
|
+
show-overflow-tooltip
|
|
393
|
+
align="center">
|
|
394
|
+
<template slot-scope="scope">
|
|
395
|
+
{{formatterStation(scope.row.posId)}}
|
|
396
|
+
</template>
|
|
397
|
+
</el-table-column>
|
|
398
|
+
<el-table-column label="工号" prop="jobNum"
|
|
399
|
+
show-overflow-tooltip
|
|
400
|
+
align="center" width="80">
|
|
401
|
+
</el-table-column>
|
|
402
|
+
|
|
403
|
+
<el-table-column label="所属角色"
|
|
404
|
+
width="180"
|
|
405
|
+
prop="userRoleId" show-overflow-tooltip
|
|
406
|
+
align="center">
|
|
407
|
+
<template slot-scope="scope">
|
|
408
|
+
{{formatterRole(scope.row.userRoleId)}}
|
|
409
|
+
</template>
|
|
410
|
+
</el-table-column>
|
|
411
|
+
<el-table-column label="是否负责人" prop="principal"
|
|
412
|
+
align="center">
|
|
413
|
+
<template slot-scope="scope">
|
|
414
|
+
<el-switch
|
|
415
|
+
disabled
|
|
416
|
+
v-model="scope.row.principal"
|
|
417
|
+
active-value="1"
|
|
418
|
+
inactive-value="0">
|
|
419
|
+
</el-switch>
|
|
420
|
+
</template>
|
|
421
|
+
</el-table-column>
|
|
422
|
+
<el-table-column label="操作" width="320" align="center" prop="operate">
|
|
423
|
+
<template slot-scope="scope">
|
|
424
|
+
<!--<el-button size="small" icon="el-icon-view" type="primary"-->
|
|
425
|
+
<!--@click="updateData(scope.row,'view')">-->
|
|
426
|
+
<!--查看-->
|
|
427
|
+
<!--</el-button>-->
|
|
428
|
+
<el-button size="small" icon="el-icon-edit" type="primary"
|
|
429
|
+
@click="updateData(scope.row)">
|
|
430
|
+
修改
|
|
431
|
+
</el-button>
|
|
432
|
+
<!--查询菜单-->
|
|
433
|
+
<el-button size="small" icon="el-icon-setting" type="danger"
|
|
434
|
+
v-if="scope.row.created == loginUser.id || mayOperate"
|
|
435
|
+
@click="resetPwd(scope.row)">
|
|
436
|
+
重置密码
|
|
437
|
+
</el-button>
|
|
438
|
+
|
|
439
|
+
<el-button size="small" icon="el-icon-zoom-in" type="warning"
|
|
440
|
+
@click="viewMenu(scope.row)">
|
|
441
|
+
查看菜单
|
|
442
|
+
</el-button>
|
|
443
|
+
</template>
|
|
444
|
+
</el-table-column>
|
|
445
|
+
</el-table>
|
|
446
|
+
</el-main>
|
|
447
|
+
</el-container>
|
|
448
|
+
</el-main>
|
|
449
|
+
</el-container>
|
|
450
|
+
</el-main>
|
|
451
|
+
<el-footer style="height: 30px">
|
|
452
|
+
<el-pagination
|
|
453
|
+
:ref="crud.pageRef"
|
|
454
|
+
:page-sizes="crud.pageSizes"
|
|
455
|
+
:page-size="crud.pageSize"
|
|
456
|
+
:current-page="crud.page"
|
|
457
|
+
:total="crud.dataStore.total"
|
|
458
|
+
@size-change="crud.sizeChange()"
|
|
459
|
+
@current-change="crud.currentPage()"
|
|
460
|
+
layout="total, sizes, prev, pager, next, jumper">
|
|
461
|
+
</el-pagination>
|
|
462
|
+
</el-footer>
|
|
463
|
+
</el-container>
|
|
464
|
+
</el-tab-pane>
|
|
465
|
+
</el-tabs>
|
|
466
|
+
|
|
467
|
+
</el-main>
|
|
468
|
+
<el-dialog :close-on-click-modal=false :visible.sync="orderDialog" title="调整用户顺序" class="order-dialog" width="400px" height="80%" top="5vh">
|
|
469
|
+
<el-main style="height: 100%;padding: 0">
|
|
470
|
+
<el-table :data="posUserArr" border stripe>
|
|
471
|
+
<el-table-column prop="userName" label="用户名称" align="center"></el-table-column>
|
|
472
|
+
<el-table-column prop="userLayer" label="组织/岗位内排序" align="center">
|
|
473
|
+
<template slot-scope="scope">
|
|
474
|
+
<el-input v-model="scope.row.userLayer" size="small">
|
|
475
|
+
</el-input>
|
|
476
|
+
</template>
|
|
477
|
+
</el-table-column>
|
|
478
|
+
</el-table>
|
|
479
|
+
</el-main>
|
|
480
|
+
<div slot="footer" class="dialog-footer">
|
|
481
|
+
<el-button type="primary" @click="updateOrder?saveOrder():addOrder()" size="small"
|
|
482
|
+
icon="el-icon-success">确定
|
|
483
|
+
</el-button>
|
|
484
|
+
<el-button @click="orderDialog = false" size="small" icon="el-icon-error">取 消</el-button>
|
|
485
|
+
</div>
|
|
486
|
+
</el-dialog>
|
|
487
|
+
<el-dialog :close-on-click-modal=false :title="userDialogTitle" :visible.sync="addUserDialog" top="15vh" height="72%" width="60%">
|
|
488
|
+
<el-form :model="addUserForm" ref="addUserRef" :rules="rules" label-width="120px" :disabled="operateType == 'view'">
|
|
489
|
+
<el-row>
|
|
490
|
+
<el-col :span="24" style="text-align: center;">
|
|
491
|
+
<div class="header-title">
|
|
492
|
+
基本信息
|
|
493
|
+
</div>
|
|
494
|
+
<el-divider class="header-divider">
|
|
495
|
+
<div class="header-slider">
|
|
496
|
+
</div>
|
|
497
|
+
</el-divider>
|
|
498
|
+
</el-col>
|
|
499
|
+
<el-col :span="12">
|
|
500
|
+
<el-form-item label="用户账号" prop="userAccount">
|
|
501
|
+
<el-input v-model="addUserForm.userAccount"></el-input>
|
|
502
|
+
</el-form-item>
|
|
503
|
+
</el-col>
|
|
504
|
+
<el-col :span="12">
|
|
505
|
+
<el-form-item label="用户姓名" prop="userName">
|
|
506
|
+
<el-input v-model="addUserForm.userName"></el-input>
|
|
507
|
+
</el-form-item>
|
|
508
|
+
</el-col>
|
|
509
|
+
<el-col :span="12">
|
|
510
|
+
<el-form-item label="用户状态" prop="userStatus">
|
|
511
|
+
<el-select v-model="addUserForm.userStatus"
|
|
512
|
+
style="width: 100%">
|
|
513
|
+
<el-option v-for="(item,key) in statusOptions" :key="key" :value="item.value"
|
|
514
|
+
:label="item.label">
|
|
515
|
+
</el-option>
|
|
516
|
+
</el-select>
|
|
517
|
+
</el-form-item>
|
|
518
|
+
</el-col>
|
|
519
|
+
<el-col :span="12">
|
|
520
|
+
<el-form-item label="是否为负责人" prop="userStatus">
|
|
521
|
+
<el-switch v-model="addUserForm.principal"
|
|
522
|
+
:disabled="addUserForm.disabledPrincipal"
|
|
523
|
+
active-value="1"
|
|
524
|
+
inactive-value="0">
|
|
525
|
+
</el-switch>
|
|
526
|
+
</el-form-item>
|
|
527
|
+
</el-col>
|
|
528
|
+
<el-col :span="12">
|
|
529
|
+
<el-form-item label="所属角色" prop="userRoleIdArr" >
|
|
530
|
+
<el-select v-model="addUserForm.userRoleIdArr" clearable filterable multiple
|
|
531
|
+
v-if="(!loginUser.commonEmpowerId || loginUser.id != addUserForm.userId) && operateType != 'view'"
|
|
532
|
+
@change="changeRoleTemp"
|
|
533
|
+
style="width: 100%">
|
|
534
|
+
<el-option v-for="(roleObj,key) in allRoleTempObj" :key="key" :value="key"
|
|
535
|
+
:disabled="disableDveRoleId.indexOf(key) > -1"
|
|
536
|
+
:label="roleObj.roleName">
|
|
537
|
+
<span style="float: left">{{ roleObj.roleName }}</span>
|
|
538
|
+
<span style="float: right;margin-right: 15px; color: #8492a6; font-size: 13px" v-if="roleObj.adminRole == '1'">管理员角色</span>
|
|
539
|
+
</el-option>
|
|
540
|
+
</el-select>
|
|
541
|
+
|
|
542
|
+
<el-select v-model="addUserForm.userRoleIdArr" clearable filterable multiple
|
|
543
|
+
v-else-if="loginUser.id == addUserForm.userId && operateType != 'view'"
|
|
544
|
+
style="width: 100%" @change="changeRole">
|
|
545
|
+
<el-option v-for="(roleObj,key) in allRoleObj" :key="key" :value="key"
|
|
546
|
+
:disabled="diableRoleIdArr.indexOf(key) > -1"
|
|
547
|
+
:label="roleObj.roleName">
|
|
548
|
+
<span style="float: left">{{ roleObj.roleName }}</span>
|
|
549
|
+
<span style="float: right;margin-right: 15px; color: #8492a6; font-size: 13px" v-if="roleObj.adminRole == '1'">管理员角色</span>
|
|
550
|
+
</el-option>
|
|
551
|
+
</el-select>
|
|
552
|
+
|
|
553
|
+
<el-input v-else v-model="addUserForm.adminRoleName" disabled></el-input>
|
|
554
|
+
|
|
555
|
+
</el-form-item>
|
|
556
|
+
</el-col>
|
|
557
|
+
<el-col :span="12">
|
|
558
|
+
<el-form-item label="所属组织" prop="userOrgId">
|
|
559
|
+
<pl-select-tree v-model="addUserForm.userOrgId"
|
|
560
|
+
v-if="addUserDialog"
|
|
561
|
+
:refresh-proper="addUserDialog"
|
|
562
|
+
:options="orgTreeData"
|
|
563
|
+
open-filter-text
|
|
564
|
+
:change-data="changeDataTree"
|
|
565
|
+
parent-id="orgParentId"
|
|
566
|
+
:props="defaultSelectTreeProps"></pl-select-tree>
|
|
567
|
+
</el-form-item>
|
|
568
|
+
</el-col>
|
|
569
|
+
|
|
570
|
+
<el-col :span="24" style="text-align: center;">
|
|
571
|
+
<div class="header-title">
|
|
572
|
+
扩展信息
|
|
573
|
+
</div>
|
|
574
|
+
<el-divider class="header-divider">
|
|
575
|
+
<div class="header-slider">
|
|
576
|
+
</div>
|
|
577
|
+
</el-divider>
|
|
578
|
+
</el-col>
|
|
579
|
+
<el-col :span="12">
|
|
580
|
+
<el-form-item label="岗位名称" prop="posIdArr">
|
|
581
|
+
<el-select v-model="addUserForm.posIdArr" clearable filterable allow-create multiple v-if="operateType != 'view'"
|
|
582
|
+
style="width: 100%">
|
|
583
|
+
<el-option v-for="(value,key) in allowStationObj" :key="key" :value="key"
|
|
584
|
+
:label="value">
|
|
585
|
+
</el-option>
|
|
586
|
+
</el-select>
|
|
587
|
+
<el-input v-else v-model="addUserForm.adminPosName" disabled></el-input>
|
|
588
|
+
|
|
589
|
+
</el-form-item>
|
|
590
|
+
</el-col>
|
|
591
|
+
|
|
592
|
+
<el-col :span="12">
|
|
593
|
+
<el-form-item label="工号" prop="jobNum" >
|
|
594
|
+
<el-input v-model="addUserForm.jobNum"></el-input>
|
|
595
|
+
</el-form-item>
|
|
596
|
+
</el-col>
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
<el-col :span="12">
|
|
600
|
+
<el-form-item label="手机号码" prop="userPhone">
|
|
601
|
+
<el-input v-model="addUserForm.userPhone"></el-input>
|
|
602
|
+
</el-form-item>
|
|
603
|
+
</el-col>
|
|
604
|
+
<el-col :span="12">
|
|
605
|
+
<el-form-item label="电子邮箱" prop="userEmail">
|
|
606
|
+
<el-input v-model="addUserForm.userEmail"></el-input>
|
|
607
|
+
</el-form-item>
|
|
608
|
+
</el-col>
|
|
609
|
+
|
|
610
|
+
<el-col :span="12">
|
|
611
|
+
<el-form-item label="身份证号" prop="userIdcard" :rules="plValidate('idcard')">
|
|
612
|
+
<el-input v-model="addUserForm.userIdcard"></el-input>
|
|
613
|
+
</el-form-item>
|
|
614
|
+
</el-col>
|
|
615
|
+
<!--用户类型-->
|
|
616
|
+
|
|
617
|
+
<!-- <el-col :span="12">-->
|
|
618
|
+
<!-- <el-form-item label="用户角色" label-width="150px" prop="userRoleId">-->
|
|
619
|
+
<!-- <el-select v-model="addUserForm.userRoleId" style="width: 100%" clearable>-->
|
|
620
|
+
<!-- <el-option v-for="item in createPushRoleArr" :key="item.id" :label="item.roleName" :value="item.id">-->
|
|
621
|
+
|
|
622
|
+
<!-- </el-option>-->
|
|
623
|
+
<!-- </el-select>-->
|
|
624
|
+
<!-- </el-form-item>-->
|
|
625
|
+
<!-- </el-col>-->
|
|
626
|
+
</el-row>
|
|
627
|
+
</el-form>
|
|
628
|
+
<div slot="footer" class="dialog-footer">
|
|
629
|
+
<el-button type="primary" @click="saveUser()" size="small" icon="el-icon-success">确 定</el-button>
|
|
630
|
+
<el-button @click="addUserDialog = false" size="small" icon="el-icon-error">取 消</el-button>
|
|
631
|
+
</div>
|
|
632
|
+
</el-dialog>
|
|
633
|
+
<el-dialog :close-on-click-modal=false title="添加岗位信息" :visible.sync="addPosDialog" top="25vh">
|
|
634
|
+
<el-form :model="addPosForm" ref="addPosRef">
|
|
635
|
+
<el-row>
|
|
636
|
+
<el-col :span="24">
|
|
637
|
+
<el-form-item label="岗位名称" label-width="120px" prop="posName" :rules="plValidate('required')">
|
|
638
|
+
<el-input type="textarea" :autosize="{ minRows: 3,maxRows:5}"
|
|
639
|
+
v-model="addPosForm.posName"></el-input>
|
|
640
|
+
</el-form-item>
|
|
641
|
+
</el-col>
|
|
642
|
+
<el-col :span="24" v-show="!pageSetting.closeMainPos">
|
|
643
|
+
<el-form-item label="是否是主岗位" label-width="120px">
|
|
644
|
+
<el-radio v-model="addPosForm.isMainpos" label="1" @change="addMainPosChange">是</el-radio>
|
|
645
|
+
<el-radio v-model="addPosForm.isMainpos" label="0" @change="addMainPosChange">否</el-radio>
|
|
646
|
+
</el-form-item>
|
|
647
|
+
</el-col>
|
|
648
|
+
<el-col :span="12">
|
|
649
|
+
<el-form-item label="所属组织" label-width="120px">
|
|
650
|
+
<el-input v-model="addPosForm.orgName" disabled></el-input>
|
|
651
|
+
</el-form-item>
|
|
652
|
+
</el-col>
|
|
653
|
+
<el-col :span="12" v-if="addPosForm.layer == '1'">
|
|
654
|
+
<el-form-item label="上级岗位" label-width="120px">
|
|
655
|
+
<tree-select v-model="addPosForm.parentPosId" placeholder="请选择"
|
|
656
|
+
:options="parentPosTree" noOptionsText="没有数据" style="height: 40px"></tree-select>
|
|
657
|
+
</el-form-item>
|
|
658
|
+
</el-col>
|
|
659
|
+
<el-col :span="12" v-else>
|
|
660
|
+
<el-form-item label="上级岗位" label-width="120px">
|
|
661
|
+
<el-input v-model="addPosForm.parentPosName" disabled></el-input>
|
|
662
|
+
</el-form-item>
|
|
663
|
+
</el-col>
|
|
664
|
+
</el-row>
|
|
665
|
+
</el-form>
|
|
666
|
+
<div slot="footer" class="dialog-footer">
|
|
667
|
+
<el-button type="primary" @click="savePos()" size="small" icon="el-icon-success">确定</el-button>
|
|
668
|
+
<el-button @click="addPosDialog = false" size="small" icon="el-icon-error">取 消</el-button>
|
|
669
|
+
</div>
|
|
670
|
+
</el-dialog>
|
|
671
|
+
|
|
672
|
+
<el-dialog :close-on-click-modal=false :visible.sync="chooseUserDialog" class="choose-user" title="选择用户" width="80%" height="90%" top="5vh">
|
|
673
|
+
<el-container style="height: 100%">
|
|
674
|
+
<el-main style="height: 100%;padding: 0">
|
|
675
|
+
<el-container style="height: 100%">
|
|
676
|
+
<el-header style="height: auto;">
|
|
677
|
+
<div class="search-form-parent el-card">
|
|
678
|
+
<el-form :inline="true" :model="userCrud.searchForm" size="small"
|
|
679
|
+
class="demo-form-inline"
|
|
680
|
+
@keyup.enter.native="userCrud.doSearch(userSearch)" onSubmit="return false;">
|
|
681
|
+
<el-form-item label="用户账号">
|
|
682
|
+
<el-input v-model="userCrud.searchForm.userAccountLike"></el-input>
|
|
683
|
+
</el-form-item>
|
|
684
|
+
<el-form-item label="用户名称">
|
|
685
|
+
<el-input v-model="userCrud.searchForm.userNamePinYin"
|
|
686
|
+
placeholder="中文、拼音全拼、简拼"></el-input>
|
|
687
|
+
</el-form-item>
|
|
688
|
+
<el-form-item>
|
|
689
|
+
<el-button type="primary" icon="el-icon-search" @click="userCrud.doSearch(userSearch)">
|
|
690
|
+
查询
|
|
691
|
+
</el-button>
|
|
692
|
+
<el-button icon="el-icon-close" @click="userCrud.resetSearch(userSearch)">清空</el-button>
|
|
693
|
+
</el-form-item>
|
|
694
|
+
</el-form>
|
|
695
|
+
</div>
|
|
696
|
+
</el-header>
|
|
697
|
+
|
|
698
|
+
<el-main style="height: 100%;padding: 10px">
|
|
699
|
+
<el-container style="height:100%" class="table-list-container">
|
|
700
|
+
<el-header style="height: auto;" size="medium">
|
|
701
|
+
<el-button type="primary" size="small" icon="el-icon-check" @click="setUser">选择
|
|
702
|
+
</el-button>
|
|
703
|
+
</el-header>
|
|
704
|
+
<el-main style="height: 100%;padding: 0">
|
|
705
|
+
<el-table :data="userCrud.dataStore.records" :ref="userCrud.tableRef" stripe border
|
|
706
|
+
height="100%"
|
|
707
|
+
style="width: 100%;" @row-click="activeUserRow"
|
|
708
|
+
@select="tableSelect"
|
|
709
|
+
@select-all="userSelectAll"
|
|
710
|
+
>
|
|
711
|
+
<el-table-column type="selection" width="40" align="center"></el-table-column>
|
|
712
|
+
<el-table-column type="index" label="序号" align="center"
|
|
713
|
+
width="60"></el-table-column>
|
|
714
|
+
<el-table-column label="用户账号" prop="userAccount" align="center"></el-table-column>
|
|
715
|
+
<el-table-column label="用户名称" prop="userName" align="center"></el-table-column>
|
|
716
|
+
<el-table-column label="用户类型" prop="userType" :formatter="formatterColumn"
|
|
717
|
+
align="center"></el-table-column>
|
|
718
|
+
<!-- <el-table-column label="当前状态" prop="userStatus" :formatter="formatterColumn"-->
|
|
719
|
+
<!-- align="center"></el-table-column>-->
|
|
720
|
+
</el-table>
|
|
721
|
+
</el-main>
|
|
722
|
+
</el-container>
|
|
723
|
+
</el-main>
|
|
724
|
+
</el-container>
|
|
725
|
+
</el-main>
|
|
726
|
+
<el-footer style="height: 40px">
|
|
727
|
+
<el-pagination
|
|
728
|
+
:ref="userCrud.pageRef"
|
|
729
|
+
:page-sizes="userCrud.pageSizes"
|
|
730
|
+
:page-size="userCrud.pageSize"
|
|
731
|
+
:current-page="userCrud.page"
|
|
732
|
+
:total="userCrud.dataStore.total"
|
|
733
|
+
@size-change="userCrud.sizeChange(userSearch)"
|
|
734
|
+
@current-change="userCrud.currentPage(userSearch)"
|
|
735
|
+
layout="total, sizes, prev, pager, next, jumper">
|
|
736
|
+
</el-pagination>
|
|
737
|
+
</el-footer>
|
|
738
|
+
</el-container>
|
|
739
|
+
</el-dialog>
|
|
740
|
+
|
|
741
|
+
|
|
742
|
+
<el-dialog :close-on-click-modal=false title="设置角色" :visible.sync="settingRoleDialog" top="20vh" height="350px" width="600px">
|
|
743
|
+
<el-checkbox-group v-model="settingRoleArr" >
|
|
744
|
+
<el-col :span="12" v-for="(role,roleId) in allRoleObj" :key="roleId">
|
|
745
|
+
<el-checkbox :label="role.id">
|
|
746
|
+
{{role.roleName.length >11? role.roleName.substring(0,10)+"...": role.roleName}}
|
|
747
|
+
<span v-if="role.adminRole == '1'" style="color: red">(管理员角色)</span>
|
|
748
|
+
</el-checkbox>
|
|
749
|
+
</el-col>
|
|
750
|
+
</el-checkbox-group>
|
|
751
|
+
<div slot="footer" class="dialog-footer">
|
|
752
|
+
<el-button type="primary" @click="saveSettingRole()" size="small" icon="el-icon-success">确定</el-button>
|
|
753
|
+
<el-button @click="settingRoleDialog = false" size="small" icon="el-icon-error">取 消</el-button>
|
|
754
|
+
</div>
|
|
755
|
+
</el-dialog>
|
|
756
|
+
|
|
757
|
+
|
|
758
|
+
<!-- -->
|
|
759
|
+
<el-dialog :close-on-click-modal=false :title="menuUserName+'的菜单'" width="400px" height="80%" top="10vh"
|
|
760
|
+
:visible.sync="viewMenuDialog" class="userViewMenuClass">
|
|
761
|
+
<owner-menu-tree :user-id="menuUserId" :user-type="menuUserType" v-if="viewMenuDialog"></owner-menu-tree>
|
|
762
|
+
<div slot="footer" class="dialog-footer">
|
|
763
|
+
<el-button type="primary" @click="viewMenuDialog = false" size="small" icon="el-icon-error">关闭
|
|
764
|
+
</el-button>
|
|
765
|
+
</div>
|
|
766
|
+
</el-dialog>
|
|
767
|
+
|
|
768
|
+
<el-dialog :close-on-click-modal=false :visible.sync="confirmDialog"
|
|
769
|
+
title="提示"
|
|
770
|
+
top="25vh" height="220px" width="600px">
|
|
771
|
+
<div class="el-message-box__container">
|
|
772
|
+
<div class="el-message-box__status el-icon-warning">
|
|
773
|
+
</div>
|
|
774
|
+
<div :class="isExsitAdminRoleUser?'el-message-box__message adminRole':'el-message-box__message'">
|
|
775
|
+
<p v-html="confirmTitle"></p>
|
|
776
|
+
</div>
|
|
777
|
+
</div>
|
|
778
|
+
<div slot="footer" class="dialog-footer" style="float: right;margin-right: 5px">
|
|
779
|
+
<el-button type="primary" @click="startSaveRole('2')" size="small" icon="el-icon-success" v-if="isExsitAdminRoleUser">覆盖用户角色</el-button>
|
|
780
|
+
<el-button type="primary" @click="startSaveRole('3')" size="small" icon="el-icon-success" v-if="isExsitAdminRoleUser">跳过上述用户</el-button>
|
|
781
|
+
<el-button type="primary" @click="startSaveRole('1')" size="small" icon="el-icon-success" v-if="!isExsitAdminRoleUser">确定</el-button>
|
|
782
|
+
<el-button @click="confirmDialog = false" size="small" icon="el-icon-error">取 消</el-button>
|
|
783
|
+
</div>
|
|
784
|
+
</el-dialog>
|
|
785
|
+
|
|
786
|
+
<el-dialog :close-on-click-modal=false :title="'批量添加岗位'" width="500px" height="600px" top="10vh"
|
|
787
|
+
:visible.sync="batchAddPosDialog">
|
|
788
|
+
<el-form :model="batchPosUserForm" size="small" label-width="100px" ref="batchAddPosFormRef">
|
|
789
|
+
<el-form-item label="选择岗位" prop="posId" :rules="plValidate('required')">
|
|
790
|
+
<el-select v-model="batchPosUserForm.posId" clearable allow-create filterable style="width: 100%">
|
|
791
|
+
<el-option v-for="item in allStationArr" :label="item.stationName" :value="item.id" :key="item.id">
|
|
792
|
+
|
|
793
|
+
</el-option>
|
|
794
|
+
</el-select>
|
|
795
|
+
</el-form-item>
|
|
796
|
+
<el-form-item label="用户名称" prop="userNames" :rules="plValidate('required')">
|
|
797
|
+
<el-input type="textarea" v-model="batchPosUserForm.userNames"
|
|
798
|
+
placeholder="请输入逗号分隔的中文用户名称,中文逗号与英文逗号同时仅可存在一种" :autosize="{minRows:4}">
|
|
799
|
+
|
|
800
|
+
</el-input>
|
|
801
|
+
</el-form-item>
|
|
802
|
+
</el-form>
|
|
803
|
+
<div slot="footer" class="dialog-footer">
|
|
804
|
+
<el-button type="primary" @click="batchAddPosUser" size="small" icon="el-icon-success">确定
|
|
805
|
+
</el-button>
|
|
806
|
+
<el-button @click="batchAddPosDialog = false" size="small" icon="el-icon-error">关闭
|
|
807
|
+
</el-button>
|
|
808
|
+
</div>
|
|
809
|
+
</el-dialog>
|
|
810
|
+
|
|
811
|
+
<el-dialog :close-on-click-modal=false :visible.sync="confirmDialog"
|
|
812
|
+
title="提示"
|
|
813
|
+
top="25vh" height="220px" width="600px">
|
|
814
|
+
<div class="el-message-box__container">
|
|
815
|
+
<div class="el-message-box__status el-icon-warning">
|
|
816
|
+
</div>
|
|
817
|
+
<div :class="isExsitAdminRoleUser?'el-message-box__message adminRole':'el-message-box__message'">
|
|
818
|
+
<p v-html="confirmTitle"></p>
|
|
819
|
+
</div>
|
|
820
|
+
</div>
|
|
821
|
+
<div slot="footer" class="dialog-footer" style="float: right;margin-right: 5px">
|
|
822
|
+
<el-button type="primary" @click="startSaveRole('2')" size="small" icon="el-icon-success" v-if="isExsitAdminRoleUser">覆盖用户角色</el-button>
|
|
823
|
+
<el-button type="primary" @click="startSaveRole('3')" size="small" icon="el-icon-success" v-if="isExsitAdminRoleUser">跳过上述用户</el-button>
|
|
824
|
+
<el-button type="primary" @click="startSaveRole('1')" size="small" icon="el-icon-success" v-if="!isExsitAdminRoleUser">确定</el-button>
|
|
825
|
+
<el-button @click="confirmDialog = false" size="small" icon="el-icon-error">取 消</el-button>
|
|
826
|
+
</div>
|
|
827
|
+
</el-dialog>
|
|
828
|
+
|
|
829
|
+
</el-container>
|
|
830
|
+
</div>
|
|
831
|
+
</template>
|
|
832
|
+
|
|
833
|
+
<script>
|
|
834
|
+
import Sortable from 'sortablejs';
|
|
835
|
+
|
|
836
|
+
import {PlSelectTree} from "sasp-base";
|
|
837
|
+
import OwnerMenuTree from "./ownerMenu/ownerMenuTree";
|
|
838
|
+
|
|
839
|
+
export default {
|
|
840
|
+
name: "sys-ent-org-user-detail",
|
|
841
|
+
components: {OwnerMenuTree, PlSelectTree},
|
|
842
|
+
props: {
|
|
843
|
+
orgId: {type: String, default: ''},
|
|
844
|
+
orgDim: {type: String, default: ''},
|
|
845
|
+
orgObjReal: {
|
|
846
|
+
type: Object, default: function () {
|
|
847
|
+
return {}
|
|
848
|
+
}
|
|
849
|
+
},
|
|
850
|
+
orgTypeObj: {
|
|
851
|
+
type: Object, default: function () {
|
|
852
|
+
return {}
|
|
853
|
+
}
|
|
854
|
+
},
|
|
855
|
+
areaOptions: {
|
|
856
|
+
type:Array,
|
|
857
|
+
default:() => {return [];}
|
|
858
|
+
},
|
|
859
|
+
pageSetting: {
|
|
860
|
+
type: Object, default: function () {
|
|
861
|
+
return {}
|
|
862
|
+
}
|
|
863
|
+
},
|
|
864
|
+
areaSetting:{
|
|
865
|
+
type:Boolean,default:true
|
|
866
|
+
},
|
|
867
|
+
useRefresh:{
|
|
868
|
+
type:Boolean,default:false
|
|
869
|
+
},
|
|
870
|
+
refreshOrgId:{
|
|
871
|
+
type:Boolean,default:false
|
|
872
|
+
},
|
|
873
|
+
updateCallBack: {type: Function, default: null},
|
|
874
|
+
sysDataObj:{type:Object,default:() => {return {};}},
|
|
875
|
+
orgTreeData:{type:Array,default:()=>{return []}},
|
|
876
|
+
|
|
877
|
+
},
|
|
878
|
+
data() {
|
|
879
|
+
//let vm = this;
|
|
880
|
+
// let validUserRepeat = (rule, value, callback) => { // 重名验证
|
|
881
|
+
// let obj = {"isExit":"true"};
|
|
882
|
+
// if(rule.field == "userAccount"){
|
|
883
|
+
// obj["isExituserAccount"] = vm.addUserForm.userAccount;
|
|
884
|
+
// }else{
|
|
885
|
+
// obj["isExitUserName"] = vm.addUserForm.userName;
|
|
886
|
+
// }
|
|
887
|
+
// vm.axios.post(vm.api.sysUser.find,obj).then(res => {
|
|
888
|
+
// let result = res.data || [];
|
|
889
|
+
// callback();
|
|
890
|
+
// /*if(result.length > 0 && result[0].id != vm.addUserForm.id){
|
|
891
|
+
// callback(new Error("名称重复"));
|
|
892
|
+
// }else{
|
|
893
|
+
// callback();
|
|
894
|
+
// }*/
|
|
895
|
+
// })
|
|
896
|
+
// };
|
|
897
|
+
let validUserAccount = (rule, value, callback) => { // 重名验证
|
|
898
|
+
if(!value){
|
|
899
|
+
callback();
|
|
900
|
+
}
|
|
901
|
+
this.axios.post(this.api.sysUser.find, {"userAccount": value}).then(res=> { // 验证账号是否存在
|
|
902
|
+
if(res.data.length == 0 || (this.operateType == 'update' && this.oldUserAccount == value)){
|
|
903
|
+
callback();
|
|
904
|
+
}else{
|
|
905
|
+
return callback(new Error('该用户账号已经存在!'));
|
|
906
|
+
}
|
|
907
|
+
});
|
|
908
|
+
|
|
909
|
+
};
|
|
910
|
+
return {
|
|
911
|
+
crud: new this.CrudUtil({
|
|
912
|
+
vue: this,
|
|
913
|
+
entityName: "sysOrgPosUser",
|
|
914
|
+
url:this.api.sysOrgPosUser.url,
|
|
915
|
+
searchUrl: this.api.sysOrgPosUser.findPageParamByStation,
|
|
916
|
+
searchForm: {'empowerUser':'Y','isNewStation':'1'},
|
|
917
|
+
noClearSearchColumns: ["orgId","tenantId","empowerUser",'isNewStation','orgTreeId',"roleUserCreated","roleUserCreateOrg","userType"],
|
|
918
|
+
initNoSearch: true,
|
|
919
|
+
}),
|
|
920
|
+
userCrud: new this.CrudUtil({
|
|
921
|
+
vue: this,
|
|
922
|
+
entityName: "sysUser",
|
|
923
|
+
url: this.api.sysUser.url,
|
|
924
|
+
searchUrl:this.api.sysUser.findPage,
|
|
925
|
+
searchForm: {"unsup": "sup","order":"UPDATE_TIME,ID DESC"},
|
|
926
|
+
noClearSearchColumns: ["userType", "unsup", "noSearchUserByOrgId", "noSearchUserByPosId","orgParentTreeSelfs",
|
|
927
|
+
"notOrg","notPos","orgDim","searchEmpowerOrgId","order","tenantId"],
|
|
928
|
+
initNoSearch: true,
|
|
929
|
+
}),
|
|
930
|
+
posCrud: new this.CrudUtil({
|
|
931
|
+
vue: this,
|
|
932
|
+
entityName: "sysOrgPosUser",
|
|
933
|
+
url: this.api.sysOrgPosUser.url,
|
|
934
|
+
searchUrl: this.api.sysOrgPosUser.findPageParam,
|
|
935
|
+
searchForm: {"posId": "$", "orgId": "$" },
|
|
936
|
+
noClearSearchColumns: ["orgId", "posId","tenantId"],
|
|
937
|
+
initNoSearch: true,
|
|
938
|
+
//afterRemoveSuccess:this.posRemoveSuc,
|
|
939
|
+
}),
|
|
940
|
+
cascadeOptions: [], // 地区选项
|
|
941
|
+
cascadeOptionsClone:[],
|
|
942
|
+
activeTabs: '1',
|
|
943
|
+
activeName: ['0'], // 默认不激活组织信息吧,如果想默认展开就设为1
|
|
944
|
+
activePosName: ['1'], // 默认激活岗位信息
|
|
945
|
+
dimObj: {}, // id与纬度名称对应关系
|
|
946
|
+
chooseUserDialog: false,
|
|
947
|
+
formOrgName: "", // 当前组织的名称
|
|
948
|
+
orgClassifyArr: [{value: '0', label: '普通部门'}, {value: '1', label: '处室'}, {value: '2', label: '安监局'}],
|
|
949
|
+
classify: "", // 部门分类
|
|
950
|
+
userTypeMap: {
|
|
951
|
+
'ent': '企业用户', 'gov': '政府用户',
|
|
952
|
+
'sup': '开发用户', 'dev': '开发用户',
|
|
953
|
+
},
|
|
954
|
+
userStatusMap: {
|
|
955
|
+
10: "正常", 20: "锁定", 30: "暂时锁定"
|
|
956
|
+
},
|
|
957
|
+
entDim: "",
|
|
958
|
+
sysEntDim: "",
|
|
959
|
+
orderDialog: false, // 排序对话框
|
|
960
|
+
posUserArr: [], // 岗位用户排序数组
|
|
961
|
+
userTypeOptions: [], // 用户类型下拉框
|
|
962
|
+
typeOptions: [], // 所有用户类型
|
|
963
|
+
addUserDialog: false, // 添加用户对话框
|
|
964
|
+
addUserForm: {},
|
|
965
|
+
statusOptions: [
|
|
966
|
+
{value: '10', label: "正常"},
|
|
967
|
+
{value: '20', label: "锁定"}
|
|
968
|
+
], // 用户状态下拉框
|
|
969
|
+
updateOrder: true, // 是调整用户顺序还是选择用户时添加数据
|
|
970
|
+
posTreeParam: {
|
|
971
|
+
"order": "PARENT_POS_ID,SORT",
|
|
972
|
+
"orgId": "$"
|
|
973
|
+
},
|
|
974
|
+
rules: {
|
|
975
|
+
userAccount: [
|
|
976
|
+
{
|
|
977
|
+
required: true,
|
|
978
|
+
message: '该输入项为必输项',
|
|
979
|
+
trigger: 'blur'
|
|
980
|
+
},
|
|
981
|
+
{
|
|
982
|
+
validator: validUserAccount,
|
|
983
|
+
trigger: 'blur'
|
|
984
|
+
}
|
|
985
|
+
],
|
|
986
|
+
userStatus: [
|
|
987
|
+
{
|
|
988
|
+
required: true,
|
|
989
|
+
message: '该输入项为必输项',
|
|
990
|
+
trigger: 'blur'
|
|
991
|
+
}
|
|
992
|
+
],
|
|
993
|
+
userName: [
|
|
994
|
+
{
|
|
995
|
+
required: true,
|
|
996
|
+
message: '该输入项为必输项',
|
|
997
|
+
trigger: 'blur'
|
|
998
|
+
},
|
|
999
|
+
// {
|
|
1000
|
+
// validator: validUserRepeat,
|
|
1001
|
+
// trigger: 'blur'
|
|
1002
|
+
// }
|
|
1003
|
+
],
|
|
1004
|
+
userType: this.plValidate('required'),
|
|
1005
|
+
userQQ: this.plValidate('qq'),
|
|
1006
|
+
userEmail: this.plValidate('email'),
|
|
1007
|
+
userOrgId:[
|
|
1008
|
+
{
|
|
1009
|
+
required: true,
|
|
1010
|
+
message: '该输入项为必输项',
|
|
1011
|
+
trigger: 'blur'
|
|
1012
|
+
}
|
|
1013
|
+
],
|
|
1014
|
+
userPhone: this.plValidate('phone'),
|
|
1015
|
+
},
|
|
1016
|
+
posTreeProper: {'label': 'name','children':'children'},
|
|
1017
|
+
posBaseForm: {}, // 岗位基本信息
|
|
1018
|
+
posId: "", // 当前选择的岗位id
|
|
1019
|
+
setPos: false, // 当前从用户列表选择的是岗位还是组织
|
|
1020
|
+
menuVisible: false, // 右击菜单出现的办法
|
|
1021
|
+
addPosDialog: false, // 添加岗位的对话框
|
|
1022
|
+
addPosForm: {}, // 添加岗位的表单数据
|
|
1023
|
+
orgLocation: null, // 组织所在地区
|
|
1024
|
+
loading:false,
|
|
1025
|
+
top:0,
|
|
1026
|
+
left:0,
|
|
1027
|
+
parentPosTree:[], // 上级岗位树
|
|
1028
|
+
manyOrg:false, // 一人多岗
|
|
1029
|
+
multipleSelection:[],
|
|
1030
|
+
multipleSelectionIds:[],
|
|
1031
|
+
createPushRoleArr:[], // 推送角色
|
|
1032
|
+
orgObj:{},
|
|
1033
|
+
|
|
1034
|
+
allStationObj:{}, //岗位对象
|
|
1035
|
+
allowStationObj:{}, //岗位对象
|
|
1036
|
+
|
|
1037
|
+
loginUser:{},//登录用户
|
|
1038
|
+
mayOperate:false,
|
|
1039
|
+
defaultSelectTreeProps: {
|
|
1040
|
+
parent: 'orgParentId', // 父级唯一标识
|
|
1041
|
+
value: 'id', // 唯一标识
|
|
1042
|
+
label: 'orgName', // 标签显示
|
|
1043
|
+
children: 'children', // 子级
|
|
1044
|
+
},
|
|
1045
|
+
allRoleObj:{},
|
|
1046
|
+
allRoleTempObj:{}, //表单展示的角色下拉
|
|
1047
|
+
disableDveRoleId:[],//管理员下发不能删除的
|
|
1048
|
+
|
|
1049
|
+
allowRoleObj:{}, //所有角色
|
|
1050
|
+
userFormField:['userId','userType',"userStatus","jobNum","userPhone","userName","userAccount","userEmail","userIdcard"],
|
|
1051
|
+
stationFormField:["id","principal","userOrgId","userLayer","userOrgStationId","principal","posIdArr","oldPosId"],
|
|
1052
|
+
operateType:'',//操作
|
|
1053
|
+
userDialogTitle:'',//添加用户弹窗标题
|
|
1054
|
+
oldUserAccount:'',//原用户账号
|
|
1055
|
+
oldPrincipal:'', //修改前是否负责人
|
|
1056
|
+
oldPosId:{}, //修改前保存的负责人
|
|
1057
|
+
exportFiledsArr:[
|
|
1058
|
+
'userAccount;用户账号;20',
|
|
1059
|
+
'userName;用户名称;20',
|
|
1060
|
+
'orgName;所属部门;30',
|
|
1061
|
+
'stationName;所属岗位;20',
|
|
1062
|
+
'jobNum;工号;20',
|
|
1063
|
+
'userRoleId;角色;40',
|
|
1064
|
+
'userStatus;用户状态;20',
|
|
1065
|
+
'principal;是否负责人;30',
|
|
1066
|
+
],
|
|
1067
|
+
settingRoleDialog:false, //设置角色
|
|
1068
|
+
settingRoleForm:{}, //设置角色对象
|
|
1069
|
+
settingRoleArr:[], //设置的角色
|
|
1070
|
+
|
|
1071
|
+
viewMenuDialog:false,//查看菜单
|
|
1072
|
+
batchAddPosDialog:false,
|
|
1073
|
+
batchPosUserForm:{},
|
|
1074
|
+
allStationArr:[],
|
|
1075
|
+
menuUserId:'',// 用户
|
|
1076
|
+
menuUserType:'', //用户类型
|
|
1077
|
+
menuUserName:'',
|
|
1078
|
+
isSingleOrgUser:false, //是否单组织岗位
|
|
1079
|
+
addStationArr:[], //需要新增的岗位对象
|
|
1080
|
+
confirmDialog:false, //模拟confirm 弹窗
|
|
1081
|
+
isExsitAdminRoleUser:false,//是否存在管理员用户
|
|
1082
|
+
confirmTitle:'', //确定标题
|
|
1083
|
+
chooseRoleUserArr:[], //
|
|
1084
|
+
adminRoleUserIdArr:[],//管理员用户
|
|
1085
|
+
deptTypeArr: [{"value": "0", "label": "普通部门"}, {"value": "1", "label": "处室"}, {
|
|
1086
|
+
"value": "2",
|
|
1087
|
+
"label": "安监局"
|
|
1088
|
+
}], // 部门类型
|
|
1089
|
+
devUser:false,
|
|
1090
|
+
showOrgEntType:false, //显示是否企业
|
|
1091
|
+
adminRoleIds:'',
|
|
1092
|
+
diableRoleIdArr:[],//不可修改和删除的角色
|
|
1093
|
+
oldOrgId:'', //修改前的组织
|
|
1094
|
+
|
|
1095
|
+
setRoleOrgIdArr:[], //当前设置角色选择的组织
|
|
1096
|
+
}
|
|
1097
|
+
},
|
|
1098
|
+
created() {
|
|
1099
|
+
let vm = this;
|
|
1100
|
+
this.orgObj = this.orgObjReal || {};
|
|
1101
|
+
document.onkeyup = function (e) { // 右键菜单快捷键
|
|
1102
|
+
if(vm.menuVisible){
|
|
1103
|
+
let key = e.key.toLowerCase();
|
|
1104
|
+
switch (key) {
|
|
1105
|
+
case "a":
|
|
1106
|
+
vm.menuVisible = false;
|
|
1107
|
+
vm.handleRightSelect('addChild');
|
|
1108
|
+
break;
|
|
1109
|
+
case "c":
|
|
1110
|
+
vm.menuVisible = false;
|
|
1111
|
+
vm.handleRightSelect('addSame');
|
|
1112
|
+
break;
|
|
1113
|
+
case "r":
|
|
1114
|
+
vm.menuVisible = false;
|
|
1115
|
+
vm.handleRightSelect('removeCurrent');
|
|
1116
|
+
break;
|
|
1117
|
+
case "d":
|
|
1118
|
+
vm.menuVisible = false;
|
|
1119
|
+
vm.handleRightSelect('removeCheck');
|
|
1120
|
+
break;
|
|
1121
|
+
default:
|
|
1122
|
+
break;
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
};
|
|
1126
|
+
vm.axios.post(vm.api.sysOrgDimension.find).then(function (res) {
|
|
1127
|
+
res.data.forEach(function (dimension) {
|
|
1128
|
+
vm.dimObj[dimension["id"]] = dimension["dimName"];
|
|
1129
|
+
})
|
|
1130
|
+
});
|
|
1131
|
+
vm.axios.post(vm.api.param.getSysParams, {"key": "entDim"}).then(function (res) {
|
|
1132
|
+
vm.entDim = res.data["entDim"];
|
|
1133
|
+
vm.axios.post(vm.api.param.getSysParams, {"key": "sysEntDim.id"}).then(function (paramRes) {
|
|
1134
|
+
vm.sysEntDim = paramRes.data["sysEntDim.id"];
|
|
1135
|
+
});
|
|
1136
|
+
});
|
|
1137
|
+
vm.axios.post(vm.api.param.getSysParams, {"key": "manyOrg"}).then(function (res) {
|
|
1138
|
+
let resData = res.data || {};
|
|
1139
|
+
vm.manyOrg = resData["manyOrg"] == "是";
|
|
1140
|
+
});
|
|
1141
|
+
vm.axios.post(vm.api.param.getSysParams,{key:"SysUserType"}).then(function (res) { // 是否可以修改用户详情,获取用户的类型
|
|
1142
|
+
let result = res.data;
|
|
1143
|
+
if(typeof(result) != Object && typeof(result) != "object"){
|
|
1144
|
+
result = JSON.parse(result.replace(/'/g, '"'));
|
|
1145
|
+
}
|
|
1146
|
+
for (let [key, value] of Object.entries(result)) {
|
|
1147
|
+
vm.typeOptions.push({"label": value, "value": key})
|
|
1148
|
+
}
|
|
1149
|
+
});
|
|
1150
|
+
|
|
1151
|
+
//加载当前岗位
|
|
1152
|
+
vm.initStation(); //加载当前岗位
|
|
1153
|
+
|
|
1154
|
+
vm.RES_GLOBAL.getAllRoleId(vm.initAdminRole);
|
|
1155
|
+
vm.initOrgDimRole().then(()=>{//加载当前组织角色
|
|
1156
|
+
vm.init();
|
|
1157
|
+
});
|
|
1158
|
+
//从系统参数中获取 singleOrgUser 是否单组织岗位
|
|
1159
|
+
vm.initSysParam();
|
|
1160
|
+
},
|
|
1161
|
+
watch: {
|
|
1162
|
+
orgId() {
|
|
1163
|
+
if(this.useRefresh){
|
|
1164
|
+
return;
|
|
1165
|
+
}
|
|
1166
|
+
this.orgObj = this.orgObjReal;
|
|
1167
|
+
this.buildParentTree();
|
|
1168
|
+
this.$refs.posTreeRef && this.$refs.posTreeRef.setTreeCurrentKey(null); // 组织切换取消岗位树当前节点
|
|
1169
|
+
|
|
1170
|
+
//判断当前得 activeTabs
|
|
1171
|
+
|
|
1172
|
+
this.init();
|
|
1173
|
+
},
|
|
1174
|
+
refreshOrgId(){
|
|
1175
|
+
if(!this.refreshOrgId){
|
|
1176
|
+
return;
|
|
1177
|
+
}
|
|
1178
|
+
this.orgObj = this.orgObjReal;
|
|
1179
|
+
// this.orgId = this.orgObj.id;
|
|
1180
|
+
this.buildParentTree();
|
|
1181
|
+
this.$refs.posTreeRef && this.$refs.posTreeRef.setTreeCurrentKey(null); // 组织切换取消岗位树当前节点
|
|
1182
|
+
this.init();
|
|
1183
|
+
},
|
|
1184
|
+
orgDim() {
|
|
1185
|
+
this.activeTabs = '1';
|
|
1186
|
+
},
|
|
1187
|
+
|
|
1188
|
+
/**
|
|
1189
|
+
* 切换tab页面
|
|
1190
|
+
*/
|
|
1191
|
+
activeTabs(){
|
|
1192
|
+
this.init();
|
|
1193
|
+
this.$nextTick(()=>{
|
|
1194
|
+
this.dragMethod();
|
|
1195
|
+
});
|
|
1196
|
+
|
|
1197
|
+
},
|
|
1198
|
+
orgObjReal(){
|
|
1199
|
+
this.orgObj = this.orgObjReal;
|
|
1200
|
+
}
|
|
1201
|
+
},
|
|
1202
|
+
mounted(){
|
|
1203
|
+
//拖动排序
|
|
1204
|
+
//已配置字段可以拖动
|
|
1205
|
+
//树定义表格可以上下拖动
|
|
1206
|
+
this.dragMethod();
|
|
1207
|
+
},
|
|
1208
|
+
|
|
1209
|
+
|
|
1210
|
+
methods: {
|
|
1211
|
+
dragMethod(){
|
|
1212
|
+
const vm = this;
|
|
1213
|
+
if(this.$refs[this.crud.tableRef]){
|
|
1214
|
+
const el = this.$refs[this.crud.tableRef].$el.querySelectorAll('.el-table__body-wrapper > table > tbody')[0];
|
|
1215
|
+
Sortable.create(el, {
|
|
1216
|
+
animation: 150,
|
|
1217
|
+
handle:'.index-sort-class',
|
|
1218
|
+
onEnd({ newIndex, oldIndex }) {
|
|
1219
|
+
const listTemp = [...vm.crud.dataStore.records];
|
|
1220
|
+
// let headObj = listTemp.splice(0,1)[0];
|
|
1221
|
+
let headObj = listTemp[0];
|
|
1222
|
+
if(newIndex == 0 && headObj.principal == '1'){ //拖动结束
|
|
1223
|
+
vm.crud.dataStore.records = []; //先清空表格数据
|
|
1224
|
+
vm.$nextTick(() => {
|
|
1225
|
+
vm.crud.dataStore.records = listTemp;
|
|
1226
|
+
});
|
|
1227
|
+
return;
|
|
1228
|
+
}
|
|
1229
|
+
const oldValue = listTemp.splice(oldIndex, 1)[0];
|
|
1230
|
+
//重新更新当前页的所有userLayer
|
|
1231
|
+
listTemp.splice(newIndex, 0, oldValue);
|
|
1232
|
+
//对于切换的两个用户排序
|
|
1233
|
+
const userLayerArr = []; //用户id对应的排序
|
|
1234
|
+
listTemp.forEach((item,index)=>{
|
|
1235
|
+
vm.$set(item,'userLayer',(vm.crud.dataStore.pages -1)*vm.crud.pageSize + (index+1));
|
|
1236
|
+
userLayerArr.push({
|
|
1237
|
+
id:item.id,
|
|
1238
|
+
userLayer:item.userLayer
|
|
1239
|
+
})
|
|
1240
|
+
});
|
|
1241
|
+
//执行批量更新
|
|
1242
|
+
if(userLayerArr.length >0){
|
|
1243
|
+
vm.axios.post(vm.api.sysOrgPosUser.batchUpdate,{updateObj:JSON.stringify(userLayerArr)}); //拖动排序
|
|
1244
|
+
}
|
|
1245
|
+
vm.crud.dataStore.records = []; //先清空表格数据
|
|
1246
|
+
vm.$nextTick(() => {
|
|
1247
|
+
vm.crud.dataStore.records = listTemp;
|
|
1248
|
+
});
|
|
1249
|
+
}
|
|
1250
|
+
});
|
|
1251
|
+
}
|
|
1252
|
+
},
|
|
1253
|
+
|
|
1254
|
+
|
|
1255
|
+
initAdminRole(roleIds){
|
|
1256
|
+
this.adminRoleIds = roleIds || '';
|
|
1257
|
+
},
|
|
1258
|
+
|
|
1259
|
+
initCreatePushRole(){
|
|
1260
|
+
let loginUser = this.USER_GLOBAL.getLoginUser() || {};
|
|
1261
|
+
this.axios.post(this.api.role.find,{"created":loginUser.id,"pushRole":"1"}).then(res => {
|
|
1262
|
+
this.createPushRoleArr = res.data || [];
|
|
1263
|
+
})
|
|
1264
|
+
},
|
|
1265
|
+
buildParentTree(){
|
|
1266
|
+
let vm = this;
|
|
1267
|
+
vm.parentPosTree = [];
|
|
1268
|
+
if(vm.orgObj.orgParentTree){
|
|
1269
|
+
vm.axios.post(vm.api.sysPos.find,{"parentPosIds":vm.orgObj.orgParentTree}).then(res => {
|
|
1270
|
+
let arr = [];
|
|
1271
|
+
(res.data || []).forEach(item => {
|
|
1272
|
+
arr.push({
|
|
1273
|
+
"id":item.id,
|
|
1274
|
+
"label":item.posName,
|
|
1275
|
+
"parentId":item.parentPosId
|
|
1276
|
+
})
|
|
1277
|
+
});
|
|
1278
|
+
vm.parentPosTree = vm.COMMON_FUNC.buildElTree(arr);
|
|
1279
|
+
//递归去除
|
|
1280
|
+
function clearTreeChildren(parentPosTreeArr) {
|
|
1281
|
+
(parentPosTreeArr || []).forEach(item =>{
|
|
1282
|
+
if(item.children){
|
|
1283
|
+
if(item.children.length == 0){
|
|
1284
|
+
delete item['children'];
|
|
1285
|
+
}else {
|
|
1286
|
+
clearTreeChildren(item.children);
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
})
|
|
1290
|
+
}
|
|
1291
|
+
clearTreeChildren(vm.parentPosTree);
|
|
1292
|
+
})
|
|
1293
|
+
}
|
|
1294
|
+
},
|
|
1295
|
+
init() {
|
|
1296
|
+
let vm = this;
|
|
1297
|
+
vm.orgId && (vm.posTreeParam["orgId"] = vm.orgId) && (vm.posCrud.searchForm["orgId"] = vm.orgId);
|
|
1298
|
+
!vm.orgId && (vm.posTreeParam["orgId"] = "$") && (vm.posCrud.searchForm["orgId"] = "$");
|
|
1299
|
+
|
|
1300
|
+
vm.$refs.posBaseRef && vm.$refs.posBaseRef.clearValidate();
|
|
1301
|
+
vm.posCrud.searchForm["posId"] = "$"; // 组织切换时修改岗位id为$,阻止查询
|
|
1302
|
+
vm.posId = "$";
|
|
1303
|
+
vm.menuVisible = false;
|
|
1304
|
+
vm.posBaseForm = {};
|
|
1305
|
+
vm.formOrgName = vm.orgObj.orgName || "";
|
|
1306
|
+
let arr = ["province", "city", "area", "street","community"];
|
|
1307
|
+
let arrTemp = [];
|
|
1308
|
+
let arrIdTmp = [];
|
|
1309
|
+
for (let elem of arr) {
|
|
1310
|
+
if (vm.orgObj[elem] && vm.sysDataObj[vm.orgObj[elem]]) {
|
|
1311
|
+
arrTemp.push(vm.sysDataObj[vm.orgObj[elem]].dataName);
|
|
1312
|
+
arrIdTmp.push(vm.orgObj[elem]);
|
|
1313
|
+
} else {
|
|
1314
|
+
break;
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
if(vm.areaSetting){
|
|
1318
|
+
vm.orgLocation = arrTemp.join(" - "); // 生成所在地区
|
|
1319
|
+
}else{
|
|
1320
|
+
vm.orgLocation = arrIdTmp;
|
|
1321
|
+
}
|
|
1322
|
+
vm.classify = vm.orgObj.orgType === 'dept' ? vm.orgObj.orgClassify : "0";
|
|
1323
|
+
vm.crud.searchForm["orgId"] = vm.orgId || "$"; // 初始化如果没选中组织则取消查询条件
|
|
1324
|
+
vm.$refs[vm.crud.setting.pageRef] && (vm.$refs[vm.crud.setting.pageRef]["internalCurrentPage"] = 1);
|
|
1325
|
+
vm.crud.searchForm.page = 1;
|
|
1326
|
+
let loginUser = this.USER_GLOBAL.getLoginUser() || {};
|
|
1327
|
+
if(loginUser && loginUser.tenantId){
|
|
1328
|
+
vm.crud.searchForm["tenantId"] = loginUser.tenantId;
|
|
1329
|
+
}
|
|
1330
|
+
vm.loginUser = loginUser;
|
|
1331
|
+
if (vm.loginUser.userType == "dev" || vm.loginUser.userType == "sup" || vm.loginUser.commonEmpowerId) {
|
|
1332
|
+
if(vm.loginUser.userType == "dev" || vm.loginUser.userType == "sup" ){
|
|
1333
|
+
vm.showOrgEntType = true;
|
|
1334
|
+
}
|
|
1335
|
+
vm.mayOperate = true;
|
|
1336
|
+
}
|
|
1337
|
+
if(vm.activeTabs == '1'){
|
|
1338
|
+
vm.crud.searchForm["orgId"] = vm.orgId || "$"; // 初始化如果没选中组织则取消查询条件
|
|
1339
|
+
delete vm.crud.searchForm['orgTreeId'];
|
|
1340
|
+
// let index = vm.crud.noClearSearchColumns.indexOf('orgTreeId');
|
|
1341
|
+
// if(index > -1){
|
|
1342
|
+
// vm.crud.noClearSearchColumns.splice(index,1);
|
|
1343
|
+
// }
|
|
1344
|
+
}else { //组织所有用户查询
|
|
1345
|
+
vm.crud.searchForm['orgTreeId'] = vm.orgId || "$";
|
|
1346
|
+
delete vm.crud.searchForm['orgId'];
|
|
1347
|
+
// let index = vm.crud.noClearSearchColumns.indexOf('orgId');
|
|
1348
|
+
// if(index > -1){
|
|
1349
|
+
// vm.crud.noClearSearchColumns.splice(index,1);
|
|
1350
|
+
// }
|
|
1351
|
+
}
|
|
1352
|
+
//赋值
|
|
1353
|
+
vm.crud.searchForm['roleUserCreated'] = loginUser.id;
|
|
1354
|
+
vm.crud.searchForm['roleUserCreateOrg'] = loginUser.linkId || loginUser.mainOrgId || '';
|
|
1355
|
+
vm.crud.searchForm["userType"] = vm.pageSetting["chooseUserType"] || "ent";
|
|
1356
|
+
vm.crud.search();
|
|
1357
|
+
},
|
|
1358
|
+
/**
|
|
1359
|
+
* 组织信息
|
|
1360
|
+
*/
|
|
1361
|
+
chooseUser(pos) { // 选择用户
|
|
1362
|
+
let vm = this;
|
|
1363
|
+
if (!vm.orgDim || !vm.orgId) {
|
|
1364
|
+
vm.$message("请先选择左侧组织!");
|
|
1365
|
+
return;
|
|
1366
|
+
}
|
|
1367
|
+
vm.userCrud.searchForm["noSearchUserByOrgId"] = "";
|
|
1368
|
+
vm.userCrud.searchForm["noSearchUserByPosId"] = "";
|
|
1369
|
+
vm.userCrud.searchForm["notOrg"] = "";
|
|
1370
|
+
vm.userCrud.searchForm["notPos"] = "";
|
|
1371
|
+
vm.multipleSelection=[];
|
|
1372
|
+
vm.multipleSelectionIds=[];
|
|
1373
|
+
if (pos === "pos") {
|
|
1374
|
+
if (!vm.posId || vm.posId == "$") {
|
|
1375
|
+
vm.$message("请先选择岗位!");
|
|
1376
|
+
return;
|
|
1377
|
+
}
|
|
1378
|
+
vm.setPos = true;
|
|
1379
|
+
if(vm.manyOrg){
|
|
1380
|
+
vm.userCrud.searchForm["notOrg"] = vm.orgId;
|
|
1381
|
+
vm.userCrud.searchForm["notPos"] = vm.posId;
|
|
1382
|
+
delete vm.userCrud.searchForm["noSearchUserByPosId"];
|
|
1383
|
+
delete vm.userCrud.searchForm["noSearchUserByOrgId"];
|
|
1384
|
+
}else{
|
|
1385
|
+
vm.userCrud.searchForm["noSearchUserByPosId"] = vm.posId;
|
|
1386
|
+
}
|
|
1387
|
+
} else {
|
|
1388
|
+
vm.setPos = false;
|
|
1389
|
+
if(vm.manyOrg){
|
|
1390
|
+
vm.userCrud.searchForm["notOrg"] = vm.orgId;
|
|
1391
|
+
delete vm.userCrud.searchForm["noSearchUserByPosId"];
|
|
1392
|
+
delete vm.userCrud.searchForm["noSearchUserByOrgId"];
|
|
1393
|
+
}else{
|
|
1394
|
+
vm.userCrud.searchForm["noSearchUserByOrgId"] = vm.orgId;
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
vm.userCrud.searchForm["orgDim"] = vm.orgDim;
|
|
1398
|
+
vm.userCrud.searchForm["userType"] = vm.pageSetting["chooseUserType"] || "ent";
|
|
1399
|
+
if (vm.orgDim === vm.entDim) {
|
|
1400
|
+
vm.userCrud.searchForm["noEntOrgType"] = "1";
|
|
1401
|
+
}
|
|
1402
|
+
if (vm.orgDim === vm.sysEntDim) {
|
|
1403
|
+
vm.userCrud.searchForm["entOrgType"] = "2";
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
let loginUser = vm.USER_GLOBAL.getLoginUser() || {};
|
|
1407
|
+
if(loginUser.userType == "empower"){
|
|
1408
|
+
let loginDept = this.USER_GLOBAL.getLoginDept();
|
|
1409
|
+
vm.userCrud.searchForm["searchEmpowerOrgId"] = loginDept.id;
|
|
1410
|
+
}
|
|
1411
|
+
//判断是否为企业管理员
|
|
1412
|
+
if(loginUser.commonEmpowerId){ //如果是管理员
|
|
1413
|
+
vm.userCrud.searchForm["searchEmpowerOrgId"] = loginUser.mainOrgId || '';
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
let objData = {};
|
|
1417
|
+
let searchForm = vm.userCrud.searchForm;
|
|
1418
|
+
vm.userCrud.noClearSearchColumns && vm.userCrud.noClearSearchColumns.forEach(function (key) {
|
|
1419
|
+
objData[key] = searchForm[key];
|
|
1420
|
+
});
|
|
1421
|
+
|
|
1422
|
+
if(loginUser && loginUser.tenantId){
|
|
1423
|
+
vm.userCrud.searchForm["tenantId"] = loginUser.tenantId;
|
|
1424
|
+
}
|
|
1425
|
+
// this.isSingleOrgUser = true;
|
|
1426
|
+
//从系统参数中获取
|
|
1427
|
+
if(this.isSingleOrgUser){ //是单组织岗位
|
|
1428
|
+
objData['isSingeOrgUser'] = '1';
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1431
|
+
|
|
1432
|
+
|
|
1433
|
+
vm.userCrud.searchForm = Object.assign({}, objData);
|
|
1434
|
+
vm.$refs[vm.userCrud.setting.pageRef] && (vm.$refs[vm.userCrud.setting.pageRef]["internalCurrentPage"] = 1);
|
|
1435
|
+
vm.userCrud.searchForm.page = 1;
|
|
1436
|
+
vm.userCrud.search();
|
|
1437
|
+
|
|
1438
|
+
vm.chooseUserDialog = true;
|
|
1439
|
+
},
|
|
1440
|
+
|
|
1441
|
+
|
|
1442
|
+
/**
|
|
1443
|
+
* 添加用户
|
|
1444
|
+
*/
|
|
1445
|
+
// addEntOrgUser(pos){
|
|
1446
|
+
//
|
|
1447
|
+
// },
|
|
1448
|
+
|
|
1449
|
+
adjustOrder(pos) { // 打开调整用户顺序
|
|
1450
|
+
let vm = this;
|
|
1451
|
+
if (!vm.orgId) {
|
|
1452
|
+
vm.$message("选择左侧组织后再操作!");
|
|
1453
|
+
return;
|
|
1454
|
+
}
|
|
1455
|
+
if (pos == "pos" && !vm.posId) {
|
|
1456
|
+
vm.$message("请先选择岗位!");
|
|
1457
|
+
return;
|
|
1458
|
+
}
|
|
1459
|
+
vm.axios.post(vm.api.sysOrgPosUser.findNoPageParamByStation, {
|
|
1460
|
+
"orgId": vm.orgId,
|
|
1461
|
+
"isNewStation":"1",
|
|
1462
|
+
"roleUserCreated":vm.loginUser.id,
|
|
1463
|
+
"roleUserCreateOrg":vm.loginUser.linkId || vm.loginUser.mainOrgId || '',
|
|
1464
|
+
"userType": vm.pageSetting["chooseUserType"] || "ent"
|
|
1465
|
+
}).then(function (res) {
|
|
1466
|
+
vm.posUserArr = [];
|
|
1467
|
+
(res.data || []).forEach((data,index)=>{
|
|
1468
|
+
data.userLayer = index + 1;
|
|
1469
|
+
vm.posUserArr.push(data);
|
|
1470
|
+
});
|
|
1471
|
+
});
|
|
1472
|
+
vm.updateOrder = true;
|
|
1473
|
+
vm.orderDialog = true;
|
|
1474
|
+
},
|
|
1475
|
+
saveOrder() { // 保存顺序
|
|
1476
|
+
let vm = this;
|
|
1477
|
+
let datas = [];
|
|
1478
|
+
//查询当前组织下是否有 责任人,如果没有默认第一个
|
|
1479
|
+
let zMvalidator = true;
|
|
1480
|
+
let isEmptValidator = true;
|
|
1481
|
+
vm.jugeExistPrincipal(vm.orgId).then(existPrincipal =>{
|
|
1482
|
+
vm.posUserArr.forEach((posUser,index)=> {
|
|
1483
|
+
(posUser["id"].split(",")||[]).forEach(id =>{
|
|
1484
|
+
let obj = {};
|
|
1485
|
+
obj["id"] = id;
|
|
1486
|
+
if(!posUser["userLayer"]){
|
|
1487
|
+
isEmptValidator = false;
|
|
1488
|
+
}
|
|
1489
|
+
obj["userLayer"] = posUser["userLayer"] || "0";
|
|
1490
|
+
const reg = /^\+?([1-9][0-9]*)$/;
|
|
1491
|
+
if (!reg.test(obj["userLayer"])) {
|
|
1492
|
+
zMvalidator = false;
|
|
1493
|
+
}
|
|
1494
|
+
datas.push(obj);
|
|
1495
|
+
});
|
|
1496
|
+
});
|
|
1497
|
+
if(!isEmptValidator){
|
|
1498
|
+
vm.$message({
|
|
1499
|
+
message: '排序不能为空',
|
|
1500
|
+
type: "warning",
|
|
1501
|
+
duration: 1200
|
|
1502
|
+
});
|
|
1503
|
+
return;
|
|
1504
|
+
}
|
|
1505
|
+
if(!zMvalidator){
|
|
1506
|
+
vm.$message({
|
|
1507
|
+
message: '排序只能输入正整数',
|
|
1508
|
+
type: "warning",
|
|
1509
|
+
duration: 1200
|
|
1510
|
+
});
|
|
1511
|
+
return;
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
vm.axios.post(vm.api.sysOrgPosUser.batchUpdate, {"updateObj": JSON.stringify(datas)}).then(function (res) {
|
|
1515
|
+
vm.$message({
|
|
1516
|
+
message: res.data.operateMessage,
|
|
1517
|
+
type: "success",
|
|
1518
|
+
duration: 1200
|
|
1519
|
+
});
|
|
1520
|
+
vm.crud.search();
|
|
1521
|
+
let loginUser = vm.USER_GLOBAL.getLoginUser() || {};
|
|
1522
|
+
if(loginUser && loginUser.tenantId){
|
|
1523
|
+
vm.posCrud.searchForm["tenantId"] = loginUser.tenantId;
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
|
|
1527
|
+
vm.posCrud.search();
|
|
1528
|
+
});
|
|
1529
|
+
vm.orderDialog = false;
|
|
1530
|
+
});
|
|
1531
|
+
},
|
|
1532
|
+
setUser() { // 选择用户
|
|
1533
|
+
let vm = this;
|
|
1534
|
+
let selection = vm.multipleSelection;
|
|
1535
|
+
//let selection = vm.$refs[vm.userCrud.tableRef].selection;
|
|
1536
|
+
if ((selection || []).length == 0) {
|
|
1537
|
+
vm.$message({
|
|
1538
|
+
duration: 1500,
|
|
1539
|
+
type: 'info',
|
|
1540
|
+
message: '请至少选择一条需要操作的数据!'
|
|
1541
|
+
});
|
|
1542
|
+
return;
|
|
1543
|
+
}
|
|
1544
|
+
vm.updateOrder = false;
|
|
1545
|
+
vm.posUserArr = [];
|
|
1546
|
+
let sort = 0;
|
|
1547
|
+
let param = {"order": "USER_LAYER DESC", "orgId": vm.orgId};
|
|
1548
|
+
if (vm.setPos) {
|
|
1549
|
+
param = {"order": "USER_LAYER DESC", "posId": vm.posId};
|
|
1550
|
+
}
|
|
1551
|
+
vm.axios.post(vm.api.sysOrgPosUser.find, param).then(function (res) {
|
|
1552
|
+
if (res.data.length > 0) {
|
|
1553
|
+
sort = Number(res.data[0].userLayer);
|
|
1554
|
+
}
|
|
1555
|
+
selection.forEach(function (select) {
|
|
1556
|
+
let obj = {};
|
|
1557
|
+
obj["userId"] = select.id;
|
|
1558
|
+
obj["userLayer"] = ++sort;
|
|
1559
|
+
if (vm.setPos) {
|
|
1560
|
+
obj["posId"] = vm.posId;
|
|
1561
|
+
}
|
|
1562
|
+
obj["orgId"] = vm.orgId;
|
|
1563
|
+
obj["userName"] = select.userName;
|
|
1564
|
+
vm.posUserArr.push(obj);
|
|
1565
|
+
});
|
|
1566
|
+
vm.orderDialog = true;
|
|
1567
|
+
})
|
|
1568
|
+
},
|
|
1569
|
+
addOrder() { // 添加至组织下
|
|
1570
|
+
let vm = this;
|
|
1571
|
+
let arr = JSON.parse(JSON.stringify(vm.posUserArr));
|
|
1572
|
+
let submitArr = [];
|
|
1573
|
+
vm.jugeExistPrincipal(vm.orgId).then(existPrincipal =>{
|
|
1574
|
+
//查询当前组织下是否有 责任人,如果没有默认第一个
|
|
1575
|
+
let zMvalidator = true;
|
|
1576
|
+
let isEmptValidator = true;
|
|
1577
|
+
|
|
1578
|
+
arr.forEach((posUser,index)=> {
|
|
1579
|
+
delete posUser["userName"];
|
|
1580
|
+
if(index == 0 && existPrincipal == 0){
|
|
1581
|
+
posUser["principal"] = "1";
|
|
1582
|
+
}
|
|
1583
|
+
if(!posUser["userLayer"]){
|
|
1584
|
+
isEmptValidator = false;
|
|
1585
|
+
}
|
|
1586
|
+
const reg = /^\+?([1-9][0-9]*)$/;
|
|
1587
|
+
if (!reg.test(posUser["userLayer"])) {
|
|
1588
|
+
zMvalidator = false;
|
|
1589
|
+
}
|
|
1590
|
+
submitArr.push(posUser);
|
|
1591
|
+
});
|
|
1592
|
+
if(!isEmptValidator){
|
|
1593
|
+
vm.$message({
|
|
1594
|
+
message: '排序不能为空',
|
|
1595
|
+
type: "warning",
|
|
1596
|
+
duration: 1200
|
|
1597
|
+
});
|
|
1598
|
+
return;
|
|
1599
|
+
}
|
|
1600
|
+
if(!zMvalidator){
|
|
1601
|
+
vm.$message({
|
|
1602
|
+
message: '排序只能输入正整数',
|
|
1603
|
+
type: "warning",
|
|
1604
|
+
duration: 1200
|
|
1605
|
+
});
|
|
1606
|
+
return;
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
vm.axios.post(vm.api.sysOrgPosUser.batchAdd, {"addObj": JSON.stringify(submitArr)}).then(function (res) {
|
|
1610
|
+
vm.$message({
|
|
1611
|
+
duration: 1200,
|
|
1612
|
+
message: res.data.operateMessage,
|
|
1613
|
+
type: "success"
|
|
1614
|
+
});
|
|
1615
|
+
vm.orderDialog = false;
|
|
1616
|
+
vm.chooseUserDialog = false;
|
|
1617
|
+
let loginUser = vm.USER_GLOBAL.getLoginUser() || {};
|
|
1618
|
+
if(loginUser && loginUser.tenantId){
|
|
1619
|
+
vm.posCrud.searchForm["tenantId"] = loginUser.tenantId;
|
|
1620
|
+
}
|
|
1621
|
+
vm.posCrud.search();
|
|
1622
|
+
vm.crud.search(vm.completeOrder);
|
|
1623
|
+
})
|
|
1624
|
+
});
|
|
1625
|
+
|
|
1626
|
+
},
|
|
1627
|
+
|
|
1628
|
+
/**
|
|
1629
|
+
* 重新计算排序
|
|
1630
|
+
*/
|
|
1631
|
+
completeOrder(callbackVm,data){
|
|
1632
|
+
let vm = this;
|
|
1633
|
+
let userLayerArr = [];
|
|
1634
|
+
(data.records || []).forEach((item,index)=>{
|
|
1635
|
+
vm.$set(item,'userLayer',(vm.crud.dataStore.pages -1)*vm.crud.pageSize + (index+1));
|
|
1636
|
+
userLayerArr.push({
|
|
1637
|
+
id:item.id,
|
|
1638
|
+
userLayer:item.userLayer
|
|
1639
|
+
})
|
|
1640
|
+
});
|
|
1641
|
+
//执行批量更新
|
|
1642
|
+
if(userLayerArr.length >0){
|
|
1643
|
+
vm.axios.post(vm.api.sysOrgPosUser.batchUpdate,{updateObj:JSON.stringify(userLayerArr)}).then(res =>{
|
|
1644
|
+
vm.crud.search();
|
|
1645
|
+
}); //拖动排序
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
},
|
|
1649
|
+
|
|
1650
|
+
|
|
1651
|
+
addUser() {// 添加用户
|
|
1652
|
+
let vm = this;
|
|
1653
|
+
if (!vm.orgId) {
|
|
1654
|
+
vm.$message("选择左侧组织后再操作!");
|
|
1655
|
+
return;
|
|
1656
|
+
}
|
|
1657
|
+
vm.operateType = "add"; //新增
|
|
1658
|
+
vm.userDialogTitle = "添加用户";
|
|
1659
|
+
vm.oldOrgId = vm.orgId;
|
|
1660
|
+
vm.addUserForm = {};
|
|
1661
|
+
vm.oldPrincipal = "0";
|
|
1662
|
+
vm.oldPosId = {};
|
|
1663
|
+
let chooseUserTypeArr = (vm.pageSetting["chooseUserType"] || "").split(",");
|
|
1664
|
+
if(chooseUserTypeArr.length == 0){
|
|
1665
|
+
chooseUserTypeArr.push("ent");
|
|
1666
|
+
}
|
|
1667
|
+
vm.allRoleTempObj = JSON.parse(JSON.stringify(vm.allRoleObj));
|
|
1668
|
+
vm.typeOptions.forEach(function (type) {
|
|
1669
|
+
vm.userTypeOptions.push(type);
|
|
1670
|
+
});
|
|
1671
|
+
vm.$set(vm.addUserForm, "userType", chooseUserTypeArr[0]);
|
|
1672
|
+
vm.$set(vm.addUserForm, "userStatus", "10");
|
|
1673
|
+
vm.$set(vm.addUserForm, "principal", "0"); //默认不是负责人
|
|
1674
|
+
|
|
1675
|
+
//默认角色
|
|
1676
|
+
vm.$set(vm.addUserForm, "userRoleIdArr", []); //默认角色
|
|
1677
|
+
|
|
1678
|
+
//设置默认 岗位
|
|
1679
|
+
vm.$set(vm.addUserForm, "posIdArr", []); //默认岗位
|
|
1680
|
+
|
|
1681
|
+
//设置默认部门
|
|
1682
|
+
vm.$set(vm.addUserForm,'userOrgId',vm.orgId); //默认所在部门
|
|
1683
|
+
vm.jugeExistPrincipal(vm.orgId).then(existPrincipal =>{
|
|
1684
|
+
vm.getMaxUserLayer(vm.orgId).then(sort =>{
|
|
1685
|
+
vm.$set(vm.addUserForm,'userLayer',sort); //自增长排序
|
|
1686
|
+
//实时加载岗位信息
|
|
1687
|
+
//设置当前用户为 责任人
|
|
1688
|
+
if(existPrincipal == 0){
|
|
1689
|
+
vm.$set(vm.addUserForm, "principal", "1"); //默认不是负责人
|
|
1690
|
+
//并且不可以选中
|
|
1691
|
+
vm.$set(vm.addUserForm, "disabledPrincipal", true); //不可以切换
|
|
1692
|
+
}
|
|
1693
|
+
vm.addUserDialog = true;
|
|
1694
|
+
vm.$nextTick(()=> {
|
|
1695
|
+
vm.$refs.addUserRef.clearValidate(); // 再次添加清除原先的f验证
|
|
1696
|
+
})
|
|
1697
|
+
});
|
|
1698
|
+
});
|
|
1699
|
+
},
|
|
1700
|
+
|
|
1701
|
+
/**
|
|
1702
|
+
* 删除用户
|
|
1703
|
+
*/
|
|
1704
|
+
deleteUser(){
|
|
1705
|
+
let vm = this;
|
|
1706
|
+
let crud = vm.crud;
|
|
1707
|
+
let selection = crud.vue.$refs[crud.tableRef].selection;
|
|
1708
|
+
if ((selection || []).length === 0) {
|
|
1709
|
+
vm.$message({
|
|
1710
|
+
duration: 1500,
|
|
1711
|
+
type: 'info',
|
|
1712
|
+
message: '请至少选择一条需要删除的数据!'
|
|
1713
|
+
});
|
|
1714
|
+
return;
|
|
1715
|
+
}
|
|
1716
|
+
let removeOrgUserIdArr = [];
|
|
1717
|
+
let removeUserIdArr = [];
|
|
1718
|
+
let existPrincipal = false;
|
|
1719
|
+
selection.forEach(item =>{
|
|
1720
|
+
removeOrgUserIdArr.push(item.id);
|
|
1721
|
+
removeUserIdArr.push(item.userId);
|
|
1722
|
+
if(item.principal == '1'){
|
|
1723
|
+
existPrincipal = true;
|
|
1724
|
+
}
|
|
1725
|
+
});
|
|
1726
|
+
if(existPrincipal && (this.crud.dataStore.records || []).length > 1){
|
|
1727
|
+
vm.$message({
|
|
1728
|
+
duration: 1500,
|
|
1729
|
+
type: 'warning',
|
|
1730
|
+
message: '当存在多个组织岗位信息时,删除不能包含负责人!'
|
|
1731
|
+
});
|
|
1732
|
+
return;
|
|
1733
|
+
}
|
|
1734
|
+
vm.$confirm('删除用户时会删除关联用户组织和用户角色,是否继续?', '提示', {
|
|
1735
|
+
confirmButtonText: '确定',
|
|
1736
|
+
cancelButtonText: '取消',
|
|
1737
|
+
}).then(()=> {
|
|
1738
|
+
vm.axios.post(this.api.sysOrgPosUser.deleteOrgUser,{removeOrgUserId: removeOrgUserIdArr.join(","),
|
|
1739
|
+
removeUserId:removeUserIdArr.join(",")}).then(res =>{
|
|
1740
|
+
vm.$message({
|
|
1741
|
+
message: res.data.operateMessage,
|
|
1742
|
+
duration: 1200,
|
|
1743
|
+
type: "success"
|
|
1744
|
+
});
|
|
1745
|
+
if(res && res.data && res.data.operateSuccess){
|
|
1746
|
+
vm.crud.search((callbackVm,data) =>{
|
|
1747
|
+
});
|
|
1748
|
+
}
|
|
1749
|
+
})
|
|
1750
|
+
});
|
|
1751
|
+
},
|
|
1752
|
+
|
|
1753
|
+
openBatchAddPosUser(){
|
|
1754
|
+
this.getDevStations().then(() => {
|
|
1755
|
+
this.batchAddPosDialog = true;
|
|
1756
|
+
this.batchPosUserForm = {};
|
|
1757
|
+
this.$nextTick(() => {
|
|
1758
|
+
this.$refs.batchAddPosFormRef.clearValidate();
|
|
1759
|
+
})
|
|
1760
|
+
})
|
|
1761
|
+
},
|
|
1762
|
+
|
|
1763
|
+
batchAddPosUser(){
|
|
1764
|
+
this.$refs.batchAddPosFormRef.validate(valid => {
|
|
1765
|
+
if(!valid){
|
|
1766
|
+
return;
|
|
1767
|
+
}
|
|
1768
|
+
this.batchPosUserForm["orgId"] = this.orgId;
|
|
1769
|
+
this.axios.post(this.api.sysOrgPosUser.batchAddPosUserByStation,this.batchPosUserForm).then(res => {
|
|
1770
|
+
if(res.data.success == "false"){
|
|
1771
|
+
this.$message({
|
|
1772
|
+
duration:0,
|
|
1773
|
+
type:"error",
|
|
1774
|
+
message:res.data.message,
|
|
1775
|
+
showClose:true
|
|
1776
|
+
})
|
|
1777
|
+
}else{
|
|
1778
|
+
this.$message.success(res.data.message);
|
|
1779
|
+
this.getDevStations().then(() => {
|
|
1780
|
+
this.crud.search();
|
|
1781
|
+
this.batchAddPosDialog = false;
|
|
1782
|
+
})
|
|
1783
|
+
}
|
|
1784
|
+
})
|
|
1785
|
+
})
|
|
1786
|
+
},
|
|
1787
|
+
|
|
1788
|
+
updateData(row,type){
|
|
1789
|
+
let vm = this;
|
|
1790
|
+
vm.operateType = "update"; //修改类型
|
|
1791
|
+
vm.userDialogTitle = "修改用户";
|
|
1792
|
+
if(type == 'view'){
|
|
1793
|
+
vm.operateType = "view"; //查看类型
|
|
1794
|
+
vm.userDialogTitle = "查看用户";
|
|
1795
|
+
}
|
|
1796
|
+
vm.oldUserAccount = row.userAccount; //用户账号
|
|
1797
|
+
vm.oldPrincipal = row.principal || '0';
|
|
1798
|
+
vm.oldOrgId = row.orgId;
|
|
1799
|
+
vm.oldPosId = {};
|
|
1800
|
+
let orgPosUserIdArr =(row.id || "").split(",");
|
|
1801
|
+
if(this.devUser){
|
|
1802
|
+
(row.posDevId || "").split(",").forEach((posId,index) =>{
|
|
1803
|
+
if(posId && orgPosUserIdArr[index]){
|
|
1804
|
+
vm.oldPosId[posId] = orgPosUserIdArr[index];
|
|
1805
|
+
}
|
|
1806
|
+
});
|
|
1807
|
+
}else{
|
|
1808
|
+
(row.posId || "").split(",").forEach((posId,index) =>{
|
|
1809
|
+
if(posId && orgPosUserIdArr[index]){
|
|
1810
|
+
vm.oldPosId[posId] = orgPosUserIdArr[index];
|
|
1811
|
+
}
|
|
1812
|
+
});
|
|
1813
|
+
}
|
|
1814
|
+
vm.addUserForm = JSON.parse(JSON.stringify(row));
|
|
1815
|
+
vm.$set(vm.addUserForm,'oldPosId',vm.oldPosId);
|
|
1816
|
+
vm.$set(vm.addUserForm,'userRoleIdArr',[]);
|
|
1817
|
+
let userRoleIdArr = [];
|
|
1818
|
+
let otherRoleIdArr = [];
|
|
1819
|
+
if(row.userRoleId){
|
|
1820
|
+
row.userRoleId.split(",").forEach(roleId =>{
|
|
1821
|
+
if(vm.allRoleObj[roleId]){
|
|
1822
|
+
// vm.addUserForm['userRoleIdArr'].push(roleId);
|
|
1823
|
+
userRoleIdArr.push(roleId);
|
|
1824
|
+
}else if(vm.allowRoleObj[roleId]){
|
|
1825
|
+
otherRoleIdArr.push(roleId);
|
|
1826
|
+
}
|
|
1827
|
+
});
|
|
1828
|
+
//解析role
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
vm.$set(vm.addUserForm,'posIdArr',[]); //岗位
|
|
1832
|
+
if(this.devUser){
|
|
1833
|
+
if(row.posDevId){
|
|
1834
|
+
vm.addUserForm['posIdArr'] = row.posDevId.split(",");
|
|
1835
|
+
}
|
|
1836
|
+
}else{
|
|
1837
|
+
if(row.posId){
|
|
1838
|
+
vm.addUserForm['posIdArr'] = row.posId.split(",");
|
|
1839
|
+
}
|
|
1840
|
+
}
|
|
1841
|
+
vm.addUserForm['posIdArr'] = vm.addUserForm['posIdArr'].filter(item => {
|
|
1842
|
+
return (!!item && vm.allowStationObj[item]);
|
|
1843
|
+
})
|
|
1844
|
+
vm.$set(vm.addUserForm,'userOrgId',row.orgId || '');
|
|
1845
|
+
vm.getRoleUserType(userRoleIdArr,row.userId,otherRoleIdArr).then(roleIdArr =>{
|
|
1846
|
+
vm.addUserForm['userRoleIdArr'] = roleIdArr;
|
|
1847
|
+
vm.jugeExistPrincipal(vm.orgId).then(existPrincipal =>{
|
|
1848
|
+
if(existPrincipal == 0){
|
|
1849
|
+
vm.$set(vm.addUserForm, "principal", "1"); //默认不是负责人
|
|
1850
|
+
//并且不可以选中
|
|
1851
|
+
vm.$set(vm.addUserForm, "disabledPrincipal", true); //不可以切换
|
|
1852
|
+
}else if(row.principal == '1'){
|
|
1853
|
+
vm.$set(vm.addUserForm, "disabledPrincipal", true); //
|
|
1854
|
+
}
|
|
1855
|
+
if(vm.loginUser.commonEmpowerId && vm.loginUser.id == vm.addUserForm.userId){ //管理员用户单独解析
|
|
1856
|
+
// {{formatterRole((addUserForm.userRoleIdArr || []).join(",")) || '暂无'}}
|
|
1857
|
+
//{{formatterStation((addUserForm.posIdArr || []).join(",")) || '暂无'}}
|
|
1858
|
+
let adminRoleName = vm.formatterRole((vm.addUserForm.userRoleIdArr || []).join(",")) || '暂无';
|
|
1859
|
+
let adminPosName = vm.formatterStation((vm.addUserForm.posIdArr || []).join(",")) || '暂无';
|
|
1860
|
+
vm.$set(vm.addUserForm, "adminRoleName", adminRoleName); //
|
|
1861
|
+
vm.$set(vm.addUserForm, "adminPosName", adminPosName); //
|
|
1862
|
+
}
|
|
1863
|
+
|
|
1864
|
+
vm.addUserDialog = true;
|
|
1865
|
+
vm.$nextTick(()=> {
|
|
1866
|
+
vm.$refs.addUserRef.clearValidate(); // 再次添加清除原先的验证
|
|
1867
|
+
})
|
|
1868
|
+
});
|
|
1869
|
+
});
|
|
1870
|
+
},
|
|
1871
|
+
/**
|
|
1872
|
+
* 获取当前组织的最大用户排序
|
|
1873
|
+
*/
|
|
1874
|
+
getMaxUserLayer(orgId){
|
|
1875
|
+
//获取默认顺序
|
|
1876
|
+
return new Promise(resolve => {
|
|
1877
|
+
let sort = 0;
|
|
1878
|
+
let param = {"order": "USER_LAYER DESC", "orgId": orgId};
|
|
1879
|
+
this.axios.post(this.api.sysOrgPosUser.find, param).then(res=> {
|
|
1880
|
+
if (res.data.length > 0) {
|
|
1881
|
+
sort = Number(res.data[0].userLayer);
|
|
1882
|
+
}
|
|
1883
|
+
sort ++; //排序
|
|
1884
|
+
resolve(sort);
|
|
1885
|
+
})
|
|
1886
|
+
});
|
|
1887
|
+
},
|
|
1888
|
+
|
|
1889
|
+
/**
|
|
1890
|
+
* 判断当前组织维度下是否存在负责人
|
|
1891
|
+
*/
|
|
1892
|
+
jugeExistPrincipal(orgId){
|
|
1893
|
+
return new Promise(resolve => {
|
|
1894
|
+
this.axios.post(this.api.sysOrgPosUser.find,{"orgId":orgId,"principal":"1"}).then(res =>{
|
|
1895
|
+
if(res.data && res.data.length > 0){
|
|
1896
|
+
resolve(1);
|
|
1897
|
+
}else {
|
|
1898
|
+
resolve(0);
|
|
1899
|
+
}
|
|
1900
|
+
})
|
|
1901
|
+
});
|
|
1902
|
+
},
|
|
1903
|
+
|
|
1904
|
+
/**
|
|
1905
|
+
* 获取用户角色关联
|
|
1906
|
+
*/
|
|
1907
|
+
getRoleUserType(userRoleIdArr,userId,otherRoleIdArr){
|
|
1908
|
+
return new Promise(resolve => {
|
|
1909
|
+
this.diableRoleIdArr = [];
|
|
1910
|
+
this.disableDveRoleId = [];
|
|
1911
|
+
this.allRoleTempObj = JSON.parse(JSON.stringify(this.allRoleObj));
|
|
1912
|
+
if(userRoleIdArr.length > 0){
|
|
1913
|
+
//根据
|
|
1914
|
+
this.axios.post(this.api.roleUser.find, {"roleIds":userRoleIdArr.join(","),"roleType":"user","userId":userId}).then(res=> {
|
|
1915
|
+
let arr = [];
|
|
1916
|
+
(res.data || []).forEach(roleUser =>{
|
|
1917
|
+
if(arr.indexOf(roleUser.roleId) == -1){
|
|
1918
|
+
if(this.loginUser.userType != 'sup' && roleUser.created != '48f9c3b6831b480a824d39a7f5b2ea16'){
|
|
1919
|
+
arr.push(roleUser.roleId);
|
|
1920
|
+
}
|
|
1921
|
+
if(this.loginUser.userType == 'sup' && roleUser.created == '48f9c3b6831b480a824d39a7f5b2ea16'){
|
|
1922
|
+
arr.push(roleUser.roleId);
|
|
1923
|
+
}
|
|
1924
|
+
if(this.allRoleObj[roleUser.roleId].adminRole == '1'){ //管理员角色
|
|
1925
|
+
this.diableRoleIdArr.push(roleUser.roleId);
|
|
1926
|
+
}
|
|
1927
|
+
}
|
|
1928
|
+
});
|
|
1929
|
+
this.disableDveRoleId = [...userRoleIdArr].filter(x => [...arr].every(y => y !== x)); //禁用的角色
|
|
1930
|
+
this.disableDveRoleId.forEach(roleId =>{
|
|
1931
|
+
if(this.allowRoleObj[roleId]){
|
|
1932
|
+
this.allRoleTempObj[roleId] = this.allowRoleObj[roleId];
|
|
1933
|
+
arr.push(roleId);
|
|
1934
|
+
}
|
|
1935
|
+
});
|
|
1936
|
+
if(otherRoleIdArr.length > 0){
|
|
1937
|
+
otherRoleIdArr.forEach(roleId =>{
|
|
1938
|
+
if(this.allowRoleObj[roleId]){
|
|
1939
|
+
this.allRoleTempObj[roleId] = this.allowRoleObj[roleId];
|
|
1940
|
+
arr.push(roleId);
|
|
1941
|
+
if(this.disableDveRoleId.indexOf(roleId) == -1){
|
|
1942
|
+
this.disableDveRoleId.push(roleId);
|
|
1943
|
+
}
|
|
1944
|
+
}
|
|
1945
|
+
});
|
|
1946
|
+
}
|
|
1947
|
+
resolve(arr);
|
|
1948
|
+
});
|
|
1949
|
+
}else {
|
|
1950
|
+
let arr = [];
|
|
1951
|
+
this.disableDveRoleId = (this.addUserForm.userRoleId || '').split(",");
|
|
1952
|
+
this.disableDveRoleId.forEach(roleId =>{
|
|
1953
|
+
if(this.allowRoleObj[roleId]){
|
|
1954
|
+
this.allRoleTempObj[roleId] = this.allowRoleObj[roleId];
|
|
1955
|
+
arr.push(roleId);
|
|
1956
|
+
}
|
|
1957
|
+
});
|
|
1958
|
+
resolve(arr);
|
|
1959
|
+
}
|
|
1960
|
+
});
|
|
1961
|
+
|
|
1962
|
+
},
|
|
1963
|
+
|
|
1964
|
+
saveUser() { // 保存用户
|
|
1965
|
+
let vm = this;
|
|
1966
|
+
// vm.addUserForm.userAccount = vm.addUserForm.userName;
|
|
1967
|
+
//保存用户信息
|
|
1968
|
+
vm.$refs.addUserRef.validate(valid=> { // 表单验证
|
|
1969
|
+
if (valid) {
|
|
1970
|
+
vm.startSaveUser();
|
|
1971
|
+
}
|
|
1972
|
+
});
|
|
1973
|
+
},
|
|
1974
|
+
|
|
1975
|
+
startSaveUser(){
|
|
1976
|
+
let vm = this;
|
|
1977
|
+
return new Promise(resolve => {
|
|
1978
|
+
let saveUserObj = {};
|
|
1979
|
+
let saveOrgStationObj = {};
|
|
1980
|
+
let userRoleIdArr = []; //用户角色
|
|
1981
|
+
Object.keys(vm.addUserForm).forEach(field =>{
|
|
1982
|
+
if(vm.userFormField.indexOf(field) > -1){
|
|
1983
|
+
if(field == "userId"){
|
|
1984
|
+
saveUserObj['id'] = vm.addUserForm['userId'];
|
|
1985
|
+
}else{ //岗位信息
|
|
1986
|
+
saveUserObj[field] = vm.addUserForm[field];
|
|
1987
|
+
}
|
|
1988
|
+
}else if(vm.stationFormField.indexOf(field) > -1){
|
|
1989
|
+
if(field == 'userOrgId') {
|
|
1990
|
+
saveOrgStationObj['orgId'] = vm.addUserForm['userOrgId'] || ''; //组织岗位id
|
|
1991
|
+
}else if(field == 'posIdArr'){
|
|
1992
|
+
if(this.devUser){
|
|
1993
|
+
saveOrgStationObj['posDevId'] = (vm.addUserForm['posIdArr'] || []).join(","); //岗位
|
|
1994
|
+
}else{
|
|
1995
|
+
saveOrgStationObj['posId'] = (vm.addUserForm['posIdArr'] || []).join(","); //岗位
|
|
1996
|
+
}
|
|
1997
|
+
}else if(field == 'oldPosId'){
|
|
1998
|
+
saveOrgStationObj['oldPosId'] = JSON.stringify(vm.oldPosId);
|
|
1999
|
+
}else {
|
|
2000
|
+
saveOrgStationObj[field] = vm.addUserForm[field];
|
|
2001
|
+
}
|
|
2002
|
+
}else if(field == 'userRoleIdArr'){ //用户角色
|
|
2003
|
+
(vm.addUserForm['userRoleIdArr'] || []).forEach(roleId =>{
|
|
2004
|
+
if(vm.allRoleObj[roleId]){
|
|
2005
|
+
if(this.disableDveRoleId.indexOf(roleId) == -1){ //排除不能删除得管理员
|
|
2006
|
+
if(vm.loginUser.id == vm.addUserForm.userId){ //排除管理员角色
|
|
2007
|
+
if(this.diableRoleIdArr.indexOf(roleId) == -1){
|
|
2008
|
+
userRoleIdArr.push(roleId);
|
|
2009
|
+
}
|
|
2010
|
+
}else{
|
|
2011
|
+
userRoleIdArr.push(roleId);
|
|
2012
|
+
}
|
|
2013
|
+
}
|
|
2014
|
+
}
|
|
2015
|
+
});
|
|
2016
|
+
|
|
2017
|
+
}
|
|
2018
|
+
});
|
|
2019
|
+
let adminRoleCount = 0;
|
|
2020
|
+
if(userRoleIdArr.length > 0){
|
|
2021
|
+
userRoleIdArr.forEach(roleId =>{
|
|
2022
|
+
if(this.allRoleObj[roleId] && this.allRoleObj[roleId].adminRole == '1'){
|
|
2023
|
+
adminRoleCount ++;
|
|
2024
|
+
}
|
|
2025
|
+
});
|
|
2026
|
+
if(adminRoleCount > 1){
|
|
2027
|
+
vm.$message({
|
|
2028
|
+
type: 'warning',
|
|
2029
|
+
message:"管理员角色只能设置一个!"
|
|
2030
|
+
});
|
|
2031
|
+
return;
|
|
2032
|
+
}
|
|
2033
|
+
}
|
|
2034
|
+
//如果当前为修改并且 为负责人,并且修改了所属部门
|
|
2035
|
+
if(vm.operateType == 'update' && saveOrgStationObj['principal'] == '1' && (saveOrgStationObj["orgId"] != (vm.oldOrgId || vm.orgId))){
|
|
2036
|
+
vm.$message({
|
|
2037
|
+
type: 'warning',
|
|
2038
|
+
message:"责任人不能修改所属组织!"
|
|
2039
|
+
});
|
|
2040
|
+
return;
|
|
2041
|
+
}
|
|
2042
|
+
|
|
2043
|
+
//记录当前 企业部门id entOrgId
|
|
2044
|
+
let loginUser = this.USER_GLOBAL.getLoginUser() || {};
|
|
2045
|
+
|
|
2046
|
+
if (vm.loginUser.userType != "sup" && vm.loginUser.userType != "dev"&& loginUser.id != this.addUserForm.userId) {
|
|
2047
|
+
saveUserObj['entOrgId'] = loginUser.mainOrgId || ''; //主企业id
|
|
2048
|
+
}
|
|
2049
|
+
vm.axios.post(vm.api.sysOrgPosUser.saveOrgStationUser,{'userInfo':JSON.stringify(saveUserObj),
|
|
2050
|
+
"orgStationInfo":JSON.stringify(saveOrgStationObj),"userRoleId":userRoleIdArr.join(",")}).then(res =>{
|
|
2051
|
+
vm.$message({
|
|
2052
|
+
duration: 1000,
|
|
2053
|
+
type: 'success',
|
|
2054
|
+
message: res.data.operateMessage
|
|
2055
|
+
});
|
|
2056
|
+
let orgUserObj = res.data.operateObj;
|
|
2057
|
+
if(orgUserObj.principal == '1'){
|
|
2058
|
+
vm.axios.post(this.api.sysOrgPosUser.updateOtherPrincipal,{'orgId':orgUserObj.orgId,'excludeOrgUserId':orgUserObj.id}).then(res =>{
|
|
2059
|
+
vm.addUserDialog = false;
|
|
2060
|
+
vm.initStation().then(() =>{
|
|
2061
|
+
vm.crud.search();
|
|
2062
|
+
});
|
|
2063
|
+
resolve();
|
|
2064
|
+
})
|
|
2065
|
+
}else {
|
|
2066
|
+
vm.addUserDialog = false;
|
|
2067
|
+
vm.initStation().then(() =>{
|
|
2068
|
+
vm.crud.search();
|
|
2069
|
+
});
|
|
2070
|
+
resolve();
|
|
2071
|
+
}
|
|
2072
|
+
});
|
|
2073
|
+
});
|
|
2074
|
+
},
|
|
2075
|
+
|
|
2076
|
+
updateOrgName() { // 更新组织
|
|
2077
|
+
let vm = this;
|
|
2078
|
+
if (!vm.orgId) {
|
|
2079
|
+
vm.$message("选择左侧组织后再操作!");
|
|
2080
|
+
return;
|
|
2081
|
+
}
|
|
2082
|
+
if (!vm.formOrgName) {
|
|
2083
|
+
vm.$message("请设置组织名称!");
|
|
2084
|
+
return;
|
|
2085
|
+
}
|
|
2086
|
+
let arr = ["province", "city", "area", "street","community"];
|
|
2087
|
+
let obj = {"id": vm.oldOrgId || vm.orgId, "orgName": vm.formOrgName, "orgClassify": vm.classify,"sort":vm.orgObj.sort};
|
|
2088
|
+
if(vm.orgLocation.length>0){
|
|
2089
|
+
vm.orgLocation.forEach((item,index)=>{
|
|
2090
|
+
obj[arr[index]] = item;
|
|
2091
|
+
})
|
|
2092
|
+
}
|
|
2093
|
+
obj['entType'] = vm.orgObj.entType || '0';
|
|
2094
|
+
vm.axios.post(vm.api.sysOrg.updateSysOrg, obj).then(function (res) {
|
|
2095
|
+
vm.$message({
|
|
2096
|
+
message: res.data.operateMessage,
|
|
2097
|
+
duration: 1200,
|
|
2098
|
+
type: "success"
|
|
2099
|
+
});
|
|
2100
|
+
res.data.operateSuccess && vm.updateCallBack && vm.updateCallBack(obj);
|
|
2101
|
+
vm.$emit("saveRollBack",obj);
|
|
2102
|
+
vm.orgObj.orgName = obj.orgName;
|
|
2103
|
+
vm.crud.search();
|
|
2104
|
+
})
|
|
2105
|
+
},
|
|
2106
|
+
formatterColumn(row, column, cellValue) { // 格式化列
|
|
2107
|
+
let vm = this;
|
|
2108
|
+
if (column.property == 'userType') {
|
|
2109
|
+
return vm.userTypeMap[cellValue];
|
|
2110
|
+
} else if (column.property == 'userStatus') {
|
|
2111
|
+
return vm.userStatusMap[cellValue];
|
|
2112
|
+
} else {
|
|
2113
|
+
return cellValue;
|
|
2114
|
+
}
|
|
2115
|
+
},
|
|
2116
|
+
/**
|
|
2117
|
+
* 岗位信息
|
|
2118
|
+
*/
|
|
2119
|
+
posTreeCallBack(posTreeVm) { // 岗位初始化全部展开
|
|
2120
|
+
let nodesMap = posTreeVm.getAllNode();
|
|
2121
|
+
let chooseFirstData = {};
|
|
2122
|
+
let chooseFirstNode = {};
|
|
2123
|
+
if((posTreeVm.data || []).length > 0){
|
|
2124
|
+
chooseFirstData = posTreeVm.data[0];
|
|
2125
|
+
}
|
|
2126
|
+
for (let [key, node] of Object.entries(nodesMap)) {
|
|
2127
|
+
node.expanded = true;
|
|
2128
|
+
if(chooseFirstData.id && node.data.id == chooseFirstData.id){
|
|
2129
|
+
chooseFirstNode = node;
|
|
2130
|
+
node.isCurrent = true;
|
|
2131
|
+
}
|
|
2132
|
+
}
|
|
2133
|
+
if(chooseFirstData.id){
|
|
2134
|
+
this.posNodeClick(chooseFirstData,chooseFirstNode);
|
|
2135
|
+
}
|
|
2136
|
+
},
|
|
2137
|
+
posDealTree(data) {
|
|
2138
|
+
let vm = this;
|
|
2139
|
+
data.forEach(function (pos) {
|
|
2140
|
+
pos["name"] = pos["posName"];
|
|
2141
|
+
if (pos["isMainpos"] === '1') {
|
|
2142
|
+
pos["name"] = pos["posName"] + "[主岗位]";
|
|
2143
|
+
pos["className"] = vm.pageSetting["posMainIcon"] || "saspiconfont pl-icon-yonghu";
|
|
2144
|
+
} else {
|
|
2145
|
+
pos["className"] = vm.pageSetting["posIcon"] || "saspiconfont pl-icon-account";
|
|
2146
|
+
}
|
|
2147
|
+
});
|
|
2148
|
+
},
|
|
2149
|
+
posNodeClick(data, node) { // 岗位树节点点击事件
|
|
2150
|
+
let vm = this;
|
|
2151
|
+
vm.posId = data.id;
|
|
2152
|
+
vm.posBaseForm = Object.assign({}, data);
|
|
2153
|
+
if(!vm.posBaseForm || vm.posBaseForm.parentPosId == '-1'){
|
|
2154
|
+
vm.posBaseForm.parentPosId = null;
|
|
2155
|
+
}
|
|
2156
|
+
vm.menuVisible = false;
|
|
2157
|
+
},
|
|
2158
|
+
posTreeRightClick(event, data, node) {
|
|
2159
|
+
let vm = this;
|
|
2160
|
+
let expand = node.expanded;
|
|
2161
|
+
let target = window.event.target;
|
|
2162
|
+
if (target.tagName === 'DIV') {
|
|
2163
|
+
target.click(); // 右键时点击当前节点
|
|
2164
|
+
} else {
|
|
2165
|
+
let pNode = target.parentNode;
|
|
2166
|
+
if (target.className === 'el-checkbox__inner') { // 右击checkBox
|
|
2167
|
+
pNode.parentNode.parentNode.click();
|
|
2168
|
+
} else { // 右击下拉图标
|
|
2169
|
+
pNode.click();
|
|
2170
|
+
}
|
|
2171
|
+
}
|
|
2172
|
+
node.expanded = expand; // 右击仅选中当前节点保持当前节点展开情况不变
|
|
2173
|
+
if (vm.objectID !== data.id) {
|
|
2174
|
+
vm.objectID = data.id;
|
|
2175
|
+
vm.menuVisible = true;
|
|
2176
|
+
} else {
|
|
2177
|
+
vm.menuVisible = !vm.menuVisible;
|
|
2178
|
+
}
|
|
2179
|
+
|
|
2180
|
+
vm.left = window.event.clientX + "px";
|
|
2181
|
+
vm.top = window.event.clientY + "px";
|
|
2182
|
+
},
|
|
2183
|
+
savePos() { // 保存岗位数据addPosForm
|
|
2184
|
+
let vm = this;
|
|
2185
|
+
vm.$refs.addPosRef.validate(function (valid) {
|
|
2186
|
+
if (valid) {
|
|
2187
|
+
if (vm.addPosForm.isMainpos == "1") { // 设置为主岗位时检索当前组织下是否有主岗位
|
|
2188
|
+
vm.axios.post(vm.api.sysPos.find, {
|
|
2189
|
+
"orgId": vm.orgId,
|
|
2190
|
+
"isMainpos": "1"
|
|
2191
|
+
}).then(function (res) {
|
|
2192
|
+
let result = res.data;
|
|
2193
|
+
if ((result || []).length > 0 && result[0].id !== vm.addPosForm.id) {
|
|
2194
|
+
let msg = "目前此组织内已存在主岗位[" + result[0].posName + "],是否确定设置此岗位为主岗位(系统会自动把[" + result[0].posName + "]设置为普通岗位)?";
|
|
2195
|
+
vm.$confirm(msg, '警告', {
|
|
2196
|
+
confirmButtonText: '确定',
|
|
2197
|
+
cancelButtonText: '取消',
|
|
2198
|
+
}).then(async function () {
|
|
2199
|
+
vm.addPosDialog = false;
|
|
2200
|
+
await vm.axios.post(vm.api.sysPos.update, {
|
|
2201
|
+
"id": result[0].id,
|
|
2202
|
+
"isMainpos": "0"
|
|
2203
|
+
});
|
|
2204
|
+
vm.addPosData();
|
|
2205
|
+
}).catch(() => {
|
|
2206
|
+
vm.$message({
|
|
2207
|
+
duration: 1000,
|
|
2208
|
+
type: 'info',
|
|
2209
|
+
message: '已取消'
|
|
2210
|
+
});
|
|
2211
|
+
});
|
|
2212
|
+
} else {
|
|
2213
|
+
vm.addPosDialog = false;
|
|
2214
|
+
vm.addPosData();
|
|
2215
|
+
}
|
|
2216
|
+
})
|
|
2217
|
+
} else {
|
|
2218
|
+
vm.addPosDialog = false;
|
|
2219
|
+
vm.addPosData();
|
|
2220
|
+
}
|
|
2221
|
+
}
|
|
2222
|
+
})
|
|
2223
|
+
},
|
|
2224
|
+
addPosData() { // 添加岗位数据
|
|
2225
|
+
let vm = this;
|
|
2226
|
+
if(!vm.addPosForm.parentPosId){
|
|
2227
|
+
vm.addPosForm.parentPosId = '-1';
|
|
2228
|
+
}
|
|
2229
|
+
vm.axios.post(vm.api.sysPos.add, vm.addPosForm).then(function (res) {
|
|
2230
|
+
vm.$message({
|
|
2231
|
+
duration: 1200,
|
|
2232
|
+
message: res.data.operateMessage,
|
|
2233
|
+
type: "success"
|
|
2234
|
+
});
|
|
2235
|
+
vm.$refs.posTreeRef.init();
|
|
2236
|
+
})
|
|
2237
|
+
},
|
|
2238
|
+
handleRightSelect(key) {
|
|
2239
|
+
let vm = this;
|
|
2240
|
+
switch (key) {
|
|
2241
|
+
case "addChild":
|
|
2242
|
+
case "addSame":
|
|
2243
|
+
vm.addNode(key);
|
|
2244
|
+
break;
|
|
2245
|
+
case "removeCurrent":
|
|
2246
|
+
vm.removeCurrentNode();
|
|
2247
|
+
break;
|
|
2248
|
+
case "removeCheck":
|
|
2249
|
+
vm.removeNode();
|
|
2250
|
+
break;
|
|
2251
|
+
default:
|
|
2252
|
+
console.log("未检测到当前操作的对应方法!");
|
|
2253
|
+
break;
|
|
2254
|
+
}
|
|
2255
|
+
},
|
|
2256
|
+
addNode(key) { // addPosForm
|
|
2257
|
+
let vm = this;
|
|
2258
|
+
if (!vm.orgId || vm.orgId == "$") {
|
|
2259
|
+
vm.$message("请选择左侧组织后继续操作!");
|
|
2260
|
+
return;
|
|
2261
|
+
}
|
|
2262
|
+
vm.addPosForm = {"isMainpos": "0"};
|
|
2263
|
+
key = key ? key : "addChild";
|
|
2264
|
+
let data = vm.$refs.posTreeRef.getTreeCurrentNode();
|
|
2265
|
+
vm.addPosForm["orgId"] = vm.orgId;
|
|
2266
|
+
vm.addPosForm["orgName"] = vm.orgObj["orgName"];
|
|
2267
|
+
if (key == "addChild") {
|
|
2268
|
+
if (!data) { // 直接添加未选择任何节点,默认第一级
|
|
2269
|
+
vm.addPosForm["parentPosId"] = null;
|
|
2270
|
+
vm.addPosForm["parentPosTree"] = "-1";
|
|
2271
|
+
vm.addPosForm["layer"] = "1";
|
|
2272
|
+
} else {
|
|
2273
|
+
vm.addPosForm["parentPosId"] = data.id;
|
|
2274
|
+
vm.addPosForm["parentPosTree"] = data["parentPosTree"] + "," + data["id"];
|
|
2275
|
+
vm.addPosForm["parentPosName"] = data.posName;
|
|
2276
|
+
vm.addPosForm["layer"] = Number(data["layer"]) + 1;
|
|
2277
|
+
}
|
|
2278
|
+
vm.addPosForm["sort"] = vm.getMaxOrder("child");
|
|
2279
|
+
} else { // 添加同级数据
|
|
2280
|
+
vm.addPosForm["parentPosId"] = data["parentPosId"];
|
|
2281
|
+
if(vm.addPosForm["parentPosId"] == "-1"){
|
|
2282
|
+
vm.addPosForm["parentPosId"] = null;
|
|
2283
|
+
}
|
|
2284
|
+
vm.addPosForm["parentPosTree"] = data["parentPosTree"];
|
|
2285
|
+
vm.addPosForm["parentPosName"] = data.parentPosName;
|
|
2286
|
+
vm.addPosForm["layer"] = data["layer"];
|
|
2287
|
+
vm.addPosForm["sort"] = vm.getMaxOrder("same");
|
|
2288
|
+
}
|
|
2289
|
+
vm.addPosDialog = true;
|
|
2290
|
+
vm.$nextTick(function () {
|
|
2291
|
+
vm.$refs.addPosRef.clearValidate();
|
|
2292
|
+
})
|
|
2293
|
+
},
|
|
2294
|
+
getMaxOrder(type) {
|
|
2295
|
+
let vm = this;
|
|
2296
|
+
let currentNode = vm.$refs.posTreeRef.getTreeCurrentNode();
|
|
2297
|
+
let sort = 1;
|
|
2298
|
+
let arr = [];
|
|
2299
|
+
if (type == "same") {
|
|
2300
|
+
let nodesMap = vm.$refs.posTreeRef.getAllNode();
|
|
2301
|
+
if (!currentNode.parentPosId || currentNode.parentPosId == "-1") {
|
|
2302
|
+
for (let [key, node] of Object.entries(nodesMap)) {
|
|
2303
|
+
if (node.level == 1) {
|
|
2304
|
+
arr.push(node.data);
|
|
2305
|
+
}
|
|
2306
|
+
}
|
|
2307
|
+
} else {
|
|
2308
|
+
// 是下级
|
|
2309
|
+
if(nodesMap[currentNode.parentPosId]){
|
|
2310
|
+
arr = nodesMap[currentNode.parentPosId].data.children;
|
|
2311
|
+
}else{ // 第一级
|
|
2312
|
+
Object.keys(nodesMap).forEach(key => {
|
|
2313
|
+
if(nodesMap[key].level == 1){
|
|
2314
|
+
arr.push(nodesMap[key].data);
|
|
2315
|
+
}
|
|
2316
|
+
})
|
|
2317
|
+
}
|
|
2318
|
+
}
|
|
2319
|
+
}
|
|
2320
|
+
if (type == "child") {
|
|
2321
|
+
arr = (currentNode || {}).children;
|
|
2322
|
+
}
|
|
2323
|
+
(arr || []).forEach(function (each) {
|
|
2324
|
+
sort = sort > Number(each["sort"]) ? sort : Number(each["sort"]);
|
|
2325
|
+
});
|
|
2326
|
+
return ++sort;
|
|
2327
|
+
},
|
|
2328
|
+
removeCurrentNode() { // 删除当前节点
|
|
2329
|
+
let vm = this;
|
|
2330
|
+
vm.$confirm('确定删除当前节点?', '警告', {
|
|
2331
|
+
confirmButtonText: '确定',
|
|
2332
|
+
cancelButtonText: '取消',
|
|
2333
|
+
}).then(function () {
|
|
2334
|
+
let currentNode = vm.$refs.posTreeRef.getTreeCurrentNode();
|
|
2335
|
+
let removeNodeArr = vm.$refs.posTreeRef.getCurrentChildren(currentNode, []);
|
|
2336
|
+
vm.axios.post(vm.api.sysPos.delete, {"ids": removeNodeArr.join(",")}).then(function (res) {
|
|
2337
|
+
if (res.data.operateSuccess) {
|
|
2338
|
+
vm.$refs.posTreeRef.defaultTreeRemove(removeNodeArr.join(","));
|
|
2339
|
+
//同步修改下级岗位中
|
|
2340
|
+
vm.axios.post(vm.api.sysPos.updateParentPos, {"parentPosIds": removeNodeArr.join(",")});
|
|
2341
|
+
|
|
2342
|
+
}
|
|
2343
|
+
vm.$message({
|
|
2344
|
+
duration: 1000,
|
|
2345
|
+
type: 'success',
|
|
2346
|
+
message: res.data.operateMessage
|
|
2347
|
+
}
|
|
2348
|
+
);
|
|
2349
|
+
});
|
|
2350
|
+
}).catch(function () {
|
|
2351
|
+
vm.$message({
|
|
2352
|
+
duration: 1000,
|
|
2353
|
+
type: 'info',
|
|
2354
|
+
message: '已取消'
|
|
2355
|
+
});
|
|
2356
|
+
});
|
|
2357
|
+
},
|
|
2358
|
+
removeNode() { // 刪除勾選節點
|
|
2359
|
+
let vm = this;
|
|
2360
|
+
let removeArr = vm.$refs.posTreeRef.getTreeCheckedNodes("key");
|
|
2361
|
+
if (removeArr.length == 0) {
|
|
2362
|
+
vm.$message("请勾选需要删除的节点!");
|
|
2363
|
+
return;
|
|
2364
|
+
}
|
|
2365
|
+
vm.$confirm('确定删除已勾选节点?', '警告', {
|
|
2366
|
+
confirmButtonText: '确定',
|
|
2367
|
+
cancelButtonText: '取消',
|
|
2368
|
+
}).then(function () {
|
|
2369
|
+
vm.loading = true;
|
|
2370
|
+
vm.axios.post(vm.api.sysPos.delete, {"ids": removeArr.join(",")}).then(function (res) {
|
|
2371
|
+
if (res.data.operateSuccess) {
|
|
2372
|
+
vm.$refs.posTreeRef.defaultTreeRemove(removeArr.join(","));
|
|
2373
|
+
}
|
|
2374
|
+
vm.loading = false;
|
|
2375
|
+
vm.$message({
|
|
2376
|
+
duration: 1000,
|
|
2377
|
+
type: 'success',
|
|
2378
|
+
message: res.data.operateMessage
|
|
2379
|
+
}
|
|
2380
|
+
);
|
|
2381
|
+
vm.init();
|
|
2382
|
+
})
|
|
2383
|
+
}).catch(function () {
|
|
2384
|
+
vm.$message({
|
|
2385
|
+
duration: 1000,
|
|
2386
|
+
type: 'info',
|
|
2387
|
+
message: '已取消'
|
|
2388
|
+
});
|
|
2389
|
+
});
|
|
2390
|
+
},
|
|
2391
|
+
updatePosInfo() { // 更新岗位信息
|
|
2392
|
+
let vm = this;
|
|
2393
|
+
if (!vm.posId) {
|
|
2394
|
+
vm.$message("请选择左侧岗位后再操作!");
|
|
2395
|
+
return;
|
|
2396
|
+
}
|
|
2397
|
+
vm.$refs.posBaseRef.validate(function (valid) {
|
|
2398
|
+
if (valid) {
|
|
2399
|
+
if (vm.posBaseForm.isMainpos == "1") { // 设置为主岗位时检索当前组织下是否有主岗位
|
|
2400
|
+
vm.axios.post(vm.api.sysPos.find, {
|
|
2401
|
+
"orgId": vm.orgId,
|
|
2402
|
+
"isMainpos": "1"
|
|
2403
|
+
}).then(function (res) {
|
|
2404
|
+
let result = res.data;
|
|
2405
|
+
if ((result || []).length > 0 && result[0].id != vm.posBaseForm.id) {
|
|
2406
|
+
let msg = "目前此组织内已存在主岗位[" + result[0].posName + "],是否确定设置此岗位为主岗位(系统会自动把[" + result[0].posName + "]设置为普通岗位)?";
|
|
2407
|
+
vm.$confirm(msg, '警告', {
|
|
2408
|
+
confirmButtonText: '确定',
|
|
2409
|
+
cancelButtonText: '取消',
|
|
2410
|
+
}).then(function () {
|
|
2411
|
+
vm.submitPosForm();
|
|
2412
|
+
vm.axios.post(vm.api.sysPos.update, {
|
|
2413
|
+
"id": result[0].id,
|
|
2414
|
+
"isMainpos": "0"
|
|
2415
|
+
});
|
|
2416
|
+
let nodesMap = vm.$refs.posTreeRef.getAllNode();
|
|
2417
|
+
let oldMainPosData = nodesMap[result[0].id].data;
|
|
2418
|
+
oldMainPosData.isMainpos = "0"; // 修改树中的数据
|
|
2419
|
+
oldMainPosData["name"] = oldMainPosData["posName"]; // 修改树中的数据
|
|
2420
|
+
oldMainPosData["className"] = vm.pageSetting["posIcon"] || "saspiconfont pl-icon-account";
|
|
2421
|
+
}).catch(() => {
|
|
2422
|
+
vm.$message({
|
|
2423
|
+
duration: 1000,
|
|
2424
|
+
type: 'info',
|
|
2425
|
+
message: '已取消'
|
|
2426
|
+
});
|
|
2427
|
+
});
|
|
2428
|
+
} else {
|
|
2429
|
+
vm.submitPosForm();
|
|
2430
|
+
}
|
|
2431
|
+
})
|
|
2432
|
+
} else {
|
|
2433
|
+
vm.submitPosForm();
|
|
2434
|
+
}
|
|
2435
|
+
}
|
|
2436
|
+
});
|
|
2437
|
+
},
|
|
2438
|
+
posRemoveSuc(){
|
|
2439
|
+
this.posBaseForm = {};
|
|
2440
|
+
},
|
|
2441
|
+
submitPosForm() { // 提交岗位表单数据
|
|
2442
|
+
let vm = this;
|
|
2443
|
+
let obj = {};
|
|
2444
|
+
obj["id"] = vm.posBaseForm["id"];
|
|
2445
|
+
obj["posName"] = vm.posBaseForm["posName"];
|
|
2446
|
+
obj["isMainpos"] = vm.posBaseForm["isMainpos"];
|
|
2447
|
+
obj["parentPosId"] = vm.posBaseForm["parentPosId"] || "-1";
|
|
2448
|
+
vm.axios.post(vm.api.sysPos.update, obj).then(function (res) {
|
|
2449
|
+
vm.$message({
|
|
2450
|
+
duration: 1200,
|
|
2451
|
+
message: res.data.operateMessage,
|
|
2452
|
+
type: "success"
|
|
2453
|
+
});
|
|
2454
|
+
if (obj["isMainpos"] == "1") {
|
|
2455
|
+
obj["name"] = obj["posName"] + "[主岗位]";
|
|
2456
|
+
} else {
|
|
2457
|
+
obj["name"] = obj["posName"];
|
|
2458
|
+
}
|
|
2459
|
+
let currentNode = vm.$refs.posTreeRef.getTreeCurrentNode();
|
|
2460
|
+
for (let [key, value] of Object.entries(obj)) { // 更新树中的数据
|
|
2461
|
+
currentNode[key] = value;
|
|
2462
|
+
}
|
|
2463
|
+
if (obj["isMainpos"] == "1") {
|
|
2464
|
+
currentNode["className"] = vm.pageSetting["posMainIcon"] || "saspiconfont pl-icon-yonghu";
|
|
2465
|
+
}else{
|
|
2466
|
+
currentNode["className"] = vm.pageSetting["posIcon"] || "saspiconfont pl-icon-account";
|
|
2467
|
+
}
|
|
2468
|
+
})
|
|
2469
|
+
},
|
|
2470
|
+
addMainPosChange(value){
|
|
2471
|
+
let vm = this;
|
|
2472
|
+
if(value == '1' && vm.addPosForm.layer != '1'){
|
|
2473
|
+
vm.$message("非一级岗位不能设置为主岗位!");
|
|
2474
|
+
vm.addPosForm.isMainpos = "0";
|
|
2475
|
+
}
|
|
2476
|
+
},
|
|
2477
|
+
mainPosChange(value) { // 主岗位变化时判断是否可以进行变更
|
|
2478
|
+
let vm = this;
|
|
2479
|
+
let currentNode = vm.$refs.posTreeRef.getTreeCurrentNode();
|
|
2480
|
+
if (!currentNode) { // 未选择树,不操作
|
|
2481
|
+
return;
|
|
2482
|
+
}
|
|
2483
|
+
if (value == "1" && currentNode.layer != '1') {
|
|
2484
|
+
vm.$message("非一级岗位不能设置为主岗位!");
|
|
2485
|
+
vm.posBaseForm.isMainpos = "0";
|
|
2486
|
+
}
|
|
2487
|
+
},
|
|
2488
|
+
activePosRow(row) {
|
|
2489
|
+
this.activeRow(row, this.posCrud.tableRef);
|
|
2490
|
+
},
|
|
2491
|
+
activeUserRow(row) {
|
|
2492
|
+
this.activeRow(row, this.userCrud.tableRef);
|
|
2493
|
+
this.tableSelect([],row);
|
|
2494
|
+
},
|
|
2495
|
+
activeOrgRow(row,column) {
|
|
2496
|
+
if(column.property == 'operate'){
|
|
2497
|
+
return;
|
|
2498
|
+
}
|
|
2499
|
+
this.activeRow(row, this.crud.tableRef);
|
|
2500
|
+
},
|
|
2501
|
+
activeRow(row, ref) { // 行点击选中当前行
|
|
2502
|
+
this.$refs[ref].toggleRowSelection(row);
|
|
2503
|
+
},
|
|
2504
|
+
//复选框选中/取消事件
|
|
2505
|
+
tableSelect(selection, row) {
|
|
2506
|
+
if (this.multipleSelection.length > 0) {
|
|
2507
|
+
let index = this.multipleSelectionIds.indexOf(row.id);
|
|
2508
|
+
if (this.multipleSelectionIds.indexOf(row.id) == -1) {
|
|
2509
|
+
this.multipleSelection.push(row);
|
|
2510
|
+
this.multipleSelectionIds.push(row.id);
|
|
2511
|
+
} else {
|
|
2512
|
+
this.multipleSelectionIds.splice(index, 1);
|
|
2513
|
+
this.multipleSelection.splice(index, 1);
|
|
2514
|
+
}
|
|
2515
|
+
} else {
|
|
2516
|
+
this.multipleSelection.push(row);
|
|
2517
|
+
this.multipleSelectionIds.push(row.id);
|
|
2518
|
+
}
|
|
2519
|
+
},
|
|
2520
|
+
userSelectAll(selection) {
|
|
2521
|
+
var vm = this;
|
|
2522
|
+
var rows = vm.userCrud.dataStore.records;
|
|
2523
|
+
if (selection.length > 0) {
|
|
2524
|
+
//全选
|
|
2525
|
+
selection.forEach(item => {
|
|
2526
|
+
this.userSelectAllPush(item);
|
|
2527
|
+
});
|
|
2528
|
+
} else {
|
|
2529
|
+
//取消全选
|
|
2530
|
+
rows.forEach(item => {
|
|
2531
|
+
this.userSelectAllCancel(item);
|
|
2532
|
+
})
|
|
2533
|
+
}
|
|
2534
|
+
},
|
|
2535
|
+
userSelectAllPush(row) {
|
|
2536
|
+
if (this.multipleSelectionIds.indexOf(row.id) == -1) {
|
|
2537
|
+
this.multipleSelection.push(row);
|
|
2538
|
+
this.multipleSelectionIds.push(row.id);
|
|
2539
|
+
}
|
|
2540
|
+
},
|
|
2541
|
+
userSelectAllCancel(row) {
|
|
2542
|
+
let index = this.multipleSelectionIds.indexOf(row.id);
|
|
2543
|
+
if (this.multipleSelectionIds.indexOf(row.id) != -1) {
|
|
2544
|
+
this.multipleSelectionIds.splice(index, 1);
|
|
2545
|
+
this.multipleSelection.splice(index, 1);
|
|
2546
|
+
}
|
|
2547
|
+
},
|
|
2548
|
+
userSearch() {
|
|
2549
|
+
let vm = this;
|
|
2550
|
+
vm.$nextTick(() => {
|
|
2551
|
+
vm.userCrud.dataStore.records.forEach(item => {
|
|
2552
|
+
if (vm.multipleSelectionIds.indexOf(item.id) > -1) {
|
|
2553
|
+
vm.$refs[vm.userCrud.tableRef].toggleRowSelection(item);
|
|
2554
|
+
}
|
|
2555
|
+
})
|
|
2556
|
+
});
|
|
2557
|
+
},
|
|
2558
|
+
/**
|
|
2559
|
+
* 加载已保存岗位
|
|
2560
|
+
*/
|
|
2561
|
+
initStation(){
|
|
2562
|
+
return new Promise(resolve => {
|
|
2563
|
+
this.allStationObj = {};
|
|
2564
|
+
this.allowStationObj = {};
|
|
2565
|
+
//判断当前岗位
|
|
2566
|
+
let loginUser = this.USER_GLOBAL.getLoginUser() || {};
|
|
2567
|
+
let searchObj = {"order":"PRIORITY"};
|
|
2568
|
+
if (loginUser.userType == 'sup' || loginUser.userType == 'dev') {
|
|
2569
|
+
// searchObj["created"] = loginUser.id;
|
|
2570
|
+
this.devUser = true;
|
|
2571
|
+
}else {
|
|
2572
|
+
searchObj["stationAttach"] = loginUser.mainOrgId || '';
|
|
2573
|
+
//
|
|
2574
|
+
this.devUser = false;
|
|
2575
|
+
}
|
|
2576
|
+
this.axios.post(this.api.sysStation.find,searchObj).then(res =>{
|
|
2577
|
+
(res.data || []).forEach(item =>{
|
|
2578
|
+
this.allStationObj[item.id] = item.stationName;
|
|
2579
|
+
if (loginUser.userType == 'sup' || loginUser.userType == 'dev') {
|
|
2580
|
+
if(item.created == loginUser.id){
|
|
2581
|
+
this.allowStationObj[item.id] = item.stationName;
|
|
2582
|
+
}
|
|
2583
|
+
}else{
|
|
2584
|
+
this.allowStationObj[item.id] = item.stationName;
|
|
2585
|
+
}
|
|
2586
|
+
});
|
|
2587
|
+
resolve();
|
|
2588
|
+
});
|
|
2589
|
+
});
|
|
2590
|
+
},
|
|
2591
|
+
|
|
2592
|
+
getDevStations(){
|
|
2593
|
+
return new Promise(resolve => {
|
|
2594
|
+
//判断当前岗位
|
|
2595
|
+
let loginUser = this.USER_GLOBAL.getLoginUser() || {};
|
|
2596
|
+
let searchObj = {"order":"PRIORITY"};
|
|
2597
|
+
this.axios.post(this.api.sysStation.find,searchObj).then(res =>{
|
|
2598
|
+
this.allStationArr = [];
|
|
2599
|
+
(res.data || []).forEach(item =>{
|
|
2600
|
+
this.allStationObj[item.id] = item.stationName;
|
|
2601
|
+
if(item.created == loginUser.id) {
|
|
2602
|
+
this.allStationArr.push(item);
|
|
2603
|
+
this.allowStationObj[item.id] = item.stationName;
|
|
2604
|
+
}
|
|
2605
|
+
});
|
|
2606
|
+
resolve();
|
|
2607
|
+
});
|
|
2608
|
+
});
|
|
2609
|
+
},
|
|
2610
|
+
|
|
2611
|
+
/**
|
|
2612
|
+
* 加载是否单组织岗位
|
|
2613
|
+
*/
|
|
2614
|
+
initSysParam(){
|
|
2615
|
+
this.PARAM_GLOBAL.getValByKeyAsync("singleOrgUser").then(res => {
|
|
2616
|
+
// this.logoText = logoText;
|
|
2617
|
+
this.isSingleOrgUser = res == '是';
|
|
2618
|
+
})
|
|
2619
|
+
},
|
|
2620
|
+
|
|
2621
|
+
/**
|
|
2622
|
+
* 加载角色
|
|
2623
|
+
*/
|
|
2624
|
+
initOrgDimRole(){
|
|
2625
|
+
return new Promise(resolve => {
|
|
2626
|
+
let loginUser = this.USER_GLOBAL.getLoginUser() || {};
|
|
2627
|
+
this.allRoleObj = {};
|
|
2628
|
+
this.allowRoleObj = {};
|
|
2629
|
+
if(!this.orgDim){
|
|
2630
|
+
resolve();
|
|
2631
|
+
}
|
|
2632
|
+
let searchParam ={
|
|
2633
|
+
// "created":loginUser.id,
|
|
2634
|
+
"noEqRoleType":"empower",
|
|
2635
|
+
"order":"ROLE_NUMBER ASC"
|
|
2636
|
+
};
|
|
2637
|
+
let allRoleSearchParam = {
|
|
2638
|
+
"noEqRoleType":"empower",
|
|
2639
|
+
"order":"ROLE_NUMBER ASC"
|
|
2640
|
+
};
|
|
2641
|
+
if(loginUser.userType != 'sup' && loginUser.userType != 'dev'){
|
|
2642
|
+
searchParam['roleAttach'] = loginUser.linkId || loginUser.mainOrgId;
|
|
2643
|
+
searchParam['entOrgIdsLike'] = loginUser.mainOrgId;
|
|
2644
|
+
}
|
|
2645
|
+
|
|
2646
|
+
let p1 = new Promise(resolve => { //总角色
|
|
2647
|
+
this.axios.post(this.api.role.find,allRoleSearchParam).then(allRes =>{
|
|
2648
|
+
resolve(allRes);
|
|
2649
|
+
});
|
|
2650
|
+
});
|
|
2651
|
+
let p2 = new Promise(resolve => { //角色
|
|
2652
|
+
this.axios.post(this.api.role.find,searchParam).then(res =>{
|
|
2653
|
+
resolve(res);
|
|
2654
|
+
});
|
|
2655
|
+
});
|
|
2656
|
+
Promise.all([p1, p2]).then(([allRoleRes, roleRes]) => {
|
|
2657
|
+
if(allRoleRes && allRoleRes.data){
|
|
2658
|
+
(allRoleRes.data || []).forEach((item,index) =>{
|
|
2659
|
+
this.allowRoleObj[item.id] = item;
|
|
2660
|
+
})
|
|
2661
|
+
}
|
|
2662
|
+
if(roleRes && roleRes.data){
|
|
2663
|
+
(roleRes.data || []).forEach((item,index) =>{
|
|
2664
|
+
if(!loginUser.commonEmpowerId && item["created"] == loginUser.id){
|
|
2665
|
+
this.allRoleObj[item.id] = item;
|
|
2666
|
+
}else if(loginUser.commonEmpowerId){
|
|
2667
|
+
this.allRoleObj[item.id] = item;
|
|
2668
|
+
}
|
|
2669
|
+
})
|
|
2670
|
+
}
|
|
2671
|
+
resolve();
|
|
2672
|
+
});
|
|
2673
|
+
|
|
2674
|
+
|
|
2675
|
+
});
|
|
2676
|
+
|
|
2677
|
+
},
|
|
2678
|
+
|
|
2679
|
+
/**
|
|
2680
|
+
* 用户数据导出
|
|
2681
|
+
* @param type
|
|
2682
|
+
*/
|
|
2683
|
+
async exportUserData(type){
|
|
2684
|
+
let vm = this;
|
|
2685
|
+
let expDatas = []; //待导出数据
|
|
2686
|
+
|
|
2687
|
+
let searchForm = {
|
|
2688
|
+
empowerUser:'Y',
|
|
2689
|
+
isNewStation:'1',
|
|
2690
|
+
roleUserCreated:vm.loginUser.id,
|
|
2691
|
+
roleUserCreateOrg:vm.loginUser.linkId || vm.loginUser.mainOrgId || '',
|
|
2692
|
+
userType: vm.pageSetting["chooseUserType"] || "ent"
|
|
2693
|
+
};
|
|
2694
|
+
let title = "";
|
|
2695
|
+
if(this.orgObj.orgParentName){
|
|
2696
|
+
title = this.orgObj.orgParentName + "->"
|
|
2697
|
+
}
|
|
2698
|
+
title+=this.formOrgName;
|
|
2699
|
+
if(vm.activeTabs == '1'){
|
|
2700
|
+
searchForm["orgId"] = vm.orgId;
|
|
2701
|
+
title +="直属用户";
|
|
2702
|
+
}else { //组织所有用户查询
|
|
2703
|
+
searchForm["orgTreeId"] = vm.orgId;
|
|
2704
|
+
title +="所有用户";
|
|
2705
|
+
}
|
|
2706
|
+
if(type=="local"){
|
|
2707
|
+
//导出当前数据
|
|
2708
|
+
if((this.crud.dataStore.records||[]).length==0){
|
|
2709
|
+
this.$message("无可导出数据,导出结束!");
|
|
2710
|
+
return false;
|
|
2711
|
+
}
|
|
2712
|
+
expDatas = this.batchFomratterContent(this.crud.dataStore.records);
|
|
2713
|
+
}else if(type=="select"){
|
|
2714
|
+
//导出选中
|
|
2715
|
+
if((vm.$refs[vm.crud.tableRef].selection|| []).length == 0){
|
|
2716
|
+
vm.$message("未选中行数据,导出结束!");
|
|
2717
|
+
return false;
|
|
2718
|
+
}else{
|
|
2719
|
+
expDatas = vm.batchFomratterContent(vm.$refs[vm.crud.tableRef].selection);
|
|
2720
|
+
}
|
|
2721
|
+
}else if(type=="all"){
|
|
2722
|
+
//导出所有
|
|
2723
|
+
if((vm.crud.dataStore.records||[]).length==0){
|
|
2724
|
+
vm.$message("无可导出数据,导出结束!");
|
|
2725
|
+
return false;
|
|
2726
|
+
}
|
|
2727
|
+
let res = await this.axios.post(this.api.sysOrgPosUser.findNoPageParamByStation,
|
|
2728
|
+
searchForm);
|
|
2729
|
+
if(res && res.data){
|
|
2730
|
+
expDatas = vm.batchFomratterContent(res.data || []);
|
|
2731
|
+
}
|
|
2732
|
+
}
|
|
2733
|
+
const formAxios = this.axios.create({
|
|
2734
|
+
baseURL: vm.api.sysOrgPosUser.exportListData,
|
|
2735
|
+
headers: {'Content-Type': 'multipart/form-data'},
|
|
2736
|
+
transformRequest: [
|
|
2737
|
+
function (data) {
|
|
2738
|
+
return data;
|
|
2739
|
+
}
|
|
2740
|
+
],
|
|
2741
|
+
});
|
|
2742
|
+
let formData = new FormData();
|
|
2743
|
+
formData.append('title',title);
|
|
2744
|
+
formData.append('fields',JSON.stringify(vm.exportFiledsArr));
|
|
2745
|
+
formData.append('datas',JSON.stringify(expDatas));
|
|
2746
|
+
formAxios.post(vm.api.sysOrgPosUser.exportListData,
|
|
2747
|
+
formData).then(res=>{
|
|
2748
|
+
if(res&&res.data){
|
|
2749
|
+
if(!(res.data|| {}).operateSuccess){
|
|
2750
|
+
vm.$message({
|
|
2751
|
+
duration:1500,
|
|
2752
|
+
message:res.data.operateMessage,
|
|
2753
|
+
type:"warning"
|
|
2754
|
+
});
|
|
2755
|
+
return;
|
|
2756
|
+
}
|
|
2757
|
+
location.href = vm.api.sysOrgPosUser.loadfile + "?filename="
|
|
2758
|
+
+ encodeURI(encodeURI(title)) + '.xlsx&fileUrl=' + res.data.operateMessage;
|
|
2759
|
+
setTimeout(() => {
|
|
2760
|
+
vm.axios.post(vm.api.sysOrgPosUser.deletefile,{"filename":res.data.operateMessage});
|
|
2761
|
+
},5000);
|
|
2762
|
+
}
|
|
2763
|
+
});
|
|
2764
|
+
},
|
|
2765
|
+
|
|
2766
|
+
/**
|
|
2767
|
+
* 设置用户角色
|
|
2768
|
+
*/
|
|
2769
|
+
settingRole(){
|
|
2770
|
+
let vm = this;
|
|
2771
|
+
let crud = vm.crud;
|
|
2772
|
+
let selection = crud.vue.$refs[crud.tableRef].selection;
|
|
2773
|
+
if ((selection || []).length === 0) {
|
|
2774
|
+
vm.$message({
|
|
2775
|
+
duration: 1500,
|
|
2776
|
+
type: 'info',
|
|
2777
|
+
message: '请至少选择一条数据!'
|
|
2778
|
+
});
|
|
2779
|
+
return;
|
|
2780
|
+
}
|
|
2781
|
+
if(Object.keys(this.allRoleObj).length == 0){
|
|
2782
|
+
vm.$message({
|
|
2783
|
+
duration: 1500,
|
|
2784
|
+
type: 'info',
|
|
2785
|
+
message: '暂无角色信息!'
|
|
2786
|
+
});
|
|
2787
|
+
return;
|
|
2788
|
+
}
|
|
2789
|
+
this.setRoleOrgIdArr = []; //设置的角色的组织
|
|
2790
|
+
selection.forEach(item =>{
|
|
2791
|
+
if(this.setRoleOrgIdArr.indexOf(item.orgId) == -1){
|
|
2792
|
+
this.setRoleOrgIdArr.push(item.orgId);
|
|
2793
|
+
}
|
|
2794
|
+
});
|
|
2795
|
+
this.settingRoleArr = [];
|
|
2796
|
+
this.settingRoleDialog = true;
|
|
2797
|
+
},
|
|
2798
|
+
|
|
2799
|
+
/**
|
|
2800
|
+
* 转换用户数据
|
|
2801
|
+
* @param dataObj
|
|
2802
|
+
*/
|
|
2803
|
+
batchFomratterContent(dataArr){
|
|
2804
|
+
//解析当前数据
|
|
2805
|
+
let exportData = [];
|
|
2806
|
+
dataArr.forEach(item =>{
|
|
2807
|
+
//解析结果
|
|
2808
|
+
//解析所属部门
|
|
2809
|
+
//用户名称
|
|
2810
|
+
let userName = item.userName;
|
|
2811
|
+
let orgName = "";
|
|
2812
|
+
if(this.activeTabs == '1' && item.orgParentTreeName){
|
|
2813
|
+
orgName = item.orgParentTreeName +"->";
|
|
2814
|
+
}
|
|
2815
|
+
orgName += item.orgName;
|
|
2816
|
+
let stationName = "";
|
|
2817
|
+
if(this.devUser){
|
|
2818
|
+
stationName = this.formatterStationDev(item || {});
|
|
2819
|
+
}else {
|
|
2820
|
+
stationName = this.formatterStation(item.posId || '');
|
|
2821
|
+
}
|
|
2822
|
+
let jobNum = item.jobNum;
|
|
2823
|
+
let userAccount = item.userAccount;
|
|
2824
|
+
//解析角色
|
|
2825
|
+
let userRoleName = this.formatterRole(item.userRoleId || '');
|
|
2826
|
+
let userStatusName = this.userStatusMap[item.userStatus];
|
|
2827
|
+
let principal = item.principal == '1' ? '是':'否';
|
|
2828
|
+
exportData.push({
|
|
2829
|
+
//用户账号
|
|
2830
|
+
"userAccount":userAccount,
|
|
2831
|
+
"userName":userName,
|
|
2832
|
+
"orgName":orgName,
|
|
2833
|
+
"stationName":stationName,
|
|
2834
|
+
"jobNum":jobNum,
|
|
2835
|
+
"userRoleId":userRoleName,
|
|
2836
|
+
"userStatus":userStatusName,
|
|
2837
|
+
"principal":principal
|
|
2838
|
+
})
|
|
2839
|
+
});
|
|
2840
|
+
return exportData;
|
|
2841
|
+
},
|
|
2842
|
+
|
|
2843
|
+
/**
|
|
2844
|
+
* 切换岗位
|
|
2845
|
+
* @param val 岗位名称
|
|
2846
|
+
*/
|
|
2847
|
+
// changeSatation(val){
|
|
2848
|
+
// this.$set(this.addUserForm,'posId',val);
|
|
2849
|
+
// let valArr = (val || '').split(",");
|
|
2850
|
+
// let addStationArr = [];
|
|
2851
|
+
// if(valArr.length > 0){
|
|
2852
|
+
// valArr.forEach(val =>{
|
|
2853
|
+
// if(!this.allStationObj[val]){
|
|
2854
|
+
// //创建岗位
|
|
2855
|
+
// // let stationObj = {
|
|
2856
|
+
// // stationName: val,
|
|
2857
|
+
// // priority:'0'
|
|
2858
|
+
// // };
|
|
2859
|
+
// // this.axios.post(this.api.sysStation.add,stationObj).then(res =>{
|
|
2860
|
+
// // if(res.data && res.data.operateObj){
|
|
2861
|
+
// // let obj = res.data.operateObj;
|
|
2862
|
+
// // this.allStationObj[obj.id] = this.allStationObj[obj.stationName];
|
|
2863
|
+
// // this.$set(this.addUserForm,'stationId',obj.id);
|
|
2864
|
+
// // }
|
|
2865
|
+
// // })
|
|
2866
|
+
// //获取大岗位编号
|
|
2867
|
+
// }
|
|
2868
|
+
//
|
|
2869
|
+
// //addStationObj
|
|
2870
|
+
// });
|
|
2871
|
+
// }
|
|
2872
|
+
// },
|
|
2873
|
+
|
|
2874
|
+
/**
|
|
2875
|
+
* 树回调
|
|
2876
|
+
*/
|
|
2877
|
+
changeDataTree(label,val){
|
|
2878
|
+
if(val && val != this.orgId){ //当前的树和左侧选中树不一致时候触发
|
|
2879
|
+
this.getMaxUserLayer(val).then(sort =>{
|
|
2880
|
+
//重新赋值 userLayer
|
|
2881
|
+
this.$set(this.addUserForm,'userLayer',sort); //自增长排序
|
|
2882
|
+
});
|
|
2883
|
+
}
|
|
2884
|
+
},
|
|
2885
|
+
|
|
2886
|
+
/**
|
|
2887
|
+
* 格式化当前角色
|
|
2888
|
+
* @param userRoleId
|
|
2889
|
+
* @returns {string}
|
|
2890
|
+
*/
|
|
2891
|
+
formatterRole(userRoleId){
|
|
2892
|
+
let value = '';
|
|
2893
|
+
let valueArr = [];
|
|
2894
|
+
let userRoleIdArr = (userRoleId || "").split(",");
|
|
2895
|
+
userRoleIdArr.forEach(roleId =>{
|
|
2896
|
+
if(this.allowRoleObj[roleId]){
|
|
2897
|
+
if(this.allowRoleObj[roleId] && this.allowRoleObj[roleId]['roleName']){
|
|
2898
|
+
valueArr.push(this.allowRoleObj[roleId]['roleName']);
|
|
2899
|
+
}
|
|
2900
|
+
}
|
|
2901
|
+
});
|
|
2902
|
+
value = valueArr.join(",");
|
|
2903
|
+
return value;
|
|
2904
|
+
},
|
|
2905
|
+
|
|
2906
|
+
/**
|
|
2907
|
+
* 格式化所属岗位
|
|
2908
|
+
*/
|
|
2909
|
+
formatterStation(posId){
|
|
2910
|
+
let value = "";
|
|
2911
|
+
let valueArr = [];
|
|
2912
|
+
let posIdArr = (posId || '').split(",");
|
|
2913
|
+
posIdArr.forEach(station =>{
|
|
2914
|
+
if(this.allStationObj[station]){
|
|
2915
|
+
valueArr.push(this.allStationObj[station]);
|
|
2916
|
+
}
|
|
2917
|
+
});
|
|
2918
|
+
value = valueArr.join(",");
|
|
2919
|
+
return value;
|
|
2920
|
+
},
|
|
2921
|
+
|
|
2922
|
+
/**
|
|
2923
|
+
* 格式化所属岗位
|
|
2924
|
+
*/
|
|
2925
|
+
formatterStationDev(row){
|
|
2926
|
+
let value = "";
|
|
2927
|
+
let valueArr = [];
|
|
2928
|
+
let posIdArr = [];
|
|
2929
|
+
if(row.posId){
|
|
2930
|
+
posIdArr = posIdArr.concat((row.posId || '').split(","));
|
|
2931
|
+
}
|
|
2932
|
+
if(row.posDevId){
|
|
2933
|
+
posIdArr = posIdArr.concat((row.posDevId || '').split(","));
|
|
2934
|
+
}
|
|
2935
|
+
posIdArr.forEach(station =>{
|
|
2936
|
+
if(this.allStationObj[station]){
|
|
2937
|
+
valueArr.push(this.allStationObj[station]);
|
|
2938
|
+
}
|
|
2939
|
+
});
|
|
2940
|
+
value = valueArr.join(",");
|
|
2941
|
+
return value;
|
|
2942
|
+
},
|
|
2943
|
+
|
|
2944
|
+
/**
|
|
2945
|
+
* 格式化所属部门
|
|
2946
|
+
*/
|
|
2947
|
+
formatterOrgDept(row){
|
|
2948
|
+
let orgName = "";
|
|
2949
|
+
if(row.orgParentTreeName){
|
|
2950
|
+
orgName = row.orgParentTreeName +"->";
|
|
2951
|
+
}
|
|
2952
|
+
orgName += row.orgName;
|
|
2953
|
+
return orgName;
|
|
2954
|
+
},
|
|
2955
|
+
|
|
2956
|
+
/**
|
|
2957
|
+
* 更新当前用户状态
|
|
2958
|
+
* @param row
|
|
2959
|
+
*/
|
|
2960
|
+
changeUserStatus(row){
|
|
2961
|
+
let newRoleStatus = row.userStatus;
|
|
2962
|
+
let confirmText = "";
|
|
2963
|
+
if(newRoleStatus == '20'){ //关闭
|
|
2964
|
+
confirmText = "锁定"
|
|
2965
|
+
}else if(newRoleStatus == '10'){ //启用
|
|
2966
|
+
confirmText = "启用";
|
|
2967
|
+
}
|
|
2968
|
+
this.$confirm("是否"+confirmText+"该用户?", '警告', {
|
|
2969
|
+
confirmButtonText: '确定',
|
|
2970
|
+
cancelButtonText: '取消',
|
|
2971
|
+
}).then(()=> {
|
|
2972
|
+
//更新当前用户的状态
|
|
2973
|
+
this.axios.post(this.api.sysUser.updateUser,{userStatus:newRoleStatus,id:row.userId}).then(res =>{
|
|
2974
|
+
if (res && res.data && res.data.operateSuccess){
|
|
2975
|
+
this.$message({
|
|
2976
|
+
duration: 1000,
|
|
2977
|
+
type: 'success',
|
|
2978
|
+
message: '操作成功!'
|
|
2979
|
+
});
|
|
2980
|
+
}
|
|
2981
|
+
});
|
|
2982
|
+
}).catch(() => {
|
|
2983
|
+
if(newRoleStatus == '20'){
|
|
2984
|
+
row.userStatus = '10';
|
|
2985
|
+
}else {
|
|
2986
|
+
row.userStatus = '20';
|
|
2987
|
+
}
|
|
2988
|
+
this.$message({
|
|
2989
|
+
duration: 1000,
|
|
2990
|
+
type: 'info',
|
|
2991
|
+
message: '已取消'
|
|
2992
|
+
});
|
|
2993
|
+
});
|
|
2994
|
+
},
|
|
2995
|
+
|
|
2996
|
+
/**
|
|
2997
|
+
* 更新负责人信息
|
|
2998
|
+
* @param row
|
|
2999
|
+
*/
|
|
3000
|
+
changePrincipal(row){
|
|
3001
|
+
let newPrincipal = row.principal;
|
|
3002
|
+
let confirmText = "";
|
|
3003
|
+
if(newPrincipal == '1'){
|
|
3004
|
+
confirmText = "同一组织下只能存在一个负责人,是否继续?";
|
|
3005
|
+
}else {
|
|
3006
|
+
confirmText = "是否关闭当前负责人?";
|
|
3007
|
+
}
|
|
3008
|
+
this.$confirm(confirmText, '警告', {
|
|
3009
|
+
confirmButtonText: '确定',
|
|
3010
|
+
cancelButtonText: '取消',
|
|
3011
|
+
}).then(()=> {
|
|
3012
|
+
//执行当前组织维度的更新
|
|
3013
|
+
//设置当前 userLayer 为 0
|
|
3014
|
+
for(let id of row.id.split(",")){
|
|
3015
|
+
let updateObj = {'principal':newPrincipal,id};
|
|
3016
|
+
this.axios.post(this.api.sysOrgPosUser.update,updateObj);
|
|
3017
|
+
}
|
|
3018
|
+
if(newPrincipal == '1'){
|
|
3019
|
+
//取消当前组织用户其他的责任人
|
|
3020
|
+
this.axios.post(this.api.sysOrgPosUser.updateOtherPrincipal,{'orgId':row.orgId,'excludeOrgUserId':row.id}).then(res =>{
|
|
3021
|
+
//刷新当前列表
|
|
3022
|
+
this.$message({
|
|
3023
|
+
duration: 1000,
|
|
3024
|
+
type: 'success',
|
|
3025
|
+
message: '操作成功!'
|
|
3026
|
+
});
|
|
3027
|
+
this.crud.search();
|
|
3028
|
+
});
|
|
3029
|
+
}else {
|
|
3030
|
+
this.$message({
|
|
3031
|
+
duration: 1000,
|
|
3032
|
+
type: 'success',
|
|
3033
|
+
message: '操作成功!'
|
|
3034
|
+
});
|
|
3035
|
+
}
|
|
3036
|
+
}).catch(() => {
|
|
3037
|
+
if(newPrincipal == '1'){
|
|
3038
|
+
row.principal = '0';
|
|
3039
|
+
}else {
|
|
3040
|
+
row.userStatus = '1';
|
|
3041
|
+
}
|
|
3042
|
+
this.$message({
|
|
3043
|
+
duration: 1000,
|
|
3044
|
+
type: 'info',
|
|
3045
|
+
message: '已取消'
|
|
3046
|
+
});
|
|
3047
|
+
});
|
|
3048
|
+
},
|
|
3049
|
+
|
|
3050
|
+
|
|
3051
|
+
/**
|
|
3052
|
+
* 重置密码
|
|
3053
|
+
* @param row
|
|
3054
|
+
*/
|
|
3055
|
+
resetPwd(row){
|
|
3056
|
+
let [vm, userNameText] = [this, row.userName ? row.userName : '用户'];
|
|
3057
|
+
this.$confirm('确定要重置' + userNameText + '的密码?', '提示', {
|
|
3058
|
+
confirmButtonText: '确定',
|
|
3059
|
+
cancelButtonText: '取消',
|
|
3060
|
+
type: 'warning',
|
|
3061
|
+
beforeClose: function (action, instance, done) {
|
|
3062
|
+
if (action == 'confirm') {
|
|
3063
|
+
vm.axios.post(vm.api.sysUser.resetPwd, {"id": row.userId}).then(function (res) {
|
|
3064
|
+
done(); // 完成后提示并关闭窗口
|
|
3065
|
+
vm.$message({
|
|
3066
|
+
type: 'success',
|
|
3067
|
+
duration: 1500,
|
|
3068
|
+
message: res.data.operateMessage
|
|
3069
|
+
});
|
|
3070
|
+
});
|
|
3071
|
+
} else {
|
|
3072
|
+
done();
|
|
3073
|
+
}
|
|
3074
|
+
}
|
|
3075
|
+
}).catch(() => {
|
|
3076
|
+
this.$message({
|
|
3077
|
+
type: 'info',
|
|
3078
|
+
message: '已取消'
|
|
3079
|
+
});
|
|
3080
|
+
});
|
|
3081
|
+
},
|
|
3082
|
+
|
|
3083
|
+
/**
|
|
3084
|
+
* 保存角色设置
|
|
3085
|
+
*/
|
|
3086
|
+
saveSettingRole(){
|
|
3087
|
+
let vm = this;
|
|
3088
|
+
//批量设置用户角色
|
|
3089
|
+
if(this.settingRoleArr.length == 0){
|
|
3090
|
+
vm.$message({
|
|
3091
|
+
type: 'warning',
|
|
3092
|
+
message:"请选择角色!"
|
|
3093
|
+
});
|
|
3094
|
+
return;
|
|
3095
|
+
}
|
|
3096
|
+
let adminRole = 0;
|
|
3097
|
+
this.settingRoleArr.forEach(roleId =>{
|
|
3098
|
+
if(this.allRoleObj[roleId] && this.allRoleObj[roleId].adminRole == '1'){
|
|
3099
|
+
adminRole ++;
|
|
3100
|
+
}
|
|
3101
|
+
});
|
|
3102
|
+
if(adminRole > 1){
|
|
3103
|
+
vm.$message({
|
|
3104
|
+
type: 'warning',
|
|
3105
|
+
message:"管理员角色只能设置一个!"
|
|
3106
|
+
});
|
|
3107
|
+
return;
|
|
3108
|
+
}
|
|
3109
|
+
this.isExsitAdminRoleUser = false;
|
|
3110
|
+
let adminRoleObj = {};
|
|
3111
|
+
let adminRoleIdArr = []; //管理员角色id
|
|
3112
|
+
Object.keys(this.allRoleObj).forEach(roleId =>{
|
|
3113
|
+
let roleObj = this.allRoleObj[roleId];
|
|
3114
|
+
if(roleObj.adminRole == '1'){ //遍历管理员角色
|
|
3115
|
+
adminRoleObj[roleId] = this.allRoleObj[roleId];
|
|
3116
|
+
adminRoleIdArr.push(roleId);
|
|
3117
|
+
}
|
|
3118
|
+
});
|
|
3119
|
+
|
|
3120
|
+
let crud = this.crud;
|
|
3121
|
+
let selection = crud.vue.$refs[crud.tableRef].selection || [];
|
|
3122
|
+
let oldAdminRoleUserArr = [];
|
|
3123
|
+
let adminRoleUserObj={};
|
|
3124
|
+
this.adminRoleUserIdArr = [];
|
|
3125
|
+
let orgUserArr = [];
|
|
3126
|
+
(selection || []).forEach(item =>{
|
|
3127
|
+
orgUserArr.push({
|
|
3128
|
+
orgPosUserId:item.id,
|
|
3129
|
+
userId:item.userId,
|
|
3130
|
+
posId:item.posId
|
|
3131
|
+
});
|
|
3132
|
+
let isAdminRoleUser = false;
|
|
3133
|
+
if(item.userRoleId){
|
|
3134
|
+
//存在角色 原角色已经存在
|
|
3135
|
+
let userRoleIdArr = item.userRoleId.split(",");
|
|
3136
|
+
userRoleIdArr.forEach(userRoleId =>{
|
|
3137
|
+
if(adminRoleIdArr.indexOf(userRoleId) > -1){
|
|
3138
|
+
oldAdminRoleUserArr.push(item);
|
|
3139
|
+
if(!adminRoleUserObj[item.userId]){
|
|
3140
|
+
adminRoleUserObj[item.userId] = [];
|
|
3141
|
+
}
|
|
3142
|
+
adminRoleUserObj[item.userId].push(this.allRoleObj[userRoleId].roleName);
|
|
3143
|
+
isAdminRoleUser = true;
|
|
3144
|
+
}
|
|
3145
|
+
});
|
|
3146
|
+
if(isAdminRoleUser){
|
|
3147
|
+
this.adminRoleUserIdArr.push(item.userId);
|
|
3148
|
+
}
|
|
3149
|
+
}
|
|
3150
|
+
});
|
|
3151
|
+
let messageTitle = "";
|
|
3152
|
+
if(oldAdminRoleUserArr.length > 0 && !this.loginUser.commonEmpowerId){ //并且当前为管理员角色
|
|
3153
|
+
this.isExsitAdminRoleUser = true;
|
|
3154
|
+
messageTitle = "选中的用户中";
|
|
3155
|
+
oldAdminRoleUserArr.forEach((roleUser,index) =>{
|
|
3156
|
+
messageTitle += "用户名<sapn style='margin-left: 5px;color: red'>"+roleUser.userName+"</sapn>";
|
|
3157
|
+
messageTitle +=" 已包含管理员角色 "+"<span style='color: #409EFF'>"+adminRoleUserObj[roleUser.userId]+"</span>";
|
|
3158
|
+
messageTitle += "<br>";
|
|
3159
|
+
});
|
|
3160
|
+
messageTitle +=" ,确定以下操作?";
|
|
3161
|
+
//覆盖角色
|
|
3162
|
+
//跳过角色
|
|
3163
|
+
|
|
3164
|
+
//取消
|
|
3165
|
+
}else {
|
|
3166
|
+
messageTitle +="确定设置当前选中的用户的所属角色?"
|
|
3167
|
+
}
|
|
3168
|
+
this.confirmTitle = messageTitle;
|
|
3169
|
+
this.chooseRoleUserArr = orgUserArr;
|
|
3170
|
+
this.confirmDialog = true;
|
|
3171
|
+
},
|
|
3172
|
+
|
|
3173
|
+
|
|
3174
|
+
/**
|
|
3175
|
+
* 保存角色设置
|
|
3176
|
+
*/
|
|
3177
|
+
startSaveRole(type){
|
|
3178
|
+
let orgUserArr = [];
|
|
3179
|
+
if(type == '1' || type == '2'){ //正常保存和覆盖
|
|
3180
|
+
orgUserArr = this.chooseRoleUserArr;
|
|
3181
|
+
//如果当前是 管理员
|
|
3182
|
+
|
|
3183
|
+
|
|
3184
|
+
}else if(type == '3'){ //跳过
|
|
3185
|
+
//过滤
|
|
3186
|
+
orgUserArr = this.chooseRoleUserArr.filter(roleUser =>{
|
|
3187
|
+
return this.adminRoleUserIdArr.indexOf(roleUser.userId);
|
|
3188
|
+
})
|
|
3189
|
+
}
|
|
3190
|
+
this.axios.post(this.api.roleUser.batchSetUserRole,{orgUserObj:JSON.stringify(orgUserArr),orgId:this.setRoleOrgIdArr.join(","),roleIds:this.settingRoleArr.join(",")}).then(res =>{
|
|
3191
|
+
if(res.data && res.data.operateSuccess){
|
|
3192
|
+
this.$message({
|
|
3193
|
+
type: 'success',
|
|
3194
|
+
message:"设置成功!"
|
|
3195
|
+
});
|
|
3196
|
+
this.settingRoleDialog = false;
|
|
3197
|
+
this.confirmDialog = false;
|
|
3198
|
+
this.crud.search();
|
|
3199
|
+
}else {
|
|
3200
|
+
this.$message({
|
|
3201
|
+
type: 'error',
|
|
3202
|
+
message:"设置失败!"
|
|
3203
|
+
});
|
|
3204
|
+
}
|
|
3205
|
+
});
|
|
3206
|
+
|
|
3207
|
+
},
|
|
3208
|
+
|
|
3209
|
+
/**
|
|
3210
|
+
* 查看用户拥有的菜单
|
|
3211
|
+
* @param row
|
|
3212
|
+
*/
|
|
3213
|
+
viewMenu(row) {
|
|
3214
|
+
let vm = this;
|
|
3215
|
+
if (!row.id) { // 行数据id不存在
|
|
3216
|
+
vm.$message("数据异常,请重新加载页面!");
|
|
3217
|
+
return;
|
|
3218
|
+
}
|
|
3219
|
+
vm.menuUserId = row.userId;//用户id
|
|
3220
|
+
vm.menuUserType = row.userType; //用户类型
|
|
3221
|
+
vm.menuUserName = row.userName;
|
|
3222
|
+
//查询 getOwnMenu
|
|
3223
|
+
vm.viewMenuDialog = true;
|
|
3224
|
+
},
|
|
3225
|
+
|
|
3226
|
+
|
|
3227
|
+
/**
|
|
3228
|
+
* 动态设置行样式
|
|
3229
|
+
* @param row
|
|
3230
|
+
* @param rowIndex
|
|
3231
|
+
* @returns {string}
|
|
3232
|
+
*/
|
|
3233
|
+
tableRowClassName({row, rowIndex}) {
|
|
3234
|
+
if (row.principal != '1') {
|
|
3235
|
+
return 'index-sort-class';
|
|
3236
|
+
}
|
|
3237
|
+
return '';
|
|
3238
|
+
},
|
|
3239
|
+
|
|
3240
|
+
|
|
3241
|
+
/**
|
|
3242
|
+
* 变化值
|
|
3243
|
+
*/
|
|
3244
|
+
changeRole(){
|
|
3245
|
+
let arr = this.addUserForm.userRoleIdArr || [];
|
|
3246
|
+
Object.keys(this.allRoleObj).forEach(roleId =>{
|
|
3247
|
+
if(this.diableRoleIdArr.indexOf(roleId) > -1 && arr.indexOf(roleId) == -1){
|
|
3248
|
+
this.$message({
|
|
3249
|
+
type: 'warning',
|
|
3250
|
+
message:"管理员角色不能变更!"
|
|
3251
|
+
});
|
|
3252
|
+
arr.push(roleId);
|
|
3253
|
+
}
|
|
3254
|
+
});
|
|
3255
|
+
},
|
|
3256
|
+
|
|
3257
|
+
/**
|
|
3258
|
+
* 切换
|
|
3259
|
+
*/
|
|
3260
|
+
changeRoleTemp(){
|
|
3261
|
+
let arr = this.addUserForm.userRoleIdArr || [];
|
|
3262
|
+
Object.keys(this.allRoleTempObj).forEach(roleId =>{
|
|
3263
|
+
if(this.disableDveRoleId.indexOf(roleId) > -1 && arr.indexOf(roleId) == -1){
|
|
3264
|
+
let title = "系统下发角色或组织直属角色不能变更!";
|
|
3265
|
+
if(this.loginUser.userType == 'sup' || this.loginUser.userType == 'dev'){
|
|
3266
|
+
title = "开发者不可变更企业用户设置的权限!";
|
|
3267
|
+
}
|
|
3268
|
+
this.$message({
|
|
3269
|
+
type: 'warning',
|
|
3270
|
+
message: title
|
|
3271
|
+
});
|
|
3272
|
+
arr.push(roleId);
|
|
3273
|
+
}
|
|
3274
|
+
});
|
|
3275
|
+
}
|
|
3276
|
+
}
|
|
3277
|
+
}
|
|
3278
|
+
</script>
|
|
3279
|
+
|
|
3280
|
+
<style scoped>
|
|
3281
|
+
|
|
3282
|
+
.header-icon{
|
|
3283
|
+
margin-left: 10px;
|
|
3284
|
+
}
|
|
3285
|
+
|
|
3286
|
+
.detail-main /deep/ .el-tabs__content {
|
|
3287
|
+
height: calc(100% - 67px);
|
|
3288
|
+
}
|
|
3289
|
+
|
|
3290
|
+
.detail-main /deep/ .el-collapse-item__header, .detail-main /deep/ .el-collapse-item__wrap {
|
|
3291
|
+
border: 1px solid #ebeef5;
|
|
3292
|
+
border-top: 0;
|
|
3293
|
+
padding: 5px;
|
|
3294
|
+
box-sizing: border-box;
|
|
3295
|
+
}
|
|
3296
|
+
|
|
3297
|
+
.detail-main /deep/ .el-tab-pane {
|
|
3298
|
+
height: 100%;
|
|
3299
|
+
}
|
|
3300
|
+
|
|
3301
|
+
.detail-main /deep/ .el-collapse-item__content {
|
|
3302
|
+
padding: 15px 10px 0;
|
|
3303
|
+
box-sizing: border-box;
|
|
3304
|
+
}
|
|
3305
|
+
|
|
3306
|
+
.choose-user /deep/ .el-dialog__body {
|
|
3307
|
+
height: calc(100% - 60px);
|
|
3308
|
+
padding: 0 15px;
|
|
3309
|
+
}
|
|
3310
|
+
|
|
3311
|
+
.el-menu-vertical {
|
|
3312
|
+
background-color: #555C63;
|
|
3313
|
+
opacity: 0.9;
|
|
3314
|
+
border-radius: 8px;
|
|
3315
|
+
width: 150px;
|
|
3316
|
+
z-index: 99;
|
|
3317
|
+
}
|
|
3318
|
+
|
|
3319
|
+
.detail-main /deep/ .el-collapse-item__header {
|
|
3320
|
+
height: 40px;
|
|
3321
|
+
}
|
|
3322
|
+
|
|
3323
|
+
.order-dialog /deep/ .el-table {
|
|
3324
|
+
height: 100%;
|
|
3325
|
+
}
|
|
3326
|
+
|
|
3327
|
+
.order-dialog /deep/ .el-table__body-wrapper {
|
|
3328
|
+
height: 100%;
|
|
3329
|
+
overflow-y: auto;
|
|
3330
|
+
}
|
|
3331
|
+
|
|
3332
|
+
fieldset{
|
|
3333
|
+
padding: 0 10px 10px;margin-bottom: 10px;
|
|
3334
|
+
border-top:1px solid #dbdbdb;
|
|
3335
|
+
border-left: 0px;
|
|
3336
|
+
border-right: 0px;
|
|
3337
|
+
border-bottom: 0px;
|
|
3338
|
+
}
|
|
3339
|
+
legend{
|
|
3340
|
+
/*margin-left: 18px;*/
|
|
3341
|
+
margin-left: 50%;
|
|
3342
|
+
height: 10px;
|
|
3343
|
+
width: 40px;
|
|
3344
|
+
background-color: #3771ff;
|
|
3345
|
+
margin-bottom: 30px;
|
|
3346
|
+
}
|
|
3347
|
+
|
|
3348
|
+
.el-message-box__container{
|
|
3349
|
+
width: 100%;
|
|
3350
|
+
height: 100%;
|
|
3351
|
+
}
|
|
3352
|
+
|
|
3353
|
+
.el-message-box__status{
|
|
3354
|
+
display: inline-block;
|
|
3355
|
+
float: left;
|
|
3356
|
+
}
|
|
3357
|
+
.message-title{
|
|
3358
|
+
display: inline-block;
|
|
3359
|
+
float: right;
|
|
3360
|
+
}
|
|
3361
|
+
.el-message-box__message{
|
|
3362
|
+
top: 40%;
|
|
3363
|
+
position: absolute;
|
|
3364
|
+
}
|
|
3365
|
+
.adminRole{
|
|
3366
|
+
top: 25%;
|
|
3367
|
+
}
|
|
3368
|
+
|
|
3369
|
+
.header-title{
|
|
3370
|
+
text-align: center;
|
|
3371
|
+
font-size: 16px;
|
|
3372
|
+
font-weight: bold;
|
|
3373
|
+
font-family: 微软雅黑, serif
|
|
3374
|
+
}
|
|
3375
|
+
.header-slider{
|
|
3376
|
+
width: 30px;
|
|
3377
|
+
height: 5px;
|
|
3378
|
+
background-color: #0b84d8;
|
|
3379
|
+
}
|
|
3380
|
+
|
|
3381
|
+
.header-divider{
|
|
3382
|
+
margin: 14px 0 20px 40px;
|
|
3383
|
+
width: calc(100% - 40px);
|
|
3384
|
+
}
|
|
3385
|
+
.header-divider /deep/ .el-divider__text{
|
|
3386
|
+
padding: 0px 0px;
|
|
3387
|
+
top: -2.3px;
|
|
3388
|
+
left: calc(50% - 20px);
|
|
3389
|
+
}
|
|
3390
|
+
</style>
|