WmsInventoryDetailList.jsp 16 KB
<%@ 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-04-28 16:32:28
- Description:
    --%>
    <head>
        <title>
            WmsInventoryDetail查询
        </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 style="width:98%;height:95%;">
        <div class="nui-panel" title="WmsInventoryDetail查询" iconCls="icon-add" style="width:100%;height:15%;" showToolbar="false" showFooter="true">
            <div id="form1" class="nui-form" align="center" style="height:100%">
                <!-- 数据实体的名称 -->
                <input class="nui-hidden" name="criteria/_entity" value="com.huaheng.wms.InventoryDetail.WmsInventoryDetail">
                <!-- 排序字段 -->
                <input class="nui-hidden" name="criteria/_orderby[1]/_property" value="id">
                <input class="nui-hidden" name="criteria/_orderby[1]/_sort" value="asc">
                <table id="table1" class="table" style="height:100%">
                    <tr>
                        <td class="form_label">
                            容器编码:
                        </td>
                        <td colspan="1">
                            <input class="nui-textbox" name="criteria/_expr[1]/containerCode"/>
                            <input class="nui-hidden" name="criteria/_expr[1]/_op" value="like">
                            <input class="nui-hidden" name="criteria/_expr[1]/_likeRule" value="all">
                        </td>
                        <td class="form_label">
                            库位编码:
                        </td>
                        <td colspan="1">
                            <input class="nui-textbox" name="criteria/_expr[2]/locationCode"/>
                            <input class="nui-hidden" name="criteria/_expr[2]/_op" value="like">
                            <input class="nui-hidden" name="criteria/_expr[2]/_likeRule" value="all">
                        </td>
                    </tr>
                    <tr>
                        <td class="form_label">
                            物料编码:
                        </td>
                        <td colspan="3">
                            <input class="nui-textbox" name="criteria/_expr[3]/materialCode"/>
                            <input class="nui-hidden" name="criteria/_expr[3]/_op" value="like">
                            <input class="nui-hidden" name="criteria/_expr[3]/_likeRule" value="all">
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <!--footer-->
        <div property="footer" align="center">
            <a class="nui-button" onclick="search()">
                查询
            </a>
            <a class="nui-button" onclick="reset()">
                重置
            </a>
        </div>
        <div class="nui-panel" title="WmsInventoryDetail列表" iconCls="icon-add" style="width:100%;height:85%;" showToolbar="false" showFooter="false" >
            <div class="nui-toolbar" style="border-bottom:0;padding:0px;">
                <table style="width:100%;">
                    <tr>
                        <td style="width:100%;">
                            <a class="nui-button" iconCls="icon-add" onclick="add()">
                                增加
                            </a>
                            <a id="update" class="nui-button" iconCls="icon-edit" onclick="edit()">
                                编辑
                            </a>
                            <a class="nui-button" iconCls="icon-remove" onclick="remove()">
                                删除
                            </a>
                            <a class="nui-button" iconCls="icon-search" onclick="emptyOut()">
                                空容器出库
                            </a>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="nui-fit">
                <div 
                        id="datagrid1"
                        dataField="wmsinventorydetails"
                        class="nui-datagrid"
                        style="width:100%;height:100%;"
                        url="com.huaheng.wms.wmsinventorydetailbiz.queryWmsInventoryDetails.biz.ext"
                        pageSize="10"
                        showPageIndex="true"
                        multiSelect="true"
                        onselectionchanged="selectionChanged"
                        allowSortColumn="false">

                    <div property="columns">
                        <div type="indexcolumn">
                        </div>
                        <div type="checkcolumn">
                        </div>
                        <div field="id" headerAlign="center" allowSort="true" visible="false">
                            ID
                        </div>
                        <div field="enterpriseCode" headerAlign="center" allowSort="true" >
                            库存所属工厂
                        </div>
                        <div field="inventoryStatus" headerAlign="center" allowSort="true" renderer="inventoryStatusRenderer" >
                            库存状态
                        </div>
                        <div field="roadWay" headerAlign="center" allowSort="true" >
                            巷道
                        </div>
                        <div field="locationCode" headerAlign="center" allowSort="true" >
                            库位编码
                        </div>
                        <div field="containerCode" headerAlign="center" allowSort="true" >
                            容器编码
                        </div>
                        <div field="containerStatus" headerAlign="center" allowSort="true" renderer="inventoryStatusRenderer"  >
                            容器状态
                        </div>
                        <div field="materialCode" headerAlign="center" allowSort="true" >
                            物料编码
                        </div>
                        <div field="materialName" headerAlign="center" allowSort="true" >
                            物料名称
                        </div>
                        <div field="qty" headerAlign="center" allowSort="true" >
                            qty
                        </div>
                        <div field="orderNumber" headerAlign="center" allowSort="true" >
                            工单号
                        </div>
                        <div field="drawingNumber" headerAlign="center" allowSort="true" >
                            图号
                        </div>
                        <div field="processNumber" headerAlign="center" allowSort="true" >
                            完工工序号
                        </div>
                        <div field="processVersion" headerAlign="center" allowSort="true" >
                            完工工序版本
                        </div>
                        <div field="batchNumber" headerAlign="center" allowSort="true" >
                            批次号
                        </div>
                        <div field="binNumber" headerAlign="center" allowSort="true" >
                            料箱号
                        </div>
                        <div field="serialNumber" headerAlign="center" allowSort="true" >
                            序列号
                        </div>
                        <div field="processingUnit" headerAlign="center" allowSort="true" >
                            加工单元
                        </div>
                        <div field="projectNo" headerAlign="center" allowSort="true" >
                            库存所属项目
                        </div>
                        <div field="createBy" headerAlign="center" allowSort="true" >
                            创建人
                        </div>
                        <div field="createTime" headerAlign="center" allowSort="true" >
                            创建日期
                        </div>
                        <div field="updateBy" headerAlign="center" allowSort="true" >
                            更新人
                        </div>
                        <div field="updateTime" headerAlign="center" allowSort="true" >
                            更新日期
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <script type="text/javascript">
            nui.parse();
            var grid = nui.get("datagrid1");

            var formData = new nui.Form("#form1").getData(false,false);
            grid.load(formData);

            //新增
            function add() {
                nui.open({
                    url: "WmsInventoryDetailForm.jsp",
                    title: "新增记录", width: 600, height: 300,
                    onload: function () {//弹出页面加载完成
                    var iframe = this.getIFrameEl();
                    var data = {pageType:"add"};//传入页面的json数据
                    iframe.contentWindow.setFormData(data);
                    },
                    ondestroy: function (action) {//弹出页面关闭前
                    grid.reload();
                }
                });
            }

        function onButtonEdit(e) {
            var btnEdit = this;
            nui.open({
                url:"SelectGridWindow.jsp",
                title: "选择列表",
                width: 650,
                height: 380,
                ondestroy: function (action) {
                    //if (action == "close") return false;
                    if (action == "ok") {
                        var iframe = this.getIFrameEl();
                        var data = iframe.contentWindow.GetData();
                        data = nui.clone(data);    //必须
                        if (data) {
                            btnEdit.setValue(data.id);
                            btnEdit.setText(data.name);
                        }
                    }

                }
            });            
             
        }  
            //编辑
            function edit() {
                var row = grid.getSelected();
                if (row) {
                    nui.open({
                        url: "WmsInventoryDetailForm.jsp",
                        title: "编辑数据",
                        width: 600,
                        height: 300,
                        onload: function () {
                            var iframe = this.getIFrameEl();
                            var data = {pageType:"edit",record:{wmsinventorydetail:row}};
                            //直接从页面获取,不用去后台获取
                            iframe.contentWindow.setFormData(data);
                            },
                            ondestroy: function (action) {
                                grid.reload();
                            }
                            });
                        } else {
                            nui.alert("请选中一条记录","提示");
                        }
                    }
        // 映射任务类型字典
        var inventoryStatusDict = {
            "some": "有货",
            "lock": "锁定",
            "empty":"空闲"
        };
        // 任务类型渲染器
        function inventoryStatusRenderer(e) {
            return inventoryStatusDict[e.value] || e.value;
        }
        
        
        
        
        
        
        
        //空容器出库
        function emptyOut(){
                   nui.open({
                   url: "SelectGridWindow.jsp",
                   title: "空容器出库", width: 700, height: 400,
                   onload: function () {},
                   ondestroy: function (action) {//弹出页面关闭前
                   if(action=="saveSuccess"){
                       grid.reload();
                   }
               }
               });}
        
        
        
        
                    //删除
                    function remove(){
                        var rows = grid.getSelecteds();
                        if(rows.length > 0){
                            nui.confirm("确定删除选中记录?","系统提示",
                            function(action){
                                if(action=="ok"){
                                    var json = nui.encode({wmsinventorydetails:rows});
                                    grid.loading("正在删除中,请稍等...");
                                    $.ajax({
                                        url:"com.huaheng.wms.wmsinventorydetailbiz.deleteWmsInventoryDetails.biz.ext",
                                        type:'POST',
                                        data:json,
                                        cache: false,
                                        contentType:'text/json',
                                        success:function(text){
                                            var returnJson = nui.decode(text);
                                            if(returnJson.exception == null){
                                                grid.reload();
                                                nui.alert("删除成功", "系统提示", function(action){
                                                    });
                                                }else{
                                                    grid.unmask();
                                                    nui.alert("删除失败", "系统提示");
                                                }
                                            }
                                            });
                                        }
                                        });
                                    }else{
                                        nui.alert("请选中一条记录!");
                                    }
                                }

                                //重新刷新页面
                                function refresh(){
                                    var form = new  nui.Form("#form1");
                                    var json = form.getData(false,false);
                                    grid.load(json);//grid查询
                                    nui.get("update").enable();
                                }

                                //查询
                                function search() {
                                    var form = new nui.Form("#form1");
                                    var json = form.getData(false,false);
                                    grid.load(json);//grid查询
                                }

                                //重置查询条件
                                function reset(){
                                    var form = new nui.Form("#form1");//将普通form转为nui的form
                                    form.reset();
                                }

                                //enter键触发查询
                                function onKeyEnter(e) {
                                    search();
                                }

                                //当选择列时
                                function selectionChanged(){
                                    var rows = grid.getSelecteds();
                                    if(rows.length>1){
                                        nui.get("update").disable();
                                    }else{
                                        nui.get("update").enable();
                                    }
                                }
                            </script>
                        </body>
                    </html>