123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266 |
- /**
- * 功能:
- *
- *
- * @author
- * @date 2015/09/14
- */
- PesInput = function() {
- /**定义变量**/
- var _this = this;
- _this.listGrid = null;// 数据列表
- var g = null;//数据列表
-
- $searchPanel = null; //查询面板
- $queryForm = null;//查询区域表单
- $searchButt = null;//查询按钮
- $more = null; //更多
- //loadParams = null;//列表加载参数
- _this.loadParams=null;
- var userId = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- var CorpArea = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- var roleids = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids();
-
- /**私有方法**/
- //8F6F2D6B24494CB6B1F1E0931E7AF87D UNIT CorpArea=="8F6F2D6B24494CB6B1F1E0931E7AF87D"&&
- /***新增信息***/
- addForm = function(){
- if(roleids.indexOf("R002105430210")>-1 && "8F6F2D6B24494CB6B1F1E0931E7AF87D"==CorpArea){
- $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/report/operation/OperationAddEdit.jsp?fd_id=");
- }else{
- top.Dialog.alert("只有省公司系统部人员可以填报操作!");
- return;
- };
- };
-
- /***修改信息***/
- editForm = function(){
- var rows = g.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要修改的记录!");
- return;
- } else if (rowsLength > 1) {
- top.Dialog.alert("请选中一条要修改的记录!");
- return;
- } else if(rows[0].WRITER_ID_360!=userId){
- top.Dialog.alert("只有本人填报的才可以修改操作!");
- }else {
- var fd_id = g.getSelectedRow().FD_OBJECTID360;
- $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/report/operation/OperationAddEdit.jsp?fd_id="+fd_id);
- }
- };
- /***删除信息***/
- del = function(){
- var rows = g.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_OBJECTID360 + ",";
- }
- var url = $.pathname() +"/ws/crud/CRUDService/delete/";
- var params = {
- objectIDs : ids,
- classid : 360
- };
- top.Dialog.confirm("确定要删除吗?|删除", function() {
- $.request.del(url,params,function(result){
- if (result.Msg.sucsess == true) {
- top.Dialog.alert("删除成功!");
- // 刷新表格数据
- g.rend();
- } else {
- top.Dialog.alert("删除失败!");
- }
- });
- });
- };
-
- //发布
- Publish = function() {
- var row = g.getSelectedRows();
- var fd_id = row[0].FD_OBJECTID360+",";
- //只能发布自己上传的文件
- var userId = row[0].WRITER_ID_360;
- var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- if(getUser_id!=userId){
- top.Dialog.alert("只能发布自己上传的文件!");
- return;
- }
- top.Dialog.confirm("确定要发布吗?|发布", function() {
- // 发布规范文件
- $.post($.pathname() +"/ws/getPulish/OperationService/OPerationPublish/", { fd_id : fd_id, }, function(result) {
- if (result.Msg.sucsess == true) {
- top.Dialog.alert("发布成功",null,null,null,1);
- // 刷新表格数据
- g.rend();
- } else {
- top.Dialog.alert("发布失败!");
- }
- }, "json");
-
- });
- };
-
- //查询//=================================================================================================================================================================
- function search(obj){
- //去掉水印
- if($("#SEASON_360").val()=="请输入季度"){
- $("#SEASON_360").val("");
- }
-
- $("#queryForm").serialize();
- //获取选中的值
- var searchCondition = getSelectCon(conditionData);
- var queryParams = getQueryFormParams($("#queryForm"));
- var params=$.extend({},_this.loadParams,queryParams);
- //与之前参数条件拼接
- params.condition = searchCondition.condition + params.condition;
- _this.listGrid.setOptions({"params":params});
- //加载数据
- _this.listGrid.rend();
- }
-
- //更多
- function more(){
- // $("#OPER_NAME_398").val("");
- // $("#START_OPER_TIME_398").resetValue();
- // $("#END_OPER_TIME_398").resetValue();
- $('#moreTable').toggle(200,function(){
- $("emptyCondition").click();
- $(parent.document.body).find("#frmright").height($(window.document.body).height());
- });
- }
- //点击主键跳转详细信息页面
- _this.openDetail = function(rowindex) {
- var row = _this.listGrid.getRow(rowindex);
- var fd_id = row.FD_OBJECTID360;
- $('#frmright', window.parent.document).attr('src',$.pathname()+'/page/business/em/report/operation/OperationInfo.jsp?fd_id='+fd_id);
- };
- return {
- init : function() {
- $queryForm = $("#queryForm");
- /**绑定查询面板的按钮点击事件**/
- $searchButt = $("#searchButt");//查询按钮
- $("#SEASON_360").keydown(function(event){
- if(event.keyCode == 13){
- search();
- }
- });
- $searchButt.bind('click',function(){
- search();
- });
- $searchButt.live('click',function(){
- search();
- });
- /**绑定更多的按钮点击事件*/
- $more = $("#more"); //更多按钮
- $more.bind('click',function(){
- more();
- });
- //获得面板对象
- $searchPanel = $("#searchPanel");
- //列表加载参数
- var grid_option1={
- columns : [
- {
- name : 'FD_OBJECTID360',
- display : '主键',
- align : 'center',
- hide : true
- },
- {
- name : 'SEASON_360_SHOW',
- display : '季度',
- align : 'center',
- width: "10%",
- showTitle:true,
- isSort : false,
- isPrimaryKey:true,
- render : function(rowdata, rowindex, value, column) {
- return "<a href='javascript:;' style='width:100%;height:100%;display:block' title='" + value + "' onclick='openDetail(" + rowindex + ")'>" + value + "</a>";
- }
- },
- {
- name : 'YEAR_360',
- display : '年度',
- align : 'center',
- width: "20%"
- },
- {
- name : 'WRITER_360',
- display : '填报人',
- align : 'center',
- width: "10%"
- },
- {
- name : 'WRITER_UNIT_360_SHOW',
- display : '填报部门',
- align : 'center',
- width: "20%"
- },
- {
- name : 'WRITER_IME_360',
- display : '填报时间',
- align : 'center',
- width: "20%"
- },
- {
- name : 'STATE_360_SHOW',
- display : '状态',
- align : 'center',
- width: "18%"
- }],
- rownumbers:true,
- checkbox:true,
- usePager:true,
- pageSize : 10,
- percentWidthMode : true,
- };
- //查询出该角色权限下的所有按钮ID roleButtonArr()方法需引入/nwyj/scripts/freamwork/com/sinosoft/common/common.js
- var roleCons = roleButtonArr();
- var toolBarOpt1={
- items: [
- {text : '新增',click : 'addForm',iconClass : 'add1_tem' ,id:"10tjlz"},
- {text : '删除',click : 'del',iconClass : 'delete_tem',id:"10sc"},
- {text : '修改',click : 'editForm',iconClass : 'update_tem',id:"10xg"},
- {text : '发布',click : 'Publish',iconClass : 'view_tem' ,id:"10102"}],
- roleCons:roleCons};
-
- _this.loadParams = {listId : '360',
- direction:'DESC',
- sort: 'UPDATEDATE',
- condition : "is_del=0"
- };
- var options1={
- url :'/nwyj/ws/crud/CRUDService/queryQui',
- params: _this.loadParams,
- width:960,
- gridOptions:grid_option1,
- singleRecodeOptions:{a:"aa"},
- paperOpration:{showInput:"true"},
- toolBarOptions:toolBarOpt1
- };
-
- _this.listGrid=g=gridAndSingleRecode=$("#dataGrid").quickgridAndSingleRecode(options1);
- g.rend();
- }
- };
- }();
- $(function() {
- PesInput.init();
- });
- function showPrimaryKey(obj,index){
- var fd_id = obj.FD_OBJECTID360;
- $('#frmright', window.parent.document).attr('src',$.pathname()+'page/business/em/report/operation/OperationInfo.jsp?fd_id='+fd_id);
- }
|