123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369 |
- var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames();
- var deptNames = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
- $(function(){
-
- // getChildInfo();
- createConditionsDom(conditionData);
- $(".item").unbind("click").bind("click",bindSelectOne);
-
- /******************************绑定事件**************************************/
- $more = $("#more"); // 更多按钮
- $more.bind('click', function() {
- more();
- });
- $searchButt = $("#searchButt");// 更多查询按钮
- $searchButt.live('click', function() {
- searchHandler();
- });
- $searchOne = $("#searchOne");//查询图标绑定查询事件
- $searchOne.bind('click', function() {
- searchHandler();
- });
- });
- function getChildInfo(){
- var url = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/getresourXj/';
- var params = {
- id : deptId,
- value:"BELONGING_DEPARMENT"
- };
- $.ajax({
- url : url,
- type : 'post',
- timeout : 60000,
- data : params,
- dataType : 'json',
- success : function(data){
- var conditionData3 = JSON.stringify(data);
- var test = eval("("+conditionData3+")");
- if(conditionData3!='{"list":[{"name":"查询单位","className":"BELONGING_DEPARMENT","equalType":"equal","list":[]}]}'){
- conditionData.list.push(test.list[0]);
- }
- createConditionsDom(conditionData);
- $(".item").unbind("click").bind("click",bindSelectOne);
- },
- error : function(e){
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- }
- var g;
- /**定义变量**/
- //列表加载参数
- //var condition="IS_DEL='0' AND WAREHOUSE_BELONGING IN('"+ deptId +"') or WAREHOUSE_BELONGING IN(SELECT A.DEPT_ID FROM SYS_DEPARTMENT A WHERE A.PARENT_ID='"+deptId+"')";
- var condition="IS_DEL='0' and BELONGING_DEPARMENT ='"+deptId+"'";
- var loadParams = {
- "listId" : '284',
- // "condition" : condition,
- "deptName":deptNames,
- direction:'DESC',
- sort: 'UPDATEDATE'
- };
- function initComplete(){
- /**
- * 工具条
- */
- var roleCons = roleButtonArr();
- var toolBarOpt1 = {
- items:[
- {text: '查看', click: "onView", iconClass: 'view_tem',id:"10003"}
- ,
- {text: '导出', click: "daochu", iconClass: 'export_tem',id:"10006"}
- // ,
- // {text: '统计', click: "sumUnit", iconClass: 'poll_tem',id:"10200"}
- // {text: '横向查看', click: "tempValue", iconClass: 'history_tem',id:"10206"}
- ],
-
- roleCons:roleCons
- };
- /**
- * 树形列
- */
- var grid_option1 = {
- columns: [
- { display: '仓库名称', name: 'WAREHOUSE_NAME', align: 'left', width: "15%",isPrimaryKey:true,
- // render : function(rowdata, value) {
- // return '<a href="javascript:void(0)" '
- // + 'onclick=jumpPage("'
- // + rowdata.FD_OBJECTID284
- // +'")>'+ rowdata.WAREHOUSE_NAME_284 +'</a>';
- // }
- render : function(rowdata, rowindex, value, column) {
- return "<a href='javascript:;' style='width:100%;height:100%;display:block' title='" + value + "' onclick='openDetail(" + rowindex + ")'>" + value + "</a>";
- }
- },
- { display: '仓库归属', name: 'WAREHOUSE_BELONGING', align: 'center', width: "10%",showTitle:true},
- { display: '所属单位', name: 'BELONGING_DEPARTMENT', align: 'center', width: "15%",showTitle:true},
- { display: '仓库类别', name: 'WAREHOUSE_TYPE', align: 'center', width: "10%",showTitle:true},
- { display: '仓库级别', name: 'WAREHOUSE_LEVEL', align: 'center' , width: "10%",showTitle:true},
- { display: '详细地址', name: 'DETAILED_ADDRESS', align: 'center', width: "15%",showTitle:true},
- { display: '存储物资类别', name: 'STORAGE_MATERIAL_TYPE', align: 'center' , width: "15%",showTitle:true},
- { display: '仓库负责人', name: 'WAREHOUSE_PRINCIPAL', align: 'center', width: "10%" ,showTitle:true}
- ],
- rownumbers : true,
- checkbox : true,
- pageSize : 10,
- percentWidthMode : true
- };
- var options1={
- url :'/nwyj/ws/WareHouseService/WareHouseService/getWarehouseInfo',
- params:loadParams,
- width:960,
- gridOptions:grid_option1,
- singleRecodeOptions:{a:"aa"},
- paperOpration:{showInput:"true"},
- toolBarOptions:toolBarOpt1
- };
- g=gridAndSingleRecode=$("#maingrid").quickgridAndSingleRecode(options1);
- }
- //导出
- function daochu(){
-
- var rows = g.getSelectedRows();
- var rowsLength = rows.length;
- // if (rowsLength == 0) {
- top.Dialog.confirm("是否导出所有的物资仓库信息?|确定", function() {
- var sql = {
- "report_type" : "rcwhxx"
- // ,
- // "json" : JSON.stringify(g.getData())
- };
- excelExport(undefined,sql,"物资仓库信息","IS_DEL,UPDATEDATE,FD_OBJECTID,SUPERIORWAREHOUSE,WAREHOUSSYSCODE","物资仓库信息",'rcdaochu');
- });
- return;
- // }
- //
- // var ids = "";
- // for ( var i = 0; i < rowsLength; i++) {
- // ids += "'"+rows[i].FD_OBJECTID284+"'" + ",";
- // }
- // var temp = ids.substring(0,ids.length-1);
- //
- // var condition = " IS_DEL='0' ";
- // condition += " AND FD_OBJECTID IN (" + temp + ") " ;
- //
- // var sql = {
- // "listId" :'284' ,
- // "condition" : condition,
- // direction:'DESC',
- // sort: 'UPDATEDATE'
- // };
- //
- // excelExport(284,sql,"FD_OBJECTID,IS_DEL");
- }
- function searchHandler(){
-
- $queryForm = $("#queryForm");
- if($("#WAREHOUSE_NAME_284").val()=="请输入仓库名称"){
- $("#WAREHOUSE_NAME_284").val("");
- }
- $queryForm.serialize();
- var $comp_id = $("#selectConditions").find(".WAREHOUSE_BELONGING");
- var loadParams11;
- //判断是否有用单位做查询条件
- if(!!$comp_id.prop("outerHTML")){
- loadParams11 = {
- // "listId" : '284',
- "condition" : " ",
- // direction:'DESC',
- // sort: 'UPDATEDATE'
- };
- }else{
-
- loadParams11 = $.extend({},loadParams,loadParams);
- }
- //获取选中的值
- var searchCondition = getSelectCon(conditionData);
- var queryParams = getQueryFormParams($queryForm);//拼接出来的条件
- var params=$.extend({},loadParams11,queryParams);// 默认
- //与之前参数条件拼接
- params.condition = searchCondition.condition + params.condition;
- g.setOptions({"params":params});
- //加载数据
- g.rend();
- }
- //点击查看
- //function jumpPage(id){
- // window.location.href="inventory.jsp?"+id;
- //}
- //点击主键跳转详细信息页面
- this.openDetail = function(rowindex) {
- var row = g.getRow(rowindex);
- var fd_id = row.WAREHOUSE_SYS_CODE;
- var fd_id1 = row.OBJECT_ID;
- window.location.href="inventory.jsp?"+fd_id+"?"+fd_id1;
- };
- function showPrimaryKey(obj,index){
- var fd_id = obj.WAREHOUSE_SYS_CODE;
- var fd_id1 = row.OBJECT_ID;
- window.location.href="inventory.jsp?"+fd_id+"?"+fd_id1;
- }
- //导出
- function exportTotalData(){
- var rows = g.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.confirm("是否导出所有的物资仓库信息?|确定", function() {
- excelExport(284,loadParams,"物资仓库信息","IS_DEL,UPDATEDATE,FD_OBJECTID,SUPERIORWAREHOUSE,WAREHOUSSYSCODE");});
- return;
- }
- var ids = "";
- for ( var i = 0; i < rowsLength; i++) {
- ids += "'"+rows[i].FD_OBJECTID284+"'" + ",";
- }
- var temp = ids.substring(0,ids.length-1);
- var condition = " IS_DEL='0' ";
- condition += " AND FD_OBJECTID IN (" + temp + ") " ;
- var sql = {
- "listId" :'284' ,
- "condition" : condition,
- direction:'DESC',
- sort: 'UPDATEDATE'
- };
- excelExport(284,sql,"物资仓库信息","IS_DEL,UPDATEDATE,FD_OBJECTID,SUPERIORWAREHOUSE,WAREHOUSSYSCODE");
- }
- //详情
- function onView(){
- var rows = g.getSelectedRows();
- if(rows.length==0){
- top.Dialog.alert("请选择一条记录");
- return;
- }
- if(rows.length>1){
- top.Dialog.alert("只能选择一条记录");
- return;
- }
- var fd_id = rows[0].OBJECT_ID;
- // window.location.href="warehouse_view.jsp?"+fd_id;
- $.indexOpenNextWindow("/nwyj/page/business/am/resource/warehouse/warehouse_view.jsp?"+fd_id);
- }
-
- //统计
- function sumUnit(){
- //top.Dialog.alert("无数据信息");
- window.location.href="warehouse_poll.jsp";
- }
- function more() {
- $('#moreDiv').toggle(400,function(){
- $("#emptyCondition").click();
- $(parent.document.body).find("#frmright").height($(window.document.body).height()+30);
- });
- }
- /*// 更多
- function more() {
- $('#moreDiv').toggle();
- // $("#WAREHOUSE_NAME_284").val("");
- $(parent.document.body).find("#frmright").height($(window.document.body).height());//重新设置高度
- }*/
- $.messager=top.Dialog;
- //横向查看功能
- function tempValue(){
- var diag = new top.Dialog();
- diag.Title = "应急组织";
- diag.URL = $.pathname() + '/page/business/am/resource/ledger/readDept.jsp';
- diag.Width = 700;
- diag.Height = 500;
- diag.Top = "80%";
- diag.Left = "50%";
- diag.ShowButtonRow=true;
- diag.ButtonAlign = 'center';
- diag.OkButtonText="确 定";
- diag.OKEvent = function(){
- Validate(diag);
- };
- diag.show();
- }
- function Validate(diag){
-
- var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id()+""; //登录人ID
- var dept_name = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames(); //申请单位的名称
- var time1=diag.innerFrame.contentWindow.$("#time1").val();
- var time2=diag.innerFrame.contentWindow.$("#time2").val();
- var yuanyin=diag.innerFrame.contentWindow.$("#yuanyin").val();
- //获取zTree对象
- var zTree = diag.innerFrame.contentWindow.$.fn.zTree.getZTreeObj("tree-1");
- //得到选中的数据集
- var checkedNodes = zTree.getCheckedNodes(true);
- if(time1==""||time2==""){
- $.messager.alert('请选择申请查看权限的时间!');
- return;
- }
- if(time1>time2){
- $.messager.alert('请选择正确的申请查看权限的时间!');
- return;
- }
- if(yuanyin==""){
- $.messager.alert('请输入申请查看权限的原因!');
- return;
- }
- if(checkedNodes==""){
- $.messager.alert('请选择要申请查看的单位!');
- return;
- }
- var compValue="";
- var compValue2="";
- for(var i = 0; i < checkedNodes.length; i++){
- //机构名称
- compValue += checkedNodes[i].id + ",";
- compValue2 += checkedNodes[i].name+",";
- }
- var compid = compValue.substring(0,compValue.length-1);
- var compname = compValue2.substring(0,compValue2.length-1);
- //给第二个form的字段设置值
- $("#APPLY_PERSION_216").val(getUser_id);
- $("#COMPNAME_216").val(dept_name);
- $("#APPROVE_PERSION_216").val("暂时数据");
- $("#START_TIME_216").val(time1);
- $("#END_TIME_216").val(time2);
- $("#APPLY_CAUSE_216").val(yuanyin);
- $("#APPLY_COMPID_216").val(compid);//查看单位的ID
- $("#APPLY_COMPNAME_216").val(compname); //查看单位的名称
-
- var $form = $('#fillForm1');
- var url = $.pathname() + '/ws/crud/CRUDService/create';
- $.ajax({
- url : url,
- type : 'post',
- data : $form.serialize(),
- dataType : 'text',
- timeout : 60000,
- success : function(data){
- $.messager.alert("申请提交成功",null,null,null,-1);
- },
- error : function(){
- $.messager.alert('操作失败');
- }
- });
-
- top.Dialog.close();//关闭新增窗口
- }
|