Răsfoiți Sursa

用户对应多个组织

lzm 2 ani în urmă
părinte
comite
8759e694c5

+ 6 - 3
sa-view-sp/sp-admin/admin-add.html

@@ -32,7 +32,7 @@
 					<span style="display: inline;">即登录账号</span>
 					<div class="c-item">
 						<label class="c-label"><span style="color: red;">*</span>部门:</label>
-						<el-select v-model="m.deptId" :disabled="currentUser.deptId!==9999999">
+						<el-select v-model="deptIds" multiple :disabled="currentUser.deptId!=='9999999'">
 							<el-option label="请选择" v-for="(item,index) in deptList" :key="item.id" :label="item.name"
 								:value="item.id"></el-option>
 
@@ -71,6 +71,7 @@
 					roleList: [],
 					deptList: [],
 					currentUser: sa.$sys.getCurrUser(),
+					deptIds: [],
 				},
 				methods: {
 					getDeptList() {
@@ -80,8 +81,9 @@
 						}, function(resp) {
 							let list = resp.data;
 							let deptId = this.currentUser.deptId;
-							if (deptId != 9999999) {
-								this.m.deptId = deptId;
+							if (deptId != '9999999') {
+								//this.m.deptId = deptId;
+								this.deptIds = deptId.split(',');
 							}
 							this.deptList = list;
 						}.bind(this))
@@ -91,6 +93,7 @@
 					ok: function() {
 						// 表单校验 
 						let m = this.m;
+						m.deptId = this.deptIds.join(",");
 						sa.checkNull(m.nickname, '请输入姓名');
 						let phone = m.phone;
 						if (!sa.isPhone(phone)) {

+ 2 - 2
sa-view/tb-car-black/tb-car-black-add.html

@@ -35,7 +35,7 @@
 					<el-form v-if="m">
 						<div class="c-item">
 							<label class="c-label"><span style="color: red;">*</span>部门:</label>
-							<el-select v-model="m.deptId" :disabled="currentUser.deptId!==9999999">
+							<el-select v-model="m.deptId" :disabled="currentUser.deptId!=='9999999'">
 								<el-option label="请选择" v-for="(item,index) in deptList" :key="item.id"
 									:label="item.name" :value="item.id"></el-option>
 
@@ -78,7 +78,7 @@
 						}, function(resp) {
 							let list = resp.data;
 							let deptId = this.currentUser.deptId;
-							if (deptId != 9999999) {
+							if (deptId != '9999999') {
 								this.m.deptId = deptId;
 							}
 							this.deptList = list;

+ 2 - 2
sa-view/tb-car-filing/tb-car-filing-add.html

@@ -35,7 +35,7 @@
 					<el-form v-if="m">
 						<div class="c-item">
 							<label class="c-label"><span style="color: red;">*</span>部门:</label>
-							<el-select v-model="m.deptId" :disabled="currentUser.deptId!==9999999">
+							<el-select v-model="m.deptId" :disabled="currentUser.deptId!=='9999999'">
 								<el-option label="请选择" v-for="(item,index) in deptList" :key="item.id"
 									:label="item.name" :value="item.id"></el-option>
 
@@ -127,7 +127,7 @@
 						}, function(resp) {
 							let list = resp.data;
 							let deptId = this.currentUser.deptId;
-							if (deptId != 9999999) {
+							if (deptId != '9999999') {
 								this.m.deptId = deptId;
 							}
 							this.deptList = list;

+ 2 - 2
sa-view/tb-person-black/tb-person-black-add.html

@@ -35,7 +35,7 @@
 					<el-form v-if="m">
 						<div class="c-item">
 							<label class="c-label"><span style="color: red;">*</span>部门:</label>
-							<el-select v-model="m.deptId" :disabled="currentUser.deptId!==9999999">
+							<el-select v-model="m.deptId" :disabled="currentUser.deptId!=='9999999'">
 								<el-option label="请选择" v-for="(item,index) in deptList" :key="item.id"
 									:label="item.name" :value="item.id"></el-option>
 
@@ -78,7 +78,7 @@
 						}, function(resp) {
 							let list = resp.data;
 							let deptId = this.currentUser.deptId;
-							if (deptId != 9999999) {
+							if (deptId != '9999999') {
 								this.m.deptId = deptId;
 							}
 							this.deptList = list;

+ 2 - 2
sa-view/tb-person-filing/tb-person-filing-add.html

@@ -36,7 +36,7 @@
 					<el-form v-if="m">
 						<div class="c-item">
 							<label class="c-label"><span style="color: red;">*</span>部门:</label>
-							<el-select v-model="m.deptId" :disabled="currentUser.deptId!==9999999">
+							<el-select v-model="m.deptId" :disabled="currentUser.deptId!=='9999999'">
 								<el-option label="请选择" v-for="(item,index) in deptList" :key="item.id"
 									:label="item.name" :value="item.id"></el-option>
 
@@ -87,7 +87,7 @@
 						}, function(resp) {
 							let list = resp.data;
 							let deptId = this.currentUser.deptId;
-							if (deptId != 9999999) {
+							if (deptId != '9999999') {
 								this.m.deptId = deptId;
 							}
 							this.deptList = list;

+ 2 - 2
sa-view/tb-venues/tb-venues-add.html

@@ -28,7 +28,7 @@
 					<el-form v-if="m">
 						<div class="c-item">
 							<label class="c-label"><span style="color: red;">*</span>部门:</label>
-							<el-select v-model="m.deptId" :disabled="currentUser.deptId!==9999999">
+							<el-select v-model="m.deptId" :disabled="currentUser.deptId!=='9999999'">
 								<el-option label="请选择" v-for="(item,index) in deptList" :key="item.id"
 									:label="item.name" :value="item.id"></el-option>
 						
@@ -68,7 +68,7 @@
 						}, function(resp) {
 							let list = resp.data;
 							let deptId = this.currentUser.deptId;
-							if (deptId != 9999999) {
+							if (deptId != '9999999') {
 								this.m.deptId = deptId;
 							}
 							this.deptList = list;