|
@@ -104,10 +104,11 @@ app.controller('phoneListCtrl', ["$rootScope", "$scope", "$http", "$state", "$ti
|
104
|
104
|
$modalInstance.dismiss('cancel');
|
105
|
105
|
};
|
106
|
106
|
$scope.areaName = data.unit;
|
107
|
|
- $scope.ok = function (areaName) {
|
108
|
|
- if (areaName != data.unit) {
|
|
107
|
+ $scope.unitAlias = data.unitAlias;
|
|
108
|
+ $scope.ok = function (areaName, unitAlias) {
|
|
109
|
+ // if (areaName != data.unit) {
|
109
|
110
|
if ($scope.areaName) {
|
110
|
|
- $modalInstance.close(areaName);
|
|
111
|
+ $modalInstance.close({areaName, unitAlias});
|
111
|
112
|
} else {
|
112
|
113
|
SweetAlert.swal({
|
113
|
114
|
title: "修改失败!",
|
|
@@ -115,9 +116,9 @@ app.controller('phoneListCtrl', ["$rootScope", "$scope", "$http", "$state", "$ti
|
115
|
116
|
type: "error"
|
116
|
117
|
})
|
117
|
118
|
}
|
118
|
|
- } else {
|
119
|
|
- $modalInstance.dismiss('cancel');
|
120
|
|
- }
|
|
119
|
+ // } else {
|
|
120
|
+ // $modalInstance.dismiss('cancel');
|
|
121
|
+ // }
|
121
|
122
|
}
|
122
|
123
|
},
|
123
|
124
|
resolve: {
|
|
@@ -132,7 +133,8 @@ app.controller('phoneListCtrl', ["$rootScope", "$scope", "$http", "$state", "$ti
|
132
|
133
|
"phoneUnit": {
|
133
|
134
|
"id": data.id,
|
134
|
135
|
"deleteFlag": 0,
|
135
|
|
- "unit": selectedItem
|
|
136
|
+ "unit": selectedItem.areaName,
|
|
137
|
+ "unitAlias": selectedItem.unitAlias
|
136
|
138
|
}
|
137
|
139
|
}
|
138
|
140
|
api_user_data.addData('phoneUnit', fildata).then(function (response) {
|
|
@@ -163,12 +165,13 @@ app.controller('phoneListCtrl', ["$rootScope", "$scope", "$http", "$state", "$ti
|
163
|
165
|
controller: function ($scope, scope, $modalInstance, api_user_data) {
|
164
|
166
|
$scope.title = "新增单位";
|
165
|
167
|
$scope.areaName = "";
|
|
168
|
+ $scope.unitAlias = "";
|
166
|
169
|
$scope.cancel = function () {
|
167
|
170
|
$modalInstance.dismiss('cancel');
|
168
|
171
|
};
|
169
|
|
- $scope.ok = function (areaName) {
|
|
172
|
+ $scope.ok = function (areaName, unitAlias) {
|
170
|
173
|
if ($scope.areaName) {
|
171
|
|
- $modalInstance.close(areaName);
|
|
174
|
+ $modalInstance.close({areaName, unitAlias});
|
172
|
175
|
} else {
|
173
|
176
|
SweetAlert.swal({
|
174
|
177
|
title: "新增失败!",
|
|
@@ -188,7 +191,8 @@ app.controller('phoneListCtrl', ["$rootScope", "$scope", "$http", "$state", "$ti
|
188
|
191
|
if (selectedItem) {
|
189
|
192
|
var fildata = {
|
190
|
193
|
"phoneUnit": {
|
191
|
|
- "unit": selectedItem
|
|
194
|
+ "unit": selectedItem.areaName,
|
|
195
|
+ "unitAlias": selectedItem.unitAlias
|
192
|
196
|
}
|
193
|
197
|
}
|
194
|
198
|
api_user_data.addData('phoneUnit', fildata).then(function (response) {
|
|
@@ -270,6 +274,7 @@ app.controller('phoneListCtrl', ["$rootScope", "$scope", "$http", "$state", "$ti
|
270
|
274
|
$scope.check = {
|
271
|
275
|
unit: data.unit,
|
272
|
276
|
dept: data.dept,
|
|
277
|
+ deptAlias: data.deptAlias,
|
273
|
278
|
phone: data.phone,
|
274
|
279
|
address: data.address
|
275
|
280
|
}
|
|
@@ -304,6 +309,7 @@ app.controller('phoneListCtrl', ["$rootScope", "$scope", "$http", "$state", "$ti
|
304
|
309
|
var fildata = {
|
305
|
310
|
"phoneDirectory": {
|
306
|
311
|
"dept": check.dept,
|
|
312
|
+ "deptAlias": check.deptAlias,
|
307
|
313
|
"address": check.address,
|
308
|
314
|
"phone": check.phone,
|
309
|
315
|
"unit": {
|
|
@@ -373,6 +379,7 @@ app.controller('phoneListCtrl', ["$rootScope", "$scope", "$http", "$state", "$ti
|
373
|
379
|
var fildata = {
|
374
|
380
|
"phoneDirectory": {
|
375
|
381
|
"dept": check.dept,
|
|
382
|
+ "deptAlias": check.deptAlias,
|
376
|
383
|
"phone": check.phone,
|
377
|
384
|
"address": check.address
|
378
|
385
|
}
|