You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Index.js 37 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714
  1. var refreshGirdData;
  2. var bootstrap = function ($, learun) {
  3. "use strict";
  4. var tabType = 'releaseFile';
  5. var wfType = '1';
  6. var folderId = "0";
  7. var folderAuth = '';
  8. //1 查看 2上传 3 下载 4 删除 5 复原
  9. var btnName = {
  10. '1': '查看',
  11. '2': '上传',
  12. '3': '下载',
  13. '4': '删除',
  14. '5': '复原',
  15. '6': '彻底删除'
  16. }
  17. var page = {
  18. init: function () {
  19. page.initleft();
  20. page.initGrid();
  21. page.bind();
  22. },
  23. bind: function () {
  24. $('#lr_form_tabs').lrFormTab(function (id) {
  25. wfType = id;
  26. page.search.verifyFile && page.search.verifyFile();
  27. });
  28. // 查询
  29. $('#btn_Search').on('click', function () {
  30. var keyword = $('#txt_Keyword').val();
  31. page.search[tabType]({ keyword: keyword });
  32. });
  33. // 刷新
  34. $('#lr_refresh').on('click', function () {
  35. location.reload();
  36. });
  37. // 文件夹管理
  38. $('#lr-folder').on('click', function () {
  39. learun.layerForm({
  40. id: 'FolderIndex',
  41. title: '文件夹管理',
  42. url: top.$.rootUrl + '/LR_SystemModule/Files/FolderIndex',
  43. width: 800,
  44. height: 500,
  45. maxmin: true,
  46. btn: null,
  47. end: function () {
  48. }
  49. });
  50. });
  51. // 文件授权
  52. $('#lr-fileAuth').on('click', function () {
  53. learun.layerForm({
  54. id: 'FileAuthIndex',
  55. title: '文件授权',
  56. url: top.$.rootUrl + '/LR_SystemModule/Files/FileAuthIndex',
  57. width: 800,
  58. height: 500,
  59. maxmin: true,
  60. btn: null,
  61. end: function () {
  62. }
  63. });
  64. });
  65. //上传文件
  66. $('#lr-uploadify').on('click', function () {
  67. learun.frameTab.open({ F_ModuleId: 'filesuploadify', F_Icon: 'fa magic', F_FullName: '上传文件审核', F_UrlAddress: '/LR_NewWorkFlow/NWFProcess/NWFContainerForm?shcemeCode=lr_files_manager&tabIframeId=filesuploadify&type=create' });
  68. //if (folderId == "0") {// 获取主目录的权限,有上传权限才允许上传
  69. // learun.httpAsync('GET', top.$.rootUrl + '/LR_SystemModule/Files/IsUPLoad', { folderId: folderId }, function (res) {
  70. // if (res == true) {
  71. // learun.frameTab.open({ F_ModuleId: 'filesuploadify', F_Icon: 'fa magic', F_FullName: '上传文件审核', F_UrlAddress: '/LR_NewWorkFlow/NWFProcess/NWFContainerForm?shcemeCode=lr_files_manager&tabIframeId=filesuploadify&type=create' });
  72. // }
  73. // else {
  74. // learun.alert.warning('你没有权限在当前目录下创建文件!');
  75. // }
  76. // })
  77. //}
  78. //else if (folderAuth == '2') {
  79. //}
  80. //else {
  81. // learun.alert.warning('你没有权限在当前目录下创建文件!');
  82. //}
  83. });
  84. //
  85. $('#pathList').on('click', '.path-item', function () {
  86. var $this = $(this);
  87. var data = $this[0]._data;
  88. if (data) {
  89. folderAuth = data.F_AuthType;
  90. }
  91. $this.nextAll().remove();
  92. folderId = $this.attr('data-fileid');
  93. page.openFolder();
  94. });
  95. },
  96. initleft: function () {
  97. $('#lr_left_list li').on('click', function () {
  98. var $this = $(this);
  99. $this.parent().find('.active').removeClass('active');
  100. $this.addClass('active');
  101. var v = $this.attr('data-value');
  102. $('.lr-layout-body>.active').removeClass('active');
  103. $('#' + v).addClass('active');
  104. tabType = v;
  105. page.search[v] && page.search[v]();
  106. //lr-uploadify
  107. });
  108. },
  109. //加载表格
  110. initGrid: function () {
  111. $('#wfgridtable').jfGrid({
  112. url: top.$.rootUrl + '/LR_SystemModule/Files/GetWFPageList',
  113. headData: [
  114. {
  115. label: "任务", name: "F_TaskName", width: 160, align: "left",
  116. formatter: function (cellvalue, row, dfop, $cell) {
  117. if (row.F_EnabledMark == 3) {
  118. if (wfType == '1') {
  119. return '本人发起';
  120. }
  121. else {
  122. cellvalue;
  123. }
  124. }
  125. // 草稿
  126. if (row.F_EnabledMark == 2) {
  127. $cell.on('click', '.create', function () {// 创建
  128. // 关闭草稿页
  129. learun.frameTab.closeByParam('tabProcessId', row.F_Id);
  130. learun.frameTab.open({ F_ModuleId: row.F_Id, F_Icon: 'fa magic', F_FullName: '创建流程-' + row.F_SchemeName, F_UrlAddress: '/LR_NewWorkFlow/NWFProcess/NWFContainerForm?processId=' + row.F_Id + '&tabIframeId=' + row.F_Id + '&type=draftCreate' });
  131. return false;
  132. });
  133. $cell.on('click', '.delete', function () {// 删除
  134. learun.layerConfirm('是否确认删除该草稿?', function (res) {
  135. if (res) {
  136. // 关闭草稿页
  137. learun.frameTab.closeByParam('tabProcessId', row.F_Id);
  138. learun.deleteForm(top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/DeleteDraft', { processId: row.F_Id }, function () {
  139. refreshGirdData();
  140. });
  141. }
  142. });
  143. return false;
  144. });
  145. return '<span class="label label-success create" title="编辑创建">编辑创建</span><span class="label label-danger delete" style="margin-left:5px;" title="删除草稿" >删除草稿</span>';
  146. }
  147. var isaAain = false;
  148. if (wfType == '1') {
  149. if (row.F_IsAgain == 1) {
  150. isaAain = true;
  151. }
  152. else if (row.F_IsFinished == 0) {
  153. // 加入催办和撤销按钮
  154. $cell.on('click', '.urge', function () {// 催办审核
  155. learun.layerConfirm('是否确认催办审核?', function (res, _index) {
  156. if (res) {
  157. learun.loading(true, '催办审核...');
  158. var postData = {
  159. processId: row.F_Id,
  160. };
  161. learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/UrgeFlow', postData, function (data) {
  162. learun.loading(false);
  163. });
  164. top.layer.close(_index);
  165. }
  166. });
  167. return false;
  168. });
  169. $cell.on('click', '.revoke', function () {// 删除
  170. learun.layerConfirm('是否确认撤销流程?', function (res, _index) {
  171. if (res) {
  172. learun.loading(true, '撤销流程...');
  173. var postData = {
  174. processId: row.F_Id,
  175. };
  176. learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/RevokeFlow', postData, function (data) {
  177. learun.loading(false);
  178. refreshGirdData();
  179. });
  180. top.layer.close(_index);
  181. }
  182. });
  183. return false;
  184. });
  185. var _btnHtml = '<span class="label label-primary urge" title="催办审核" >催办审核</span>';
  186. if (row.F_IsStart == 0) {
  187. _btnHtml += '<span class="label label-warning revoke" style="margin-left:5px;" title="撤销流程" >撤销流程</span>';
  188. }
  189. return _btnHtml;
  190. }
  191. else {
  192. return '本人发起';
  193. }
  194. }
  195. if (row.F_TaskType == 3) {
  196. return "【加签】" + cellvalue;
  197. }
  198. else if (row.F_TaskType == 5 && wfType == '2') {
  199. isaAain = true;
  200. }
  201. else if (row.F_TaskType == 5) {
  202. return '重新发起';
  203. }
  204. if (isaAain) {
  205. $cell.on('click', '.AgainCreate', function () {
  206. var title = "";
  207. if (row.F_SchemeName != row.F_Title && row.F_Title) {
  208. title = row.F_SchemeName + "(" + row.F_Title + ")";
  209. }
  210. else {
  211. title = row.F_SchemeName;
  212. }
  213. learun.frameTab.open({ F_ModuleId: row.F_Id, F_Icon: 'fa magic', F_FullName: '重新发起-' + title, F_UrlAddress: '/LR_NewWorkFlow/NWFProcess/NWFContainerForm?processId=' + row.F_Id + '&tabIframeId=' + row.F_Id + '&type=againCreate' });
  214. return false;
  215. });
  216. return '<span class="label label-danger AgainCreate" title="重新发起">重新发起</span>';
  217. }
  218. if (wfType == '3' && row.F_TaskType == 1 && row.F_IsFinished == 0) {// 已完成任务,添加一个撤销按钮
  219. cellvalue = '<span class="label label-warning revoke2" style="margin-left:5px;margin-right:5px;" title="撤销审核" >撤销审核</span>' + cellvalue;
  220. $cell.on('click', '.revoke2', function () {// 删除
  221. learun.layerConfirm('是否确认撤销审核?', function (res, _index) {
  222. if (res) {
  223. learun.loading(true, '撤销审核...');
  224. var postData = {
  225. processId: row.F_Id,
  226. taskId: row.F_TaskId,
  227. };
  228. learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/RevokeAudit', postData, function (data) {
  229. learun.loading(false);
  230. refreshGirdData();
  231. });
  232. top.layer.close(_index);
  233. }
  234. });
  235. return false;
  236. });
  237. }
  238. return cellvalue;
  239. }
  240. },
  241. {
  242. label: "文件名", name: "FileName", width: 120, align: "left",
  243. },
  244. {
  245. label: "文件编号", name: "FileCode", width: 120, align: "left",
  246. },
  247. {
  248. label: "文件版本", name: "FileVer", width: 60, align: "center",
  249. },
  250. {
  251. label: "等级", name: "F_Level", width: 60, align: "center",
  252. formatter: function (cellvalue) {
  253. switch (cellvalue) {
  254. case 0:
  255. return '普通';
  256. break;
  257. case 1:
  258. return '重要';
  259. break;
  260. case 2:
  261. return '紧急';
  262. break;
  263. default:
  264. return '普通';
  265. break;
  266. }
  267. }
  268. },
  269. {
  270. label: "状态", name: "F_EnabledMark", width: 70, align: "center",
  271. formatter: function (cellvalue, row) {
  272. if (row.F_TaskType == 4) {
  273. if (row.F_IsUrge == "1" && wfType == '2') {
  274. return "<span class=\"label label-danger\">催办加急</span>";
  275. }
  276. return "<span class=\"label label-success\">运行中</span>";
  277. }
  278. if (row.F_IsFinished == 0) {
  279. if (cellvalue == 1) {
  280. if (row.F_IsUrge == "1" && wfType == '2') {
  281. return "<span class=\"label label-danger\">催办加急</span>";
  282. }
  283. return "<span class=\"label label-success\">运行中</span>";
  284. } else if (cellvalue == 2) {
  285. return "<span class=\"label label-primary\">草稿</span>";
  286. } else {
  287. return "<span class=\"label label-danger\">作废</span>";
  288. }
  289. }
  290. else {
  291. return "<span class=\"label label-warning\">结束</span>";
  292. }
  293. }
  294. },
  295. { label: "发起者", name: "F_CreateUserName", width: 70, align: "center" },
  296. {
  297. label: "时间", name: "F_CreateDate", width: 150, align: "left",
  298. formatter: function (cellvalue) {
  299. return learun.formatDate(cellvalue, 'yyyy-MM-dd hh:mm:ss');
  300. }
  301. }
  302. ],
  303. mainId: 'F_Id',
  304. isPage: true,
  305. sidx: 'F_CreateDate DESC',
  306. onSelectRow: function (row) {
  307. if (wfType == '2') {
  308. if (row.F_TaskType == 5) {
  309. $('#lr_verify span').text("重新发起");
  310. }
  311. else if (row.F_TaskType == 3) {
  312. $('#lr_verify span').text("【加签】" + row.F_TaskName);
  313. }
  314. else {
  315. $('#lr_verify span').text(row.F_TaskName);
  316. }
  317. }
  318. },
  319. dblclick: function () {
  320. if (wfType == '2') {
  321. page.verify();
  322. }
  323. else {
  324. page.eye();
  325. }
  326. }
  327. });
  328. $('#gridTable').jfGrid({
  329. url: top.$.rootUrl + '/LR_SystemModule/Files/GetPublishList',
  330. headData: [
  331. {
  332. label: '文件名', name: 'F_Name', width: 400, align: 'left',
  333. formatter: function (cellvalue, row) {
  334. return "<div style='cursor:pointer;'><div style='float: left;'><img src='" + top.$.rootUrl + "/Content/images/filetype/" + row.F_FileType + ".png' style='width:30px;height:30px;padding:5px;margin-left:-5px;margin-right:5px;' /></div><div style='float: left;line-height:35px;'>" + cellvalue + "</div></div>";
  335. }
  336. },
  337. {
  338. label: '文件编号', name: 'F_Code', width: 120, align: 'left'
  339. },
  340. {
  341. label: '文件版本', name: 'F_Ver', width: 60, align: 'center'
  342. },
  343. {
  344. label: '大小', name: 'F_FileSize', width: 100, align: 'center',
  345. formatter: function (cellvalue, row) {
  346. if (row.Type == '2') {
  347. return '';
  348. }
  349. else {
  350. return page.CountFileSize(cellvalue);
  351. }
  352. }
  353. },
  354. {
  355. label: '操作', name: 'F_Id', width: 200, align: 'left',
  356. formatter: function (value, row, op, $cell) {
  357. var $div = $('<div></div>');
  358. if (row.Type == '2') {
  359. var $openFolder = $('<span class=\"label label-success\" style=\"cursor: pointer;\">打开</span>');
  360. $openFolder.on('click', function () {
  361. folderId = value;
  362. folderAuth = row.F_AuthType;
  363. page.openFolder();
  364. var $span = $('<span data-fileid="' + value + '" class="path-item">/&nbsp;' + row.F_Name + '</span>');
  365. $span[0]._data = row;
  366. $('#pathList').append($span);
  367. });
  368. $div.append($openFolder);
  369. }
  370. else {
  371. var btnlist = row.F_AuthType.split(',');
  372. $.each(btnlist, function (_index, _item) {
  373. if (_item != '6' && _item != '5' && $div.find('[data-value="' + _item + '"]').length == 0) {
  374. var btnClass = 'label-info';
  375. if (_item == '4') {
  376. btnClass = 'label-warning';
  377. }
  378. var $btn = $('<span class=\"label ' + btnClass +'\" data-value="' + _item + '" style=\"cursor: pointer; margin-right:8px;\">' + btnName[_item] + '</span>');
  379. $btn[0]._row = row;
  380. $btn.on('click', function () {
  381. var $this = $(this);
  382. var btnValue = $this.attr('data-value');
  383. var btnRow = $this[0]._row;
  384. switch (btnValue) {
  385. case '1':// 查看
  386. learun.layerForm({
  387. id: 'PreviewForm',
  388. title: '文件预览',
  389. url: top.$.rootUrl + '/LR_SystemModule/Annexes/PreviewFile?fileId=' + btnRow.F_PFiled,
  390. width: 1080,
  391. height: 850,
  392. btn: null
  393. });
  394. break;
  395. case '2':// 上传
  396. learun.frameTab.open({ F_ModuleId: btnRow.F_Id, F_Icon: 'fa magic', F_FullName: '上传文件审核', F_UrlAddress: '/LR_NewWorkFlow/NWFProcess/NWFContainerForm?shcemeCode=lr_files_manager&tabIframeId=' + btnRow.F_Id + '&type=create&wfFormParam=' + btnRow.F_Id });
  397. break;
  398. case '3':// 下载
  399. learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: btnRow.F_FileId}, method: 'POST' });
  400. break;
  401. case '4':// 删除
  402. learun.layerConfirm('是否确认删除该文件!', function (res) {
  403. if (res) {
  404. learun.deleteForm(top.$.rootUrl + '/LR_SystemModule/Files/VDeleteFile', { keyValue: btnRow.F_Id }, function () {
  405. refreshGirdData();
  406. });
  407. }
  408. });
  409. break;
  410. }
  411. });
  412. $div.append($btn);
  413. }
  414. });
  415. // 查看
  416. var $hbtn = $('<span class=\"label label-primary\" style=\"cursor: pointer;\">查看历史</span>');
  417. $hbtn.on('click', function () {
  418. learun.layerForm({
  419. id: 'FileHistroyIndex',
  420. title: '文件历史【'+row.F_Name+'】',
  421. url: top.$.rootUrl + '/LR_SystemModule/Files/FileHistroyIndex?fileInfoId=' + row.F_Id ,
  422. width: 800,
  423. height: 500,
  424. maxmin: true,
  425. btn: null,
  426. end: function () {
  427. }
  428. });
  429. });
  430. $div.append($hbtn);
  431. }
  432. return $div;
  433. }
  434. }
  435. ],
  436. mainId: 'F_Id'
  437. });
  438. $('#dgridtable').jfGrid({
  439. url: top.$.rootUrl + '/LR_SystemModule/Files/GetDeleteList',
  440. headData: [
  441. {
  442. label: '文件名', name: 'F_Name', width: 400, align: 'left',
  443. formatter: function (cellvalue, row) {
  444. return "<div style='cursor:pointer;'><div style='float: left;'><img src='" + top.$.rootUrl + "/Content/images/filetype/" + row.F_FileType + ".png' style='width:30px;height:30px;padding:5px;margin-left:-5px;margin-right:5px;' /></div><div style='float: left;line-height:35px;'>" + cellvalue + "</div></div>";
  445. }
  446. },
  447. {
  448. label: '文件编号', name: 'F_Code', width: 120, align: 'left'
  449. },
  450. {
  451. label: '文件版本', name: 'F_Ver', width: 60, align: 'center'
  452. },
  453. {
  454. label: '大小', name: 'F_FileSize', width: 100, align: 'center',
  455. formatter: function (cellvalue) {
  456. return page.CountFileSize(cellvalue);
  457. }
  458. },
  459. {
  460. label: '操作', name: 'F_Id', width: 200, align: 'left',
  461. formatter: function (value, row, op, $cell) {
  462. var $div = $('<div></div>');
  463. var btnlist = row.F_AuthType.split(',');
  464. $.each(btnlist, function (_index, _item) {
  465. if (_item != '2' && _item != '4' && $div.find('[data-value="' + _item + '"]').length == 0) {
  466. var btnClass = 'label-info';
  467. if (_item == '6') {
  468. btnClass = 'label-danger';
  469. }
  470. else if (_item == '5') {
  471. btnClass = 'label-warning';
  472. }
  473. var $btn = $('<span class=\"label ' + btnClass +'\" data-value="' + _item + '" style=\"cursor: pointer; margin-right:8px;\">' + btnName[_item] + '</span>');
  474. $btn[0]._row = row;
  475. $btn.on('click', function () {
  476. var $this = $(this);
  477. var btnValue = $this.attr('data-value');
  478. var btnRow = $this[0]._row;
  479. switch (btnValue) {
  480. case '1':// 查看
  481. learun.layerForm({
  482. id: 'PreviewForm',
  483. title: '文件预览',
  484. url: top.$.rootUrl + '/LR_SystemModule/Annexes/PreviewFile?fileId=' + btnRow.F_PFiled,
  485. width: 1080,
  486. height: 850,
  487. btn: null
  488. });
  489. break;
  490. case '3':// 下载
  491. learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: btnRow.F_FileId }, method: 'POST' });
  492. break;
  493. case '5':// 复原
  494. learun.layerConfirm('是否确认还原该文件!', function (res) {
  495. if (res) {
  496. learun.postForm(top.$.rootUrl + '/LR_SystemModule/Files/RecoveryFile', { keyValue: btnRow.F_Id }, function () {
  497. refreshGirdData();
  498. });
  499. }
  500. });
  501. break;
  502. case '6':// 彻底删除
  503. learun.layerConfirm('是否确认彻底删除该文件!', function (res) {
  504. if (res) {
  505. learun.deleteForm(top.$.rootUrl + '/LR_SystemModule/Files/DeleteFile', { keyValue: btnRow.F_Id }, function () {
  506. refreshGirdData();
  507. });
  508. }
  509. });
  510. break;
  511. }
  512. });
  513. $div.append($btn);
  514. }
  515. });
  516. // 查看
  517. var $hbtn = $('<span class=\"label label-primary\" style=\"cursor: pointer;\">查看历史</span>');
  518. $hbtn.on('click', function () {
  519. learun.layerForm({
  520. id: 'FileHistroyIndex',
  521. title: '文件历史【' + row.F_Name + '】',
  522. url: top.$.rootUrl + '/LR_SystemModule/Files/FileHistroyIndex?fileInfoId=' + row.F_Id,
  523. width: 800,
  524. height: 500,
  525. maxmin: true,
  526. btn: null,
  527. end: function () {
  528. }
  529. });
  530. });
  531. $div.append($hbtn);
  532. return $div;
  533. }
  534. }
  535. ],
  536. mainId: 'F_Id'
  537. });
  538. page.search.releaseFile();
  539. },
  540. search: {
  541. verifyFile: function (param) {
  542. param = param || {};
  543. param.wfType = wfType;
  544. $('#wfgridtable').jfGridSet('reload', param);
  545. },
  546. releaseFile: function (param) {
  547. param = param || {};
  548. param.folderId = folderId || "0";
  549. if (param.folderId == "0") {
  550. $('#pathList [data-fileid="0"]').nextAll().remove();
  551. }
  552. $('#gridTable').jfGridSet('reload', param);
  553. },
  554. recycledFile: function (param) {
  555. param = param || {};
  556. $('#dgridtable').jfGridSet('reload', param);
  557. }
  558. },
  559. search2: {
  560. verifyFile: function () {
  561. $('#wfgridtable').jfGridSet('reload');
  562. },
  563. releaseFile: function () {
  564. $('#gridTable').jfGridSet('reload');
  565. },
  566. recycledFile: function () {
  567. $('#dgridtable').jfGridSet('reload');
  568. }
  569. },
  570. verify: function () {
  571. var processId = $('#wfgridtable').jfGridValue('F_Id');
  572. var taskId = $('#wfgridtable').jfGridValue('F_TaskId');
  573. var title = $('#wfgridtable').jfGridValue('F_Title');
  574. var schemeName = $('#wfgridtable').jfGridValue('F_SchemeName');
  575. var taskName = $('#wfgridtable').jfGridValue('F_TaskName');
  576. var taskType = $('#wfgridtable').jfGridValue('F_TaskType');
  577. if (schemeName != title && title) {
  578. title = schemeName + "(" + title + ")";
  579. }
  580. else {
  581. title = schemeName;
  582. }
  583. //1审批2传阅3加签4子流程5重新创建
  584. switch (taskType) {
  585. case 1:// 审批
  586. learun.frameTab.open({ F_ModuleId: taskId, F_Icon: 'fa magic', F_FullName: '审批-' + title + '/' + taskName, F_UrlAddress: '/LR_NewWorkFlow/NWFProcess/NWFContainerForm?tabIframeId=' + taskId + '&type=audit' + "&processId=" + processId + "&taskId=" + taskId });
  587. break;
  588. case 2:// 传阅
  589. learun.frameTab.open({ F_ModuleId: taskId, F_Icon: 'fa magic', F_FullName: '查阅-' + title + '/' + taskName, F_UrlAddress: '/LR_NewWorkFlow/NWFProcess/NWFContainerForm?tabIframeId=' + taskId + '&type=refer' + "&processId=" + processId + "&taskId=" + taskId });
  590. break;
  591. case 3:// 加签
  592. learun.frameTab.open({ F_ModuleId: taskId, F_Icon: 'fa magic', F_FullName: '加签审核-' + title + '/' + taskName, F_UrlAddress: '/LR_NewWorkFlow/NWFProcess/NWFContainerForm?tabIframeId=' + taskId + '&type=signAudit' + "&processId=" + processId + "&taskId=" + taskId });
  593. break;
  594. case 4:// 子流程
  595. learun.frameTab.open({ F_ModuleId: taskId, F_Icon: 'fa magic', F_FullName: '子流程-' + title + '/' + taskName, F_UrlAddress: '/LR_NewWorkFlow/NWFProcess/NWFContainerForm?tabIframeId=' + taskId + '&type=chlid' + "&processId=" + processId + "&taskId=" + taskId });
  596. break;
  597. case 5:// 重新创建
  598. learun.frameTab.open({ F_ModuleId: processId, F_Icon: 'fa magic', F_FullName: '重新发起-' + title, F_UrlAddress: '/LR_NewWorkFlow/NWFProcess/NWFContainerForm?processId=' + processId + '&tabIframeId=' + processId + '&type=againCreate' });
  599. break;
  600. case 6:// 重新创建
  601. learun.frameTab.open({ F_ModuleId: taskId, F_Icon: 'fa magic', F_FullName: '子流程-' + title + '/' + taskName, F_UrlAddress: '/LR_NewWorkFlow/NWFProcess/NWFContainerForm?tabIframeId=' + taskId + '&type=againChild' + "&processId=" + processId + "&taskId=" + taskId });
  602. break;
  603. }
  604. },
  605. eye: function () {
  606. var processId = $('#wfgridtable').jfGridValue('F_Id') || '';
  607. var taskId = $('#wfgridtable').jfGridValue('F_TaskId') || '';
  608. var title = $('#wfgridtable').jfGridValue('FileName');
  609. var taskType = $('#wfgridtable').jfGridValue('F_TaskType');
  610. var enabledMark = $('#wfgridtable').jfGridValue('F_EnabledMark');
  611. if (enabledMark == 2) {// 草稿不允许查看进度
  612. learun.alert.warning("草稿不能查看进度");
  613. return;
  614. }
  615. if (learun.checkrow(processId)) {
  616. if (taskType == '4' || taskType == '6') {
  617. learun.frameTab.open({ F_ModuleId: processId + taskId, F_Icon: 'fa magic', F_FullName: '查看流程进度【' + title + '】', F_UrlAddress: '/LR_NewWorkFlow/NWFProcess/NWFContainerForm?tabIframeId=' + processId + taskId + '&type=childlook' + "&processId=" + processId + "&taskId=" + taskId });
  618. }
  619. else {
  620. learun.frameTab.open({ F_ModuleId: processId + taskId, F_Icon: 'fa magic', F_FullName: '查看流程进度【' + title + '】', F_UrlAddress: '/LR_NewWorkFlow/NWFProcess/NWFContainerForm?tabIframeId=' + processId + taskId + '&type=look' + "&processId=" + processId + "&taskId=" + taskId });
  621. }
  622. }
  623. },
  624. openFolder: function () {
  625. page.search.releaseFile();
  626. },
  627. //计算文件大小函数(保留两位小数),Size为字节大小
  628. CountFileSize: function (Size) {
  629. var m_strSize = "";
  630. var FactSize = 0;
  631. FactSize = Size;
  632. if (FactSize < 1024.00)
  633. m_strSize = page.ToDecimal(FactSize) + " 字节";
  634. else if (FactSize >= 1024.00 && FactSize < 1048576)
  635. m_strSize = page.ToDecimal(FactSize / 1024.00) + " KB";
  636. else if (FactSize >= 1048576 && FactSize < 1073741824)
  637. m_strSize = page.ToDecimal(FactSize / 1024.00 / 1024.00) + " MB";
  638. else if (FactSize >= 1073741824)
  639. m_strSize = page.ToDecimal(FactSize / 1024.00 / 1024.00 / 1024.00) + " GB";
  640. return m_strSize;
  641. },
  642. //保留两位小数
  643. //功能:将浮点数四舍五入,取小数点后2位
  644. ToDecimal: function (x) {
  645. var f = parseFloat(x);
  646. if (isNaN(f)) {
  647. return 0;
  648. }
  649. f = Math.round(x * 100) / 100;
  650. return f;
  651. },
  652. };
  653. refreshGirdData = function () {
  654. page.search2[tabType]();
  655. };
  656. page.init();
  657. }