deviceList.jsp 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@include file="/context/mytags.jsp"%>
  3. <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  4. <div class="easyui-layout" fit="true">
  5. <div region="center" style="padding:0px;border:0px">
  6. <t:datagrid name="deviceList" checkbox="false" fitColumns="true" title="设备基础档案管理" actionUrl="deviceController.do?datagrid" idField="id" fit="true" queryMode="group" rowList="${['20','40','60','80','100']}" >
  7. <t:dgCol title="主键" field="id" hidden="true" queryMode="single" width="120"></t:dgCol>
  8. <t:dgCol title="设备编码" field="code" query="true" queryMode="single" width="120"></t:dgCol>
  9. <t:dgCol title="设备名称" field="name" query="true" queryMode="single" width="120" ></t:dgCol>
  10. <t:dgCol title="设备类型" field="typeId" query="true" queryMode="single" dictionary="P_device_type,type_code,type_name" width="120"></t:dgCol>
  11. <t:dgCol title="设备型号" field="deviceModel" width="120" ></t:dgCol>
  12. <t:dgCol title="设备规格" field="deviceSpecs" width="120" ></t:dgCol>
  13. <t:dgCol title="设备单位" field="deviceDepart" width="120" ></t:dgCol>
  14. <t:dgCol title="设备厂商" field="deviceFactory" width="120" ></t:dgCol>
  15. <t:dgCol title="库存" field="deviceStock" hidden="true" width="120" ></t:dgCol>
  16. <c:if test="${flg}">
  17. <t:dgToolBar title="新建" icon="icon-add" operationCode="add" url="deviceController.do?goAdd" funname="add"></t:dgToolBar>
  18. <t:dgToolBar title="修改" icon="icon-edit" operationCode="edit" url="deviceController.do?goUpdate" funname="update"></t:dgToolBar>
  19. <t:dgToolBar title="查看" icon="icon-search" url="deviceController.do?goUpdate" funname="detail"></t:dgToolBar>
  20. <t:dgToolBar title="删除" icon="icon-remove" operationCode="remove" url="deviceController.do?doDel" funname="logicDel"></t:dgToolBar>
  21. <t:dgToolBar title="导出" icon="icon-put" operationCode="put" funname="ExportXls"></t:dgToolBar>
  22. </c:if>
  23. </t:datagrid>
  24. </div>
  25. </div>
  26. <script src = "webpage/com/xcgl/device/deviceList.js"></script>
  27. <script type="text/javascript">
  28. function logicDel(){
  29. var rows = $("#deviceList").datagrid('getSelections');
  30. if (rows.length > 0) {
  31. if(rows) {
  32. $.messager.confirm("确认", "确定要删除这条数据?", function (r) {
  33. if (r) {
  34. $.ajax({
  35. url : "deviceController.do?doDel",
  36. type : 'post',
  37. data : {
  38. id : rows[0].id
  39. },
  40. cache : false,
  41. success : function(data) {
  42. var d = data;
  43. if (d.success) {
  44. var msg = d.msg;
  45. tip(msg);
  46. $("#deviceList").datagrid('reload');
  47. } else {
  48. layer.alert(d.msg);
  49. }
  50. }
  51. });
  52. }
  53. });
  54. }
  55. } else {
  56. layer.alert("请选择需要删除的数据");
  57. }
  58. }
  59. //编写自定义JS代码获得输入框中的值等父级页面调用取值
  60. function getSelectedRow(){
  61. var selectRows = $("#deviceList").datagrid('getSelections');
  62. return selectRows;
  63. }
  64. //导出
  65. function ExportXls() {
  66. JeecgExcelExport("deviceController.do?exportXlsByT", "deviceList");
  67. }
  68. </script>