|
@@ -1,5 +1,5 @@
|
1
|
1
|
// 'use strict';
|
2
|
|
-/**
|
|
2
|
+/**
|
3
|
3
|
* controller for User Profile Example
|
4
|
4
|
*/
|
5
|
5
|
app.controller('adminUserListCtrl_requ', ["$rootScope", "$scope", "$http", "$state", "FileUploader", "$timeout", "$interval", "$modal", "SweetAlert", "i18nService", "uiGridConstants", "uiGridGroupingConstants", "Restangular", "api_user_data", function ($rootScope, $scope, $http, $state, FileUploader, $timeout, $interval, $modal, SweetAlert, i18nService, uiGridConstants, uiGridGroupingConstants, Restangular, api_user_data) {
|
|
@@ -302,7 +302,7 @@ app.controller('adminUserListCtrl_requ', ["$rootScope", "$scope", "$http", "$sta
|
302
|
302
|
if (data.place) {
|
303
|
303
|
var modelData = {
|
304
|
304
|
model: {
|
305
|
|
- requester: {
|
|
305
|
+ user: {
|
306
|
306
|
"id": data.id,
|
307
|
307
|
"branch": data.branch,
|
308
|
308
|
"account": data.account,
|
|
@@ -318,7 +318,8 @@ app.controller('adminUserListCtrl_requ', ["$rootScope", "$scope", "$http", "$sta
|
318
|
318
|
"studentNo": data.studentNo,
|
319
|
319
|
"houseNumber": data.houseNumber,
|
320
|
320
|
"requesterType": data.requesterType,
|
321
|
|
- "weixin": data.weixin
|
|
321
|
+ "weixin": data.weixin,
|
|
322
|
+ engineer: 0,
|
322
|
323
|
}
|
323
|
324
|
}
|
324
|
325
|
};
|
|
@@ -341,7 +342,8 @@ app.controller('adminUserListCtrl_requ', ["$rootScope", "$scope", "$http", "$sta
|
341
|
342
|
"studentNo": data.studentNo,
|
342
|
343
|
"houseNumber": data.houseNumber,
|
343
|
344
|
"requesterTypeDTO": data.requesterTypeDTO,
|
344
|
|
- "weixin": data.weixin
|
|
345
|
+ "weixin": data.weixin,
|
|
346
|
+ engineer: 0,
|
345
|
347
|
}
|
346
|
348
|
}
|
347
|
349
|
};
|
|
@@ -489,7 +491,7 @@ app.controller('adminUserListCtrl_requ', ["$rootScope", "$scope", "$http", "$sta
|
489
|
491
|
modalInstance.result.then(function (selectedItem) {
|
490
|
492
|
if (selectedItem) {
|
491
|
493
|
if (selectedItem.length > 0) {
|
492
|
|
- api_user_data.rmvData('requester', selectedItem).then(function (response) {
|
|
494
|
+ api_user_data.rmvData('user', selectedItem).then(function (response) {
|
493
|
495
|
if (response.data) {
|
494
|
496
|
SweetAlert.swal({
|
495
|
497
|
title: "删除成功!",
|
|
@@ -567,10 +569,10 @@ app.controller('adminUserListCtrl_requ', ["$rootScope", "$scope", "$http", "$sta
|
567
|
569
|
angular.forEach(grid.columns, function (item) {
|
568
|
570
|
if (item.enableFiltering) {
|
569
|
571
|
if (angular.isDefined(item.filters[0].term) && item.filters[0].term != '') {
|
570
|
|
- if (angular.isUndefined(filtersData['requester'])) {
|
571
|
|
- filtersData['requester'] = {};
|
|
572
|
+ if (angular.isUndefined(filtersData['user'])) {
|
|
573
|
+ filtersData['user'] = {};
|
572
|
574
|
}
|
573
|
|
- filtersData['requester'][item.field] = item.filters[0].term;
|
|
575
|
+ filtersData['user'][item.field] = item.filters[0].term;
|
574
|
576
|
}
|
575
|
577
|
}
|
576
|
578
|
});
|
|
@@ -605,7 +607,7 @@ app.controller('adminUserListCtrl_requ', ["$rootScope", "$scope", "$http", "$sta
|
605
|
607
|
$scope.fileData = {
|
606
|
608
|
"idx": 0,
|
607
|
609
|
"sum": 10,
|
608
|
|
- "requester": {
|
|
610
|
+ "user": {
|
609
|
611
|
|
610
|
612
|
}
|
611
|
613
|
};
|
|
@@ -615,15 +617,15 @@ app.controller('adminUserListCtrl_requ', ["$rootScope", "$scope", "$http", "$sta
|
615
|
617
|
}
|
616
|
618
|
// 清空
|
617
|
619
|
$scope.clean = function () {
|
618
|
|
- delete $scope.fileData.requester.name;
|
619
|
|
- delete $scope.fileData.requester.account;
|
620
|
|
- delete $scope.fileData.requester.dept;
|
|
620
|
+ delete $scope.fileData.user.name;
|
|
621
|
+ delete $scope.fileData.user.account;
|
|
622
|
+ delete $scope.fileData.user.dept;
|
621
|
623
|
$scope.try_async_load();
|
622
|
624
|
$scope.refreshData('expand-right', $scope.fileData);
|
623
|
625
|
}
|
624
|
626
|
$scope.onFilterCallback = function (data) {
|
625
|
627
|
// console.log(data);
|
626
|
|
- $scope.fileData.requester.dept = data;
|
|
628
|
+ $scope.fileData.user.dept = data;
|
627
|
629
|
}
|
628
|
630
|
$scope.refreshData = function (style, filterData) {
|
629
|
631
|
$scope.ldloading[style.replace('-', '_')] = true;
|
|
@@ -638,7 +640,8 @@ app.controller('adminUserListCtrl_requ', ["$rootScope", "$scope", "$http", "$sta
|
638
|
640
|
// $scope.gridApi.grid.options.paginationCurrentPage = 0;
|
639
|
641
|
// $scope.gridApi.grid.selection.selectedCount = 0;
|
640
|
642
|
// }
|
641
|
|
- api_user_data.fetchDataList('requester', filterData).then(function (data) {
|
|
643
|
+ filterData.user.engineer = 0;
|
|
644
|
+ api_user_data.fetchDataList('user', filterData).then(function (data) {
|
642
|
645
|
var myData = Restangular.stripRestangular(data);
|
643
|
646
|
$scope.gridOptions.totalItems = myData.totalNum;
|
644
|
647
|
$scope.myData = myData.list;
|
|
@@ -663,7 +666,8 @@ app.controller('adminUserListCtrl_requ', ["$rootScope", "$scope", "$http", "$sta
|
663
|
666
|
// $scope.gridApi.grid.options.paginationCurrentPage = 0;
|
664
|
667
|
// $scope.gridApi.grid.selection.selectedCount = 0;
|
665
|
668
|
// }
|
666
|
|
- api_user_data.fetchDataList('requester', filterData).then(function (data) {
|
|
669
|
+ filterData.user.engineer = 0;
|
|
670
|
+ api_user_data.fetchDataList('user', filterData).then(function (data) {
|
667
|
671
|
var myData = Restangular.stripRestangular(data);
|
668
|
672
|
$scope.gridOptions.totalItems = myData.totalNum;
|
669
|
673
|
$scope.myData = myData.list;
|