| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300 |
- <%@ page contentType="text/html;charset=GBK"%>
- <%@ taglib uri="/WEB-INF/tlds/author.tld" prefix="h"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <HEAD>
- <TITLE>存货管理(用于成品配货,选择货物信息)</TITLE>
- <script type=text/javascript src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.5.2.min.js"></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 type="text/javascript" src="/shares/js/yw/erp2/finishproduct/productTypeTree.js"></script>
- <link href="./liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css"></link>
- <script src="./liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
- <script src="./liger/lib/ligerUI/js/plugins/ligerLayout.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
- <script type="text/javascript">
- var pidArr = new Array();
- var rows = new Array(); // 先声明一维
- $(function() {
- $("#layout1").ligerLayout({
- leftWidth : 250,
- height : '99%'
- });
- });
- function addProduct() {
- var selectProductType = $("#selectProductType").val();
- if (selectProductType == "1") {
- alert("根目录无法上传存货!");
- return;
- }
- window.parent.f_addTab('addProduct', '新增存货',
- 'productMgrAction.do?task=toEditProduct&ptype_id='
- + selectProductType + '&tabid=' + getCurrentTabId());
- }
- function editProduct(product_id) {
- window.parent.f_addTab('editProduct', '编辑存货',
- 'productMgrAction.do?task=toEditProduct&product_id='
- + product_id + '&tabid=' + getCurrentTabId());
- }
- function viewProduct(product_id) {
- window.parent.f_addTab('viewProduct', '查看存货',
- 'productMgrAction.do?task=viewProduct&product_id=' + product_id
- + '&tabid=' + getCurrentTabId());
- }
- function delProduct(product_id) {
- var selectProductType = $("#selectProductType").val();
- if (confirm("确定要删除吗?")) {
- $.ajax({
- type : "POST",
- url : "productMgrAction.do?task=delProduct",
- data : {
- "product_id" : product_id
- },
- timeout : 10000,
- cache : false,
- dataType : "json",
- success : function(data) {
- var success = data.success;
- if (success != undefined) {
- if (success == 1) {
- $.ligerDialog.success("删除成功。");
- } else if (success == 0) {
- $.ligerDialog.error("删除失败。");
- } else if (success == 3) {
- $.ligerDialog.warn("有库存不能删除!");
- }
- } else {
- showAjaxError(null, data.error);
- }
- loadProductList();
- },
- error : showAjaxError
- });
- }
- }
- function f_reload() {
- var manager = $("#productGrid").ligerGetGridManager();
- manager.loadData();
- }
- var grid = null;
- function loadProductList(params) {
- var selectProductType = document.getElementById("selectProductType").value;
- var columns = [ {
- display : '存货编码',
- name : 'product_num',
- width : 120
- }, {
- display : '存货名称',
- name : 'product_name',
- width : 120
- }, {
- display : '存货分类',
- name : 'product_ptype_name',
- width : 120
- }, {
- display : '规格型号',
- name : 'product_standard_all',
- width : 120,
- render : function(row) {
- return row.product_standard + row.product_mode;
- }
- }, {
- display : '序列管理',
- name : 'product_is_serial_name',
- render : function(row) {
- if (row.product_is_serial == "0") {
- return "<font color='green'>"+row.product_is_serial_name+"</font>";
- } else if (row.product_is_serial == "1") {
- return "<font color='blue'>"+row.product_is_serial_name+"</font>";
- }
- }
- } ];
- if ("${requestScope.depot_id}" != "") {
- columns.push({
- display : '库存数量',
- name : 'sockt_count'
- });
- }
- grid = $("#productGrid")
- .ligerGrid(
- {
- columns : columns,
- pageSize : 20,
- pageSizeOptions :[20,30,40,50],
- url : 'productMgrLookup.do?task=productLookupPackingList&depot_id=${requestScope.depot_id}&location_id=${requestScope.location_id}&ptype_id='
- + selectProductType
- +'&type=${type}'
- + '&time='
- + new Date().getTime() + params,
- pageParmName : 'p', //页索引参数名,(提交给服务器)
- pagesizeParmName : 'pSize', //页记录数参数名,(提交给服务器)
- width : '99.9%',
- height : '99.4%',
- checkbox : true,
- isChecked : f_isChecked,
- onCheckRow : f_onCheckRow,
- onCheckAllRow : f_onCheckAllRow
- });
- $("#pageloading").hide();
- if ("${checkbox}" == 'false' || "${checkbox}" == '') {
- $(".l-grid-hd-cell-btn-checkbox").css("display", "none"); //隱藏checkAll
- }
- }
- function f_select() {
- // return grid.getCheckedRows();
- return rows;
- }
- function f_isChecked(rowdata) {
- for ( var i = 0; i < pidArr.length; i++) {
- if (rowdata.product_id == pidArr[i]) {
- rows.push(rowdata);
- return true;
- }
- }
- return false;
- }
- function f_onCheckRow(checked, rowdata, rowindex) {
- if (checked) { //判断是否选中该行
- if(inArray(rowdata.product_id, pidArr)<0){ //判断数组中是否存在该数组
- pidArr.push(rowdata.product_id); //不存在添加
- rows.push(rowdata);
- }
- }else{
- if(inArray(rowdata.product_id, pidArr)>=0){
- pidArr.splice(inArray(rowdata.product_id, pidArr),1);//存在删除
- rows.splice(inArray(rowdata, rows),1);//存在删除
- }
- }
- }
- function f_onCheckAllRow(checked, grid) {
- for (var rowid in this.records){
- if (checked) { //判断是否选中该行
- if(inArray(this.records[rowid].product_id, pidArr)<0){ //判断数组中是否存在该数组
- pidArr.push(this.records[rowid].product_id); //不存在添加
- rows.push(this.records[rowid]);
- }
- }else{
- if(inArray(this.records[rowid].product_id, pidArr)>=0){
- pidArr.splice(inArray(this.records[rowid].product_id, pidArr),1);//存在删除
- rows.splice(inArray(this.records[rowid], rows),1);//存在删除
- }
- }
- }
- }
- //查询
- function searchByKword() {
- var product_num = $("#product_num").val();
- var s = "";
- if (product_num != "" && typeof (product_num) != "undefined") {
- s += "&product_num=" + encodeURI(encodeURI(product_num));
- }
- var product_name = $("#product_name").val();
- if (product_name != "" && typeof (product_name) != "undefined") {
- s += "&product_name=" + encodeURI(encodeURI(product_name));
- }
- var gridManager = $("#productGrid").ligerGetGridManager();
- if(gridManager)
- gridManager.setOptions({newPage:1});
- loadProductList(s);
- }
-
- //新增存货关闭弹出层
- function addProductTop() {
- var selectProductType = $("#selectProductType").val();
- if (selectProductType == "1") {
- alert("根目录无法新增存货!");
- return;
- }
- window.parent.f_addTab('addProduct', '新增存货',
- 'productMgrAction.do?task=toEditProduct&ptype_id='
- + selectProductType + '&tabid=' + getCurrentTabId());
- window.parent.$(".l-dialog,.l-window-mask").remove(); //关闭弹出层
- }
- </script>
- <style type="text/css">
- body {
- padding: 5px;
- margin: 0;
- }
- #layout1 {
- width: 99.5%;
- margin: 0;
- padding: 0;
- }
- .l-button {
- margin-left: 1px;
- }
- .l-layout-left {
- overflow-y: auto;
- }
- </style>
- </HEAD>
- <BODY>
- <%@ include file="/include/button.jsp"%>
- <%@ include file="/include/message.jsp"%>
- <div class="l-content">
- <form name="userRoleForm" method="post">
- <input type="hidden" name="type" id="type" value="${type}"/>
- <input type="hidden" name="selectProductType" id="selectProductType" />
- <div id="layout1">
- <div position="left" title="存货类别" class="user-tree-style">
- <ul id="productTypeTree" class="tree" style="margin-top: 3px;">
- </div>
- <c:if test="${empty requestScope.depot_id}">
- <div position="center" id="center" title="存货列表">
- </c:if>
- <c:if test="${!empty requestScope.depot_id}">
- <div position="center" id="center" title="存货列表(${requestScope.depot_name })">
- </c:if>
- <%-- <h:isAuthor key="/productMgrAction?task=taskDoEditProduct"> --%>
- <!-- <div id="deptBtn" style="text-align:left;"> -->
- <!-- <input type="button" value="新增" class="l-button" onclick="addProductTop();" id="addProductBtn" /> -->
- <!-- </div> -->
- <%-- </h:isAuthor> --%>
- <div class="default_search" style="margin: 0;">
- <ul style="float: left;">
- <li style="float: left; height: 25px; line-height: 25px; margin: 0; padding-top: 2px;">存货编码:</li>
- <li style="float: left; height: 25px; line-height: 25px; margin: 0; padding-top: 2px;">
- <input type="text" name="product_num" id="product_num" />
- </li>
- </ul>
- <ul style=" float: left;">
- <li style="float: left; height: 25px; line-height: 25px; margin: 0; padding-top: 2px;">存货名称:</li>
- <li style="float: left; height: 25px; line-height: 25px; margin: 0; padding-top: 2px;">
- <input type="text" name="product_name" id="product_name" />
- </li>
- </ul>
- <ul style="float: left;">
- <li style="float: left; height: 25px; line-height: 25px; margin: 0; padding-top: 2px;">
- <input type="button" class='l-button' name="search" onclick="searchByKword()" value="查询" />
- </li>
- </ul>
- </div>
- <div style="overflow: hidden; clear: both;">
- <div id="productGrid" style="margin: 0; padding: 0"></div>
- </div>
- </div>
- </div>
- </form>
- </div>
- </BODY>
- </HTML>
|