| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283 |
- <%@ 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>
- <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerDialog.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 type="text/javascript">
- var grid = null;
- var checkValue = new Array(); //定义一个数组
- var i = 0;
- function initSupplierGridList(params) {
- var checkbox = false;
- if ("${checkbox}" == 'false' || "${checkbox}" == '') {
- checkbox = false;
- } else {
- checkbox = true;
- }
- var columns = [
- {
- display : '供应商编号',
- name : 'sno',
- width : 120
- }, {
- display : '供应商全称',
- name : 'sname',
- width : 300
- }, {
- display : '联系人',
- name : 'slinkman',
- width : 100
- }, {
- display : '创建时间',
- name : 'createdate',
- width : 180
- } ];
- if ("${requestScope.lookup }" == "") {
- columns.push({
- display : '操作',
- isAllowHide : false,
- width : 200,
- render : function(row) {
- var html = '<a href=\"#\" onclick=\"addSuppilerProduct('
- + row.sid +');\">供货产品</a> ';
- //html += '<a href=\"#\" onclick=\"viewSuppilerProduct('
- //+ row.sid + ');\">供货明细</a> ';
- html += '<a href=\"#\" onclick=\"viewSuppiler('
- + row.sid + ');\">查看</a> ';
- html += '<a href=\"#\" onclick=\"editSuppiler('
- + row.sid+');\">编辑</a> ';
- html += '<a href=\"#\" onclick=\"deleteRow('
- + row.sid + ');\">删除</a> ';
- return html;
- }
- });
- }
- grid = $("#maingrid4").ligerGrid(
- {
- columns : columns,
- pageSize : 20,
- url : 'SupplierAction.do?task=list&lookup=${lookup}&time='
- + new Date().getTime() + params,
- pageParmName : 'p', //页索引参数名,(提交给服务器)
- pagesizeParmName : 'pSize', //页记录数参数名,(提交给服务器)
- width : '99.9%',
- height : '99.3%',
- checkbox : checkbox,
- isChecked: f_isChecked,
- onCheckRow: function(checked, rowdata, rowindex) {
- for (var rowid in this.records){
- this.unselect(rowid);
- }
- if(checked){
- this.select(rowindex);
- }else{
- this.unselect(rowindex);
- }
- }
- });
- $("#pageloading").hide();
- $(".l-grid-hd-cell-btn-checkbox").css("display", "none"); //隱藏checkAll
- }
-
-
- //默认选中
- function f_isChecked(rowdata){
- if(checkValue != "" && typeof (checkValue) != "undefined"){
- if(checkValue[i]==rowdata.sid){
- i++;
- return true;
- }
- return false;
- }
- }
-
- $(function() {
- if('${checkValue}' != "" && typeof ('${checkValue}') != "undefined"){
- checkValue = '${checkValue}'.split(",");
- }
- initSupplierGridList();
- });
-
- function searchByKword() {
- var s = "";
- var sno = $("#sno").val();
- if (sno != "" && typeof (sno) != "undefined") {
- s += "&sno=" + encodeURI(encodeURI(sno));
- }
- var sname = $("#sname").val();
- if (sname != "" && typeof (sname) != "undefined") {
- s += "&sname=" + encodeURI(encodeURI(sname));
- }
- var stype = $("#stype").val();
- if (stype != "" && typeof (stype) != "undefined") {
- s += "&stype=" + encodeURI(encodeURI(stype));
- }
- var bill_type = $("#bill_type").val();
- if (bill_type != "" && typeof (bill_type) != "undefined") {
- s += "&bill_type=" + encodeURI(encodeURI(bill_type));
- }
- grid.set("newPage","1");
- $(function() {
- initSupplierGridList(s);
- });
- }
- // wzf start 2015-1-23
- function autoSearch(par1,par2){
- var s = "";
- var sno ="";
- if (par1!= "" && typeof ( par1) != "undefined"){
- sno = par1;
- }else{
- sno = $("#sno").val();
- }
-
- if (sno != "" && typeof (sno) != "undefined") {
- s += "&sno=" + encodeURI(encodeURI(sno));
- }
- var sname = "";
- if (par2!= "" && typeof (par2) != "undefined"){
- sname = par2;
- }else{
- sname = $("#sname").val();
- }
-
- if (sname != "" && typeof (sname) != "undefined") {
- s += "&sname=" + encodeURI(encodeURI(sname));
- }
- grid.set("newPage","1");
- $(function() {
- initSupplierGridList(s);
- });
- }
- // wzf start 2015-1-23
- function f_select() {
- var rows = grid.getCheckedRows();
- return rows;
- }
- // 导入
- var importDlg;
- function importExcel(){
- var type="supplier";
- importDlg = $.ligerDialog.open({
- height: 120,
- width:440,
- url: 'initStockAction.do?task=toImport&type='+type,
- allowClose:false,
- title:'导入供应商',
- buttons : [ {
- text : '导入',
- onclick : function(item,dialog){
- dialog.frame.importExcel(window);
- }
- },{
- text : '关闭',
- onclick : function(item,dialog){
- importDlg.close();
- grid.loadData();
- }
- }]
- });
- }
-
- //新增供应货物
- function addSuppilerProduct(universalid){
- addTab('addSuppilerProduct' + getCurrentTabId(), '新增供应货物', '${pageContext.request.contextPath }/SupplierAction.do?task=toAddSupplyProduct&sid='
- + universalid + '&tabid=' + getCurrentTabId(),true,true);
- }
-
- function viewSuppilerProduct(universalid){
- addTab('viewSuppilerProduct' + getCurrentTabId(), '供货明细', '${pageContext.request.contextPath }/SupplierAction.do?task=infoSupplyProduct&sid='
- + universalid + '&tabid=' + getCurrentTabId(),true,true);
- }
-
-
- //查看供应商
- function viewSuppiler(universalid){
- addTab('viewSuppiler' + getCurrentTabId(), '查看供应商', '${pageContext.request.contextPath }/SupplierAction.do?task=info&sid='
- + universalid + '&tabid=' + getCurrentTabId(),true,true);
- }
- //编辑供应商
- function editSuppiler(universalid){
- addTab('editSuppiler' + getCurrentTabId(), '编辑供应商', '${pageContext.request.contextPath }/SupplierAction.do?task=toEdit&sid='
- + universalid + '&tabid=' + getCurrentTabId(),true,true);
- }
-
- //删除供应商
- function deleteRow(universalid){
- if (window.confirm("确定要删除吗?")){
- addTab('delSuppiler' + getCurrentTabId(), '删除供应商', '${pageContext.request.contextPath }/SupplierAction.do?task=del&sid='
- + universalid + '&tabid=' + getCurrentTabId(),true,true);
- }
- }
- </script>
- </head>
- <body>
- <%@ include file="/include/message.jsp"%>
- <div class="container">
- <c:if test="${requestScope.lookup == null or requestScope.looup == '' }">
- <div id="title" class="form-button">
- <input type="button" class="l-button" value="新增供应商" onclick="addTab('addSupplier'+getCurrentTabId(), '新增供应商', '${pageContext.request.contextPath }/SupplierAction.do?task=toCreate&tabid=' + getCurrentTabId(),true,true);"/>
- <input type="button" class="l-button" value="导入供应商" onclick="importExcel()" />
- </div>
- <div class="default_search" style="margin: 0; height:30px;"></div>
- </c:if>
- <div class="default_search" style="margin: 0;">
- <ul class="list_search">
- <li class="title">供应商编号:</li>
- <li class="text"><input type="text" name="sno" id="sno" onkeyup="autoSearch(this.value,'')" onchange="autoSearch('','')"></li>
- </ul>
- <ul class="list_search">
- <li class="title">供应商全称:</li>
- <li class="text"><input type="text" name="sname" id="sname" onkeyup="autoSearch('',this.value)" onchange="autoSearch('','')"></li>
- </ul>
-
- <ul class="list_search" >
- <li class="title">供应商类别:</li>
- <li class="text">
- <select id="stype" name="stype" class="short-text">
- <option value="" selected="selected">--请选择--</option>
- <c:forEach items="${requestScope.stype}" var="stype">
- <option value="${stype.dvalue }">${stype.dname }</option>
- </c:forEach>
- </select>
- </li>
- </ul>
- <ul class="list_search">
- <li class="title">发票类型:</li>
- <li class="text">
- <select id="bill_type" name="bill_type" class="short-text">
- <option value="" selected="selected">--请选择--</option>
- <c:forEach items="${requestScope.bill_type}" var="bill_type">
- <option value="${bill_type.dvalue }">${bill_type.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 style="clear:both;"></div>
- <div id="searchbar">
- <div style="overflow: hidden;clear: both;">
- <div id="maingrid4" style="margin: 0; padding: 0"></div>
- </div>
- </div>
- </div>
- </body>
- </html>
|