| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404 |
- <%@ page language="java" contentType="text/html;charset=GBK"
- pageEncoding="GBK"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html;charset=GBK">
- <title>仓库列表</title>
- <link
- href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css"
- rel="stylesheet" type="text/css" />
- <script
- src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js"
- type="text/javascript"></script>
- <script
- src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js"
- type="text/javascript"></script>
- <script
- src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerGrid.js"
- type="text/javascript"></script>
- <link href="${pageContext.request.contextPath}/main.css"
- rel="stylesheet" type="text/css" />
- <script type="text/javascript" src="/shares/js/constant.js"></script>
- <script type="text/javascript" src="/shares/js/common.js"></script>
- <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
- <script type="text/javascript">
- var grid = null;
- function loadDepotList(params) {
- var checkbox = false;
- if ("${checkbox}" == 'false' || "${checkbox}" == '') {
- checkbox = false;
- } else {
- checkbox = true;
- }
- var columns = [
- // { display: '序号', name: 'sordernum', width: 100 },
- {
- display : '仓库编号',
- name : 'depot_num',
- width : 120
- }, {
- display : '仓库名称',
- name : 'depot_name',
- width : 320
- }, {
- display : '仓库管理员',
- name : 'depot_keeper_name',
- width : 100
- }, {
- display : '仓库类型',
- name : 'depot_type',
- width : 100,
- render : function (row){
- // alert(row.apply_status_name);
- if(row.depot_type=='D')
- return "仓库";
- if(row.depot_type=='G')
- return "货场";
- if(row.depot_type=='W')
- return "车间";
- }
- },
- /*{
- display : '是否设置库位',
- name : 'depot_isset_area_name',
- width : 100
- },*/
- {
- display : '仓库状态',
- name : 'depot_status_name',
- width : 100
- } ];
- if ("${requestScope.lookup }" == "") {
- columns
- .push({
- display : '操作',
- isAllowHide : false,
- width:120,
- render : function(row) {
- var html = "";
- if(row.depot_status == 'unuse'){
- html += '<a href=\"#\" onclick=\"startDepot('+ row.depot_id+',\''+ row.depot_isset_area + '\')\">启用</a> ';
- html += '<a href=\"#\" onclick=\"addTab(\'editDepot\'+getCurrentTabId(), \'修改仓库信息\', \'${pageContext.request.contextPath }/depotAction.do?task=toEditDepot&depot_id='
- + row.depot_id
- + '&tabid='
- + getCurrentTabId() + '\',true,true);\">编辑</a> ';
- html += '<a href=\"#\" onclick=\"delDepot('+ row.depot_id + ')\">删除</a> ';
- }
- if(row.depot_status == 'onuse'){
- html += '<a href=\"#\" onclick=\"stopDepot('+ row.depot_id + ')\">停用</a> ';
- }
- return html;
- }
- });
- }
- grid = $("#maingrid4")
- .ligerGrid(
- {
- columns : columns,
- pageSize : 20,
- url : 'depotAction.do?task=getDepotList&lookup=${lookup}&time='
- + new Date().getTime() + params,
- pageParmName : 'p', //页索引参数名,(提交给服务器)
- pagesizeParmName : 'pSize', //页记录数参数名,(提交给服务器)
- width : '99.9%',
- height : '99%',
- checkbox : checkbox
- });
- $("#pageloading").hide();
- }
- $(function() {
- loadDepotList();
- });
- function searchByKword() {
- var depot_num = document.getElementById("depot_num");//仓库编号
- var depot_name = document.getElementById("depot_name");//仓库编号
- var depot_type = document.getElementById("depot_type");//仓库类型
-
- var s = "";
- if (depot_num.value != "" && typeof (depot_num.value) != "undefined") {
- s += "&depot_num=" + encodeURI(encodeURI(depot_num.value));
- }
- if (depot_name.value != "" && typeof (depot_name.value) != "undefined") {
- s += "&depot_name=" + encodeURI(encodeURI(depot_name.value));
- }
- if (depot_type.value != "" && typeof (depot_type.value) != "undefined") {
- s += "&depot_type=" + depot_type.value;
- }
- $(function() {
- loadDepotList(s);
- });
- }
- function f_select() {
- var rows = grid.getCheckedRows();
- return rows;
- }
-
- function addDepot(){
- addTab('addDepot'+getCurrentTabId(), '新增仓库', 'depotAction.do?task=toEditDepot&tabid=' + getCurrentTabId(),true,true);
- }
-
- function delDepot(depot_id) {
- if (confirm("确定要删除吗?")) {
- /* $.ajax({
- type : "POST",
- url : "depotAction.do?task=queryLocNPro",
- data : {
- "depot_id" : depot_id
- },
- timeout : 10000,
- cache : false,
- dataType : "json",
- success:function(msg){
- if(msg > 0){
- if (confirm("仓库中还有在用库位,是否确认删除?")) {
- $.ajax({
- type : "POST",
- url : "depotAction.do?task=doDelDepot",
- data : {
- "depot_id" : depot_id
- },
- timeout : 10000,
- cache : false,
- dataType : "json",
- success : function(data) {
- var success = data.success;
- if (success != undefined) {
- $.ligerDialog.success("删除成功");
- } else {
- showAjaxError(null, data.error);
- }
- loadDepotList();
- },
- error : showAjaxError
- });
- }
- }else{
- $.ajax({
- type : "POST",
- url : "depotAction.do?task=doDelDepot",
- data : {
- "depot_id" : depot_id
- },
- timeout : 10000,
- cache : false,
- dataType : "json",
- success : function(data) {
- var success = data.success;
- if (success != undefined) {
- $.ligerDialog.success("删除成功");
- } else {
- showAjaxError(null, data.error);
- }
- loadDepotList();
- },
- error : showAjaxError
- });
- }
- },
- error : showAjaxError
- });
- */
- $.ajax({
- type : "POST",
- url : "depotAction.do?task=queryInNOut",
- data : {
- "depot_id" : depot_id
- },
- timeout : 10000,
- cache : false,
- dataType : "json",
- success:function(msg){
- if(msg > 0){
- addError("该仓库有过出入库操作,不允许删除!");
- }else{
- $.ajax({
- type : "POST",
- url : "depotAction.do?task=doDelDepot",
- data : {
- "depot_id" : depot_id
- },
- timeout : 10000,
- cache : false,
- dataType : "json",
- success : function(data) {
- var success = data.success;
- if (success != undefined) {
- $.ligerDialog.success("删除成功");
- } else {
- showAjaxError(null, data.error);
- }
- loadDepotList();
- },
- error : showAjaxError
- });
- }
- },
- error : showAjaxError
- });
- }
-
- }
- function stopDepot(depot_id) {
- if (confirm("确定要停用吗?")) {
- $.ajax({
- type : "POST",
- url : "depotAction.do?task=queryPro&depot_id="+depot_id,
- data : "",
- timeout : 10000,
- cache : false,
- //dataType : "json",
- success:function(msg){
- if(msg > 0){
- addError("该仓库还有存货,不允许停用!");
- }else{
- $.ajax({
- type : "POST",
- url : "depotAction.do?task=stopDepot",
- data : {
- "depot_id" : depot_id
- },
- timeout : 10000,
- cache : false,
- //dataType : "json",
- success : function(data) {
- if (data > 0) {
- $.ligerDialog.success("停用成功!");
- } else {
- addError("停用失败!");
- }
- loadDepotList();
- },
- error : showAjaxError
- });
- }
- },
- error : showAjaxError
- });
- }
- }
- function startDepot(depot_id,depot_isset_area) {
- if (confirm("确定要启用吗?")) {
- if(depot_isset_area == "yes"){
- $.ajax({
- type : "POST",
- url : "depotAction.do?task=queryLocNPro",
- data : {
- "depot_id" : depot_id
- },
- timeout : 10000,
- cache : false,
- dataType : "json",
- success:function(msg){
- if(msg <= 0){
- addError("该仓库已设置库位,但未添加库位或库位未启用,无法启用仓库!");
- }else{
- $.ajax({
- type : "POST",
- url : "depotAction.do?task=startDepot",
- data : {
- "depot_id" : depot_id
- },
- timeout : 10000,
- cache : false,
- dataType : "json",
- success : function(data) {
- if (data > 0) {
- $.ligerDialog.success("启用成功!");
- } else {
- addError("启用失败!");
- }
- loadDepotList();
- },
- error : showAjaxError
- });
- }
- },
- error : showAjaxError
- });
- }else{
- $.ajax({
- type : "POST",
- url : "depotAction.do?task=startDepot",
- data : {
- "depot_id" : depot_id
- },
- timeout : 10000,
- cache : false,
- dataType : "json",
- success : function(data) {
- if (data > 0) {
- $.ligerDialog.success("启用成功!");
- } else {
- addError("启用失败!");
- }
- loadDepotList();
- },
- error : showAjaxError
- });
- }
-
- }
- }
- </script>
- <style type="text/css">
- #deptBtn2 {
- width: 100%;
- background: #eef7fe;
- height: 35px;
- padding-top: 3px
- }
- </style>
- </head>
- <body>
- <%@ include file="/include/message.jsp"%>
- <div class="container-layout">
- <div id="deptBtn2" class="form-button">
- <input type="button" value="新增" class="l-button" onclick="addDepot();" id="addDepotBtn">
- </div>
- <div class="default_search" style="margin: 0;">
- <ul class="list_search">
- <li class="title">仓库编号:</li>
- <li class="text"><input type="text" name="depot_num" id="depot_num">
- </li>
- </ul>
- <ul class="list_search">
- <li class="title">仓库名称:</li>
- <li class="text"><input type="text" name="depot_name" id="depot_name">
- </li>
- </ul>
- <ul class="list_search">
- <li class="title">仓库类型:</li>
- <li class="text">
- <select id="depot_type" name="depot_type" style="width:160px;">
- <option value="" selected="selected">-请选择-</option>
- <c:forEach items="${depotTypeList}" var="item">
- <option
- <c:if test="${item.dvalue eq requestScope.depot.depot_type}">
- selected="selected"
- </c:if>
- value="${item.dvalue }" >
- ${item.dname }
- </option>
- </c:forEach>
- </select>
- </li>
- </ul>
- <ul>
- <li class="search-button"><input type="button" class='l-button'
- name="search" onclick="searchByKword()" value="查询" /></li>
- </ul>
- </div>
- <div id="searchbar">
- <div style="overflow: hidden; clear: both;">
- <div id="maingrid4" style="margin: 0; padding: 0"></div>
- </div>
- </div>
- </div>
- </body>
- </html>
|