managerAudit.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <%@ page contentType="text/html;charset=UTF-8" %>
  2. <script>
  3. $(document).ready(function() {
  4. var item = "";
  5. var procInsId = $("#procInsId").val();
  6. console.log(procInsId);
  7. //bootstrapTable加载数据
  8. $('#informationTable').bootstrapTable({
  9. //请求方法
  10. method: 'post',
  11. //类型json
  12. dataType: "json",
  13. contentType: "application/x-www-form-urlencoded",
  14. //显示检索按钮
  15. showSearch: false,
  16. //显示刷新按钮
  17. showRefresh: false,
  18. //显示切换手机试图按钮
  19. showToggle: false,
  20. //显示 内容列下拉框
  21. showColumns: false,
  22. //显示到处按钮
  23. showExport: false,
  24. //显示切换分页按钮
  25. showPaginationSwitch: false,
  26. //最低显示2行
  27. minimumCountColumns: 2,
  28. //是否显示行间隔色
  29. striped: true,
  30. //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  31. cache: false,
  32. //是否显示分页(*)
  33. pagination: false,
  34. //排序方式
  35. sortOrder: "asc",
  36. //初始化加载第一页,默认第一页
  37. pageNumber: 1,
  38. //每页的记录行数(*)
  39. pageSize: 10,
  40. //可供选择的每页的行数(*)
  41. pageList: [10, 25, 50, 100],
  42. //这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据
  43. url: "${ctx}/picking/activiti/constructionData?procInsId="+procInsId,
  44. //默认值为 'limit',传给服务端的参数为:limit, offset, search, sort, order Else
  45. ////查询参数,每次调用是会带上这个参数,可自定义
  46. queryParams: function (params) {
  47. var searchParam = $("#searchForm").serializeJSON();
  48. searchParam.pageNo = params.limit === undefined ? "1" : params.offset / params.limit + 1;
  49. searchParam.pageSize = params.limit === undefined ? -1 : params.limit;
  50. searchParam.orderBy = params.sort === undefined ? "" : params.sort + " " + params.order;
  51. return searchParam;
  52. },
  53. //分页方式:client客户端分页,server服务端分页(*)
  54. sidePagination: "server",
  55. contextMenuTrigger: "right",//pc端 按右键弹出菜单
  56. contextMenuTriggerMobile: "press",//手机端 弹出菜单,click:单击, press:长按。
  57. contextMenu: '#context-menu',
  58. onClickRow: function (row, $el) {
  59. },
  60. onShowSearch: function () {
  61. $("#search-collapse").slideToggle();
  62. },
  63. formatNoMatches: function () {
  64. return "你的自定义文字说明";
  65. },
  66. columns: [
  67. {
  68. field: 'materialCode',
  69. title: '物料编码',
  70. }, {
  71. field: 'materialDescription',
  72. title: '物料名称',
  73. }, {
  74. field: 'extensionDescription',
  75. title: '扩展描述',
  76. }, {
  77. field: 'mdUnits',
  78. title: '单位',
  79. }, {
  80. field: 'mdTotalAmount',
  81. title: '总量',
  82. }, {
  83. field: 'mdSingleWeight',
  84. title: '单重/kg',
  85. }, {
  86. field: 'mdTotalWeight',
  87. title: '总重/吨',
  88. }, {
  89. field: 'mdTheParty',
  90. title: '甲乙供',
  91. }, {
  92. field: 'mdText',
  93. title: '备注',
  94. }
  95. ]
  96. });
  97. if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端
  98. $('#informationTable').bootstrapTable("toggleView");
  99. }
  100. // 绑定查询按扭
  101. $("#search").click("click", function() {
  102. $('#informationTable').bootstrapTable('refresh');
  103. });
  104. // 绑定查询重置按扭
  105. $("#reset").click("click", function() {
  106. $("#searchForm input").val("");
  107. $("#searchForm select").val("");
  108. $('#informationTable').bootstrapTable('refresh');
  109. });
  110. //通过
  111. $("#agree").click(function () {
  112. jp.prompt("同意, 审批意见", function (message) {
  113. jp.post("${ctx}/act/task/managerAudit",
  114. {
  115. "taskId":"${showList.act.taskId}",
  116. "taskName":"${showList.act.taskName}",
  117. "taskDefKey":"${showList.act.taskDefKey}",
  118. "procInsId":"${showList.act.procInsId}",
  119. "procDefId":"${showList.act.procDefId}",
  120. "flag":"yes",
  121. "comment":window.encodeURI(message)
  122. },
  123. function (data) {
  124. if(data.success){
  125. jp.success(data.msg);
  126. jp.go("${ctx}/act/task/todo")
  127. }
  128. })
  129. })
  130. })
  131. //驳回
  132. $("#no").click(function () {
  133. jp.prompt("驳回, 审批意见", function (message) {
  134. jp.post("${ctx}/act/task/managerAudit",
  135. {
  136. "taskId":"${showList.act.taskId}",
  137. "taskName":"${showList.act.taskName}",
  138. "taskDefKey":"${showList.act.taskDefKey}",
  139. "procInsId":"${showList.act.procInsId}",
  140. "procDefId":"${showList.act.procDefId}",
  141. "flag":"no",
  142. "comment":window.encodeURI(message)
  143. },
  144. function (data) {
  145. if(data.success){
  146. jp.success(data.msg);
  147. jp.go("${ctx}/act/task/todo")
  148. }
  149. })
  150. })
  151. })
  152. });
  153. function getIdSelections() {
  154. return $.map($("#informationTable").bootstrapTable('getSelections'), function (row) {
  155. return row.id
  156. });
  157. }
  158. //刷新列表
  159. function refresh() {
  160. $('#informationTable').bootstrapTable('refresh');
  161. }
  162. function addRow(list, idx, tpl, row){
  163. $(list).append(Mustache.render(tpl, {
  164. idx: idx, delBtn: true, row: row
  165. }));
  166. }
  167. </script>