严智鑫
2024-05-13 cedce4883f0d204f5bf7bf87c0bf4858dabb0c23
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
<%@ page language="java" pageEncoding="UTF-8"%>
<!-- 设置次破 -->
<div class="modal fade" id="div_cipo" tabindex="-1" role="dialog"
    aria-labelledby="myModalLabel" aria-hidden="true">
    <form class="form-horizontal" role="form">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"
                        aria-hidden="true">&times;</button>
                    <h3 class="modal-title" id="UNum_AlertTitle">设置破损</h3>
                </div>
                <div class="modal-body" style="text-align: left;">
 
                    <div class="form-group">
                        <h4>
                            <label class="col-lg-4 control-label no-padding-right"
                                style="font-weight: bolder;">当前班组: </label>
                        </h4>
 
                        <div class="col-lg-6 input-group">
                            <span class="input-group-addon s-style" id='c_banzu'
                                style="color: red"></span>
                        </div>
                        <br />
                        <h4>
                            <label class="col-lg-4 control-label no-padding-right"
                                style="font-weight: bolder;">流程卡号: </label>
                        </h4>
 
                        <div class="col-lg-6 input-group">
                            <span class="input-group-addon s-style" id='lckNO'>NG</span>
                        </div>
 
 
                        <h4>
                            <label class="col-lg-4 control-label no-padding-right"
                                style="font-weight: bolder;">玻璃类型: </label>
                        </h4>
 
                        <div class="col-lg-6 input-group">
                            <span class="input-group-addon s-style" id='blType'>NG</span>
                        </div>
 
                        <h4>
                            <label class="col-lg-4 control-label no-padding-right"
                                style="font-weight: bolder;">玻璃尺寸: </label>
                        </h4>
 
                        <div class="col-lg-6 input-group">
                            <span class="input-group-addon s-style" id='blSize'>NG</span>
                        </div>
 
 
                        <h4>
                            <label class="col-lg-4 control-label no-padding-right"
                                style="font-weight: bolder;">数量: </label>
                        </h4>
 
                        <div class="col-lg-6 input-group">
                            <span class="input-group-addon s-style" id='zSum'>1</span>
                        </div>
 
                        <h4>
                            <label class="col-lg-4 control-label no-padding-right"
                                style="font-weight: bolder;">玻璃ID:</label>
                        </h4>
 
                        <div class="col-lg-6 input-group">
                            <span class="input-group-addon s-style" id='blID'>0</span>
                        </div>
                         <span class="input-group-addon s-style" style="display: none" id='tID'></span>
                        
                        <br /> <br />
                        <h4>
                            <label class="col-lg-4 control-label no-padding-right"
                                style="font-weight: bolder;">次破类型 :</label>
                        </h4>
                        <div class="col-lg-6 input-group">
                            <select id="cp_leixing" class="span_tasktext form-control"
                                style="font-size: 18px" onChange="lx_change();">
 
                            </select>
                        </div>
 
                        <h4>
                            <label class="col-lg-4 control-label no-padding-right"
                                style="font-weight: bolder;">次破原因 :</label>
                        </h4>
                        <div class="col-lg-6 input-group">
                            <select id="cp_yuanyin" class="span_tasktext form-control"
                                style="font-size: 18px" onChange="yy_change();">
 
                            </select>
                        </div>
 
                    </div>
                    <br />
                    <div class="form-group">
 
                        <p style="text-align: center; font-size: 20px; color: red"
                            id="cp-warring-info"></p>
                    </div>
 
                </div>
                <div class="modal-footer">
 
                    <button type="button" class="btn btn-primary btn-lg"
                        data-dismiss="modal" id="btnCancal">取消</button>
 
                    <button type="button" class="btn btn-danger btn-lg" id="btnSubmit"
                        onclick="setCiPo()">确认</button>
                </div>
            </div>
        </div>
    </form>
</div>
 
<script>
    var cpyyList = null;
    var cplxList = null;
    var p_url = "/gmms2/mesview/data/_public_manage";
    var gy = "";
 
    function getCiPoInfo() {
        if (gongyi == "钢化前" || gongyi == "钢化后") {
 
            gy = "钢化";
 
        }
        
        $.ajax({
                    type : "post",
                    data : {
                        caozuo : "查询",
                        leixing : "次破原因",
                        gongyi : gy,
                        line : group
                    },
                    dataType : "json",
                    url : p_url,
                    success : function(data) {
                        cpyyList = d = data;
                        var html = " <option  selected=\"selected\" value='0'>选择次破原因</option>";
                        $("#cp_yuanyin").empty();
                        /* for (var i = 0; i < d.length; i++) {
                            html += " <option value="+d[i][0]+">" + d[i][1]
                                    + "</option>";
                        } */
                        document.getElementById("cp_yuanyin").innerHTML += html;
 
                    },
                    error : function(data) {
 
                    }
                });
 
        $.ajax({
                    type : "post",
                    data : {
                        caozuo : "查询",
                        leixing : "次破类型",
                        gongyi : gy,
                        line : group
                    },
                    dataType : "json",
                    url : p_url,
                    success : function(data) {
                        cplxList = d = data;
                        var html = " <option  selected=\"selected\" value='0'>选择次破类型</option>";
                        $("#cp_leixing").empty();
                        for (var i = 0; i < d.length; i++) {
                            html += " <option  value="+d[i][0]+">" + d[i][1]
                                    + "</option>";
                        }
                        document.getElementById("cp_leixing").innerHTML += html;
 
                    },
                    error : function(data) {
 
                    }
                });
 
    }
 
    var czState = false;//操作状态
    function setCiPo() {
        /* if (gongyi == "钢化前" || gongyi == "钢化后") {
            gy = "钢化";
        } */
        var cplx = $("#cp_leixing").val();
        var cpyy = $("#cp_yuanyin").val();
        if (cplx == 0) {
            $("#cp-warring-info").text("请选择次破类型!");
            return;
        }
        if (cpyy == 0) {
            var length = $('#cp_yuanyin').children('option').length;
            if (length == 1) {
                cpyy = 0;
            } else {
                $("#cp-warring-info").text("请选择次破原因!");
                return;
            }
        }
        var glassId = $("#tID").text();
        var cpInfo_ = glassId + "-" + cplx + "-" + cpyy + "-" + gongyi + "-"+ group;
        /* alert(cpInfo_);
        return; */
        $.ajax({
            type : "post",
            data : {
                caozuo : "次破",
                gongyi : gongyi,
                cpInfo : cpInfo_
 
            },
            url : p_url,
            dataType : 'text',
            success : function(data) {
                var d = data.trim();
                if (d == "OK") {
                    $("#div_cipo").modal('toggle');
                    LoadLCKTable(current_lck);
                    return;
                } else {
                    $("#cp-warring-info").text(data);
                }
 
            },
            error : function(data) {
                $("#cp-warring-info").text(data);
            }
        })
        return;
    }
 
    function setGlassCiPo(glassId) {
        var cpInfo_ = glassId + "-" + 0 + "-" + 0 + "-" + gy + "-" + group;
        
        //return;
        //alert(cpInfo_);
        //return;
        $.ajax({
            type : "post",
            data : {
                caozuo : "次破",
                gongyi : "钢化",
                cpInfo : cpInfo_
 
            },
            url : p_url,
            dataType : 'text',
            success : function(data) {
                var d = data.trim();
                if (d == "OK") {
                    $("#CZ_Sure").modal('toggle');
                    show();//表内容加载
                    return;
                } else {
                    $("#CZ_Sure").modal('toggle');
                    $("#CZ_Msg").modal('toggle');
                    $("#cz_Ming").html("设置破损");
                    $("#cz_Zhuangtai").html("执行失败");
                    $("#cz_mingxi").attr("style", "color:red;");
                    $("#cz_mingxi").text(data);
                    /* $("#p-yuanyin").attr("style","display:");
                    $("#error_mingxi").text(data); */
                }
            },
            error : function(data) {
                $("#cp-warring-info").text(data);
            }
        })
        return;
    }
 
    function lx_change() {
        if ($("#cp_leixing").val() == 0) {
            $("#cp_yuanyin").empty();
            var html = " <option  selected=\"selected\" value='0'>选择次破原因</option>";
            document.getElementById("cp_yuanyin").innerHTML += html;
            return;
        }
 
        var lx_s = $("#cp_leixing").find("option:selected").text();
        $("#cp_yuanyin").empty();
        var html = " <option  selected=\"selected\" value='0'>选择次破原因</option>";
        for (var i = 0; i < cpyyList.length; i++) {
            if (cpyyList[i][2] == lx_s) {
                html += " <option value="+cpyyList[i][0]+">" + cpyyList[i][1]
                        + "</option>";
            }
        }
        document.getElementById("cp_yuanyin").innerHTML += html;
    }
 
    function yy_change() {
        if ($("#cp_yuanyin").val() != 0) {
            if ($("#cp-warring-info").text() == "请选择次破原因!") {
                $("#cp-warring-info").text("");
 
            }
        } else {
            $("#cp-warring-info").text("请选择次破原因!");
        }
 
    }
</script>