123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- /**
- *
- * @returns {___anonymous_MakeshiftSite}
- * @author lenovo
- * @date 2015/09/17 09:50
- */
- MakeshiftSite = function() {
- /**定义变量**/
- var _this = this;
- _this.listGrid = null;//数据列表
- $queryForm = null;//查询区域的表单
- $searchHandler = null;//查询按钮
- _this.loadParams = null;//列表加载参数
-
- /**私有方法**/
-
- /***新增信息***/
- _this.addForm = function(){
- $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/response/report/settlements/SiteAddEdit.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 {
- var fd_id = _this.listGrid.getSelectedRow().FD_OBJECTID381;
- $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/response/report/settlements/SiteAddEdit.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_OBJECTID381 + ",";
- }
- var url = $.pathname() +"/ws/crud/CRUDService/delete/";
- var params = {
- objectIDs : ids,
- classid : 381
- };
- top.Dialog.confirm("确定要删除吗?|删除", function() {
- $.request.del(url,params,function(result){
- if (result.Msg.sucsess == true) {
- top.Dialog.alert("删除成功!");
- // 刷新表格数据
- _this.listGrid.loadData();
- } else {
- top.Dialog.alert("删除失败!");
- }
- });
- });
- };
- /****查看详细信息****/
- _this.showInfo = 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_OBJECTID381;
- $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/response/report/settlements/SiteInfo.jsp?fd_id="+fd_id);
- }
- };
- //************************************************************************************************************************************************/
- //查询
- function search(obj){
- $queryForm.serialize();
- var queryParams = getQueryFormParams($queryForm);
- var params = concatJson({}, [_this.loadParams,queryParams]);
- _this.listGrid.setOptions( {
- params : params
- });
- //页号重置为1
- _this.listGrid.setNewPage(1);
- _this.listGrid.loadData();//加载数据
- }
- //************************************************************************************************************************************************/
- return {
- init : function() {
- $queryForm = $("#queryForm");
- /**绑定查询面板的按钮点击事件**/
- $searchHandler = $("#searchHandler");//查询按钮
- $searchHandler.bind('click',function(){
- search();
- });
- //定义列表加载参数
- _this.loadParams = {
- listId : '381',
- condition : 'is_del=0'
- };
- /**grid载入数据(定义数据列表)**/
- _this.listGrid = $("#maingrid").quiGrid({
- //title : "临时场所管理数据列表",
- columns : [
- {
- name : 'FD_OBJECTID381',
- display : '主键',
- align : 'center',
- hide : true
- },
- {
- name : 'SETTLEMENTS_NAME_381',
- display : '名称',
- align : 'center',
- width: "10%"
- },
- {
- name : 'PLACE_381',
- display : '地点',
- align : 'center',
- width: "10%"
- },
- {
- name : 'NUMBER_OF_PLACEMENT_381',
- display : '安置人数',
- align : 'center',
- width: "10%"
- },
- {
- name : 'NUMBER_OF_TENTS_381',
- display : '帐篷数量',
- align : 'center',
- width: "10%"
- },
- {
- name : 'TEMPORARY_ELECTRICITY_LOAD_381',
- display : '临时用电负荷',
- align : 'center',
- width: "10%"
- },
- {
- name : 'PLACE_TYPES_381_SHOW',//类型
- display : '临时场所类型',
- align : 'center',
- width: "10%"
- },
- {
- name : 'POWER_SUPPLY_MODE_381',
- display : '供电方式',
- align : 'center',
- width: "10%"
- },
- {
- name : 'EQUIPMENT_NUMBER_381',
- display : '照明设备数量',
- align : 'center',
- width: "10%"
- },
- {
- name : 'UNATTENDED_HEAD_381',
- display : '值守人员',
- align : 'center',
- width: "10%"
- },
- {
- name : 'TELEPHONE_381',
- display : '电话',
- align : 'center',
- width: "10%"
- }],
- url : $.pathname() + '/ws/crud/CRUDService/queryQui',
- params : _this.loadParams,
- //排序字段
- sortName:'UPDATEDATE',
- sortOrder:"DESC",
- rownumbers : true,
- checkbox : true,
- height : "100%",
- width : "100%",
- pageSize : 10,
- percentWidthMode : true,
- toolbar : {
- items : [ {
- text : '新增',
- click : _this.addForm,
- iconClass : 'icon_add'
- }, {
- line : true
- }, {
- text : '修改',
- click : _this.editForm,
- iconClass : 'icon_edit'
- }, {
- line : true
- }, {
- text : '删除',
- click : _this.del,
- iconClass : 'icon_delete'
- }, {
- line : true
- }, {
- text : '查看',
- click : _this.showInfo,
- iconClass : 'icon_view'
- } ]
- }
- });
- }
- };
-
- }();
- $(function() {
- MakeshiftSite.init();
- });
-
|