e734c29f21efc720c5156060915ffe4c6e79beeb.svn-base 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. var g;
  2. //列表加载参数
  3. var loadParams = {
  4. "listId" : '361',
  5. "condition" : 'IS_DEL=0'
  6. };
  7. //初始化列表
  8. function initComplete(){
  9. g = $("#maingrid").quiGrid({
  10. columns: [
  11. { name: 'FD_OBJECTID361', hide : true},
  12. { display: '部门', name: 'DEPT_361',align: 'center', width: "20%"},
  13. { display: '交班人', name: 'RELIEVED_MAN_361',align: 'center', width: "20%"},
  14. { display: '接班人', name: 'SUCCEED_MAN_361', align: 'center', width: "20%" },
  15. { display: '交接班时间', name: 'RELIEVED_TIME_361',align: 'center', width: "20%" },
  16. { display: '状态', name: 'DAILY_STATE_361',align: 'center', width: "20%" }
  17. ],
  18. url :$.pathname() + '/ws/crud/CRUDService/queryQui',
  19. params : loadParams,
  20. sortName : 'FD_OBJECTID361',
  21. sortOrder : 'desc nulls last',
  22. rownumbers:true,
  23. checkbox:true,
  24. height: '100%',
  25. width:"100%",
  26. pageSize: 10,
  27. percentWidthMode:true,
  28. //顶部图标按钮栏
  29. toolbar:
  30. {
  31. items: [
  32. { text: '新增', click: onAdd, iconClass: 'icon_add', disabled: false },
  33. { line: true },
  34. { text: '详细信息', click: onView, iconClass: 'icon_view', disabled: false },
  35. { line: true },
  36. { text: '删除', click: onDelete, iconClass: 'icon_delete', disabled: false },
  37. { line: true },
  38. { text: '修改', click: onEdit, iconClass: 'icon_edit', disabled: false },
  39. { line: true },
  40. { text: '发布', click: onRelease, iconClass: 'icon_release', disabled: false },
  41. { line: true }
  42. ]
  43. }
  44. });
  45. $("#searchPanel").bind("stateChange",function(e,state){
  46. g.resetHeight();
  47. });
  48. }
  49. function searchHandler(){
  50. var search = $('#RELIEVED_MAN_361').val();
  51. var condition = "IS_DEL=0";
  52. if(search!=""){
  53. condition += " AND RELIEVED_MAN LIKE '%" +search+"%'";
  54. }
  55. g.setOptions({//重置加载列表的参数
  56. params : {
  57. "listId" :'361' ,
  58. "condition" : condition
  59. }
  60. });
  61. g.setNewPage(1);
  62. g.loadData();//刷新列表
  63. }
  64. //详细信息
  65. function onView(){
  66. var rows = g.getSelectedRows();
  67. if(rows.length==0){
  68. top.Dialog.alert("请选择一条记录");
  69. return;
  70. }
  71. if(rows.length>1){
  72. top.Dialog.alert("只能选择一条记录");
  73. return;
  74. }
  75. var fd_id = rows[0].FD_OBJECTID361;
  76. var iframe =parent.document.getElementsByName("frmright")[0];
  77. iframe.src = $.pathname()+"/page/business/em/alert/duty/transfer_daily_info.jsp?"+fd_id;
  78. }
  79. //修改
  80. function onEdit(){
  81. var rows = g.getSelectedRows();
  82. if(rows.length==0){
  83. top.Dialog.alert("请选择一条记录");
  84. return;
  85. }
  86. if(rows.length>1){
  87. top.Dialog.alert("只能选择一条记录");
  88. return;
  89. }
  90. var fd_id = rows[0].FD_OBJECTID361;
  91. var iframe =parent.document.getElementsByName("frmright")[0];
  92. iframe.src = $.pathname()+"/page/business/em/alert/duty/transfer_daily_update.jsp?"+fd_id;
  93. }
  94. //新增
  95. function onAdd(){
  96. //获取iframe中的元素值
  97. var iframe =parent.document.getElementsByName("frmright")[0];
  98. iframe.src = $.pathname()+"/page/business/em/alert/duty/transfer_daily_add.jsp";
  99. }
  100. //删除
  101. function onDelete(){
  102. var rows = g.getSelectedRows();
  103. var rowsLength = rows.length;
  104. if (rowsLength == 0) {
  105. top.Dialog.alert("请选中要删除的记录!");
  106. return;
  107. }
  108. var ids = "";
  109. for ( var i = 0; i < rowsLength; i++) {
  110. ids += rows[i].FD_OBJECTID361 + ",";
  111. }
  112. top.Dialog.confirm("确定要删除吗?|删除", function() {
  113. $.post($.pathname() +"/ws/crud/CRUDService/delete/", {
  114. "objectIDs" : ids,
  115. classid : 361
  116. }, function(result) {
  117. if (result.Msg.sucsess == true) {
  118. $.messager.alert("删除成功",null,null,null,1);
  119. // 刷新表格数据
  120. g.loadData();
  121. } else {
  122. top.Dialog.alert("删除失败!");
  123. }
  124. }, "json");
  125. });
  126. }
  127. //发布
  128. function onRelease(){
  129. var rows = g.getSelectedRows();
  130. if(rows.length==0){
  131. top.Dialog.alert("请选择一条记录");
  132. return;
  133. }
  134. if(rows.length>1){
  135. top.Dialog.alert("只能选择一条记录");
  136. return;
  137. }
  138. var fd_id = rows[0].FD_OBJECTID361;
  139. var iframe =parent.document.getElementsByName("frmright")[0];
  140. iframe.src = $.pathname()+"/page/business/em/alert/duty/transfer_daily_release.jsp?"+fd_id;
  141. }
  142. $.messager=top.Dialog;
  143. //刷新表格 表单提交的回调
  144. function afterFormSubmit(){
  145. g.loadData();
  146. }