processFlow.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792
  1. function checkForm() {
  2. var rs = true;
  3. var reqOffice = $("#reqOffice").val();
  4. // 查询当前环节附件
  5. var tache_files = $(".tache_file");
  6. if(reqOffice == "1" && tache_files.length == 0){
  7. rs = $.validate({
  8. name : "file_fileId",
  9. model : [ {
  10. type : "require",
  11. msg : "请上传附件!"
  12. }]
  13. }) && rs;
  14. }
  15. var pathJudgeType = $("#pathJudgeType").val();
  16. if (pathJudgeType == "1") {
  17. rs = $.validate({
  18. name : "nextTmodelId",
  19. model : [ {
  20. type : "require",
  21. msg : "下一步环节不能为空!"
  22. } ]
  23. });
  24. }
  25. var usersNames = $("[type='text'][id*='usersName']:visible");
  26. for ( var i = 0; i < usersNames.length; i++) {
  27. rs = $.validate({
  28. name : usersNames[i].id,
  29. model : [ {
  30. type : "require",
  31. msg : "下一步环节操作人不能为空!"
  32. } ]
  33. }) && rs;
  34. }
  35. if (rs) {
  36. return true;
  37. }
  38. return false;
  39. }
  40. function checkCode(){
  41. var handleValidate = $("#handleValidate").val();
  42. if(handleValidate=='0'){
  43. formJs();
  44. return;
  45. }
  46. var validateCode = $("#validateCode").val();
  47. if(validateCode == null || validateCode==''){
  48. $("#errorTip").show();
  49. return;
  50. }
  51. $.ajax({
  52. url : "FlowAction.do",
  53. async : false,
  54. type : "post",
  55. data : {
  56. "task" : "checkCode",
  57. "insId" : $("#insId").val(),
  58. "tinsId" : $("#tinsId").val(),
  59. "user" : $("#userid").val(),
  60. "code" : $("#validateCode").val()
  61. },
  62. success : function(data) {
  63. //alert(data);
  64. if (data=="true") {
  65. $("#errorTip").hide();
  66. formJs();
  67. } else {
  68. $("#errorTip").show();
  69. }
  70. },
  71. error : function() {
  72. addError("数据处理失败,请检查网络重新登录或联系管理员!");
  73. }
  74. });
  75. }
  76. function formJs() {
  77. if (formId == "0") {
  78. var rs = checkForm();
  79. $("#formInsId").val("0");
  80. if (rs) {
  81. //$('.bsubmit').attr("disabled", "disabled");
  82. preProcess("FlowAction.do", "#insForm");
  83. }
  84. } else {
  85. var rs = true;
  86. rs = checkForm() && rs;
  87. if (rs) {
  88. var hasGen = $(window.frames["formIns"].document).find(
  89. "#hasGen").val();
  90. //$('.bsubmit').attr("disabled", "disabled");
  91. if(document.frames == undefined){
  92. window.frames["formIns"].replaceTextarea();
  93. } else {
  94. document.frames.formIns.replaceTextarea();
  95. }
  96. if (hasGen == 0) {
  97. $(window.frames["formIns"].document).find("#formIns").attr("action","bpmFormInstanceAction.do?task=updateIns");
  98. $(window.frames["formIns"].document).find("#formIns").submit();
  99. } else {
  100. if(document.frames == undefined){
  101. window.frames["formIns"].save();
  102. } else {
  103. document.frames.formIns.save();
  104. }
  105. }
  106. }
  107. }
  108. }
  109. /**
  110. * 修改流程标题
  111. */
  112. function changeInsName() {
  113. $("#insNameText").show();
  114. $("#insNameEnter").show();
  115. $("#insNameEdit").hide();
  116. $("#insNameFont").hide();
  117. }
  118. /**
  119. * 确认标题修改
  120. */
  121. function confirmInsName() {
  122. if($.trim($("#insNameText").val()) == ''){
  123. addError("流程标题不能为空!");
  124. return;
  125. }
  126. if($.trim($("#insNameText").val()).length >100){
  127. addError("流程标题不能超过100个字!");
  128. return;
  129. }
  130. $("#insNameText").hide();
  131. $("#insNameEnter").hide();
  132. $("#insNameEdit").show();
  133. $("#insNameFont").show();
  134. $("#insNameFont").text($("#insNameText").val());
  135. $("#insName").val($("#insNameText").val());
  136. }
  137. function returnJs(buttonName){
  138. if(!confirm("确认" + buttonName + "该流程?")){
  139. return;
  140. }
  141. $('#task').val('return');
  142. /*if(formId == "0"){
  143. var rs = true;
  144. $("#formInsId").val("0");
  145. if(rs){
  146. $('.bsubmit').attr("disabled", "disabled");
  147. saveFlow("FlowAction.do", "#insForm");
  148. }
  149. } else {
  150. var rs = true;
  151. rs = document.frames.formIns.checkForm();
  152. //rs = checkForm() && rs;
  153. if(rs){
  154. var hasGen = $(window.frames["formIns"].document).find("#hasGen").val();
  155. $('.bsubmit').attr("disabled", "disabled");
  156. if(hasGen == 0){
  157. $(window.frames["formIns"].document).find("#formIns").submit();
  158. } else {
  159. document.frames.formIns.save();
  160. }
  161. }
  162. }*/
  163. var rs = true;
  164. if(formId == "0"){
  165. $("#formInsId").val("0");
  166. }
  167. if(rs){
  168. //$('.bsubmit').attr("disabled", "disabled");
  169. var x = $("#insForm").serializeArray();
  170. $.each(x, function(i, field) {
  171. field.value = encodeURI(field.value);
  172. });
  173. $.ajax({
  174. url : "FlowAction.do",
  175. async : true,
  176. type : "post",
  177. data : x,
  178. success : function(data) {
  179. //addInfo(data);
  180. //location="MTFlowAction.do?task=toDealList";
  181. yrConfirm(data+"是否继续办理下一个流程?",nextdeal);
  182. },
  183. error : function() {
  184. alert("数据处理失败,请检查网络重新登录或联系管理员!");
  185. },
  186. beforeSend : function() {
  187. }
  188. });
  189. }
  190. }
  191. function returnToSenderJs(){
  192. if(!confirm("确认退回至发起人?")){
  193. return;
  194. }
  195. $('#task').val('returnToSender');
  196. var rs = true;
  197. if(formId == "0"){
  198. $("#formInsId").val("0");
  199. }
  200. if(rs){
  201. //$('.bsubmit').attr("disabled", "disabled");
  202. var x = $("#insForm").serializeArray();
  203. $.each(x, function(i, field) {
  204. field.value = encodeURI(field.value);
  205. });
  206. $.ajax({
  207. url : "FlowAction.do",
  208. async : true,
  209. type : "post",
  210. data : x,
  211. success : function(data) {
  212. //addInfo(data);
  213. //location="MTFlowAction.do?task=toDealList";
  214. yrConfirm(data+"是否继续办理下一个流程?",nextdeal);
  215. },
  216. error : function() {
  217. alert("数据处理失败,请检查网络重新登录或联系管理员!");
  218. },
  219. beforeSend : function() {
  220. }
  221. });
  222. }
  223. }
  224. var officeDialog = null;
  225. var nextTacheDialog = null;
  226. var assistDialog = null;
  227. function ow(owurl, name) {
  228. officeDialog = $.ligerDialog.open({
  229. height : 700,
  230. width : 1000,
  231. url : owurl,
  232. showMax : false,
  233. showToggle : false,
  234. showMin : false,
  235. isResize : false,
  236. modal : true,
  237. title : name,
  238. allowClose : false
  239. });
  240. }
  241. function closeOfficeDialog() {
  242. officeDialog.close();
  243. }
  244. function openOffice() {
  245. var officeId = $("#officeId").val();
  246. ow('${pageContext.request.contextPath}/NtkoAction.do?task=edit&fileId='
  247. + officeId, 'web文档');
  248. }
  249. function setValue(fileId, fileName) {
  250. $("#officeId").val(fileId);
  251. $("#officeName").val(fileName);
  252. }
  253. /**
  254. * 点击"提交"展示"选择下一环节信息"
  255. */
  256. function chooseNextTache(buttonName) {
  257. if(!confirm("确认" + buttonName + "该流程?")){
  258. return;
  259. }
  260. var rs = true;
  261. var reqRemark = $("#reqRemark").val();
  262. if (reqRemark == "1") {
  263. rs = $.validate({
  264. name : "remark",
  265. model : [ {
  266. type : "require",
  267. msg : "流程内容不能为空!"
  268. },{
  269. type : "len",
  270. min : 0,
  271. max : 1000,
  272. msg : "流程内容长度不能超过1000个字!"
  273. } ]
  274. });
  275. }else{
  276. rs = $.validate({
  277. name : "remark",
  278. model : [ {
  279. type : "len",
  280. min : 0,
  281. max : 1000,
  282. msg : "流程内容长度不能超过1000个字!"
  283. } ]
  284. });
  285. }
  286. if (formId != "0") {
  287. if(document.frames == undefined){
  288. rs = window.frames["formIns"].checkForm() && rs;
  289. } else {
  290. rs = document.frames.formIns.checkForm() && rs;
  291. }
  292. }
  293. if (!rs) {
  294. return;
  295. }
  296. window.scrollTo(0,0);
  297. //nextTacheDialog.show();
  298. checkCode();
  299. }
  300. /**
  301. * 关闭"选择下一环节信息"对话框
  302. */
  303. function closeNextTache() {
  304. nextTacheDialog.hidden();
  305. }
  306. function closeNextTacheInfo() {
  307. nextTacheInfoDialog.hidden();
  308. }
  309. /**
  310. * 初始化"选择下一环节信息"对话框
  311. */
  312. $(function() {
  313. nextTacheInfoDialog = $.ligerDialog.open({
  314. width : 1000,
  315. target : $("#nextTacheInfo"),
  316. showMax : false,
  317. showToggle : false,
  318. showMin : false,
  319. show : false,
  320. isResize : false,
  321. modal : true,
  322. top: 260,
  323. title : "后续环节人员查看及选择",
  324. allowClose : true,
  325. containerId : 'insForm'
  326. });
  327. nextTacheInfoDialog.hidden();
  328. assistDialog = $.ligerDialog.open({
  329. width : 500,
  330. target : $("#assistDiv"),
  331. showMax : false,
  332. showToggle : false,
  333. showMin : false,
  334. show : false,
  335. isResize : false,
  336. modal : true,
  337. title : "选择协办人员",
  338. allowClose : true,
  339. containerId : 'insForm'
  340. });
  341. assistDialog.hidden();
  342. });
  343. function preProcess(actionUrl, formName) {
  344. $("#task").val("preProcess");
  345. var x = $(formName).serializeArray();
  346. $.each(x, function(i, field) {
  347. field.value = encodeURI(field.value);
  348. });
  349. $.ajax({
  350. url : actionUrl,
  351. async : true,
  352. type : "post",
  353. data : x,
  354. dataType : "json",
  355. success : function(data) {
  356. //addInfo(data);
  357. //closeSelf();
  358. var resultState = data[0].resultState;
  359. var submitState = data[0].submitState;
  360. var resultInfo = data[0].resultInfo;
  361. if(!submitState){
  362. $("#sbmbtn").hide();
  363. $("#clsbtn").show();
  364. } else {
  365. $("#sbmbtn").show();
  366. $("#clsbtn").hide();
  367. }
  368. document.body.scrollIntoView();//滚动到页面顶部
  369. if(resultState){
  370. var table= $("#nextTacheInfoTd");
  371. table.html("");
  372. var nextTacheInstances = data[0].nextTacheInstances;
  373. for(var i = 0 ; i < nextTacheInstances.length; i++){
  374. var users = nextTacheInstances[i].users;
  375. var info = nextTacheInstances[i].info;
  376. var isCheck = nextTacheInstances[i].isCheck;
  377. var tacheModel = nextTacheInstances[i].tacheModel;
  378. var html = "<tr><td>";
  379. html += "<input type='hidden' id='tmodelId_" +
  380. tacheModel.tmodelId + "' name='tmodelId_" +
  381. tacheModel.tmodelId + "' value='" + tacheModel.tmodelId + "'>";
  382. html += tacheModel.tmodelName;
  383. html += "</td><td>";
  384. if(isCheck){
  385. html += "<input type='hidden' id='isCheck_" + tacheModel.tmodelId
  386. + "' name='isCheck_" + tacheModel.tmodelId + "' value='1'>";
  387. } else {
  388. html += "<input type='hidden' id='isCheck_" + tacheModel.tmodelId
  389. + "' name='isCheck_" + tacheModel.tmodelId + "' value='0'>";
  390. }
  391. if(info != "" && info != null && info != undefined){
  392. html += "<span style='color:red'>" + info + "</span>";
  393. } else {
  394. var lzCount = 0;
  395. for(var j = 0 ; j < users.length; j++){
  396. var userState = users[j].state;
  397. if(userState == "1"){
  398. html += "<input type='checkbox' id='tmodel_" +
  399. tacheModel.tmodelId + "' name='tmodel_" + tacheModel.tmodelId +
  400. "' value='" + users[j].id + "' checked='checked'>";
  401. html += users[j].userId.username;
  402. } else {
  403. lzCount ++;
  404. }
  405. // else {
  406. // html += "<input type='checkbox' id='tmodel_" +
  407. // tacheModel.tmodelId + "' name='tmodel_" + tacheModel.tmodelId +
  408. // "' value='" + users[j].id + "' readonly='readonly'>";
  409. // html += users[j].userId.username;
  410. // html += "(该用户已离职)&nbsp;";
  411. // }
  412. }
  413. if(users.length == lzCount){
  414. html += "<span style='color:red'>下一环节操作人无人在职!</span>";
  415. }
  416. }
  417. html += "</td></tr>";
  418. table.append(html);
  419. }
  420. } else {
  421. var table= $("#nextTacheInfoTd");
  422. table.html("");
  423. var html = "<td style='text-align: center;' colspan='2'>";
  424. html += "<span style='color: red;'>" + resultInfo + "</span>";
  425. html += "</td>";
  426. table.append(html);
  427. }
  428. $("#validateTip").hide();
  429. nextTacheInfoDialog.show();
  430. },
  431. error : function() {
  432. alert("数据处理失败,请检查网络重新登录或联系管理员!");
  433. //$("button").removeAttr("disabled");
  434. },
  435. beforeSend : function() {
  436. //$("button").attr("disabled", "disabled");
  437. }
  438. });
  439. }
  440. function saveFlow() {
  441. $("#sbmbtn").attr("disabled", "disabled");
  442. $("#task").val("process");
  443. var x = $("#insForm").serializeArray();
  444. $.each(x, function(i, field) {
  445. field.value = encodeURI(field.value);
  446. });
  447. var tmodelIds = $("[name*='tmodelId_']");
  448. for(var i = 0; i < tmodelIds.length; i++){
  449. var isCheck = $("#isCheck_" + tmodelIds[i].value).val();
  450. if(isCheck == '1'){
  451. var bool = false;
  452. $("input[name='tmodel_" + tmodelIds[i].value + "']").each(function(){
  453. if(this.checked){
  454. bool = true;
  455. }
  456. });
  457. if(!bool){
  458. $("#validateTip").show();
  459. $("#sbmbtn").removeAttr("disabled");
  460. return false;
  461. }
  462. }
  463. }
  464. var result1 = false;
  465. $.ajax({
  466. url : "FlowAction.do",
  467. async : false,
  468. type : "post",
  469. data : x,
  470. dataType : 'json',
  471. success : function(data) {
  472. var resultState = data[0].resultState;
  473. var resultInfo = data[0].resultInfo;
  474. if(resultState){
  475. //addInfo("流程办理成功!");
  476. // var oldTabid = $("#tabid").val();
  477. // window.parent.f_reloadTab(oldTabid);
  478. // window.parent.frames[oldTabid].closeODialog($("#dialogId").val());
  479. result1 = true;
  480. //location="MTFlowAction.do?task=toDealList";
  481. } else {
  482. addError(resultInfo);
  483. }
  484. },
  485. error : function() {
  486. alert("数据处理失败,请检查网络重新登录或联系管理员!");
  487. $("button").removeAttr("disabled");
  488. },
  489. beforeSend : function() {
  490. //$("button").attr("disabled", "disabled");
  491. }
  492. });
  493. if(!result1){
  494. $("#sbmbtn").removeAttr("disabled");
  495. }else{
  496. yrConfirm("流程办理成功,是否继续办理下一个流程?",nextdeal);
  497. }
  498. }
  499. function nextdeal(r){
  500. if(r==true){
  501. $.ajax({
  502. url : "FlowAction.do",
  503. async : false,
  504. type : "post",
  505. data : {
  506. "task" : "dealList",
  507. "p" : "0",
  508. "pSize" : "1"
  509. },
  510. /*dataType : 'json',*/
  511. success : function(data) {
  512. var jsondata = eval('(' + data + ')');
  513. var Total = jsondata.Total;
  514. if(Total == 0){
  515. addInfo("没有剩余的待办流程!");
  516. location="MTFlowAction.do?task=toDealList";
  517. }else{
  518. var Rows = jsondata.Rows;
  519. var tinsId = Rows[0].tinsId;
  520. var control = Rows[0].modelId.control.value;
  521. if (control == "1") {
  522. item("MTFlowAction.do?task=toProcess&tinsId="+tinsId);
  523. }else{
  524. item("MTFlowAction.do?task=toCustomProcess&tinsId="+tinsId);
  525. }
  526. }
  527. //closeSelf();
  528. },
  529. error : function(data,err) {
  530. alert("数据处理失败,请检查网络重新登录或联系管理员!");
  531. },
  532. beforeSend : function() {
  533. }
  534. });
  535. }else{
  536. location="MTFlowAction.do?task=toDealList";
  537. }
  538. }
  539. //表单暂存
  540. function tempformJs() {
  541. if(document.frames == undefined){
  542. window.frames["formIns"].replaceTextarea();
  543. } else {
  544. document.frames.formIns.replaceTextarea();
  545. }
  546. $(window.frames["formIns"].document).find("#formIns").attr("action","bpmFormInstanceAction.do?task=tempInsForUpdate");
  547. $(window.frames["formIns"].document).find("#formIns").submit();
  548. nextTacheInfoDialog.hidden();
  549. }
  550. function sendAssist(){
  551. var rs = false;
  552. rs = $.validate({
  553. name : "taskContent",
  554. model : [ {
  555. type : "require",
  556. msg : "内容不为空!"
  557. } ]
  558. });
  559. rs = $.validate({
  560. name : "assistUsernames",
  561. model : [ {
  562. type : "require",
  563. msg : "对象不为空!"
  564. } ]
  565. }) && rs;
  566. if(!rs){
  567. return;
  568. }
  569. $.ajax({
  570. url : "bpmTaskAction.do",
  571. async : true,
  572. type : "post",
  573. data : {
  574. "task" : "createAssist",
  575. "users" : $("#assistUsers").val(),
  576. "insId" : $("#insId").val(),
  577. "tinsId" : $("#tinsId").val(),
  578. "taskContent" : encodeURI($("#taskContent").val())
  579. },
  580. //dataType : 'json',
  581. success : function(data) {
  582. if(data == "true"){
  583. assistDialog.hidden();
  584. $("#assistUsernames").val("");
  585. $("#taskContent").val("");
  586. $("#assistUsers").val("");
  587. addInfo("派发成功!");
  588. } else {
  589. assistDialog.hidden();
  590. addInfo("派发失败!");
  591. }
  592. },
  593. error : function() {
  594. alert("数据处理失败,请检查网络重新登录或联系管理员!");
  595. },
  596. beforeSend : function() {
  597. }
  598. });
  599. }
  600. function sendCode1() {
  601. $("#errorTip").hide();
  602. $.ajax({
  603. url : "FlowAction.do",
  604. async : false,
  605. type : "post",
  606. data : {
  607. "task" : "sendCode",
  608. "insId" : $("#insId").val(),
  609. "tinsId" : $("#tinsId").val(),
  610. "user" : $("#userid").val()
  611. },
  612. success : function(data) {
  613. //alert(data);
  614. if (data) {
  615. $("#sendCode").hide();
  616. $("#resendCode").hide();
  617. $("#resendTip").show();
  618. setTimeout(function() {
  619. $("#resendTip").hide();
  620. $("#resendCode").show();
  621. }, '60000');
  622. }
  623. },
  624. error : function() {
  625. addError("数据处理失败,请检查网络重新登录或联系管理员!");
  626. }
  627. });
  628. }
  629. function sendCode2() {
  630. $("#errorTip").hide();
  631. //alert(1);
  632. $.ajax({
  633. url : "FlowAction.do",
  634. async : false,
  635. type : "post",
  636. data : {
  637. "task" : "resendCode",
  638. "insId" : $("#insId").val(),
  639. "tinsId" : $("#tinsId").val(),
  640. "user" : $("#userid").val()
  641. },
  642. success : function(data) {
  643. //alert(data);
  644. if (data) {
  645. $("#sendCode").hide();
  646. $("#resendCode").hide();
  647. $("#resendTip").show();
  648. setTimeout(function() {
  649. $("#resendTip").hide();
  650. $("#resendCode").show();
  651. }, '60000');
  652. }
  653. },
  654. error : function() {
  655. addError("数据处理失败,请检查网络重新登录或联系管理员!");
  656. }
  657. });
  658. }
  659. function delFile(ifileId){
  660. if(confirm("是否确定删除该附件?")){
  661. $.ajax({
  662. url : "FlowAction.do",
  663. async : true,
  664. type : "post",
  665. data : {
  666. "task" : "delFile",
  667. "ifileId" : ifileId
  668. },
  669. success : function(data) {
  670. if (data == "10010") {
  671. addError("删除附件失败!");
  672. } else if (data == "10011") {
  673. addInfo("删除附件成功!");
  674. var datestr = formatDate(new Date());
  675. var tr = $("#"+ifileId).clone();
  676. $("#"+ifileId).html("");
  677. $("#"+ifileId).remove();
  678. tr.find("#"+ifileId+"_filespan").removeAttr("id");
  679. tr.find("#"+ifileId+"_span").html("<font color=\"red\">(已删除,删除时间:"+datestr+")</font> ");
  680. tr.find("#"+ifileId+"_tache").removeClass("tache_file");
  681. $("#delfiletable").append(tr);
  682. var delLink = $("#delLink").html();
  683. if(!delLink){
  684. $("#delLink").html("(<a id=\"ahide\" href=\"#\" onclick=\"delfileshownhide();\">查看已删除附件</a>)");
  685. }
  686. } else {
  687. addError(data);
  688. }
  689. },
  690. error : function() {
  691. alert("数据处理失败,请检查网络重新登录或联系管理员!");
  692. }
  693. });
  694. }
  695. }
  696. function delfileshownhide(){
  697. var delfiles = $('#delfiles').css('display');
  698. if(delfiles == "none"){
  699. $("#delfiles").show();
  700. $("#ahide").html("隐藏已删除附件");
  701. }else if(delfiles == "block"){
  702. $("#delfiles").hide();
  703. $("#ahide").html("查看已删除附件");
  704. }
  705. }
  706. function show(targetId, self){
  707. $("#" + targetId).show();
  708. $(self).hide();
  709. $(self).next().show();
  710. }
  711. function hide(targetId, self){
  712. $("#" + targetId).hide();
  713. $(self).hide();
  714. $(self).prev().show();
  715. }
  716. function showTaskDetail(id){
  717. $("#showTaskDetail_" + id).toggle();
  718. $("#hideTaskDetail_" + id).toggle();
  719. $(".taskDetail_"+id).toggle();
  720. }
  721. function openimg(){
  722. //是否支持svg
  723. var bool = Raphael.svg;
  724. if(bool){
  725. //$.ligerDialog.open({width : 1000, height : 300, target: $("#flowimg2") });
  726. locking(2);
  727. }else{
  728. //$.ligerDialog.open({width : 1000, height : 300, target: $("#flowimg1") });
  729. locking(1);
  730. }
  731. }
  732. function delayTache(){
  733. if(!confirm("确认推迟办理该流程?")){
  734. return;
  735. }
  736. $('#task').val('delayTache');
  737. var rs = true;
  738. if(formId == "0"){
  739. $("#formInsId").val("0");
  740. }
  741. if(rs){
  742. var x = $("#insForm").serializeArray();
  743. $.each(x, function(i, field) {
  744. field.value = encodeURI(field.value);
  745. });
  746. $.ajax({
  747. url : "FlowAction.do",
  748. async : true,
  749. type : "post",
  750. data : x,
  751. success : function(data) {
  752. yrConfirm(data+"是否继续办理下一个流程?",nextdeal);
  753. },
  754. error : function() {
  755. alert("数据处理失败,请检查网络重新登录或联系管理员!");
  756. },
  757. beforeSend : function() {
  758. }
  759. });
  760. }
  761. }