zhuguifei
2026-03-10 2c1fd10c6fbabb8e9f0e9f07fe66fb36c008e883
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
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script type="text/javascript" src="${pageContext.request.contextPath}/pms/pub/combobox/comboboxUtil.js" charset="utf-8"></script>
<script type="text/javascript">
        $.loadComboboxData($("#matProd1"),"MATPROD",false);
        $.loadComboboxData($("#unit"),"UNIT",false);
        //$.loadComboboxData($("#eqps"),"ALLEQPS",false);
        $.loadComboboxData($("#eqps"),"ALLROLLERS",false);
        var matPickGrid;
        $(function() {
            //初始化时间
            var today = new Date();
            var month=today.getMonth()+1;
            if(month<10){month=("0"+month);}
            var day=today.getDate();
            if(day<10){day=("0"+day);}
            var date=today.getFullYear()+"-"+month+"-"+day;
           $("#scrq_date1").val(date);    //时间用这个
           $("#scrq_date2").val(date);
            //根据工单类型选择要填充的设备
             $("#ot").combobox({
                onChange:function(n){
                    if(n==1){
                        $.loadComboboxData($("#eqps"),"ALLROLLERS",false);
                    }else if(n==2){
                        $.loadComboboxData($("#eqps"),"ALLPACKERS",false);
                    }else if(n==3){
                        $.loadComboboxData($("#eqps"),"ALLBOXERS",false);
                    }else if(n==4){
                        $.loadComboboxData($("#eqps"),"ALLFILTERS",false);
                    }else if(n==5){
                        $.loadComboboxData($("#eqps"),"ALLTRANSM",false);
                    }
                }
            });
 
 
 
            //下拉框事件 根据牌号获取辅料
            $('#matProd1').combobox({
                onChange: function (n, o) {
                    $('#bom_version').combobox({
                        url:"${pageContext.request.contextPath}/pms/workorder/getBomVersionByProd.do?matid="+n,
                        valueField:'id',
                        textField:'name',
                        onChange: function (n, o) {
                            var bean ={bomVersion : n};
                            matPickGrid.datagrid({
                                url : "${pageContext.request.contextPath}/pms/workorder/getBomDetail.do",
                                queryParams :bean
                            });
                        },
                        onLoadSuccess: defaultSelect
 
                    })
 
                    $('#param_version').combobox({
                        url:"${pageContext.request.contextPath}/pms/workorder/getParamVersionByProd.do?matid="+n,
                        valueField:'id',
                        textField:'name',
                        onLoadSuccess: defaultSelect
 
                    })
                }
            });
            matPickGrid = $('#matPickGrid').datagrid({
                rownumbers :true,
                idField : 'id',
                fit : true,
                singleSelect :true,
                fitColumns : false,
                remoteSort: false,
                border : false,
                striped : true,
                nowrap : true,
                singleSelect:true,
                checkOnSelect : false,
                selectOnCheck : false,
                columns : [ [ /*{
                    title : '编号',
                    field : 'id',
                    checkbox : true
                }, {
                    field : 'matProdCode',
                    title : '产品编号',
                    width : 120,
                    sortable : true
                } , {
                    field : 'matProd',
                    title : '产品',
                    width : 120,
                    sortable : true
                } , */{
                    field : 'mat',
                    title : '辅料',
                    width : 260,
                    sortable : true
            /*    }, {
                    field : 'matUnitId',
                    title : '辅料ID',
                    width : 60,
                    sortable : true*/
 
                }, {
                    field : 'qty',
                    title : '辅料量',
                    width : 160,
                    sortable : true
                }, {
                    field : 'unit',
                    title : '辅料单位',
                    width : 160,
                    sortable : true
            /*    }, {
                    field : 'des',
                    title : '说明',
                    width : 150,
                    sortable : true*/
                }  ] ],
                toolbar : '#matPickToolbar',
                onLoadSuccess : function() {
                    $(this).datagrid('tooltip');
                }
            });
        });
</script>
<div class="easyui-layout" data-options="fit : true,border : false">
<div id="matPickToolbar" style="display: none;">
    <div class="topTool">
        <form id="form" method="post">
            <fieldset >
                <div >
                    <span class="label">工单类型:</span>
                    <select id="ot" name="type"
                            class="easyui-combobox"
                            data-options="panelHeight:'auto',editable:false,width:130">
                            <option value="1">卷烟机工单</option>
                            <option value="2">包装机工单</option>
                            <option value="3">封箱机工单</option>
                            <%--<option value="4">成型机工单</option>
                            <option value="4">发射机工单</option>--%>
                        </select>
                </div>
                <div >
                    <span class="label">设备:</span>
                    <input id="eqps" name="equipmentId"
                        class="easyui-combobox easyui-validatebox"
                        data-options="textField:'name',valueField:'id',editable:false,width:130,multiple:true,required:true" />
                </div>
                <div >
                    <span class="label">计划产量:</span>
                    <input name="qty"  class="easyui-validatebox" value="50" data-options="required:true" style="width:70px"/>
                    <select id="unit" name="unitId"
                        data-options="panelHeight:200,width:50,panelWidth:120,editable:false,required:true">
                    </select>
                </div>
                <div >
                    <span class="label">牌号:</span>
                    <select id="matProd1" name="matId" class="easyui-combobox"
                        data-options="panelHeight:'auto',width:130,editable:false,required:true"/>
                </div>
                <div >
                    <span class="label">工单日期:</span>
 
                    <input id="scrq_date1" name="date1" readOnly=true type="text"
                            class="easyui-datebox" datefmt="yyyy-MM-dd"
                            style="width:130px" required="required"/>
                    <!-- <input id="number" name="number" class="easyui-numberbox" min="1" max="32" value="3" data-options="required:true" style="width:70px"/> -->
                </div>
                <div >
                    <span class="label" >&nbsp;&nbsp;到:</span>
                    <input id="scrq_date2" name="date2" readOnly=true type="text"
                            class="easyui-datebox" datefmt="yyyy-MM-dd"
                            style="width:130px" required="required"/>
                </div>
                <div >
                    <span class="label">BOM版本:</span>
                    <select id="bom_version" name="bomVersion" class="easyui-combobox"
                            data-options="panelHeight:'auto',width:130,editable:false,required:true"/>
                </div>
                <div >
                    <span class="label">工艺版本:</span>
                    <select id="param_version" name="paramVersion" class="easyui-combobox"
                            data-options="panelHeight:'auto',width:130,editable:false"/>
                </div>
            </fieldset>
        </form>
    </div>
</div>
 
<div data-options="region:'center',border:false">
    <table id="matPickGrid"></table>
</div>
</div>