SysPlanScript.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743
  1. //初始化选择器
  2. function initData(){
  3. var href = __ctx+"/platform/system/sysUser/get.ht?openType=detail&userId=";
  4. //初始化提交人
  5. var submitId = $("input[name='submitId']").val();
  6. var submitor = $("input[name='submitor']").val();
  7. var arrySubmit = [{id:submitId,name:submitor}];
  8. if(submitId!=''&&submitId!=null&& 'undefined' != typeof (submitId)){
  9. setOwnerDiv('submitDiv',arrySubmit,href,'submitId','submitor');
  10. }
  11. //初始化负责人
  12. var chargeId = $("input[name='chargeId']").val();
  13. var charge = $("input[name='charge']").val();
  14. var arryCharge = [{id:chargeId,name:charge}];
  15. if(chargeId!=''&&chargeId!=null&& 'undefined' != typeof (chargeId)){
  16. setOwnerDiv('chargeDiv',arryCharge,href,'chargeId','charge');
  17. }
  18. //初始化参与人
  19. var participantIds = $("input[name='participantIds']").val();
  20. var participants = $("input[name='participants']").val();
  21. var arryParticipant = convertToArry(participantIds,participants);
  22. if(participantIds!=''&&participantIds!=null&& 'undefined' != typeof (participantIds)){
  23. setOwnerDiv('participantDiv',arryParticipant,href,'participantIds','participants');
  24. }
  25. //初始化客户
  26. var customerId = $("input[name='customerId']").val();
  27. var customer = $("input[name='customer']").val();
  28. var arryCustomer = [{id:customerId,name:customer}];
  29. if(customerId!=''&&customerId!=null&& 'undefined' != typeof (customerId)){
  30. setOwnerDiv('customerDiv',arryCustomer,"",'customerId','customer');
  31. }
  32. //初始化 工单
  33. var runId = $("input[name='runId']").val();
  34. var runName = $("input[name='runName']").val();
  35. var arryRun = [{id:runId,name:runName}];
  36. if(runId!=''&&runId!=null&& 'undefined' != typeof (runId)){
  37. var flowHref = __ctx+"/platform/bpm/processRun/info.ht?runId=";
  38. setOwnerDiv('runDiv',arryRun,flowHref,runId,runName,"1000","600","查看流程工单");
  39. }
  40. var date = new Date();
  41. var seperator1 = "-";
  42. var seperator2 = ":";
  43. var month = date.getMonth() + 1;
  44. var strDate = date.getDate();
  45. if (month >= 1 && month <= 9) {
  46. month = "0" + month;
  47. }
  48. if (strDate >= 0 && strDate <= 9) {
  49. strDate = "0" + strDate;
  50. }
  51. var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
  52. + " " + date.getHours() + seperator2 + date.getMinutes()
  53. + seperator2 + date.getSeconds();
  54. $("input[name='startTime']").val(currentdate);
  55. $("input[name='endTime']").val(currentdate);
  56. //初始化附件选择器
  57. // AttachMent.init("w");
  58. }
  59. //初始化提交事件
  60. function initSubmit(){
  61. $("a.save").click(function() {
  62. //验证
  63. var frm=$('#sysPlanEdit');
  64. if(!frm.valid()) return ;
  65. //核验选择器的
  66. var submitId = $("input[name='submitId']").val();
  67. if(typeof(submitId)=='undefined'||submitId==null||submitId==''){
  68. $.ligerDialog.warn("请选择提交人!","消息提示");
  69. return;
  70. }
  71. var chargeId = $("input[name='chargeId']").val();
  72. if(typeof(chargeId)=='undefined'||chargeId==null||chargeId==''){
  73. $.ligerDialog.warn("请选择负责人!","消息提示");
  74. return;
  75. }
  76. var rate=$("input[name='rate']").val();
  77. if(typeof(rate)=='undefined'||rate==null||rate==''||rate==0){
  78. $.ligerDialog.warn("请填写日程完成进度!","消息提示");
  79. return;
  80. }
  81. var description= $("textarea[name='description']").val();
  82. if($("textarea[name='description']").val()==''){
  83. $.ligerDialog.warn("请填写日程内容!","消息提示");
  84. return;
  85. }
  86. //提交保存内容
  87. frm.submit();
  88. });
  89. }
  90. //初始化日程交流提交事件
  91. function initExchangeSubmit(dialog){
  92. $("a.save").click(function() {
  93. //核验信息
  94. var content = $("textarea[name='content']").val();
  95. if(typeof(content)=='undefined'||content==null||content==''){
  96. $.ligerDialog.warn("请填写内容!","消息提示");
  97. return;
  98. }
  99. var url = __ctx + "/platform/system/sysPlan/saveExchange.ht";
  100. var planId = $("input[name='planId']").val();
  101. var id = $("input[name='id']").val();
  102. var doc = $("textarea[name='doc']").val();
  103. $.ajax({
  104. type:"post",
  105. url:url,
  106. dataType:"json",
  107. data:{
  108. id:id,
  109. planId:planId,
  110. content:content,
  111. doc:doc
  112. },
  113. success:function(data){
  114. var type = $("input[name='type']").val();
  115. var currentViweDate = $("input[name='currentViweDate']").val();
  116. if(data.result){
  117. $.ligerDialog.success(data.message,"消息提示",function(){
  118. dialog.get("sucCall")(data.cause);
  119. dialog.close();
  120. });
  121. }
  122. else{
  123. $.ligerDialog.warn(data.message,"消息提示");
  124. }
  125. }
  126. });
  127. });
  128. }
  129. //初始化日程评论提交事件
  130. function initCommentSubmit(dialog){
  131. $("a.save").click(function() {
  132. //核验信息
  133. var commentcontent = $("textarea[name='commentcontent']").val();
  134. if(typeof(commentcontent)=='undefined'||commentcontent==null||commentcontent==''){
  135. $.ligerDialog.warn("请填写评论内容!","消息提示");
  136. return;
  137. }
  138. var url = __ctx + "/platform/system/sysPlan/saveComment.ht";
  139. var planId = $("input[name='planId']").val();
  140. var id = $("input[name='id']").val();
  141. var doc = $("textarea[name='doc']").val();
  142. var commentgrade = $("select[name='commentgrade']").val();
  143. $.ajax({
  144. type:"post",
  145. url:url,
  146. dataType:"json",
  147. data:{
  148. id:id,
  149. planId:planId,
  150. commentcontent:commentcontent,
  151. commentgrade:commentgrade,
  152. doc:doc
  153. },
  154. success:function(data){
  155. var type = $("input[name='type']").val();
  156. var currentViweDate = $("input[name='currentViweDate']").val();
  157. if(data.result){
  158. $.ligerDialog.success(data.message,"消息提示",function(){
  159. dialog.get("sucCall")(data.cause);
  160. dialog.close();
  161. });
  162. }
  163. else{
  164. $.ligerDialog.warn(data.message,"消息提示");
  165. }
  166. }
  167. });
  168. });
  169. }
  170. //初始化删除事件
  171. function initDelete(){
  172. $("#delSysPlan").click(function() {
  173. var ids = $("input[name='id']").val();
  174. delSysPlan(ids);
  175. });
  176. }
  177. //通过id字符串(id1,id2,id3...)删除日程
  178. function delSysPlan(ids){
  179. if(!ids){
  180. $.ligerDialog.warn("日程ID为空,删除失败!","消息提示");
  181. return;
  182. }
  183. $.ligerDialog.confirm('确定删除吗?', function (confirm) {
  184. if (confirm){
  185. var url = __ctx + "/platform/system/sysPlan/delete.ht";
  186. $.ajax({
  187. type:"post",
  188. url:url,
  189. dataType:"json",
  190. data:{
  191. ids:ids
  192. },
  193. success:function(data){
  194. var type = $("input[name='type']").val();
  195. var currentViweDate = $("input[name='currentViweDate']").val();
  196. if(data.result){
  197. $.ligerDialog.success(data.message,"消息提示",function(){
  198. var href = __ctx + "/platform/system/sysPlan/submit.ht?currentViweDate="+currentViweDate;
  199. if(type=='charge'){
  200. href = __ctx + "/platform/system/sysPlan/charge.ht?currentViweDate="+currentViweDate;
  201. }
  202. window.location.href = href;
  203. });
  204. }
  205. else{
  206. $.ligerDialog.warn(data.message,"消息提示");
  207. }
  208. }
  209. });
  210. }
  211. });
  212. }
  213. //初始化删除日程交流事件
  214. function initDeleteExchang(){
  215. $("#delSysPlanExchange").click(function() {
  216. var ids = "";
  217. $("input[name='exchangeId']").each(function () {
  218. var me = $(this);
  219. if(me.is(":checked")){
  220. ids += me.val()+",";
  221. }
  222. });
  223. if(ids){
  224. ids = ids.substring(0,ids.length-1);
  225. }
  226. delSysPlanExchange(ids);
  227. });
  228. }
  229. //通过id字符串(id1,id2,id3...)删除日程交流信息
  230. function delSysPlanExchange(ids){
  231. if(!ids){
  232. $.ligerDialog.warn("删除失败,请选择日程交流信息!","消息提示");
  233. return;
  234. }
  235. $.ligerDialog.confirm('确定删除吗?', function (confirm) {
  236. if (confirm){
  237. var url = __ctx + "/platform/system/sysPlan/deleteExchange.ht";
  238. $.ajax({
  239. type:"post",
  240. url:url,
  241. dataType:"json",
  242. data:{
  243. ids:ids
  244. },
  245. success:function(data){
  246. var id = $("input[name='id']").val();
  247. var type = $("input[name='type']").val();
  248. var currentViweDate = $("input[name='currentViweDate']").val();
  249. if(data.result){
  250. $.ligerDialog.success(data.message,"消息提示",function(){
  251. var href = __ctx + "/platform/system/sysPlan/submit.ht?id="+id+"&currentViweDate="+currentViweDate;
  252. if(type=='charge'){
  253. href = __ctx + "/platform/system/sysPlan/exchange.ht?type=charge&id="+id+"&currentViweDate="+currentViweDate;
  254. }else if(type=='participant'){
  255. href = __ctx + "/platform/system/sysPlan/participantToExchange.ht?type=participant&id="+planId+"&currentViweDate="+currentViweDate;
  256. }else if(type=='myPlan'){
  257. href = __ctx + "/platform/system/sysPlan/exchange.ht?type=myPlan&id="+id;
  258. }
  259. window.location.href = href;
  260. });
  261. }
  262. else{
  263. $.ligerDialog.warn(data.message,"消息提示");
  264. }
  265. }
  266. });
  267. }
  268. });
  269. }
  270. //初始化完成日程事件
  271. function initFinishSysPlan(){
  272. $("#finishSysPlan").click(function() {
  273. var id = $("input[name='id']").val();
  274. finishSysPlan(id);
  275. });
  276. }
  277. //通过id完成日程
  278. function finishSysPlan(id){
  279. if(!id){
  280. $.ligerDialog.warn("日程ID信息为空,完成任务失败!","消息提示");
  281. return;
  282. }
  283. $.ligerDialog.confirm('确定完成任务吗?', function (confirm) {
  284. if (confirm){
  285. var url = __ctx + "/platform/system/sysPlan/chargeSysPlans.ht";
  286. $.ajax({
  287. type:"post",
  288. url:url,
  289. dataType:"json",
  290. data:{
  291. ids:id,
  292. rate:100
  293. },
  294. success:function(data){
  295. var type = $("input[name='type']").val();
  296. var currentViweDate = $("input[name='currentViweDate']").val();
  297. if(data.result){
  298. $.ligerDialog.success(data.message,"消息提示",function(){
  299. var href = __ctx + "/platform/system/sysPlan/submit.ht?id="+id+"&currentViweDate="+currentViweDate;
  300. if(type=='charge'){
  301. href = __ctx + "/platform/system/sysPlan/exchange.ht?type=charge&id="+id+"&currentViweDate="+currentViweDate;
  302. }else if(type=='participant'){
  303. href = __ctx + "/platform/system/sysPlan/participantToExchange.ht?type=participant&id="+id+"&currentViweDate="+currentViweDate;
  304. }else if(type=='myPlan'){
  305. href = __ctx + "/platform/system/sysPlan/exchange.ht?type=myPlan&id="+id;
  306. }
  307. window.location.href = href;
  308. });
  309. }
  310. else{
  311. $.ligerDialog.warn(data.message,"消息提示");
  312. }
  313. }
  314. });
  315. }
  316. });
  317. }
  318. //初始化日程交流信息添加事件
  319. function initAddSysPlanExchange(){
  320. $("#addSysPlanExchange").click(function() {
  321. var planId = $("input[name='id']").val();
  322. editSysPlanExchange("",planId);
  323. });
  324. }
  325. //打开修改日程交流页面
  326. function editSysPlanExchange(id,planId){
  327. var url = __ctx + "/platform/system/sysPlan/exchangeEdit.ht?planId="+planId+"&id="+id;
  328. var type = $("input[name='type']").val();
  329. var currentViweDate = $("input[name='currentViweDate']").val();
  330. DialogUtil.open({
  331. height:400,
  332. width: 600,
  333. title : '编辑日程交流',
  334. url: url,
  335. isResize: false,
  336. sucCall:function(retVal){
  337. if(retVal){
  338. var href = __ctx + "/platform/system/sysPlan/submit.ht?id="+planId+"&currentViweDate="+currentViweDate;
  339. if(type=='charge'){
  340. href = __ctx + "/platform/system/sysPlan/exchange.ht?type=charge&id="+planId+"&currentViweDate="+currentViweDate;
  341. }else if(type=='participant'){
  342. href = __ctx + "/platform/system/sysPlan/participantToExchange.ht?type=participant&id="+planId+"&currentViweDate="+currentViweDate;
  343. }else if(type=='myPlan'){
  344. href = __ctx + "/platform/system/sysPlan/exchange.ht?type=myPlan&id="+planId;
  345. }
  346. window.location.href = href;
  347. }
  348. }
  349. });
  350. }
  351. //打开日交流信息查看页面
  352. function openSysPlanExchange(id,planId){
  353. var url = __ctx + "/platform/system/sysPlan/exchangeGet.ht?planId="+planId+"&id="+id;
  354. DialogUtil.open({
  355. height:400,
  356. width: 600,
  357. title : '日程交流信息详情',
  358. url: url,
  359. isResize: false,
  360. sucCall:function(retVal){
  361. //回调
  362. }
  363. });
  364. }
  365. //打开日评论信息查看页面
  366. function openSysPlanExchange(id,planId){
  367. var url = __ctx + "/platform/system/sysPlan/commentGet.ht?planId="+planId+"&id="+id;
  368. DialogUtil.open({
  369. height:400,
  370. width: 600,
  371. title : '日程评论信息详情',
  372. url: url,
  373. isResize: false,
  374. sucCall:function(retVal){
  375. //回调
  376. }
  377. });
  378. }
  379. //选择用户
  380. /* 例子:
  381. <input type="hidden" name="submitId" value="${sysPlan.submitId}" />
  382. <input type="hidden" name="submitor" value="${sysPlan.submitor}" />
  383. <div id='submitDiv'></div>
  384. <a class="link add" onclick="chooseUser(this,'submitDiv','submitId','submitor','yes');" ><span></span>选择</a>
  385. <a class="link reset" onclick="resetSelect('submitDiv','submitId','submitor');" ><span></span>重置</a>
  386. */
  387. function chooseUser(me,divId,myId,myName,isSingleMark) {
  388. var isSingle = false;
  389. if(isSingleMark=='yes'){
  390. isSingle = true;
  391. }
  392. var data = [];
  393. var href = __ctx+"/platform/system/sysUser/get.ht?openType=detail&userId=";
  394. var ids = $("input[name='"+myId+"']").val();
  395. var names = $("input[name='"+myName+"']").val();
  396. if(ids){
  397. data = convertToArry(ids, names);
  398. }
  399. UserDialog({isSingle:isSingle,selectUsers:data,callback:function(userIds, fullnames,email,mobile,json){
  400. var arry = convertToArry(userIds, fullnames);
  401. if(arry.length>0){
  402. setOwnerDiv(divId,arry,href,myId,myName);
  403. }
  404. }});
  405. };
  406. //选择自定义对话框
  407. /* 例子:
  408. <input type="hidden" name="customerId" value="${sysPlan.chargeId}" />
  409. <input type="hidden" name="customer" value="${sysPlan.charge}" />
  410. <div id='customerDiv'></div>
  411. <a class="link add" onclick="chooseCustomer(this,'spxx(别名)','这里是参数为空','customerDiv','customerId','customer');" ><span></span>选择</a>
  412. <a class="link reset" onclick="resetSelect('customerDiv','customerId','customer');" ><span></span>重置</a>
  413. */
  414. function chooseCustomer(me,alias,paramValueString,divId,myId,myName){
  415. //最好是返回一个对象的,因为客户这个字段只支持一个
  416. CommonDialog(alias,function(data){
  417. //data返回 Object { F_spmc = "参数值", F_dj = "参数值", F_sl = "参数值"},多个则返回 Object 数组
  418. if(data){
  419. var arry = convertToArry(data.ID, data.F_spmc);
  420. if(arry.length>0){
  421. setOwnerDiv(divId,arry,null,myId,myName);
  422. }
  423. }
  424. },paramValueString);
  425. }
  426. /* 例子:
  427. */
  428. function chooseProcessRun(me,divId,myId,myName,isSingleMark) {
  429. var isSingle = 'yes';
  430. if(isSingleMark!='yes'){
  431. isSingle = 'no';
  432. }
  433. var ids = $("input[name='"+myId+"']").val();
  434. var names = $("input[name='"+myName+"']").val();
  435. var data = [];
  436. if(ids){
  437. data = convertToArry(ids, names);
  438. }
  439. processRunDialog({isSingle:isSingle,arguments:data,callback:function(that,rtn){
  440. //var arry = convertToArry(userIds, fullnames);
  441. if(that&&that.json){
  442. var arry = that.json;
  443. setOwnerDiv(divId,arry,"",myId,myName);
  444. }
  445. }});
  446. };
  447. /**
  448. * 流程工单选择窗口。
  449. * processRunDialog({isSingle:true,callback:dlgCallBack}){
  450. * //回调函数处理
  451. * }});
  452. * @param conf
  453. */
  454. function processRunDialog(conf){
  455. var dialogWidth=900;
  456. var dialogHeight=640;
  457. conf=$.extend({},{dialogWidth:dialogWidth ,dialogHeight:dialogHeight ,help:0,status:0,scroll:0,center:1},conf);
  458. if(!conf.isSingle)conf.isSingle='yes';
  459. var url=__ctx + '/platform/system/sysPlan/processRunDialog.ht?isSingle=' + conf.isSingle;
  460. url=url.getNewUrl();
  461. var that = this;
  462. DialogUtil.open({
  463. height:conf.dialogHeight,
  464. width: conf.dialogWidth,
  465. title : '打开选择引用流程实例工单对话框',
  466. url: url,
  467. isResize: true,
  468. conf:conf,
  469. //自定义参数
  470. arguments: conf.arguments,
  471. sucCall:function(rtn){
  472. conf.callback.call(that,rtn);
  473. }
  474. });
  475. }
  476. //转成JSON数组
  477. function convertToArry(tempIds,tempNames){
  478. var ids=tempIds.split(",");
  479. var names=tempNames.split(",");
  480. var arry=[];
  481. for(var i=0;i<ids.length;i++){
  482. var obj={};
  483. obj.id=ids[i];
  484. obj.name=names[i];
  485. arry.push(obj);
  486. }
  487. return arry;
  488. }
  489. //选择器回填
  490. function setOwnerDiv(divId,arry,href,myId,myName,width,height,title){
  491. var div = $("#"+divId);
  492. div.empty();
  493. var myIdObj = $("input[name='"+myId+"']");
  494. var myNameObj = $("input[name='"+myName+"']");
  495. var ids = "";
  496. var names = "";
  497. for(var i=0;i<arry.length;i++){
  498. var obj=arry[i];
  499. ids += obj.id+",";
  500. names += obj.name+",";
  501. var a = $('<a class="moreinfo"></a>').html(obj.name).attr("ownerId",obj.id);
  502. if(href){
  503. a.attr("hrefstr",href+obj.id);
  504. a.attr("href","#");
  505. }
  506. if(width){
  507. a.attr("dialogWidth",width);
  508. }
  509. if(height){
  510. a.attr("dialogHeight",height);
  511. }
  512. if(title){
  513. a.attr("dialogTitle",title);
  514. }
  515. var span = $('<span class="owner-span"></span>').html(a);
  516. div.append(span);
  517. }
  518. ids = ids.substring(0, ids.length-1);
  519. names = names.substring(0, names.length-1);
  520. myIdObj.val(ids);
  521. myNameObj.val(names);
  522. }
  523. //重置
  524. function resetSelect(divId,cleanId,cleanName){
  525. $("#"+divId).empty();
  526. $("input[name='"+cleanId+"']").val("");
  527. $("input[name='"+cleanName+"']").val("");
  528. }
  529. //人员查看详情事件
  530. function openDetailEvent(){
  531. $("a.moreinfo").live('click',function(){
  532. var me = $(this),
  533. hrefStr = me.attr('hrefstr'),
  534. dialogWidth = me.attr('dialogWidth'),
  535. dialogHeight = me.attr('dialogHeight'),
  536. dialogTitle = me.attr('dialogTitle');
  537. if(!hrefStr)return;
  538. //alert(hrefStr);
  539. openDetailWin({url:hrefStr,hasClose:true,dialogWidth:dialogWidth,dialogHeight:dialogHeight,dialogTitle:dialogTitle});
  540. });
  541. }
  542. //显示用户详情
  543. function openDetailWin(conf){
  544. var dialogWidth=1100;
  545. var dialogHeight=780;
  546. var dialogTitle='用户详情';
  547. conf=$.extend({},{dialogWidth:dialogWidth ,dialogHeight:dialogHeight ,dialogTitle:dialogTitle, help:0,status:0,scroll:0,center:1},conf);
  548. var url = conf.url + '&hasClose=' +conf.hasClose;
  549. /*KILLDIALOG*/
  550. DialogUtil.open({
  551. height:conf.dialogHeight,
  552. width: conf.dialogWidth,
  553. title: conf.dialogTitle,
  554. url: url,
  555. isResize: true,
  556. });
  557. }
  558. //全选择方法
  559. function selectCheckbox(all_checkboxName){
  560. var checkboxNames = all_checkboxName.split("_");
  561. var checkboxName = checkboxNames[1];
  562. var checkboxNameArry = $("input[name='"+checkboxName+"']");
  563. var checked=$("#"+all_checkboxName).is(":checked");
  564. if(checked){
  565. checkboxNameArry.attr("checked",true);
  566. }else{
  567. checkboxNameArry.removeAttr("checked");
  568. }
  569. };
  570. //订阅
  571. function subscribeSysPlan(planId){
  572. var executionUrl = __ctx + "/platform/system/sysPlan/subscribeSysPlan.ht";
  573. var reutrnUrl = __ctx + "/platform/system/sysPlan/underList.ht";
  574. var queryParam = {planId:planId};
  575. executionSysPlan(queryParam,executionUrl,reutrnUrl);
  576. }
  577. //退订
  578. function cancelSysPlan(subscribeId){
  579. var executionUrl = __ctx + "/platform/system/sysPlan/cancelSysPlan.ht";
  580. var reutrnUrl = __ctx + "/platform/system/sysPlan/underList.ht";
  581. var queryParam = {id:subscribeId};
  582. executionSysPlan(queryParam,executionUrl,reutrnUrl);
  583. }
  584. //推送
  585. function pushSysPlan(planId,type){
  586. var executionUrl = __ctx + "/platform/system/sysPlan/planPush.ht?type=" + type;
  587. var reutrnUrl;
  588. if(type == 1){
  589. reutrnUrl = __ctx + "/platform/system/sysPlan/underList.ht";
  590. }else if(type == 2){
  591. reutrnUrl = __ctx + "/platform/system/sysPlanPush/list.ht";
  592. }
  593. var queryParam = {planId:planId};
  594. executionSysPlan(queryParam,executionUrl,reutrnUrl);
  595. }
  596. //执行异步回返方法
  597. function executionSysPlan(queryParam,executionUrl,reutrnUrl){
  598. var queryUserId = $("input[name='queryUserId']").val();
  599. if(queryUserId!=null&&queryUserId!=''&& 'undefined' != typeof (queryUserId)){
  600. reutrnUrl = reutrnUrl+"?queryUserId="+queryUserId;
  601. }
  602. $.ajax({
  603. type:"post",
  604. url:executionUrl,
  605. dataType:"json",
  606. data:queryParam,
  607. success:function(data){
  608. if(data.result){
  609. $.ligerDialog.success(data.message,"消息提示",function(){
  610. window.location.href = reutrnUrl;
  611. });
  612. }
  613. else{
  614. $.ligerDialog.warn(data.message,"消息提示");
  615. }
  616. }
  617. });
  618. }
  619. //初始化日程评论信息添加事件
  620. function initAddSysPlanComment(){
  621. $("#addSysPlanComment").click(function() {
  622. var planId = $("input[name='id']").val();//获取日志ID
  623. editSysPlanComment("",planId);
  624. });
  625. }
  626. //打开修改日程交流页面
  627. function editSysPlanComment(id,planId){
  628. var url = __ctx + "/platform/system/sysPlan/commentEdit.ht?planId="+planId+"&id="+id;
  629. var type = $("input[name='type']").val();
  630. var currentViweDate = $("input[name='currentViweDate']").val();
  631. //alert(type);
  632. DialogUtil.open({
  633. height:610,
  634. width:750,
  635. title : '编辑日程评论',
  636. url: url,
  637. isResize: false,
  638. sucCall:function(retVal){
  639. if(retVal){
  640. var href = __ctx + "/platform/system/sysPlan/submit.ht?id="+planId+"&currentViweDate="+currentViweDate;
  641. if(type=='charge'){
  642. href = __ctx + "/platform/system/sysPlan/exchange.ht?type=charge&id="+planId+"&currentViweDate="+currentViweDate;
  643. }else if(type=='participant'){
  644. href = __ctx + "/platform/system/sysPlan/participantToExchange.ht?type=participant&id="+planId+"&currentViweDate="+currentViweDate;
  645. }else if(type=='myPlan'){
  646. href = __ctx + "/platform/system/sysPlan/exchange.ht?type=myPlan&id="+planId;
  647. }else if(type=='subscribeList'){
  648. href = __ctx + "/platform/system/sysPlan/comment.ht?type=charge&id="+planId+"&currentViweDate="+currentViweDate;
  649. }else if(type=='subscribe'){
  650. href = __ctx + "/platform/system/sysPlan/comment.ht?type=charge&id="+planId+"&currentViweDate="+currentViweDate;
  651. }
  652. window.location.href = href;
  653. }
  654. }
  655. });
  656. }