|
@@ -103,12 +103,14 @@ app.controller('phoneListCtrl', ["$rootScope", "$scope", "$http", "$state", "$ti
|
103
|
103
|
$scope.cancel = function () {
|
104
|
104
|
$modalInstance.dismiss('cancel');
|
105
|
105
|
};
|
106
|
|
- $scope.areaName = data.unit;
|
107
|
|
- $scope.unitAlias = data.unitAlias;
|
108
|
|
- $scope.ok = function (areaName, unitAlias) {
|
|
106
|
+ $scope.check = {
|
|
107
|
+ areaName: data.unit,
|
|
108
|
+ unitAlias: data.unitAlias ? data.unitAlias.split(',') : []
|
|
109
|
+ }
|
|
110
|
+ $scope.ok = function (check) {
|
109
|
111
|
// if (areaName != data.unit) {
|
110
|
|
- if ($scope.areaName) {
|
111
|
|
- $modalInstance.close({areaName, unitAlias});
|
|
112
|
+ if ($scope.check.areaName) {
|
|
113
|
+ $modalInstance.close(check);
|
112
|
114
|
} else {
|
113
|
115
|
SweetAlert.swal({
|
114
|
116
|
title: "修改失败!",
|
|
@@ -134,7 +136,7 @@ app.controller('phoneListCtrl', ["$rootScope", "$scope", "$http", "$state", "$ti
|
134
|
136
|
"id": data.id,
|
135
|
137
|
"deleteFlag": 0,
|
136
|
138
|
"unit": selectedItem.areaName,
|
137
|
|
- "unitAlias": selectedItem.unitAlias
|
|
139
|
+ "unitAlias": String(selectedItem.unitAlias)
|
138
|
140
|
}
|
139
|
141
|
}
|
140
|
142
|
api_user_data.addData('phoneUnit', fildata).then(function (response) {
|
|
@@ -164,14 +166,16 @@ app.controller('phoneListCtrl', ["$rootScope", "$scope", "$http", "$state", "$ti
|
164
|
166
|
templateUrl: 'assets/views/system/tpl/company.html',
|
165
|
167
|
controller: function ($scope, scope, $modalInstance, api_user_data) {
|
166
|
168
|
$scope.title = "新增单位";
|
167
|
|
- $scope.areaName = "";
|
168
|
|
- $scope.unitAlias = "";
|
|
169
|
+ $scope.check = {
|
|
170
|
+ areaName: "",
|
|
171
|
+ unitAlias: []
|
|
172
|
+ }
|
169
|
173
|
$scope.cancel = function () {
|
170
|
174
|
$modalInstance.dismiss('cancel');
|
171
|
175
|
};
|
172
|
|
- $scope.ok = function (areaName, unitAlias) {
|
173
|
|
- if ($scope.areaName) {
|
174
|
|
- $modalInstance.close({areaName, unitAlias});
|
|
176
|
+ $scope.ok = function (check) {
|
|
177
|
+ if ($scope.check.areaName) {
|
|
178
|
+ $modalInstance.close(check);
|
175
|
179
|
} else {
|
176
|
180
|
SweetAlert.swal({
|
177
|
181
|
title: "新增失败!",
|
|
@@ -192,7 +196,7 @@ app.controller('phoneListCtrl', ["$rootScope", "$scope", "$http", "$state", "$ti
|
192
|
196
|
var fildata = {
|
193
|
197
|
"phoneUnit": {
|
194
|
198
|
"unit": selectedItem.areaName,
|
195
|
|
- "unitAlias": selectedItem.unitAlias
|
|
199
|
+ "unitAlias": String(selectedItem.unitAlias)
|
196
|
200
|
}
|
197
|
201
|
}
|
198
|
202
|
api_user_data.addData('phoneUnit', fildata).then(function (response) {
|
|
@@ -274,7 +278,7 @@ app.controller('phoneListCtrl', ["$rootScope", "$scope", "$http", "$state", "$ti
|
274
|
278
|
$scope.check = {
|
275
|
279
|
unit: data.unit,
|
276
|
280
|
dept: data.dept,
|
277
|
|
- deptAlias: data.deptAlias,
|
|
281
|
+ deptAlias: data.deptAlias ? data.deptAlias.split(',') : [],
|
278
|
282
|
phone: data.phone,
|
279
|
283
|
address: data.address
|
280
|
284
|
}
|
|
@@ -309,7 +313,7 @@ app.controller('phoneListCtrl', ["$rootScope", "$scope", "$http", "$state", "$ti
|
309
|
313
|
var fildata = {
|
310
|
314
|
"phoneDirectory": {
|
311
|
315
|
"dept": check.dept,
|
312
|
|
- "deptAlias": check.deptAlias,
|
|
316
|
+ "deptAlias": String(check.deptAlias),
|
313
|
317
|
"address": check.address,
|
314
|
318
|
"phone": check.phone,
|
315
|
319
|
"unit": {
|
|
@@ -347,9 +351,9 @@ app.controller('phoneListCtrl', ["$rootScope", "$scope", "$http", "$state", "$ti
|
347
|
351
|
controller: function ($scope, scope, $modalInstance, api_user_data) {
|
348
|
352
|
$scope.title = "新增部门";
|
349
|
353
|
if (area !== undefined) {
|
350
|
|
- $scope.check = { unit: area }
|
|
354
|
+ $scope.check = { unit: area, deptAlias: [] }
|
351
|
355
|
} else {
|
352
|
|
- $scope.check = {}
|
|
356
|
+ $scope.check = { deptAlias: [] }
|
353
|
357
|
}
|
354
|
358
|
$scope.outarea = scope.outarea;
|
355
|
359
|
$scope.cancel = function () {
|
|
@@ -379,7 +383,7 @@ app.controller('phoneListCtrl', ["$rootScope", "$scope", "$http", "$state", "$ti
|
379
|
383
|
var fildata = {
|
380
|
384
|
"phoneDirectory": {
|
381
|
385
|
"dept": check.dept,
|
382
|
|
- "deptAlias": check.deptAlias,
|
|
386
|
+ "deptAlias": String(check.deptAlias),
|
383
|
387
|
"phone": check.phone,
|
384
|
388
|
"address": check.address
|
385
|
389
|
}
|