4f7398ab730f9c5a82c16b6e74820fbf341798aa.svn-base 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. sysAdmin = function() {
  2. /** 定义变量* */
  3. var _this = this;
  4. _this.listGrid = null;// 数据列表
  5. //_this.searchPanel = null; // 查询面板
  6. $queryForm = null;// 查询区域表单
  7. $searchButt = null;// 查询按钮
  8. $more = null; // 更多
  9. $reported = null; //填报
  10. _this.loadParams = null;// 列表加载参数
  11. /** 私有方法* */
  12. /** *新增信息** */
  13. _this.addForm = function() {
  14. $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/evaluate/admin/sysAdminEdit.jsp?fd_id=&is_adjst=1");
  15. };
  16. /** *修改信息** */
  17. _this.editForm = function() {
  18. var rows = _this.listGrid.getSelectedRows();
  19. var rowsLength = rows.length;
  20. if (rowsLength == 0) {
  21. top.Dialog.alert("请选中要修改的记录!");
  22. return;
  23. } else if (rowsLength > 1) {
  24. top.Dialog.alert("请选中一条要修改的记录!");
  25. return;
  26. } else {
  27. var fd_id = rows[0].FD_OBJECTID799;
  28. //alert(fd_id)
  29. $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/evaluate/admin/sysAdminEdit.jsp?fd_id="+ fd_id+"&is_adjst=2");
  30. }
  31. };
  32. /** *删除信息** */
  33. _this.del = function(){
  34. var rows = _this.listGrid.getSelectedRows();
  35. var rowsLength = rows.length;
  36. if (rowsLength == 0) {
  37. top.Dialog.alert("请选中要删除的记录!");
  38. return;
  39. }
  40. var ids = "";
  41. for ( var i = 0; i < rowsLength; i++) {
  42. ids += rows[i].FD_OBJECTID799 + ",";
  43. }
  44. var url = $.pathname() +"/ws/crud/CRUDService/delete/";
  45. var params = {
  46. objectIDs : ids,
  47. classid : 799
  48. };
  49. top.Dialog.confirm("确定要删除吗?|删除", function() {
  50. $.request.del(url,params,function(result){
  51. if (result.Msg.sucsess == true) {
  52. top.Dialog.alert("删除成功!");
  53. // 刷新表格数据
  54. //_this.listGrid.loadData();
  55. _this.listGrid.rend();
  56. } else {
  57. top.Dialog.alert("删除失败!");
  58. }
  59. });
  60. });
  61. };
  62. _this.editSYS = function(){
  63. var rows = _this.listGrid.getSelectedRows();
  64. var rowsLength = rows.length;
  65. user_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  66. if (rowsLength == 0) {
  67. top.Dialog.alert("请选中一条配置记录!");
  68. return;
  69. } else if (rowsLength > 1) {
  70. top.Dialog.alert("请选中一条配置记录!");
  71. return;
  72. } else if(rows[0].WRITER_ID_799!=user_id){
  73. top.Dialog.alert("只有本人新增的才可以配置!");
  74. } else {
  75. var fd_id = rows[0].FD_OBJECTID799;
  76. //console.log(rows[0].TYPE_799);
  77. if(rows[0].TYPE_799 == 1){
  78. $.noIndexOpenNextWindow($.pathname()+ "/page/business/em/evaluate/admin/sysAdminManageEdit.jsp?fd_id="+ fd_id+"&is_adjst="+rows[0].TYPE_799);
  79. }else{
  80. $.noIndexOpenNextWindow($.pathname()+ "/page/business/em/evaluate/admin/sysOuterManageEdit.jsp?fd_id="+ fd_id+"&is_adjst="+rows[0].TYPE_799);
  81. }
  82. }
  83. };
  84. _this.test = function(){
  85. var rows = _this.listGrid.getSelectedRows();
  86. var rowsLength = rows.length;
  87. if (rowsLength == 0) {
  88. top.Dialog.alert("请选中要评分的记录!");
  89. return;
  90. }
  91. if (rowsLength > 1) {
  92. top.Dialog.alert("请选中一条要评分的记录!");
  93. return;
  94. }
  95. var fdId = rows[0].FD_OBJECTID799;
  96. console.log(rows[0].TYPE_799);
  97. var url = $.pathname() + '/ws/scoreGrade/ScoreService/testscore';
  98. var params = {
  99. user_id : "",
  100. fd_id : fdId,
  101. sys_id : fdId,
  102. is_assinging : "",
  103. type : rows[0].TYPE_799
  104. };
  105. $.request.query(url,params,function(data){
  106. });
  107. };
  108. // 查询
  109. function search(obj) {
  110. //去掉水印
  111. if($("#NAME_799").val().trim()==" 体 系 名" || $("#NAME_799").val().trim()==""){
  112. $("#NAME_799").val("");
  113. }
  114. $queryForm.serialize();
  115. //获取选中的值
  116. var searchCondition = getSelectCon(conditionData);
  117. var queryParams = getQueryFormParams($queryForm);
  118. var params=$.extend({},_this.loadParams,queryParams);
  119. //与之前参数条件拼接
  120. params.condition = searchCondition.condition + params.condition;
  121. _this.listGrid.setOptions({"params":params});
  122. //加载数据
  123. _this.listGrid.rend();//加载数据
  124. }
  125. // 更多
  126. function more() {
  127. $('#moreTable').toggle();
  128. }
  129. //点击主键跳转详细信息页面
  130. _this.openDetail = function(rowindex) {
  131. var row = _this.listGrid.getRow(rowindex);
  132. var fd_id = row.FD_OBJECTID799;
  133. if(row.TYPE_799=="1"){
  134. $('#frmright', window.parent.document).attr('src',$.pathname()+'/page/business/em/evaluate/admin/sysAdminView.jsp?fd_id='+fd_id);
  135. }else{
  136. $('#frmright', window.parent.document).attr('src',$.pathname()+'/page/business/em/evaluate/admin/sysOuterView.jsp?fd_id='+fd_id);
  137. }
  138. };
  139. return {
  140. init : function() {
  141. $queryForm = $("#queryForm");
  142. //绑定查询面板的按钮点击事件
  143. $searchButt = $("#searchButt");// 查询按钮
  144. $searchButt.bind('click', function() {
  145. search();
  146. });
  147. $('#NAME_799').keydown(function(e){
  148. if(e.keyCode==13){
  149. search();
  150. }
  151. });
  152. //绑定更多的按钮点击事件
  153. $more = $("#more"); // 更多按钮
  154. $more.bind('click', function() {
  155. more();
  156. });
  157. // 获得面板对象 12
  158. //_this.searchPanel = $("#searchPanel");
  159. //部门id--预警范围用到
  160. //var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
  161. // 列表加载参数
  162. _this.loadParams = {
  163. listId : '799',
  164. direction:'ASC',
  165. sort: 'UPDATEDATE',
  166. direction:'DESC',
  167. condition : 'is_del = 0',
  168. };
  169. var toolBarOpt1 = {
  170. items : [ {text : '新增', disabled: false,click : 'addForm',iconClass : 'add1_tem',id : '10000'},
  171. {text : '删除', disabled: false,click : 'del',iconClass : 'delete_tem',id : '10002'},
  172. {text : '修改',disabled: false,click : 'editForm',iconClass : 'update_tem',id : '10001'},
  173. //{text : 'CESHI',disabled: false,click : 'test',iconClass : 'update_tem',id : '10001'},
  174. {text : '配置标准',disabled: false,click : 'editSYS',iconClass : 'adjust_tem',id : '10004'}
  175. ]
  176. };
  177. var grid_option1={
  178. columns : [
  179. {name : 'FD_OBJECTID799',hide : true},
  180. {display : '体系名', name : 'NAME_799', align : 'center', width : "30%",isPrimaryKey:true,
  181. render : function(rowdata, rowindex, value, column) {
  182. return "<a href='javascript:;' style='width:100%;height:100%;display:block' title='" + value + "' onclick='openDetail(" + rowindex + ")'>" + value + "</a>";
  183. }
  184. },
  185. {display : '体系类型', name : 'TYPE_799_SHOW', align : 'center', width : "15%"},
  186. {display : '备注', name : 'REMARK_799', align : 'center', width : "35%"},
  187. {display : '创建时间', name : 'WRITE_TIME_799', align : 'center', width : "20%",render:function (rowdata, rowindex, value){
  188. return value.split(' ')[0];
  189. }}
  190. ],
  191. checkbox : true,
  192. rownumbers : true,
  193. pageSize : 10,
  194. percentWidthMode : true
  195. };
  196. //alert(grid_option1);
  197. var options1={
  198. //url :'/nwyj/ws/crud/CRUDService/queryQui',
  199. url :$.pathname() + '/ws/crud/CRUDService/queryQui',
  200. params: _this.loadParams,
  201. width:960,
  202. height:300,
  203. gridOptions:grid_option1,
  204. singleRecodeOptions:{a:"aa"},
  205. paperOpration:{showInput:"true"},
  206. toolBarOptions:toolBarOpt1
  207. };
  208. _this.listGrid=gridAndSingleRecode=$("#dataGrid").quickgridAndSingleRecode(options1);
  209. // _this.listGrid.rend();
  210. }
  211. };
  212. }();
  213. $(function() {
  214. sysAdmin.init();
  215. });