supplyStoreRoom.js
2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
(function () {
"use strict";
var supplychainStoreRoomSupplyIndexCtrl = function ($scope, $modal, $http, customizationService, dialogService) {
$scope.$emit('navShow', 2);
//初始化,关键字
$scope.vm = {
pageNumber: 1,
pageSize: 10,
isActive: true,
totalCount: 0
};
$scope.page = {
pageSize: 10,
pageNumber: 1
};
//获取供应链
$scope.networks = [];
$scope.getSupplychainNetworkList = function () {
customizationService.apiCustomizationSupplyFindSupplychainNetwork({pageSize: 0,demandIsActive:true, supplyIsActive:true}).success(function (data) {
if (data.errors == null || data.errors.length > 0) {
dialogService.tip(data.errors);
} else {
angular.forEach(data.result, function (network) {
network.showOperatingUnitName = network.supplyTenantName + " —— " + network.demandTenantName;
$scope.networks.push(network);
});
}
});
};
//列表 数生成
$scope.getSupplychainNetworkList();
$scope.getList = function () {
if ($scope.vm.network == null) {
dialogService.tip([{message: "请选择供应链"}]);
} else {
$scope.vm.supplychainNetworkId = $scope.vm.network.id;
customizationService.apiCustomizationSupplychainStoreRoomSupplyFind($scope.vm).success(function (data) {
if (data.errors == null || data.errors.length > 0) {
dialogService.tip(data.errors);
} else {
$scope.vm.totalCount = data.totalCount;
if (data.result != null && data.result.length > 0) {
var parentIndex = 0;
angular.forEach(data.result, function (result) {
if (parentIndex % 2 == 0) {
result.color = "color-blue";
} else {
result.color = "color-yellow";
}
parentIndex++;
result.level = 0;
result.visable = true;
});
}
$scope.trees = data.result;
}
});
}
};
$scope.doSearch = function () {
$scope.getList();
};
};
angular.module("xn.page", [])
.controller("SupplychainStoreRoomSupplyIndexCtrl", ["$scope", "$modal", "$http", "CustomizationService", "dialogService", supplychainStoreRoomSupplyIndexCtrl])
})();