operate.ui.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. window.renderReviewerItem = function(result, info)
  2. {
  3. if(info.col.name == 'approval_node') result.push({html: "<input type='hidden' name='approval_id[]' value='" + info.row.data.approval_id + "' />"});
  4. if(info.col.name == 'approval_reviewer')
  5. {
  6. if(info.row.data.types.indexOf('reviewer') !== -1)
  7. {
  8. if(info.row.data.reviewers) result.push({html: '<div class="otherReview">' + info.row.data.reviewers + '</div>'}, {className: 'order-last'});
  9. }
  10. else
  11. {
  12. if(info.row.data.reviewers) result.push({html: info.row.data.reviewers})
  13. }
  14. }
  15. if(info.col.name == 'approval_ccer')
  16. {
  17. if(info.row.data.types.indexOf('ccer') !== -1)
  18. {
  19. if(info.row.data.ccers) result.push({html:'<div class="otherCcer">' + info.row.data.ccers + '</div>'}, {className: 'order-last'});
  20. }
  21. else
  22. {
  23. if(info.row.data.ccers) result.push({html: info.row.data.ccers});
  24. }
  25. }
  26. info.row.id = info.row.data.approval_id;
  27. return result;
  28. }
  29. window.getReviewerCellProps = function(cell)
  30. {
  31. const hasReviewer = cell.row.data.types.indexOf('reviewer') !== -1;
  32. return {items: cell.row.data.reviewerItems, multiple: true, className: 'mx-2' + (hasReviewer ? '' : ' hidden'), name: `approval_reviewer[${cell.row.index}]`};
  33. }
  34. window.getCcerCellProps = function(cell)
  35. {
  36. const hasCcer = cell.row.data.types.indexOf('ccer') !== -1;
  37. return {items: cell.row.data.ccerItems, multiple: true, className: 'mx-2' + (hasCcer ? '' : ' hidden'), name: `approval_ccer[${cell.row.index}]`};
  38. }
  39. window.loadAllPrevData = function()
  40. {
  41. $('.prevField').each(function()
  42. {
  43. loadPrevData($(this));
  44. });
  45. }