WmsTaskHeaderAdd.jsp 21.2 KB
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 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" session="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%--
- Author(s): lty
- Date: 2024-05-13 14:47:23
- Description:
    --%>
    <head>
        <title>
            WmsTaskHeader录入
        </title>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
        <script src="<%= request.getContextPath() %>/common/nui/nui.js" type="text/javascript">
        </script>
    </head>
    <body>
        <fieldset style="border:solid 1px #aaa;position:relative;margin:5px 2px 0px 2px;">
            <legend>
                WmsTaskHeader
            </legend>
            <div id="dataform1" style="padding-top:5px;">
                <!-- hidden域 -->
                <input class="nui-hidden" name="wmstaskheader.wmsTaskDetails" id="wmstaskheader.wmsTaskDetails"/>
                <input class="nui-hidden" name="wmstaskheader.taskHeaderId" id="wmstaskheader.taskHeaderId"/>
                <table style="width:100%;height:95%;table-layout:fixed;" class="nui-form-table">
                    <tr>
                        <td class="form_label">
                            单据类型:
                        </td>
                        <td colspan="1">
                            <input id="countryCombo" name="wmstaskheader.orderType" class="nui-combobox" style="width:150px;" textField="name" valueField="id"
	    	   onvaluechanged="onCountryChanged" />         
                        </td>
<!--                        <td class="form_label">
                            工单号:
                        </td>
                        <td colspan="1">
                            <input class="nui-textbox" name="wmstaskheader.orderNumber"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="form_label">
                            图号:
                        </td>
                        <td colspan="1">
                            <input class="nui-textbox" name="wmstaskheader.drawingNumber"/>
                        </td>-->
                        <td class="form_label">
                            任务类型:
                        </td>
                        <td colspan="1">      
                        	    <input id="cityCombo" class="nui-combobox" name="wmstaskheader.taskType" style="width:150px;" textField="name" valueField="id"
	    	   parentField="cid" /> 
                        </td>
                    </tr>
                    <tr>
<!--                        <td class="form_label">
                            内部类型:
                        </td>
                        <td colspan="1">
                            <input class="nui-textbox" name="wmstaskheader.internalTaskType"/>
                        </td>-->

                        <td class="form_label">
                            容器号:
                        </td>
                        <td colspan="1">
                            <input class="nui-textbox" name="wmstaskheader.containerCode"/>
                        </td>
                        <td class="form_label">
                            目标出入口:
                        </td>
                        <td colspan="1">
                            <input class="nui-textbox" name="wmstaskheader.toPortCode"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="form_label">
                            起始库位:
                        </td>
                        <td colspan="1">
                            <input class="nui-textbox" name="wmstaskheader.fromLocationCode"/>
                        </td>
                    
                        <td class="form_label">
                            目标库位:
                        </td>
                        <td colspan="1">
                            <input class="nui-textbox" name="wmstaskheader.toLocationCode"/>
                        </td>
                    </tr>
<!--                        <td class="form_label">
                            容器填充状态:
                        </td>
                        <td colspan="1">
                            <input class="nui-textbox" name="wmstaskheader.containerFillStatus"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="form_label">
                            重量:
                        </td>
                        <td colspan="1">
                            <input class="nui-textbox" name="wmstaskheader.weight"/>
                        </td>
                        <td class="form_label">
                            是否空出:
                        </td>
                        <td colspan="1">
                            <input class="nui-textbox" name="wmstaskheader.isEmptyOut"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="form_label">
                            是否重入:
                        </td>
                        <td colspan="1">
                            <input class="nui-textbox" name="wmstaskheader.isDoubleIn"/>
                        </td>
                        <td class="form_label">
                            是否取货错:
                        </td>
                        <td colspan="1">
                            <input class="nui-textbox" name="wmstaskheader.isPickupError"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="form_label">
                            任务状态:
                        </td>
                        <td colspan="1">
                            <input class="nui-textbox" name="wmstaskheader.status"/>
                        </td>
                        <td class="form_label">
                            优先级:
                        </td>
                        <td colspan="1">
                            <input class="nui-textbox" name="wmstaskheader.priortiy"/>
                        </td>
                    </tr>
                     <tr>
                       <td class="form_label">
                            是否回库:
                        </td>
                        <td colspan="1">
                            <input class="nui-textbox" name="wmstaskheader.back"/>
                        </td>
                        <td class="form_label">
                            回传MES信息:
                        </td>
                        <td colspan="1">
                            <input class="nui-textbox" name="wmstaskheader.backMes"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="form_label">
                            回传MES次数:
                        </td>
                        <td colspan="1">
                            <input class="nui-textbox" name="wmstaskheader.backMesTimes"/>
                        </td>
                        <td class="form_label">
                            回传MES时间:
                        </td>
                        <td colspan="1">
                            <input class="nui-datepicker" name="wmstaskheader.backMesTimestamp"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="form_label">
                            创建人:
                        </td>
                        <td colspan="1">
                            <input class="nui-textbox" name="wmstaskheader.createBy"/>
                        </td>
                        <td class="form_label">
                            创建日期:
                        </td>
                        <td colspan="1">
                            <input class="nui-datepicker" name="wmstaskheader.createTime"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="form_label">
                            更新人:
                        </td>
                        <td colspan="1">
                            <input class="nui-textbox" name="wmstaskheader.updateBy"/>
                        </td>
                        <td class="form_label">
                            更新日期:
                        </td>
                        <td colspan="1">
                            <input class="nui-datepicker" name="wmstaskheader.updateTime"/>
                        </td>
                    </tr>-->
                </table>
            </div>
        </fieldset>
        <!-- 从表的修改 -->
        <div style="margin:0px 2px 0px 2px;" >
            <div class="nui-tabs" id="tab" activeIndex="0" style="width:100%;height:100%;">
                <div title="WmsTaskDetail">
                    <div class="nui-toolbar" style="border-bottom:0;padding:0px;">
                        <table style="width:100%;">
                            <tr>
                                <td style="width:100%;">
                                    WmsTaskDetail
                                </td>
                                <td >
                                    <a class="nui-button " iconCls="icon-add" onclick="gridAddRow('grid_0')"  plain="true" tooltip="增加">
                                        &nbsp;
                                    </a>
                                </td>
                                <td >
                                    <a class="nui-button " iconCls="icon-remove" onclick="gridRemoveRow('grid_0')"  plain="true" tooltip="删除">
                                        &nbsp;
                                    </a>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="grid_0" class="nui-datagrid" style="width:100%;height:150px;" showPager="false" sortMode="client" allowCellEdit="true" allowCellSelect="true" multiSelect="true" editNextOnEnterKey="true" >
                        <div property="columns">
                            <div type="checkcolumn">
                            </div>
<!--                            <div field="taskType" allowSort="true" align="left" headerAlign="center" width="">
                                任务类型
                                <input class="nui-textbox" name="taskType" property="editor"/>
                            </div>
                            <div field="internalTaskType" allowSort="true" align="left" headerAlign="center" width="">
                                内部任务类型
                                <input class="nui-textbox" name="internalTaskType" property="editor"/>
                            </div>-->
                            <div field="materialCode" allowSort="true" align="left" headerAlign="center" width="">
                                物料编码
                                <input class="nui-textbox" name="materialCode" property="editor"/>
                            </div>
                            <div field="materialName" allowSort="true" align="left" headerAlign="center" width="">
                                物料名称
                                <input class="nui-textbox" name="materialName" property="editor"/>
                            </div>
                            <div field="qty" allowSort="true" align="left" headerAlign="center" width="">
                                物料数量
                                <input class="nui-textbox" name="qty" property="editor"/>
                            </div>
<!--                            <div field="dqty" allowSort="true" align="left" headerAlign="center" width="">
                                组盘数量
                                <input class="nui-textbox" name="dqty" property="editor"/>
                            </div>
                           <div field="toInventoryDetailId" allowSort="true" align="left" headerAlign="center" width="">
                                入库库存详情ID
                                <input class="nui-textbox" name="toInventoryDetailId" property="editor"/>
                            </div>
                            <div field="fromInventoryDetailId" allowSort="true" align="left" headerAlign="center" width="">
                                出库库存详情ID
                                <input class="nui-textbox" name="fromInventoryDetailId" property="editor"/>
                            </div>
                            <div field="orderNumber" allowSort="true" align="left" headerAlign="center" width="">
                                工单号
                                <input class="nui-textbox" name="orderNumber" property="editor"/>
                            </div>
                            <div field="drawingNumber" allowSort="true" align="left" headerAlign="center" width="">
                                图号
                                <input class="nui-textbox" name="drawingNumber" property="editor"/>
                            </div>
                            <div field="processNumber" allowSort="true" align="left" headerAlign="center" width="">
                                完工工序号
                                <input class="nui-textbox" name="processNumber" property="editor"/>
                            </div>
                            <div field="processVersion" allowSort="true" align="left" headerAlign="center" width="">
                                完工工序版本
                                <input class="nui-textbox" name="processVersion" property="editor"/>
                            </div>
                            <div field="batchNumber" allowSort="true" align="left" headerAlign="center" width="">
                                批次号
                                <input class="nui-textbox" name="batchNumber" property="editor"/>
                            </div>
                            <div field="status" allowSort="true" align="left" headerAlign="center" width="">
                                任务状态
                                <input class="nui-textbox" name="status" property="editor"/>
                            </div>
                            <div field="binNumber" allowSort="true" align="left" headerAlign="center" width="">
                                料箱号
                                <input class="nui-textbox" name="binNumber" property="editor"/>
                            </div>
                            <div field="serialNumber" allowSort="true" align="left" headerAlign="center" width="">
                                序列号
                                <input class="nui-textbox" name="serialNumber" property="editor"/>
                            </div>
                            <div field="processingUnit" allowSort="true" align="left" headerAlign="center" width="">
                                加工单元
                                <input class="nui-textbox" name="processingUnit" property="editor"/>
                            </div>
                            <div field="createBy" allowSort="true" align="left" headerAlign="center" width="">
                                创建人
                                <input class="nui-textbox" name="createBy" property="editor"/>
                            </div>
                            <div field="createTime" allowSort="true" align="left" headerAlign="center" width="">
                                创建日期
                                <input class="nui-datepicker" name="createTime" property="editor"/>
                            </div>
                            <div field="updateBy" allowSort="true" align="left" headerAlign="center" width="">
                                更新人
                                <input class="nui-textbox" name="updateBy" property="editor"/>
                            </div>
                            <div field="updateTime" allowSort="true" align="left" headerAlign="center" width="">
                                更新日期
                                <input class="nui-datepicker" name="updateTime" property="editor"/>
                            </div>-->
                        </div>
                    </div>
                </div>
            </div>
            <div class="nui-toolbar" style="padding:0px;" borderStyle="border:0;">
                <table width="100%">
                    <tr>
                        <td style="text-align:center;" colspan="4">
                            <a class="nui-button" iconCls="icon-save" onclick="onOk()">
                                保存
                            </a>
                            <span style="display:inline-block;width:25px;">
                            </span>
                            <a class="nui-button" iconCls="icon-cancel" onclick="onCancel()">
                                取消
                            </a>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <script type="text/javascript">
            nui.parse();
            
            
            var countryCombo = nui.get("countryCombo");
	        var cityCombo = nui.get("cityCombo");
	
	        function onCountryChanged(e) {
	            var id = countryCombo.getValue();
	            //延迟填充数据,模拟ajax异步特性
	            setTimeout(function () {
	            	var cs = getCitys(id);
	            	debugger
	                cityCombo.load(cs);
	            }, 100);
	        }
	                
	        var countrys = [
	            { id: "", name: "请选择.." },
	            { id: "出库单", name: "出库单" },
	            { id: "入库单", name: "入库单" },
	        ];
	        var citys = [
	            { id: 300, name: '整盘出库', cid: "出库单" },
	            { id: 400, name: '分拣出库', cid: "出库单" },
	            { id: 600, name: '空容器出库', cid: "出库单" },
	            { id: 100, name: '整盘入库', cid: "入库单" },
	            { id: 200, name: '补充入库', cid: "入库单" },
	            { id: 500, name: '空容器入库', cid: "入库单" },
	            
	        ];
	        function getCitys(cid) {
	            var cs = [];
	            for (var i = 0, l = citys.length; i < l; i++) {
	                var city = citys[i];
	                if (city.cid == cid) {
	                    cs.push(city);
	                }
	            }
	            return cs;
	        }
	
	        countryCombo.load(countrys);
	        
            var tab = nui.get("tab");
            var form = new nui.Form("#dataform1");
            form.setChanged(false);

            function onOk(){
                saveData();
            }

            function gridAddRow(datagrid){
                var grid = nui.get(datagrid);
                grid.addRow({});
            }

            function gridRemoveRow(datagrid) {
                var grid = nui.get(datagrid);
                var rows = grid.getSelecteds();
                if (rows.length > 0) {
                    grid.removeRows(rows, true);
                }
            }

            function setGridData(datagrid,dataid){
                var grid = nui.get(datagrid);
                var grid_data = grid.getChanges();
                nui.get(dataid).setValue(grid_data);
            }

            function saveData(){
                form.validate();
                if(form.isValid()==false) return;
                setGridData("grid_0","wmstaskheader.wmsTaskDetails");
                var data = form.getData(false,true);
                var json = nui.encode(data);

                $.ajax({
                    url:"com.huaheng.wms.wmstaskheaderbiz.addWmsTaskHeader.biz.ext",
                    type:'POST',
                    data:json,
                    cache:false,
                    contentType:'application/json',
                    success:function(returnJson){
                        console.log(returnJson); // 输出返回的 JSON 数据,以便调试
                        if (returnJson==null) {
							nui.alert("返回值不存在", "失败");
						}
                        if (returnJson && returnJson.exception && returnJson.exception.code === 200) {
                            // 执行成功
                            CloseWindow("saveSuccess");
                        } else {
                            // 执行失败
                            nui.alert(returnJson.exception.message, "失败");
                        }
                        }
                        });
                    }

                    function onReset(){
                        form.reset();
                        form.setChanged(false);
                    }

                    function onCancel(){
                        CloseWindow("cancel");
                    }

                    function CloseWindow(action){

                        if(action=="close"){

                            }else if(window.CloseOwnerWindow)
                            return window.CloseOwnerWindow(action);
                            else
                            return window.close();
                        }
                    </script>
                </body>
            </html>