123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188 |
- function saveRecords(json,obj,backUrl){
- var saveUrl = $.pathname() + "/ws/xianlutingyun/XianlutingyunService/create";
- var userId = json.user_id;
- var type = json.report_type;
- var comp = json.comp_id;
- //var report_id = json.report_id;
- var name = json.name;
- var operate = json.operate;
- var jsonData = json.json;
- var dept = json.report_comp;
- var sendStat = json.sendStat;
- var roleId = json.roleId;
- var relVal = "";
- var relText ="";
- ///var relVal = $("#warning").attr("relValue");
- /*if(relVal==""){
- top.Dialog.alert("请选择选择填报计划");
- return;
- }
- var relText = $("#warning").attr("relText");*/
- var treeObj = $.fn.zTree.getZTreeObj("reportTree");
- var checked = treeObj.getCheckedNodes(true);
- if(checked.length==0){
- top.Dialog.alert("请选择选择填报计划");
- return ;
- }else{
-
- for(var i=0;i<checked.length;i++){
- if(!checked[i].isParent){
-
- relVal += checked[i].id+",";
- relText +=checked[i].name+",";
- }
- }
- }
-
- var recordParams ="";
- if(json.flag){
- recordParams = {
- json:jsonData,
- user_id:userId,
- report_type:type,
- comp_id : comp,
- report_id:relVal,
- name:name,
- operate:operate,
- report_comp:dept,
- warnText:relText,
- sendStat:sendStat,
- roleId:roleId,
- flag:json.flag
- };
- }else{
- recordParams = {
- json:jsonData,
- user_id:userId,
- report_type:type,
- comp_id : comp,
- report_id:relVal,
- name:name,
- operate:operate,
- report_comp:dept,
- warnText:relText,
- sendStat:sendStat,
- roleId:roleId,
-
- };
- }
-
-
- if(backUrl){
- window.parent.document.getElementById("frmright").setAttribute("src", backUrl);
- }else{
-
- window.history.go(-1);
- }
- addNewReport(saveUrl,recordParams,obj);
- }
- function showWarningNumber(json){
- var type = json.report_type;
- var comp = json.comp_id;
- var report_id = json.report_id;
- var role = json.roleId;
- var moreReportrl = $.pathname() + "/ws/xianlutingyun/XianlutingyunService/getNeedWritePro";
- var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
- var deptFlag = getThing($.pathname() +"/ws/getRepotDept/ReportDeptService/checkReportDept",{"corpId":comp,"deptId":deptId},"text");
-
-
- var setting1 = {
- view : {
- selectedMulti : false
- },
- check: {
- enable: true
- },
- async : {
- dataType : 'JSON',
- contentType : "application/json"
- },
- callback : {
- onClick : nodeNick,
- }
-
- };
- var params = {
- comp_id :comp,
- report_type:type,
- role_id:role,
- deptId:deptId,
- flag:deptFlag,
- needType:"another",
- report_id:report_id
- };
- var nodes = getThing(moreReportrl, params);
- $.fn.zTree.init($("#reportTree"), setting1, nodes);
-
- //var treeObj = $.fn.zTree.getZTreeObj("reportTree");
- //var node =treeObj.getNodeByParam("id", report_id, null);
-
- //treeObj.selectNode(node);
-
- }
- function addNewReport(url,params,obj){
- $.ajax({
- url : url,
- type : 'post',
- timeout : 15000,
- async : false,
- data : params,
- dataType : 'json',
- success : function(data) {
- if(data.Msg.sucsess==true){
- top.Dialog.alert("新增报表成功");
- obj.close();
- }else{
- top.Dialog.alert("新增报表失败");
- }
- },
- error : function(e) {
- $.messager.alert('保存报表失败!', '访问服务失败!', 'error');
- }
- });
-
- }
- /*function getThing(url,params,text){
- var datas="" ;
- if(!text){
- text = "json";
- }
- $.ajax({
- url : url,
- type : 'post',
- timeout : 15000,
- async : false,
- data : params,
- dataType : text,
- success : function(data) {
- datas = data;
- },
- error : function(e) {
- $.messager.alert('获取消息失败!', '访问服务失败!', 'error');
- }
- });
- return datas;
- }*/
- function nodeNick(event, treeId, treeNode){
-
- if (!treeNode.isParent) {
- var treeObj = $.fn.zTree.getZTreeObj("reportTree");
- treeObj.checkNode(treeNode,true,true);
-
- }
- }
|