2
schangxiang@126.com
2024-08-16 b47c50a2a514def7374b32d7194b2c599cba5625
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
(function () {
    'use strict';
    angular.module('task.controller')
        .controller('PreviewPlaceCtrl', PreviewPlaceCtrl);
 
    function PreviewPlaceCtrl($scope, CurdHelper, $timeout, Utils, $window, $state, Common, $document) {
        $scope.init = init;
        $scope.haveMaterialPlace = 0;
        $scope.lockMaterialPlace = 0;
        $scope.emptyPlace = 0;
        $scope.emptyLockPlace = 0;
        $scope.showInfo = showInfo;
        $scope.currentTab = 1;
        $scope.unShowInfo = unShowInfo;
        $scope.changeCurrentTab = changeCurrentTab;
        $scope.data = {};
        $scope.tabs = [{
            id: 1,
            tag: "one",
            name: "库位预览",
            datas: {}
        }];
        $scope.containerInfo = {
 
            typename: "",
            name: "",
            code: "",
            description: "",
            updatetime: "",
            quantity: "",
 
        };
        $scope.placeTypeNum = {
            emptyPlace: 0,
            fullPlace: 0,
            lockPlace: 0,
 
        };
 
        $scope.rows = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
        $scope.columns = [0, 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];
        $scope.x = 0;
        $scope.y = 0;
        $scope.nav_div = {
            top: 0,
            left: 0
        };
        //$scope.showProdFlag = showProdFlag;
 
        //function showProdFlag(flag) {
        //    var str = "无";
        //    switch (flag) {
        //        case 1:
        //            str = "试";
        //            break;
        //        case 2:
        //            str = "跟";
        //            break;
        //        case 3:
        //            str = "优";
        //            break;
        //        case 4:
        //            str = "返";
        //            break;
        //    }
        //    return str;
        //}
 
 
        function init() {
            changeCurrentTab(1);
            $timeout(queryNum, 5000);
            $timeout(queryTab, 5000);
 
        }
        function queryNum() {
            CurdHelper.query("./Home/GetPlaceStatusNum", function (data) {
                if (Utils.isBlank(data.Message)) {
                    var res = data.Result[0];
                    $scope.placeTypeNum.emptyPlace = res.EmptyPlace;
                    $scope.placeTypeNum.fullPlace = res.FullPlace;
                    $scope.placeTypeNum.lockPlace = res.LockPlace;
                }
 
                if ($state.includes("task.preview-place")) {
                    $timeout(queryNum, 10000);
                }
            });
        }
 
        function queryTab() {
            CurdHelper.query("./Home/GetPlacePreview", function (data) {
                debugger;
                if (Utils.isBlank(data.Message))
                {
                    $scope.dataLack = data.Result;
                }
                if ($state.includes("task.preview-place")) {
                    $timeout(queryTab, 10000);
                }
            });
 
        }
        function changeCurrentTab(n) {
            $scope.currentTab = n;
        }
 
        function showInfo($event, b) {
            if (b == undefined) {
                return;
            }
            $scope.x = $event.screenX;
            $scope.y = $event.screenY;
                $scope.showPlaceInfo = true;
                if ($event.screenY > 700) {
                    $scope.nav_div.top = $event.screenY - 250 - 200;
                } else if ($event.screenY < 560) {
                    $scope.nav_div.top = $event.screenY*2.2;
                } else {
                    $scope.nav_div.top = $event.screenY - 100 - 200;
                }
                if ($event.screenX > 700) {
                    $scope.nav_div.left = $event.screenX - 600;
                } else {
                    $scope.nav_div.left = $event.screenX+100 ;
                }
 
                $scope.containerInfo.name = b.name;
                $scope.containerInfo.code = b.code;
                $scope.containerInfo.typename = b.typename;
                $scope.containerInfo.description = b.description;
                $scope.containerInfo.updatetime = b.updatetime;
                $scope.containerInfo.quantity = 1;
        }
 
        function unShowInfo() {
            $scope.showPlaceInfo = false;
            $scope.showEmptyPlaceInfo = false;
        }
    }
 
})();