Greasy Fork镜像 支持简体中文。

listPending

注入覆盖用:oa.mengtiandairy.com:7070

目前為 2023-10-27 提交的版本,檢視 最新版本

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.gf.qytechs.cn/scripts/475244/1271367/listPending.js

  1. console.log.apply(void 0, [
  2. '%c[@inject] %coverride http://oa.mengtiandairy.com:7070/seeyon/apps_res/collaboration/js/listPending.js',
  3. 'color: green',
  4. 'color: gray'
  5. ])
  6.  
  7. //批处理
  8. function batchDeal() {
  9. var rows = grid.grid.getSelectRows();
  10. if (rows.length == 0) {
  11. $.alert($.i18n('collaboration.listPending.selectBatchData')); //请选择要删除的记录
  12. return;
  13. }
  14. var sendDevelop = $.ctp.trigger('beforeBatchDealColl');
  15. if (!sendDevelop) {
  16. return;
  17. }
  18. var process = new BatchProcess();
  19. for (var i = 0; i < rows.length; i++) {
  20. var affairId = rows[i].affairId;
  21. var subject = rows[i].subject;
  22. var category = rows[i].category || "1";
  23. var summaryId = rows[i].summaryId;
  24. if (process.batchOpinion == "0" || process.batchOpinion == null) {
  25. process.batchOpinion = rows[i].disAgreeOpinionPolicy == null ? "0" : rows[i].disAgreeOpinionPolicy == "1" ? "3" : "0";//意见是否必填,3,不同意时,意见必填
  26. }
  27. process.addData(affairId, summaryId, category, subject);
  28. }
  29.  
  30. if (!process.isEmpty()) {
  31. var r = process.doBatch();
  32. }
  33. //try{window.location.reload();}catch(e){}
  34. }
  35.  
  36.  
  37. //取消加粗
  38. function cancelBold(rowIndex) {
  39. var obj = $("tr:eq(" + rowIndex + ")").find(".font_bold");
  40. if (obj != null && typeof (obj) != 'undefined') obj.removeClass("font_bold");
  41. }
  42. function rend(txt, data, r, c, col) {
  43. //未读 11 加粗显示
  44. var subState = data.subState;
  45. var readState = data.readState;
  46. if (readState == 0 || subState == 11) {
  47. txt = "<span class='font_bold'>" + (txt == undefined ? '' : txt) + "</span>"
  48. }
  49.  
  50. if (col.name == "subject") {
  51. //标题列加深
  52. txt = "<span class='grid_black titleText'>" + txt + "</span>";
  53. //如果是代理 ,颜色变成蓝色
  54. if (data.proxy) {
  55. txt = "<span class='color_blue'>" + txt + "</span>";
  56. }
  57. //加图标
  58. //重要程度
  59. if (data.importantLevel != "" && data.importantLevel != 1) {
  60. txt = "<span style='float: left;' class='ico16 important" + data.importantLevel + "_16 '></span>" + txt;
  61. }
  62. //附件
  63. if (data.hasAttsFlag == true) {
  64. txt = txt + "<span class='ico16 affix_16'></span>";
  65. }
  66. //协同类型
  67. if (data.bodyType != "" && data.bodyType != null && data.bodyType != "10" && data.bodyType != "30" && data.bodyType !== "90") {
  68. txt = txt + "<span class='ico16 office" + data.bodyType + "_16'></span>";
  69. }
  70. //流程状态
  71. if (data.state != null && data.state != "" && data.state != "0" && data.state != "2") {
  72. txt = "<span style='float: left;' class='ico16 flow" + data.state + "_16 '></span>" + txt;
  73. }
  74. //如果设置了处理期限(节点期限),添加超期图标
  75. if (data.nodeDeadLineName != $.i18n('common.default')) {
  76. if (data.isCoverTime) {
  77. //超期图标
  78. txt = txt + "<span class='ico16 extended_red_16'></span>";
  79. } else {
  80. //未超期图标
  81. txt = txt + "<span class='ico16 extended_blue_16'></span>";
  82. }
  83. }
  84. } else if (col.name === "nodeDeadLineName") {
  85. if (data.isCoverTime) {
  86. //超期图标
  87. txt = "<span class='color_red'>" + txt + "</span>";
  88. }
  89. } else if (col.name === "subState") {
  90. var titleTip = subState;
  91. if (subState == 16 || subState == 17 || subState == 18) {
  92. titleTip = 16;
  93. };
  94. var toolTip = $.i18n('collaboration.toolTip.label' + subState);
  95. var backFromId = data.backFromId;
  96. var isBackfrom = false;
  97. if (backFromId != null || (data.subState == "7" || data.subState == "16")) {
  98. isBackfrom = true;
  99. }
  100. //被回退,处理提交后取回,不显示回退图标
  101. if (isBackfrom && subState != 13 && subState != 15 && subState != 17 && subState != 6) {//被回退并且暂存待办后不显示。被回退图标
  102. toolTip = $.i18n('collaboration.toolTip.label' + 16);
  103. return "&nbsp;<span class='ico16 be_rolledback_16' title='" + toolTip + "'></span>&nbsp;";
  104. } else if (subState == 12) {
  105. return "&nbsp;<span class='ico16 viewed_16' title='" + toolTip + "'></span>&nbsp;";
  106. } else if (subState == 6) {
  107. toolTip = $.i18n("common.toolbar.takeBack.label");
  108. return "&nbsp;<span class='ico16 retrieve_16' title='" + toolTip + "'></span>&nbsp;";
  109. } else {
  110. if (subState == 15 || subState == 17) {
  111. toolTip = $.i18n("common.workflow.specialback.label");
  112. if (subState == 17) {
  113. //指定回退中间节点的时候按照指定回退发起方显示图标
  114. subState = 15;
  115. }
  116. }
  117. return "&nbsp;<span class='ico16 pending" + subState + "_16' title='" + toolTip + "'></span>&nbsp;";
  118. }
  119. } else if (col.name === "processId") {
  120. return "&nbsp;<a class='ico16 view_log_16 noClick' href='javascript:void(0)' onclick='showDetailLogDialog(\"" + data.summaryId + "\",\"" + data.processId + "\",2)'></a>&nbsp;";
  121. } else if (col.name === "nodeName") {
  122. return null == data.affairNodeName ? txt : data.affairNodeName + "(" + txt + ")";
  123. } else if (col.name == "hasPrint") {//是否打印
  124. if (data.print > 0) {
  125. txt = "<span class='font_bold'>" + $.i18n('common.yes') + "</span>";
  126. } else {
  127. txt = "<span class='font_bold'>" + $.i18n('common.no') + "</span>";
  128. }
  129.  
  130. }
  131. return txt;
  132. }
  133.  
  134. //点击事件
  135. function dbclickRow(data, rowIndex, colIndex) {
  136. //取消加粗
  137. //cancelBold(rowIndex);
  138. $("#listPending tr").eq(rowIndex).find("span").removeClass("font_bold");
  139.  
  140. if (!isAffairValid(data.affairId)) {
  141. $("#listPending").ajaxgridLoad();
  142. return;
  143. }
  144. var url = _ctxPath + "/collaboration/collaboration.do?method=summary&openFrom=listPending&affairId=" + data.affairId + (window.CsrfGuard ? CsrfGuard.getUrlSurffix() : "");
  145. var title = data.subject;
  146. doubleClick(url, escapeStringToHTML(title));
  147. grid.grid.resizeGridUpDown('down');
  148. //页面底部说明加载
  149. $('#summary').attr("src", _ctxPath + "/collaboration/listDesc.do?method=listDesc&type=listPending&size=" + grid.p.total + "&r=" + Math.random() + CsrfGuard.getUrlSurffix());
  150. }
  151. //删除
  152. function deleteCol() {
  153. deleteItems('pending', grid, 'listPending', paramMethod);
  154. }
  155.  
  156. function transmitCol() {
  157. transmitColFromGrid(grid);
  158. }
  159.  
  160. var grid;
  161. var searchobj;
  162. var isSearch = false;
  163. var layoutObj = null;
  164.  
  165.  
  166. $(document).ready(function () {
  167. var bpmMenuType = $("#bpmMenuType").val();
  168. var tppHeight = 102;
  169. if (!bpmMenuType || bpmMenuType === "false") {
  170. tppHeight = 112;
  171. }
  172. if (isShowStatisticalToolBar == "0") {
  173. tppHeight = 40;
  174. }
  175. layoutObj = new MxtLayout({
  176. 'id': 'layout',
  177. 'northArea': {
  178. 'id': 'north',
  179. 'height': tppHeight,
  180. 'sprit': false,
  181. 'border': false
  182. },
  183. 'centerArea': {
  184. 'id': 'center',
  185. 'border': false,
  186. 'minHeight': 20
  187. }
  188. });
  189. var submenu = new Array();
  190. //判断是否有新建协同的资源权限,如果没有则屏蔽转发协同
  191. if ($.ctx.resources.contains('F01_newColl')) {
  192. //协同
  193. submenu.push({ name: $.i18n('common.toolbar.transmit.col.label'), click: transmitCol });
  194. };
  195. //判断是否有转发邮件的资源权限,如果没有则屏蔽转发协同
  196. if ($.ctx.resources.contains('F12_mailcreate')) {
  197. //邮件
  198. if (emailShow) {
  199. submenu.push({ name: $.i18n('common.toolbar.transmit.mail.label'), click: transmitMail });
  200. }
  201. };
  202. var toolbarArray = new Array();
  203. //转发
  204. toolbarArray.push({ id: "transmit", name: $.i18n('common.toolbar.transmit.label'), className: "ico16 forwarding_16", subMenu: submenu });
  205. //归档
  206. if (isPigeonholeBtn() && hasDoc == "true") {
  207. toolbarArray.push({ id: "pigeonhole", name: $.i18n('common.toolbar.pigeonhole.label'), className: "ico16 filing_16", click: function () { doPigeonhole("pending", grid, "listPending"); } });
  208. }
  209. //删除
  210. if (canDel == "true") {
  211. toolbarArray.push({ id: "delete", name: $.i18n('common.toolbar.delete.label'), className: "ico16 del_16", click: deleteCol });
  212. }
  213. //批处理
  214. toolbarArray.push({ id: "batchDeal", name: $.i18n('common.batch.handle.label'), className: "ico16 batch_16", click: batchDeal });
  215. //toolbar扩展
  216. for (var i = 0; i < addinMenus.length; i++) {
  217. toolbarArray.push(addinMenus[i]);
  218. }
  219. //批量打印
  220. //toolbarArray.push({id: "batchPrint", name: $.i18n('common.toolbar.batch.print.label'), className:"ico16 print_16", click:batchPrint});
  221. //智能排序开关
  222. if (hasAIPlugin == "true") {
  223. var checkValue = false;
  224. if (aiSortValueTemp == "true") {
  225. checkValue = true;
  226. }
  227. toolbarArray.push({ id: "aiSortBtn", type: "checkbox", checked: checkValue, text: $.i18n('ai.sort.labe'), value: "1", click: aiSortClick });
  228. }
  229.  
  230.  
  231. //工具栏
  232. $("#toolbars").toolbar({
  233. toolbar: toolbarArray
  234. });
  235.  
  236.  
  237. //查询条件
  238. var condition = new Array();
  239. //标题
  240. condition.push({ id: 'title', name: 'title', type: 'input', text: $.i18n("common.subject.label"), value: 'subject', maxLength: 100 });
  241. //模板名称
  242. condition.push({ id: 'templateNameSearch', name: 'templateName', type: 'input', text: $.i18n("common.template.label"), value: 'templateName' });
  243. //重要程度
  244. condition.push({
  245. id: 'importent', name: 'importent', type: 'select', text: $.i18n("common.importance.label"), value: 'importantLevel',
  246. items: [{
  247. text: $.i18n("common.importance.putong"),//普通
  248. value: '1'
  249. }, {
  250. text: $.i18n("common.importance.zhongyao"),//重要
  251. value: '2'
  252. }, {
  253. text: $.i18n("common.importance.feichangzhongyao"),//非常重要
  254. value: '3'
  255. }]
  256. });
  257. //发起人
  258. condition.push({ id: 'spender', name: 'spender', type: 'input', text: $.i18n("common.sender.label"), value: 'startMemberName' });
  259. //addby libing 上一处理人
  260. condition.push({ id: 'preApproverNameSearch', name: 'preApproverName', type: 'input', text: $.i18n("cannel.display.column.preApprover.label"), value: 'preApproverName' });
  261. //发起时间
  262. condition.push({ id: 'datetime', name: 'datetime', type: 'datemulti', text: $.i18n("common.date.sendtime.label"), value: 'createDate', ifFormat: '%Y-%m-%d', dateTime: false });
  263. //接受时间
  264. condition.push({ id: 'receivetime', name: 'receivetime', type: 'datemulti', text: $.i18n("cannel.display.column.receiveTime.label"), value: 'receiveDate', ifFormat: '%Y-%m-%d', dateTime: false });
  265. condition.push({ id: 'nodeDeadLine', name: 'nodeDeadLine', type: 'datemulti', text: $.i18n("common.workflow.deadline.date"), value: 'expectprocesstime', ifFormat: '%Y-%m-%d', dateTime: false });
  266. condition.push({
  267. id: 'subStateSearch', name: 'subState', type: 'select', text: $.i18n("common.deal.state"), value: 'subState', ifFormat: '%Y-%m-%d', dateTime: false,
  268. items: [{
  269. text: $.i18n("collaboration.toolTip.label11"),//未读
  270. value: '11'
  271. }, {
  272. text: $.i18n("collaboration.toolTip.label12"),//已读
  273. value: '12'
  274. }, {
  275. text: $.i18n("common.save.and.pause.flow"),//暂存待办
  276. value: '13'
  277. }, {
  278. text: $.i18n("collaboration.toolTip.label16"),//被回退
  279. value: '7'
  280. }, {
  281. text: $.i18n("common.toolbar.takeBack.label"),//取回
  282. value: '6'
  283. }]
  284. });
  285. //是否超期:节点超期查询出来。
  286. condition.push({
  287. id: 'isOverdueSearch',
  288. name: 'isOverdue',
  289. type: 'select',
  290. text: $.i18n('collaboration.condition.affairOverdue'), //节点超期
  291. value: 'isOverdue',
  292. items: [{
  293. text: $.i18n('common.yes'),
  294. value: '1'
  295. }, {
  296. text: $.i18n('common.no'),
  297. value: '0'
  298. }]
  299. });
  300.  
  301. var bpmMenuType = $("#bpmMenuType").val();
  302. var queryTppHeight = 72;
  303. if (!bpmMenuType || bpmMenuType === "false") {
  304. queryTppHeight = 82;
  305. }
  306. if (isShowStatisticalToolBar == "0") {
  307. queryTppHeight = 5;
  308. }
  309.  
  310. var right = 85;
  311. //国际化下 查询区域的位置需要进行动态设置
  312. if (typeof (__getCurSysLang) !== "undefined") {
  313. var lang = __getCurSysLang();
  314. if (lang !== "zh_CN" && lang != "zh_TW") {
  315. right = 110;
  316. }
  317. }
  318. searchobj = $.searchCondition({
  319. right: right,
  320. top: queryTppHeight,
  321. searchHandler: function () {//chenxd
  322.  
  323. var val = searchobj.g.getReturnValue();
  324.  
  325. if (val != null) {
  326. $("#listPending").ajaxgridLoad(getSearchValueObj());
  327. isSearch = true;
  328. var _summarySrc = $('#summary').attr("src");
  329. if (_summarySrc.indexOf("listDesc") != -1) {
  330. setTimeout(function () {
  331. $('#summary').attr("src", "listDesc.do?method=listDesc&type=listPending&size=" + grid.p.total + "&r=" + Math.random() + CsrfGuard.getUrlSurffix());
  332. }, 1000);
  333. }
  334. }
  335. },
  336. conditions: condition
  337. });
  338. var _colModel = [{
  339. display: 'id',
  340. name: 'affairId',
  341. width: 'smallest',
  342. type: 'checkbox',
  343. isToggleHideShow: false,
  344. align: 'center'
  345. }, {
  346. display: $.i18n("common.subject.label"),//标题
  347. name: 'subject',
  348. sortable: true,
  349. width: 'big'
  350. }, {
  351. display: $.i18n("common.sender.label"),//发起人
  352. name: 'startMemberName',
  353. sortable: true,
  354. width: 'small'
  355. }, {
  356. display: $.i18n("cannel.display.column.preApprover.label"),//上一处理人
  357. name: 'preApproverName',
  358. sortable: true,
  359. width: 'small'
  360. }, {
  361. display: $.i18n("common.date.sendtime.label"),//发起时间
  362. name: 'startDate',
  363. sortable: true,
  364. width: 'medium'
  365. }, {
  366. display: $.i18n("cannel.display.column.receiveTime.label"),//接收时间
  367. name: 'receiveTime',
  368. sortable: true,
  369. width: 'medium'
  370. }, {
  371. display: $.i18n("common.workflow.deadline.date"),//处理期限(节点期限)
  372. name: 'nodeDeadLineName',
  373. sortable: true,
  374. width: 'medium'
  375. },/*{
  376. display: $.i18n("cannel.display.column.print.label"),//是否打印
  377. name: 'hasPrint',
  378. sortable : true,
  379. width: 'medium'
  380. },*/ {
  381. display: $.i18n("collaboration.col.hasten.number.label"),//催办次数
  382. name: 'hastenTimes',
  383. sortable: true,
  384. width: 'small'
  385. }, {
  386. display: $.i18n("common.deal.state"),//处理状态
  387. name: 'subState',
  388. width: 'small'
  389. }, {
  390. display: $.i18n("common.workflow.log.label"),//流程日志
  391. name: 'processId',
  392. width: 'small'
  393. }, {
  394. display: $.i18n("collaboration.current.Node.label"),//当前节点
  395. name: 'nodeName',
  396. sortable: true,
  397. width: 'small'
  398. }]
  399. // @inject-start: 添加列
  400. _colModel.splice(2, 0, ...window.colappend)
  401. // @inject-end
  402. //表格加载
  403. grid = $('#listPending').ajaxgrid({
  404. colModel: _colModel,
  405. click: dbclickRow,
  406. render: rend,
  407. height: 200,
  408. noTotal: isShowTotal == "0" ? true : false,
  409. onChangeSort: disableAISort,
  410. showTableToggleBtn: true,
  411. gridType: 'autoGrid',
  412. parentId: $('.layout_center').eq(0).attr('id'),
  413. vChange: true,
  414. vChangeParam: {
  415. overflow: "hidden",
  416. autoResize: false //表格下方是否自动显示
  417. },
  418. isHaveIframe: true,
  419. slideToggleBtn: true,
  420. callBackTotle: function (data) {
  421. /*if(!isSearch){
  422. $(".query_menu_bar .active_item .item_number").text(data);
  423. } else {
  424. isSearch = false;
  425. }*/
  426. // OA-178592
  427. $(".query_menu_bar .active_item .item_number").text(data);
  428. },
  429. managerName: "colManager",
  430. managerMethod: "getPendingList"
  431. });
  432. //页面底部说明加载
  433. $('#summary').attr("src", _ctxPath + "/collaboration/listDesc.do?method=listDesc&type=listPending&size=" + grid.p.total + "&r=" + Math.random() + CsrfGuard.getUrlSurffix());
  434. var params = {
  435. userId: _wfcurrentUserId,
  436. templeteIds: ""
  437. };
  438. if (isShowStatisticalToolBar == "1") {
  439. $('#statisticalToolBar').show();
  440. if (isShowTotal == "1") {
  441. callBackendMethod("colManager", "getOverdueOrSevenDayOverdueMap", _wfcurrentUserId, _paramTemplateIds, {
  442. success: function (data) {
  443. $("#allPendingNum").text(grid.p.total);
  444. $("#overTimeNum").text(data.overdue);
  445. $("#sevenOverTimeNum").text(data.sevenDayOverdue);
  446. $("#fromleaderNum").text(data.fromleader);
  447. $("#myDepartmentNum").text(data.mydept);
  448. }
  449. });
  450. }
  451. }
  452. if (isShowTotal == "0") {
  453. $("#allPendingNum").hide();
  454. $("#overTimeNum").hide();
  455. $("#sevenOverTimeNum").hide();
  456. $("#fromleaderNum").hide();
  457. $("#myDepartmentNum").hide();
  458. }
  459. });
  460.  
  461. function aiSortClick() {
  462. //智能排序清空右侧查询条件
  463. searchobj.g.clearCondition();
  464. //隐藏高级查询
  465. if ($(".more_query_area").css("display") !== "none" && $("#aiSortBtn").is(":checked")) {
  466. openQueryViews("listPending");
  467. }
  468.  
  469. //智能查询参数
  470. var aiSortCondition = new Object();
  471. var toTab = $(".active_item").attr("id");
  472. if (toTab == 'overTime') {
  473. aiSortCondition.coverTime = "1";
  474. } else if (toTab == 'sevenOverTime') {
  475. aiSortCondition.sevenDayOverdue = "sevenDayOverdue";
  476. } else if (toTab == 'myDepartment') {
  477. aiSortCondition.myDept = "myDept";
  478. } else if (toTab == 'fromleader') {
  479. aiSortCondition.myLeader = "myLeader";
  480. }
  481. aiSortCondition.aiSort = ("checked" == $("#aiSortBtn").attr("checked")) + '';
  482. aiSortCondition.templeteIds = _paramTemplateIds;
  483. $("#listPending").ajaxgridLoad(aiSortCondition);
  484. //更新智能排序开关状态
  485. var params = new Object();
  486. params["aiSortValue"] = aiSortCondition.aiSort;
  487. params["openFrom"] = "listPending";
  488. params["source"] = "listPending";
  489. callBackendMethod("pendingManager", "updateAISortValue", params, {
  490. success: function (data) {
  491. }
  492. });
  493. }
  494.  
  495. //关闭智能排序开关
  496. function disableAISort() {
  497. //取消勾选
  498. $("#aiSortBtn").removeAttr("checked");
  499. //发送请求,更新ai排序状态
  500. var params = new Object();
  501. params["aiSortValue"] = "false";
  502. params["openFrom"] = "listPending";
  503. params["source"] = "listPending";
  504. callBackendMethod("pendingManager", "updateAISortValue", params, {
  505. success: function (data) {
  506. }
  507. });
  508. }
  509. function loadPendingGrid() {
  510. $("#listPending").ajaxgridLoad();
  511. }
  512.  
  513. //判断当前窗口是否打开了
  514. function exitWinOpen(affairId) {
  515. var _wmp = getCtpTop()._windowsMap;
  516. if (_wmp) {
  517. //参考common-debug.js修改
  518. try {
  519. var _wmpKeys = _wmp.keys();
  520. } catch (e) {//兼容处理,为了解决bug:OA-80754公司协同:连续打开2个新闻、2个公告,页签不关闭,这时,首页待办栏目中的标题点不动,栏目空间都可以刷新。
  521. getCtpTop()._windowsMap = new Properties();
  522. _wmp = getCtpTop()._windowsMap;
  523. }
  524.  
  525. //不存在的情况删除之前打开的信息
  526. for (var p = 0; p < _wmp.keys().size(); p++) {
  527. var _kkk = _wmp.keys().get(p);
  528. try {
  529. var _fff = _wmp.get(_kkk);
  530. var _dd = _fff.document;
  531. if (_dd) {
  532. var _p = parseInt(_dd.body.clientHeight);
  533. if (_p == 0) {
  534. _wmp.remove(_kkk);
  535. p--;
  536. }
  537. } else {
  538. _wmp.remove(_kkk);
  539. p--;
  540. }
  541. } catch (e) {
  542. _wmp.remove(_kkk);
  543. p--;
  544. }
  545. }
  546. var exitWin = _wmp.get(affairId);
  547. if (exitWin) {
  548. try {
  549. alert($.i18n("window.already.exit.js"));
  550. exitWin.focus();
  551. return false;
  552. } catch (e) {
  553. }
  554. }
  555. }
  556.  
  557. return true;
  558. }
  559.  
  560. function colseQuery() {
  561. try {
  562. var dialogTemp = window.parentDialogObj['queryDialog'];
  563. dialogTemp.close();
  564. } catch (e) {
  565. }
  566. }
  567.  
  568. //二维码传参chenxd
  569. function precodeCallback() {
  570. var obj = getSearchValueObj();
  571. obj.openFrom = "listPending";
  572. return obj;
  573. }
  574.  
  575. function getSearchValueObj() {
  576. o = new Object();
  577. var templeteIds = $.trim(_paramTemplateIds);
  578. if (templeteIds != "") {
  579. o.templeteIds = templeteIds;
  580. }
  581. var choose = $('#' + searchobj.p.id).find("option:selected").val();
  582. if (choose == 'subject') {
  583. o.subject = $('#title').val();
  584. } else if (choose == 'templateName') {
  585. o.templateName = $('#templateNameSearch').val();
  586. } else if (choose == 'importantLevel') {
  587. o.importantLevel = $('#importent').val();
  588. } else if (choose == 'startMemberName') {
  589. o.startMemberName = $('#spender').val();
  590. } else if (choose == 'preApproverName') {
  591. o.preApproverName = $("#preApproverNameSearch").val();
  592. } else if (choose == 'createDate') {
  593. var fromDate = $('#from_datetime').val();
  594. var toDate = $('#to_datetime').val();
  595. if (fromDate != "" && toDate != "" && fromDate > toDate) {
  596. $.alert($.i18n('collaboration.rule.date'));//开始时间不能早于结束时间
  597. return;
  598. }
  599. var date = fromDate + '#' + toDate;
  600. o.createDate = date;
  601. } else if (choose == 'receiveDate') {
  602. var fromDate = $('#from_receivetime').val();
  603. var toDate = $('#to_receivetime').val();
  604. if (fromDate != "" && toDate != "" && fromDate > toDate) {
  605. $.alert($.i18n('collaboration.rule.date'));//开始时间不能早于结束时间
  606. return;
  607. }
  608. var date = fromDate + '#' + toDate;
  609. o.receiveDate = date;
  610. } else if (choose == 'expectprocesstime') {
  611. var fromDate = $('#from_nodeDeadLine').val();
  612. var toDate = $('#to_nodeDeadLine').val();
  613. if (fromDate != "" && toDate != "" && fromDate > toDate) {
  614. $.alert($.i18n('collaboration.rule.date'));//开始时间不能早于结束时间
  615. return;
  616. }
  617. var date = fromDate + '#' + toDate;
  618. o.expectprocesstime = date;
  619. } else if (choose == 'subState') {
  620. o.subState = $('#subStateSearch').val();
  621. } else if (choose == 'isOverdue') {
  622. o.isOverdue = $("#isOverdueSearch").val();
  623. }
  624. if (window.location.href.indexOf("condition=templeteAll&textfield=all") != -1) {
  625. o.templeteAll = "all";
  626. }
  627. //增加智能排序条件
  628. if (hasAIPlugin == "true") {
  629. var chk = $("#aiSortBtn").attr("checked");
  630. //刷新列表,并保存开关状态
  631. if (chk && chk == "checked") {
  632. o.aiSort = "true";
  633. } else {
  634. o.aiSort = "false";
  635. }
  636. }
  637. var toTab = $(".active_item").attr("id");
  638. if (toTab == 'overTime') {
  639. o.coverTime = "1";
  640. } else if (toTab == 'sevenOverTime') {
  641. o.sevenDayOverdue = "sevenDayOverdue";
  642. } else if (toTab == 'myDepartment') {
  643. o.myDept = "myDept";
  644. } else if (toTab == 'fromleader') {
  645. o.myLeader = "myLeader";
  646. }
  647. return o;
  648. }
  649.  
  650. function tabSwitch(toTab) {
  651. tabActive(toTab);
  652. tabSwitchLoadData(toTab);
  653. }
  654.  
  655. function tabActive(toTab) {
  656. if (toTab == 'allPending') {
  657. $("#allPending").addClass("active_item");
  658. $("#overTime").removeClass("active_item");
  659. $("#sevenOverTime").removeClass("active_item");
  660. $("#myDepartment").removeClass("active_item");
  661. $("#fromleader").removeClass("active_item");
  662. } else if (toTab == 'overTime') {
  663. $("#allPending").removeClass("active_item");
  664. $("#overTime").addClass("active_item");
  665. $("#sevenOverTime").removeClass("active_item");
  666. $("#myDepartment").removeClass("active_item");
  667. $("#fromleader").removeClass("active_item");
  668. } else if (toTab == 'sevenOverTime') {
  669. $("#allPending").removeClass("active_item");
  670. $("#overTime").removeClass("active_item");
  671. $("#sevenOverTime").addClass("active_item");
  672. $("#myDepartment").removeClass("active_item");
  673. $("#fromleader").removeClass("active_item");
  674. } else if (toTab == 'myDepartment') {
  675. $("#allPending").removeClass("active_item");
  676. $("#overTime").removeClass("active_item");
  677. $("#sevenOverTime").removeClass("active_item");
  678. $("#myDepartment").addClass("active_item");
  679. $("#fromleader").removeClass("active_item");
  680. } else if (toTab == 'fromleader') {
  681. $("#allPending").removeClass("active_item");
  682. $("#overTime").removeClass("active_item");
  683. $("#sevenOverTime").removeClass("active_item");
  684. $("#myDepartment").removeClass("active_item");
  685. $("#fromleader").addClass("active_item");
  686. }
  687. }
  688.  
  689. function tabSwitchLoadData(toTab) {
  690. var param = new Object();
  691. if (toTab == 'overTime') {
  692. param.coverTime = "1";
  693. } else if (toTab == 'sevenOverTime') {
  694. param.sevenDayOverdue = "sevenDayOverdue";
  695. } else if (toTab == 'myDepartment') {
  696. param.myDept = "myDept";
  697. } else if (toTab == 'fromleader') {
  698. param.myLeader = "myLeader";
  699. }
  700. param.templeteIds = _paramTemplateIds;
  701.  
  702. //切换页签的时候将查询条件带入
  703. var obj = getSearchValueObj();
  704. param = $.extend(obj, param);
  705.  
  706. $("#listPending").ajaxgridLoad(param);
  707. // var params = {templeteIds:,
  708. // userId:};
  709. //现取count从GRID中获取,无需切换页签请求后台
  710. // callBackendMethod("colManager","getOverdueOrSevenDayOverdueMap",_wfcurrentUserId,_paramTemplateIds,{
  711. // success : function (data) {
  712. // $("#allPendingNum").text(data.allpending);
  713. // $("#overTimeNum").text(data.overdue);
  714. // $("#sevenOverTimeNum").text(data.sevenDayOverdue);
  715. // $("#fromleaderNum").text(data.fromleader);
  716. // $("#myDepartmentNum").text(data.mydept);
  717. // }
  718. // });
  719. }
  720.  
  721. function showAdvanceSearch() {
  722. openQueryViews('listPending', !advanceSearchFlag);
  723. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址