| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243 |
- <%@ page contentType="text/html;charset=GBK"%>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
- <!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}/js/jquery-1.3.2.min.js"></SCRIPT>
- <link href="main.css" rel="stylesheet" type="text/css"></link>
- <script type="text/javascript" src="js/lr-page.js"></script>
- <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/erp/deviceTypeTree.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 src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerMenu.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath}/ligerlib/ligerUI/js/plugins/ligerMenuBar.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath}/ligerlib/ligerUI/js/plugins/ligerToolBar.js" type="text/javascript"></script>
-
- <script type="text/javascript">
- var menu1 = { items:
- [
- { text: '打印设备台帐', click: toPrintPage },
- { text: '打印设备条码', click: toPrintDevBarcode },
- // { line: true },
- { text: '打印设备卡片', click: itemclick }
- ]
- };
-
- function itemclick(item)
- {
- alert(item.text);
- }
-
- function toPrintPage(){
- var selectDeviceType = $("#selectDeviceType").val();
- window.open("deviceMgrAction.do?task=toPrintDeviceList&d_type_id="
- + selectDeviceType + '&tabid=' + getCurrentTabId(),"printDeviceList");
- }
- function toPrintDevBarcode(){
- var selectDeviceType = $("#selectDeviceType").val();
- window.open("deviceMgrAction.do?task=toPrintDevBarcode&d_type_id="
- + selectDeviceType + '&tabid=' + getCurrentTabId(),"printDeviceBarcode");
- }
- $(function() {
- $("#layout1").ligerLayout({
- leftWidth : 250,
- height : '99%'
- });
- $("#topmenu").ligerMenuBar({ items: [
- { text: '增加', click: addDevice , icon:'add'},
- {
- text : '打印',
- menu : menu1
- } ]
- });
- });
- function addDevice() {
- var selectDeviceType = $("#selectDeviceType").val();
- if (selectDeviceType == "1") {
- alert("根目录无法上传设备!");
- return;
- }
- window.parent.f_addTab('addDevice', '新增设备',
- 'deviceMgrAction.do?task=toEditDevice&d_type_id='
- + selectDeviceType + '&tabid=' + getCurrentTabId());
- }
- function editDevice(dev_id) {
- window.parent.f_addTab('editDevice', '编辑设备',
- 'deviceMgrAction.do?task=toEditDevice&dev_id=' + dev_id
- + '&tabid=' + getCurrentTabId());
- }
- function viewDevice(dev_id) {
- window.parent.f_addTab('viewDevice', '查看设备',
- 'deviceMgrAction.do?task=viewDevice&dev_id=' + dev_id
- + '&tabid=' + getCurrentTabId());
- }
- function delDevice(dev_id) {
- var selectDeviceType = $("#selectDeviceType").val();
- if (confirm("确定要删除吗?")) {
- $.ajax({
- type : "POST",
- url : "deviceMgrAction.do?task=delDevice",
- data : {
- "dev_id" : dev_id
- },
- timeout : 10000,
- cache : false,
- dataType : "json",
- success : function(data) {
- var success = data.success;
- if (success != undefined) {
- $.ligerDialog.success("删除成功");
- } else {
- showAjaxError(null, data.error);
- }
- loadDeviceList();
- },
- error : showAjaxError
- });
- }
- }
- function f_reload() {
- var manager = $("#deviceGrid").ligerGetGridManager();
- manager.loadData();
- }
- function loadDeviceList() {
- var grid = null;
- var selectDeviceType = document.getElementById("selectDeviceType").value;
- grid = $("#deviceGrid")
- .ligerGrid(
- {
- columns : [
- {
- display : '${customDevice.dev_code }',
- name : 'dev_code',
- width : 120
- },
- {
- display : '${customDevice.dev_name }',
- name : 'dev_name',
- width : 120
- },
- {
- display : '${customDevice.dev_type_name }',
- name : 'dev_type_name',
- width : 120
- },
- {
- display : '${customDevice.dev_brand }',
- name : 'dev_brand',
- width : 120
- },
- {
- display : '${customDevice.dev_model }',
- name : 'dev_model',
- width : 120
- },
- {
- display : '操作',
- isAllowHide : false,
- render : function(row) {
- var html = '<a href=\"#\" onclick=\"viewDevice('
- + row.dev_id
- + ')\">查看</a> ';
- html += '<a href=\"#\" onclick=\"editDevice('
- + row.dev_id
- + ')\">编辑</a> ';
- html += '<a href=\"#\" onclick=\"delDevice('
- + row.dev_id
- + ')\">删除</a> ';
- return html;
- }
- } ],
- pageSize : 20,
- url : 'deviceMgrAction.do?task=deviceList&d_type_id='
- + selectDeviceType
- + '&time='
- + new Date().getTime(),
- pageParmName : 'p', //页索引参数名,(提交给服务器)
- pagesizeParmName : 'pSize', //页记录数参数名,(提交给服务器)
- width : '99.9%',
- height : '99.9%'
- });
- $("#pageloading").hide();
- }
- </script>
- <style type="text/css">
- body {
- padding: 5px;
- margin: 0;
- }
- #layout1 {
- width: 100%;
- margin: 0;
- padding: 0;
- }
- .l-button {
- margin-left: 1px;
- }
- #deptBtn {
- width: 100%;
- background: #e5ecf9;
- text-align: center;
- height: 25px;
- padding-top: 3px
- }
- .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="selectDeviceType" id="selectDeviceType" />
- <div id="layout1">
- <div position="left" title="设备类别" class="user-tree-style">
- <div id="deptBtn">
- <input type="button" value="新增" class="l-button" onclick="addDeviceType()" id="addDeviceTypeBtn" />
- <input type="button" value="修改" class="l-button" onclick="editDeviceType()" id="editDeviceTypeBtn" />
- <input type="button" value="删除" class="l-button" onclick="delDeviceType()" id="delDeviceTypeBtn" />
- </div>
- <ul id="deviceTypeTree" class="tree" style="margin-top: 3px;">
- </div>
- <div position="center" id="center" title="设备列表">
- <div id="topmenu"></div>
- <!-- <div id="deptBtn" style="text-align:left;"> -->
- <!-- <input type="button" value="新增" class="l-button" onclick="addDevice();" id="addDeviceBtn"> -->
- <!-- </div> -->
- <div id="deviceGrid" style="margin:0; padding:0"></div>
- </div>
- </div>
- </form>
- </div>
- </BODY>
- </HTML>
|