| <!DOCTYPE HTML> | 
| <html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> | 
| <head> | 
|     <meta charset="utf-8"> | 
|     <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> | 
|     <meta name="renderer" content="webkit|ie-comp|ie-stand"> | 
|     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | 
|     <meta name="viewport" | 
|           content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> | 
|     <meta http-equiv="Cache-Control" content="no-siteapp"/> | 
|     <!-- 本框架基本脚本和样式 --> | 
|     <script type="text/javascript" | 
|             th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> | 
|     <script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> | 
|   | 
| </head> | 
| <body class=" container-fluid"> | 
| <div class="pd-10"> | 
|     <!-- 搜索框部分start --> | 
|     <div class="row form-head"> | 
|         <form class="form-inline" id="serchform"> | 
|             <div class="form-group mr-20"> | 
|                 <label for="instoreType">入库单类型</label> | 
|                 <select class="form-control autoFull" name="instoreType" id="instoreType" | 
|                         data-filed="value" | 
|                         data-value="value" | 
|                         th:data-url="@{/admin/customerDictionary/getListByParentCode/RKLX}" | 
|                        > | 
|                     <option value=''>--请选择入库类型--</option> | 
|                 </select> | 
|             </div> | 
|             <div class="form-group mr-20"> | 
|                 <label>往来单位</label> | 
|                 <select class="form-control autoFull" name="supplierId" id="supplierId" | 
|                         data-filed="supplName" | 
|                         th:data-url="@{/admin/supplier/all}"> | 
|                     <option value=''>--请选择供应--</option> | 
|                 </select> | 
|             </div> | 
|   | 
|             <div class="form-group mr-20"> | 
|                 <select class="form-control" name="checkStatus" id="checkStatus"> | 
|                     <option value=''>--请选择审核状态--</option> | 
|                     <option value='待审核'>待审核</option> | 
|                     <option value='审核通过'>审核通过</option> | 
|                     <option value='审核未通过'>审核未通过</option> | 
|                 </select> | 
|             </div> | 
|   | 
|             <div class="form-group mr-20"> | 
|                 <label>创建时间</label> | 
|                 <input autocomplete="off"   name="startTime" type="text" class="form-control datetimepicker" id="beginTime">- | 
|                 <input autocomplete="off"   name="endTime" type="text" class="form-control datetimepicker" id="endTime"> | 
|             </div> | 
|   | 
|             <div class="form-group mr-20"> | 
|                 <label for="makingManId">制单人</label> | 
|                 <select class="form-control autoFull" name="makingmanId" id="makingmanId" | 
|                         data-filed="suName" | 
|                         th:data-value="suId" | 
|                         th:data-url="@{/admin/all}"> | 
|                     <option value=''>--请选择制单人--</option> | 
|                 </select> | 
|             </div> | 
|             <div class="form-group mr-20"> | 
|                 <label for="appManId">审核人</label> | 
|                 <select class="form-control autoFull" name="appmanId" id="appmanId" data-filed="suName" | 
|                         th:data-value="suId" | 
|                         th:data-url="@{/admin/all}"> | 
|                     <option value=''>--请选择审核人--</option> | 
|                 </select> | 
|             </div> | 
|             <div class="form-group"> | 
|                 <button onclick="myGrid.serchData(1)" type="button" | 
|                         class="btn btn-sm btn-info"> | 
|                     <i class="fa fa-search "></i> 搜索 | 
|                 </button> | 
|                 <button type="reset" class="btn btn-sm btn-info "> | 
|                     <i class="fa fa-refresh "></i> 重置 | 
|                 </button> | 
|             </div> | 
|         </form> | 
|     </div> | 
|     <div class="row mt-10"> | 
|         <div id="option-bar"> | 
|             <!-- 功能按钮部分 --> | 
|             <button matrix:btn="instoreInfo-add"  onclick="openAdd()" type="button" class="btn btn-info btn-sm"><i class="fa fa-plus" ></i>  新增</button> | 
|             <button  matrix:btn="instoreInfo-excelOut"  onclick="exportExcel()" type="button" class="btn btn-default btn-sm"><i class="fa fa-download"></i>导出 </button> | 
|   | 
|         </div> | 
|         <!-- 数据表格部分 --> | 
|         <table id="mgrid"> | 
|             <thead> | 
|             <tr> | 
|                 <th data-formatter="MGrid.indexfn" data-align="center" data-width="30px">序号</th> | 
|                 <th data-field="instoreId" data-sortable="true">单号</th> | 
|                 <th data-field="instoreDate" data-formatter="MGrid.getTime" data-sortable="true">创建时间</th> | 
|                 <th data-field="sumall">总价</th> | 
|                 <th data-field="makingmanName">制单人</th> | 
|                 <th data-field="appmanName">审核人</th> | 
|                 <th data-field="storeName">入库仓库</th> | 
|                 <th data-field="supplierName">往来单位</th> | 
|                 <th data-field="instoreType">入库类型</th> | 
|                 <th data-field="remark">备注</th> | 
|                 <th data-field="checkStatus">审核状态</th> | 
|                 <th data-field="appRemark">审核意见</th> | 
|                 <th data-align="center" data-width="180px" data-field="id" data-formatter="buidOperate">操作</th> | 
|             </tr> | 
|             </thead> | 
|         </table> | 
|         <!-- 数据表格部分end --> | 
|     </div> | 
| </div> | 
|   | 
| <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> | 
| <script type="text/javascript" th:inline="javascript" > | 
|   | 
|   | 
|     //定义表格对象 | 
|     var myGrid; | 
|   | 
|     $(function () { | 
|         $(".select2").select2(); | 
|         //初始化入库单属性搜索列表 | 
|         MTools.autoFullSelect(); | 
|   | 
|         //时间 | 
|         var _initParam = { | 
|             format: 'yyyy-mm-dd hh:ii', | 
|             todayBtn: true, | 
|             autoclose: true, | 
|             startView: 2, | 
|             maxView: 3, | 
|             minView: 0 | 
|         }; | 
|         MTools.ininDatetimepicker(_initParam); | 
|         //限制结束时间不小于开始时间 | 
|         var initParam = { | 
|             format: 'yyyy-mm-dd hh:ii', | 
|             todayBtn: true, | 
|             autoclose: true, | 
|             startView: 2, | 
|             maxView: 3, | 
|             minView: 0 | 
|         }; | 
|         MTools.limitStartEndTime(initParam); | 
|   | 
|   | 
|         myGrid = MGrid.initGrid({ | 
|             url: basePath + "/admin/instore/showList", | 
|             delUrl: basePath + "/admin/instore/dell", | 
|             sortName:"instoreDate", | 
|             sortOrder:"desc", | 
|         }); | 
|   | 
|   | 
|     }); | 
|   | 
|   | 
|   | 
|   | 
|   | 
|     //打开添加界面 | 
|     function openAdd() { | 
|         layer.full( | 
|             layer.open({ | 
|                 type: 2, | 
|                 title: "添加入库单", | 
|                 area: [MUI.SIZE_L, '400px'], | 
|                 content: [basePath+'/admin/instore/editForm'] | 
|             })); | 
|     } | 
|   | 
|     //打开编辑界面 | 
|     // function openEdit(id) { | 
|     //     layer.full( | 
|     //         layer.open({ | 
|     //             type: 2, | 
|     //             title: "编辑入库单", | 
|     //             area: [MUI.SIZE_L, '400px'], | 
|     //             maxmin: true, | 
|     //             content: [basePath+'/admin/instore/editForm?id=' + id] | 
|     //         })); | 
|     // } | 
|   | 
|     function openEdit(id) { | 
|         layer.full( | 
|             layer.open({ | 
|                 type: 2, | 
|                 title: "编辑入库单", | 
|                 area: [MUI.SIZE_L, '400px'], | 
|                 maxmin: true, | 
|                 content: [basePath+'/admin/redirect/hive/instore/instoreinfo-form?id=' + id] | 
|             })); | 
|     } | 
|   | 
|     function openCheck(id) { | 
|         layer.full( | 
|             layer.open({ | 
|                 type: 2, | 
|                 title: "审核入库单", | 
|                 area: [MUI.SIZE_L, '400px'], | 
|                 maxmin: true, | 
|                 content: [basePath+'/admin/instore/checkInfo?id=' + id] | 
|             })); | 
|     } | 
|   | 
|     function openLook(id) { | 
|         layer.full( | 
|             layer.open({ | 
|                 type: 2, | 
|                 title: "查看入库单", | 
|                 area: [MUI.SIZE_L, '400px'], | 
|                 maxmin: true, | 
|                 content: [basePath+'/admin/instore/lookInfo?id=' + id] | 
|             })); | 
|     } | 
|   | 
|   | 
|     //导出 | 
|         function exportExcel(){ | 
|             var instoreType = $("#instoreType").val(); | 
|             var supplierId = $("#supplierId").val(); | 
|             var checkStatus = $("#checkStatus").val(); | 
|             var makingmanId = $("#makingmanId").val(); | 
|             var beginTime=$("#beginTime").val(); | 
|             var endTime=$("#endTime").val(); | 
|             var appmanId=$("#appmanId").val(); | 
|             window.open(basePath+"/admin/instore/exportExcel?&instoreType="+encodeURI(encodeURI(instoreType))+"&supplierId="+supplierId+"&checkStatus="+encodeURI(encodeURI(checkStatus))+"&makingmanId="+makingmanId+"&startTime="+beginTime+"&endTime="+endTime+"&appmanId="+appmanId); | 
|         } | 
|   | 
|     var btns = []; | 
|     btns[0] = "", btns[1] = "",btns[2] = "",btns[3] = ""; | 
|     //构建操作栏的按钮 | 
|     function buidOperate(value, row, index) { | 
|         var html = []; | 
|         var makingmanId = row.makingmanId | 
|         var staffId =[[${session.userInfo.suId}]]; | 
|         var isSame = (makingmanId == staffId); | 
|         var checkStatus = row.checkStatus; | 
|         var html = ""; | 
|         html += btns[0].replace('VALUE', value); | 
|         //没有审核的才可以修改,审核后不可以修改,不可以在审核 | 
|         if (checkStatus == "待审核" || checkStatus == "审核未通过") { | 
|             //没有审核并且登入者是审核者才显示审核的按钮, | 
|             // if ((staffId == row.appmanId)) { | 
|             if (checkStatus == "待审核") { | 
|                 html += btns[2].replace('VALUE', value); | 
|             } | 
|             // } | 
|             if (isSame) { | 
|                 html += btns[1].replace('VALUE', value); | 
|                 html += btns[3].replace('VALUE', value); | 
|             } | 
|         } | 
|         return html; | 
|     } | 
|   | 
|   | 
| </script> | 
|   | 
| <script matrix:btn="instoreInfo-look"  > | 
|     btns[0]='<a class="text-primary " href="javascript:void(0)" onClick="openLook(\'VALUE\')" >查看</a> ' | 
| </script> | 
|   | 
| <script matrix:btn="instoreInfo-edit"  > | 
|     btns[1]='<a class="text-primary " href="javascript:void(0)" onClick="openEdit(\'VALUE\')">编辑</a> ' | 
| </script> | 
| <script matrix:btn="instoreInfo-check"  > | 
|     btns[2]='<a class="text-primary " href="javascript:void(0)" onClick="openCheck(\'VALUE\')">审核</a> ' | 
| </script> | 
| <script matrix:btn="instoreInfo-del"  > | 
|     btns[3]='<a class="text-danger " href="javascript:void(0)" onClick="myGrid.delItem(\'VALUE\')">删除</a> ' | 
| </script> | 
|   | 
|   | 
|   | 
| </body> | 
| </html> |