netExamine.js 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. <%@ page contentType="text/html;charset=UTF-8" %>
  2. <script>
  3. $(document).ready(function() {
  4. window.operateEvents = {
  5. 'blur input': function (e, value, row, index) {
  6. var ss = $('#'+row.id).val();
  7. jp.confirm('确认要修改?', function () {
  8. jp.get("${ctx}/picking/activiti/mdTotalAmount?id="+row.id+"&mdTotalAmount="+ss, function (data) {
  9. jp.success(data.msg);
  10. refresh();
  11. })
  12. },function () {
  13. $('#informationTable').bootstrapTable('refresh');
  14. })
  15. }
  16. };
  17. var item = "";
  18. var procInsId = $("#procInsId").val();
  19. console.log(procInsId);
  20. //bootstrapTable加载数据
  21. $('#informationTable').bootstrapTable({
  22. //请求方法
  23. method: 'post',
  24. //类型json
  25. dataType: "json",
  26. contentType: "application/x-www-form-urlencoded",
  27. //显示检索按钮
  28. showSearch: false,
  29. //显示刷新按钮
  30. showRefresh: false,
  31. //显示切换手机试图按钮
  32. showToggle: false,
  33. //显示 内容列下拉框
  34. showColumns: false,
  35. //显示到处按钮
  36. showExport: false,
  37. //显示切换分页按钮
  38. showPaginationSwitch: false,
  39. //最低显示2行
  40. minimumCountColumns: 2,
  41. //是否显示行间隔色
  42. striped: true,
  43. //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  44. cache: false,
  45. //是否显示分页(*)
  46. pagination: false,
  47. //排序方式
  48. sortOrder: "asc",
  49. //初始化加载第一页,默认第一页
  50. pageNumber: 1,
  51. //每页的记录行数(*)
  52. pageSize: 10,
  53. //可供选择的每页的行数(*)
  54. pageList: [10, 25, 50, 100],
  55. //这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据
  56. url: "${ctx}/picking/activiti/constructionData?procInsId="+procInsId,
  57. //默认值为 'limit',传给服务端的参数为:limit, offset, search, sort, order Else
  58. ////查询参数,每次调用是会带上这个参数,可自定义
  59. queryParams: function (params) {
  60. var searchParam = $("#searchForm").serializeJSON();
  61. searchParam.pageNo = params.limit === undefined ? "1" : params.offset / params.limit + 1;
  62. searchParam.pageSize = params.limit === undefined ? -1 : params.limit;
  63. searchParam.orderBy = params.sort === undefined ? "" : params.sort + " " + params.order;
  64. return searchParam;
  65. },
  66. //分页方式:client客户端分页,server服务端分页(*)
  67. sidePagination: "server",
  68. contextMenuTrigger: "right",//pc端 按右键弹出菜单
  69. contextMenuTriggerMobile: "press",//手机端 弹出菜单,click:单击, press:长按。
  70. contextMenu: '#context-menu',
  71. onClickRow: function (row, $el) {
  72. },
  73. onShowSearch: function () {
  74. $("#search-collapse").slideToggle();
  75. },
  76. formatNoMatches: function () {
  77. return "你的自定义文字说明";
  78. },
  79. columns: [
  80. {
  81. checkbox: true
  82. },
  83. {
  84. field: 'materialCode',
  85. title: '物料编码',
  86. }, {
  87. field: 'materialDescription',
  88. title: '物料名称',
  89. }, {
  90. field: 'extensionDescription',
  91. title: '扩展描述',
  92. }, {
  93. field: 'mdUnits',
  94. title: '单位',
  95. }, {
  96. field: 'mdTotalAmount',
  97. title: '总量',
  98. events: operateEvents,
  99. formatter: getTime
  100. }, {
  101. field: 'mdSingleWeight',
  102. title: '单重/kg',
  103. }, {
  104. field: 'mdTotalWeight',
  105. title: '总重/吨',
  106. }, {
  107. field: 'mdTheParty',
  108. title: '甲乙供',
  109. }, {
  110. field: 'mdText',
  111. title: '备注',
  112. }
  113. ]
  114. });
  115. $('#informationTable2').bootstrapTable({
  116. //请求方法
  117. method: 'post',
  118. //类型json
  119. dataType: "json",
  120. contentType: "application/x-www-form-urlencoded",
  121. //显示检索按钮
  122. showSearch: false,
  123. //显示刷新按钮
  124. showRefresh: false,
  125. //显示切换手机试图按钮
  126. showToggle: false,
  127. //显示 内容列下拉框
  128. showColumns: false,
  129. //显示到处按钮
  130. showExport: false,
  131. //显示切换分页按钮
  132. showPaginationSwitch: false,
  133. //最低显示2行
  134. minimumCountColumns: 2,
  135. //是否显示行间隔色
  136. striped: true,
  137. //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  138. cache: false,
  139. //是否显示分页(*)
  140. pagination: false,
  141. //排序方式
  142. sortOrder: "asc",
  143. //初始化加载第一页,默认第一页
  144. pageNumber:1,
  145. //每页的记录行数(*)
  146. pageSize: 10,
  147. //可供选择的每页的行数(*)
  148. pageList: [10, 25, 50, 100],
  149. //这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据
  150. url: "${ctx}/picking/showlist/afterData?procInsId="+procInsId,
  151. //默认值为 'limit',传给服务端的参数为:limit, offset, search, sort, order Else
  152. ////查询参数,每次调用是会带上这个参数,可自定义
  153. queryParams : function(params) {
  154. var searchParam = $("#searchForm").serializeJSON();
  155. searchParam.pageNo = params.limit === undefined? "1" :params.offset/params.limit+1;
  156. searchParam.pageSize = params.limit === undefined? -1 : params.limit;
  157. searchParam.orderBy = params.sort === undefined? "" : params.sort+ " "+ params.order;
  158. return searchParam;
  159. },
  160. //分页方式:client客户端分页,server服务端分页(*)
  161. sidePagination: "server",
  162. contextMenuTrigger:"right",//pc端 按右键弹出菜单
  163. contextMenuTriggerMobile:"press",//手机端 弹出菜单,click:单击, press:长按。
  164. contextMenu: '#context-menu',
  165. onClickRow: function(row, $el){
  166. },
  167. onShowSearch: function () {
  168. $("#search-collapse").slideToggle();
  169. },
  170. formatNoMatches:function(){
  171. return "你的自定义文字说明";
  172. },
  173. columns: [
  174. {
  175. field: 'mdBigClass',
  176. title: '模块大类',
  177. },
  178. {
  179. field: 'mdTheClass',
  180. title: '模块中类',
  181. },
  182. {
  183. field: 'mdName',
  184. title: '模块名称',
  185. },
  186. {
  187. field: 'materialCode',
  188. title: '物料编码',
  189. },{
  190. field: 'materialDescription',
  191. title: '物料名称',
  192. },{
  193. field: 'extensionDescription',
  194. title: '扩展描述',
  195. },{
  196. field: 'mdUnits',
  197. title: '单位',
  198. },{
  199. field: 'mdTotalAmount',
  200. title: '总量',
  201. },{
  202. field: 'mdSingleWeight',
  203. title: '单重/kg',
  204. },{
  205. field: 'mdTotalWeight',
  206. title: '总重/吨',
  207. },{
  208. field: 'mdTheParty',
  209. title: '甲乙供',
  210. },{
  211. field: 'mdText',
  212. title: '备注',
  213. }
  214. ]
  215. });
  216. function myChange(row) {
  217. alert(row.id);
  218. }
  219. function getTime(value, row, index) {
  220. return [
  221. "<input id="+row.id+" type='number' name='changeAmount' class='form-control required' value="+row.mdTotalAmount+">",
  222. ].join('');
  223. }
  224. if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端
  225. $('#informationTable').bootstrapTable("toggleView");
  226. }
  227. $('#informationTable').on('check.bs.table uncheck.bs.table load-success.bs.table ' +
  228. 'check-all.bs.table uncheck-all.bs.table', function () {
  229. $('#remove').prop('disabled', ! $('#informationTable').bootstrapTable('getSelections').length);
  230. $('#view,#edit').prop('disabled', $('#informationTable').bootstrapTable('getSelections').length!=1);
  231. });
  232. $("#click2").click("click",function () {
  233. $("#click3").attr("style","");
  234. $("#click2").attr("style","border-bottom: 0px;border-left: 1px solid rgb(221,221,221);border-right: 1px solid rgb(221,221,221);border-top: 1px solid rgb(221,221,221)");
  235. $("#div2").attr("style", "display:block;");
  236. $("#div3").attr("style", "display:none;");
  237. });
  238. $("#click3").click("click",function () {
  239. $("#click2").attr("style","");
  240. $("#click3").attr("style","border-bottom: 0px;border-left: 1px solid rgb(221,221,221);border-right: 1px solid rgb(221,221,221);border-top: 1px solid rgb(221,221,221)");
  241. $("#div2").attr("style", "display:none;");
  242. $("#div3").attr("style", "display:block;");
  243. });
  244. // 绑定查询按扭
  245. $("#search").click("click", function() {
  246. $('#informationTable').bootstrapTable('refresh');
  247. });
  248. // 绑定查询重置按扭
  249. $("#reset").click("click", function() {
  250. $("#searchForm input").val("");
  251. $("#searchForm select").val("");
  252. $('#informationTable').bootstrapTable('refresh');
  253. });
  254. //通过
  255. $("#agree").click(function () {
  256. jp.prompt("同意, 审批意见", function (message) {
  257. jp.post("${ctx}/act/task/netExamine",
  258. {
  259. "taskId":"${showList.act.taskId}",
  260. "taskName":"${showList.act.taskName}",
  261. "taskDefKey":"${showList.act.taskDefKey}",
  262. "procInsId":"${showList.act.procInsId}",
  263. "procDefId":"${showList.act.procDefId}",
  264. "flag":"yes",
  265. "comment":window.encodeURI(message)
  266. },
  267. function (data) {
  268. if(data.success){
  269. jp.success(data.msg);
  270. jp.go("${ctx}/act/task/todo")
  271. }
  272. })
  273. })
  274. })
  275. //驳回
  276. $("#no").click(function () {
  277. jp.prompt("驳回, 审批意见", function (message) {
  278. jp.post("${ctx}/act/task/netExamine",
  279. {
  280. "taskId":"${showList.act.taskId}",
  281. "taskName":"${showList.act.taskName}",
  282. "taskDefKey":"${showList.act.taskDefKey}",
  283. "procInsId":"${showList.act.procInsId}",
  284. "procDefId":"${showList.act.procDefId}",
  285. "flag":"no",
  286. "comment":window.encodeURI(message)
  287. },
  288. function (data) {
  289. if(data.success){
  290. jp.success(data.msg);
  291. jp.go("${ctx}/act/task/todo")
  292. }
  293. })
  294. })
  295. })
  296. });
  297. function getIdSelections() {
  298. return $.map($("#informationTable").bootstrapTable('getSelections'), function (row) {
  299. return row.id
  300. });
  301. }
  302. //刷新列表
  303. function refresh() {
  304. $('#informationTable').bootstrapTable('refresh');
  305. }
  306. function addRow(list, idx, tpl, row){
  307. $(list).append(Mustache.render(tpl, {
  308. idx: idx, delBtn: true, row: row
  309. }));
  310. }
  311. function deleteAll(){
  312. jp.confirm('确认要删除该图片管理记录吗?', function(){
  313. jp.loading();
  314. jp.get("${ctx}/picking/activiti/deleteAll?ids=" + getIdSelections(), function(data){
  315. refresh();
  316. jp.success(data.msg);
  317. })
  318. })
  319. }
  320. function add(){
  321. var procInsId = $("#procInsId").val();
  322. jp.openSaveDialog('新增物料', "${ctx}/picking/activiti/netExamineUpload?procInsId="+procInsId,'800px', '500px');
  323. }
  324. </script>