huang
2025-03-14 3450516ed847b35904c1cdda0f0a19b65511e645
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
$(function(){
    //支持的文件类型正则表达式
    var fileType = /\.(opt|OPT)$/;
    var result = $("#result").attr("resultid");
    if(result == "alsohave"){
        alert("任务库已含有当前导入订单,请重新换批次");
        window.location.href=contextPath + "/shelfmanager/taskimport";
    }else if(result == "failue"){
        alert("opt文件存在问题,请仔细查阅!");
        window.location.href=contextPath + "/shelfmanager/taskimport";
    }else if(result == "success"){
        alert("当前任务导入成功");
        window.location.href=contextPath + "/shelfmanager/taskimport";
    }
    $("#fileupload").fileupload({
        url: contextPath + '/upload/optpattern',
        dataType: 'json',
        multipart: true,
        add: function(e, data) { //校验文件格式
            var goUpload = true;
            var uploadFile = data.files;
            for(var i=0;i<uploadFile.length; i++){
                 if (!fileType.test(uploadFile[i].name)) {
                     goUpload = false;
                     break ;
                 }
            }
            
            if (goUpload == true) {
                data.submit();
            }
        },
        done: function(e, data) {
            $("#upload").hide();
            $("#ctrl").hide();
            $("#delSubmit").show();
            $('#uploadError').html('');
            //上传成功
            $('#fileName').val(data.result.fileName);
            $("#upload").before("<span style='position:relative;width: 140px; height: 122px;'>"
                    +"<img src='/gmms2/static/images/f5.png'>"
                    +"<span style='line-height:12px; position:absolute; top:50%; left:50%; margin-left:-24px; margin-top:-6px;font-weight: bolder;'>"
                    +data.result.fileName.substring(0,data.result.fileName.lastIndexOf("."))
                    +"</span></span>");
        },
         progressall: function(e, data) {
         }
    });
    
    $("#delSubmit").click(function(){
        $("#delSubmit").attr("disabled", true);
        var send=true;
        if(send){
            send=false;
            $("#uploadForm").submit();    
        }
    });
    
    $('#deleteOneModal').on('hide.bs.modal', function () {
        window.location.href=contextPath + "/upload/cancelUpload";
      });
    
    
});
 
    function upload(){
        $("#deleteOneModal").modal('show');
        $("#delSubmit").hide();
    }
 
    
    function moshi(){
        $("#moshi").modal('show');
        $("#delSubmit").hide();
    }
 
    
    function push(){
        var checkBoxes=$(":checkbox");
        var rawpackagetxtIds="";
        
        for(var i=0; i<checkBoxes.length; i++){
            if(checkBoxes[i].name=='push'&&checkBoxes[i].checked){
                rawpackagetxtIds+=(checkBoxes[i].id+";");
            }
        }
        
        rawpackagetxtIds=rawpackagetxtIds.substring(0, rawpackagetxtIds.length-1);
        
        if (rawpackagetxtIds == '') {
            $.MsgBox.Alert("警告", "请至少选中左边的一个文件");
            return;
        }
        //发送ajax请求
        $.ajax({
            url:contextPath + "/shelfmanager/batchDeleteRawpackagetxts?ajax=true&rawpackagetxtIds="+rawpackagetxtIds,
                    success: function(data){
                        if(data.trim()=="success"){
                            window.location.href=contextPath + "/shelfmanager/taskimport";
                        }
                        else{
                              $.MsgBox.Alert("警告", data.substring(4, data.length)+"文件开始不能Push,料架不够此文件吊装");
                        }
                    }
               })
    }
    
    function reserse(){
        var checkBoxe=$(":checkbox");
        var rawpackagetxtId="";
        for(var i=0; i<checkBoxe.length; i++){
            if(checkBoxe[i].name=='reverse'&&checkBoxe[i].checked){
                rawpackagetxtId+=(checkBoxe[i].id+";");
            }
        }
        
        rawpackagetxtId=rawpackagetxtId.substring(0, rawpackagetxtId.length-1);
        
        if (rawpackagetxtId == '') {
            $.MsgBox.Alert("警告", "请至少选中右边的一个文件");
            return;
        }
        
        //发送ajax请求
        $.ajax({
            url:contextPath + "/shelfmanager/batchDeleteRawpackagetxt?ajax=true&rawpackagetxtId="+rawpackagetxtId,
                    success: function(data){
                        if(data.trim()=="success"){
                            window.location.href=contextPath + "/shelfmanager/taskimport";
                        }else{
                            $.MsgBox.Alert("警告", data.substring(4, data.length)+"文件需要的原片已经在吊装,不能Reverse");
                        }
                    }
               })
    }
    
    function cancel(){    
        var checkBoxe=$(":checkbox");
        var rawpackagetxtId="";
        for(var i=0; i<checkBoxe.length; i++){
            if(checkBoxe[i].name=='reverse'&&checkBoxe[i].checked){
                rawpackagetxtId+=(checkBoxe[i].id+";");
            }
        }
        
        rawpackagetxtId=rawpackagetxtId.substring(0, rawpackagetxtId.length-1);
        
        if (rawpackagetxtId != '') {
            $.MsgBox.Alert("警告", "只能选中左边的文件");
            return;
        }
        
        var checkBoxes=$(":checkbox");
        var rawpackagetxtIds="";
        
        for(var i=0; i<checkBoxes.length; i++){
            if(checkBoxes[i].name=='push'&&checkBoxes[i].checked){
                rawpackagetxtIds+=(checkBoxes[i].id+";");
            }
        }
        
        rawpackagetxtIds=rawpackagetxtIds.substring(0, rawpackagetxtIds.length-1);
        
        if (rawpackagetxtIds == '') {
            $.MsgBox.Alert("警告", "请至少选中左边的一个文件");
            return;
        }
        
         //发送ajax请求
        $.ajax({
            url:contextPath + "/shelfmanager/batchCancelRawpackagetxts?ajax=true&rawpackagetxtIds="+rawpackagetxtIds,
                    success: function(data){
                        if(data.trim()=="success"){
                            window.location.href=contextPath + "/shelfmanager/taskimport";
                        }
                    }
        })
    }