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
(function () {
    'use strict';
    angular.module('task.controller')
        .controller('ConveyorMonitorDetail1Ctrl', ConveyorMonitorDetail1Ctrl);
 
    function ConveyorMonitorDetail1Ctrl($scope, $window, CurdHelper,Common, ETaskTypeService, $state, $timeout, Utils, Global, $stateParams) {
        $scope.data = [];
        $scope.info_div = {
            width: $window.innerWidth/2-30,
            height: 460
        }
        $scope.input_length = {
            width: ($window.innerWidth) / 4 - 132 - 45,
        }
        $scope.task_send_div = {
            width: $window.innerWidth - 50
        };
        $scope.sysModes ={
            name: "批次状态",
            value: false
        }
        $scope.changeMode = changeMode;
        $scope.materialcode = "";
        $scope.sendFlag = false;
        $scope.init = init;
        $scope.clearText = clearText;
        $scope.sendTask = sendTask;
        function init() {
            $scope.conveyorName = $stateParams.name+"输送机监控";
            queryConveyor();
        }
        function queryConveyor() {
      
            CurdHelper.queryByParam("./Device/GetGateInfo", { conveyorName: "conveyor1", gateName: "gate11" }, function (data) {
 
                if (Utils.isBlank(data.Message)) {
                    $scope.gate11 = data.Result;
                }
            });
            CurdHelper.queryByParam("./Device/GetGateInfo", { conveyorName: "conveyor1", gateName: "gate12" }, function (data) {
 
                if (Utils.isBlank(data.Message)) {
                    $scope.gate12 = data.Result;
                }
            });
 
            CurdHelper.queryByParam("./Device/GetGateInfo", { conveyorName: "conveyor1", gateName: "gate13" }, function (data) {
 
                if (Utils.isBlank(data.Message)) {
                    $scope.gate13 = data.Result;
                }
            });
 
            CurdHelper.queryByParam("./Device/GetGateInfo", { conveyorName: "conveyor1", gateName: "gate14" }, function (data) {
 
                if (Utils.isBlank(data.Message)) {
                    $scope.gate14 = data.Result;
                }
            });
 
            CurdHelper.queryByParam("./Device/GetGateInfo", { conveyorName: "conveyor1", gateName: "gate15" }, function (data) {
 
                if (Utils.isBlank(data.Message)) {
                    $scope.gate15 = data.Result;
                }
            });
 
            CurdHelper.query("./Home/GetIsLots", function (data) {
 
                if (Utils.isBlank(data.Message)) {
                    $scope.sysModes.value = data.Result;
                }
            });
            if ($state.includes("task.conveyor-monitor-detail1")) {
                $timeout(queryConveyor, 1000);
            }
        }
 
        function clearText() {
            $scope.materialcode = "";
            $scope.sendFlag = false;
        }
 
        function changeMode() {
            var flag = !$scope.sysModes.value;
            CurdHelper.queryByParam("./Home/SetIsLots", { flag: flag }, function (data) { });
        }
 
        function sendTask() {
            debugger
            $scope.sendFlag = true;
            if ($scope.materialcode == "" || $scope.gate11.RIsEmpty == "无钢材") {
                alert("请确保物料不为空或入库的gate11口有钢材!");
                clearText();
            }
            else
            {
            CurdHelper.save("./Task/SendAndChackMaterial", { materialcode: $scope.materialcode }, function (data) {
                    $scope.sendFlag = true;
                    alert(Utils.isBlank(data.Message) ? "下发成功" : data.Message);
                    clearText();
                });
            }
         
        }
    }
 
})();