123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207 |
- /**
- * 功能:
- *
- *
- * @author HXB
- * @date 2015/10/27
- */
- TargetManage = function() {
- /** 定义变量* */
- var _this = this;
- _this.listGrid = null;// 数据列表
- _this.searchPanel = null; // 查询面板
- $queryForm = null;// 查询区域表单
- $searchButt = null;// 查询按钮
- $more = null; // 更多
- _this.loadParams = null;// 列表加载参数
- //部门id
- //var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
- /** 私有方法* */
- /** *新增信息** */
- _this.addForm = function() {
- $('#frmright', window.parent.document).attr('src',$.pathname()+"/page/business/em/evaluate/targetManage/TargetManageAddEdit.jsp?fd_id=");
- };
- /** *修改信息** */
- _this.editForm = function() {
- var rows = _this.listGrid.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要修改的记录!");
- return;
- } else if (rowsLength > 1) {
- top.Dialog.alert("请选中一条要修改的记录!");
- return;
- } else{
- if(_this.listGrid.getSelectedRow().__level==1){
- top.Dialog.alert("评估指标不可修改,请选择子项修改!");
- return;
- }else{
- var fd_id = _this.listGrid.getSelectedRow().FD_OBJECTID374;
- $('#frmright', window.parent.document).attr('src',$.pathname()+"/page/business/em/evaluate/targetManage/TargetManageAddEdit.jsp?fd_id="+fd_id);
- }
-
- }
- };
- /** *删除信息** */
- _this.del = function() {
- var rows = _this.listGrid.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要删除的记录!");
- return;
- }
- var ids = "";
- for ( var i = 0; i < rowsLength; i++) {
- ids += rows[i].FD_OBJECTID374 + ",";
- }
- var url = $.pathname() +"/ws/crud/CRUDService/delete/";
- var params = {
- objectIDs : ids,
- classid : 374
- };
- top.Dialog.confirm("确定要删除吗?|删除", function() {
- $.request.del(url,params,function(result){
- if (result.Msg.sucsess == true) {
- top.Dialog.alert("删除成功!");
- // 刷新表格数据
- _this.listGrid.loadData();
- //_this.listGrid.rend();
- } else {
- top.Dialog.alert("删除失败!");
- }
- });
- });
- };
- /** **评价内容*** */
- _this.show = function() {
- var rows = _this.listGrid.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要查看的记录!");
- return;
- } else if (rowsLength > 1) {
- top.Dialog.alert("请选中一条要查看的记录!");
- return;
- } else {
- var fd_id = _this.listGrid.getSelectedRow().FD_OBJECTID374;
- $('#frmright', window.parent.document).attr('src',$.pathname()+"/page/business/em/evaluate/targetManage/TargetManageDetails.jsp?fd_id="+fd_id);
- }
- };
- // 查询
- function search(obj) {
- $queryForm.serialize();
- var queryParams = getQueryFormParams($queryForm);
- //去掉水印
- if(queryParams.NAME_374=="体系/评价项目名"){
- queryParams.NAME_374="";
- }
-
- var params=$.extend({},_this.loadParams,queryParams);
-
- var searchCondition = getSelectCon(conditionData);
- params.condition = searchCondition.condition + params.condition;
-
- //alert(params.condition);
-
- _this.exportParams = params;
- _this.listGrid.setOptions({"params":params});
- //加载数据
- _this.listGrid.rend();
- }
- // 更多
- function more() {
- $('#moreDiv').toggle();
- document.getElementById("queryForm").reset(); //重置一下表单
- $(parent.document.body).find("#frmright").height($(window.document.body).height());
- }
- return {
- init : function() {
- $queryForm = $("#queryForm");
- /** 绑定查询面板的按钮点击事件* */
- $searchButt = $("#searchButt");// 查询按钮
- $searchButt.bind('click', function(){
- search();
- });
- /** 绑定更多的按钮点击事件 */
- $more = $("#more"); // 更多按钮
- $more.bind('click', function() {
- more();
- });
- // 获得面板对象
- _this.searchPanel = $("#searchPanel");
- // 列表加载参数
- _this.loadParams = {
- listId : '374',
- //condition : "is_del=0 and WRITE_DEPT='"+deptId+"'",
- condition : "is_del=0",
- direction : 'desc', // 排序方式
- sort : 'UPDATEDATE'
- };
-
- // var datadata = {"rows":[{"open":false,"WRITE_TIME_374":"2015-10-31 15:08:51.000000","NAME_374":"南网应急管理评估指标体系","isParent":true,"FD_OBJECTID374":"372144592870071100000035100000"},{"open":false,"WRITE_TIME_374":"2015-10-30 15:08:40.000000","NAME_374":"应急准备评估指标","isParent":true,"FD_OBJECTID374":"372144592872886000000036100000"},{"open":false,"WRITE_TIME_374":"2015-10-14 15:08:06.000000","NAME_374":"基础准备评估指标","isParent":true,"FD_OBJECTID374":"372144592882177900000037100000"}]};
- /** grid载入数据* */
- var toolBarOpt1 = {
- items : [ {text : '新增',click : _this.addForm,iconClass : 'add1_tem'},
- {text : '删除',click : _this.del,iconClass : 'delete_tem'},
- {text : '修改',click : _this.editForm,iconClass : 'update_tem'},
- {text : '评价内容',click : _this.show,iconClass : 'view_tem'}
-
- ]
- };
- _this.listGrid = $("#dataGrid").quiGrid({
- columns: [
- {
- display : '体系/评价项目名',
- name : 'NAME_374',
- width : "35%",
- align:'left',
- id:'FD_OBJECTID374'
- },{
- display : '项目级别',
- name : 'LEVEL_374_SHOW',
- showTitle:true,
- width : "20%"
- }, {
- display : '权重',
- name : 'WEIGHT_VALUE_374',
- showTitle:true,
- width : "20%"
- }, {
- display : '创建日期',
- name : 'WRITE_TIME_374',
- showTitle:true,
- width : "25%",
- render:function (rowdata, rowindex, value){
- return value.split(' ')[0];
- }
- }
- ],
- height: '460px',
- width:"100%",
- checkbox:true,
- type:'post',
- usePager: true,
- rownumbers:true,
- url :$.pathname() + '/ws/targetManage/TargetManageService/getTrunkTree',
- params: {},
- toolbar:toolBarOpt1,
- percentWidthMode:true,
- autoCheckChildren:true,
- tree: { columnId: 'FD_OBJECTID374' },
- treeAjax:true,
- treeChildDataPath:$.pathname() + '/ws/targetManage/TargetManageService/getTargetTreeList?params=',
- treeAutoParam:"params"
- });
- }
- };
- }();
- $(function() {
- TargetManage.init();
- });
|