gong_info2.jsp 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
  2. <%
  3. String path = request.getContextPath();
  4. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
  5. %>
  6. <!DOCTYPE html>
  7. <html>
  8. <head>
  9. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  10. <!-- 避免IE使用兼容模式 -->
  11. <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
  12. <meta name="renderer" content="webkit">
  13. <!-- 导入公共样式 -->
  14. <%@ include file="ap.jsp" %>
  15. </head>
  16. <style>
  17. #printTable td,th{
  18. font-size:16px;
  19. }
  20. </style>
  21. <body>
  22. <!-- layout布局 开始 -->
  23. <div data-toggle="topjui-layout" data-options="fit:true">
  24. <div data-options="region:'center',iconCls:'icon-reload',title:'',split:true,border:false">
  25. <div data-toggle="topjui-layout" data-options="fit:true">
  26. <div data-options="region:'center',title:'',fit:false,split:true,border:false,bodyCls:'border_right_bottom'"
  27. style="height:80%">
  28. <!-- datagrid表格 -->
  29. <table data-toggle="topjui-datagrid"
  30. data-options="id:'userDg',
  31. <!-- pagination:false, -->
  32. singleSelect:true,
  33. selectOnCheck:false,
  34. checkOnSelect:false,
  35. ">
  36. </table>
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. <div data-toggle="topjui-layout" data-options="fit:true" >
  42. <div data-options="region:'center',iconCls:'icon-reload',title:'',split:true,border:false">
  43. <div data-toggle="topjui-layout" data-options="fit:true">
  44. <div data-options="region:'center',title:'',fit:false,split:true,border:false,bodyCls:'border_right_bottom'"
  45. style="height:80%">
  46. <!-- datagrid表格 -->
  47. <table data-toggle="topjui-datagrid"
  48. data-options="id:'userDg01',
  49. <!-- pagination:false, -->
  50. singleSelect:true,
  51. selectOnCheck:false,
  52. checkOnSelect:false,
  53. ">
  54. </table>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. <!-- 表格工具栏开始 -->
  60. <div id="userDg-toolbar" class="topjui-toolbar"
  61. data-options="grid:{
  62. type:'datagrid',
  63. id:'userDg'
  64. }">
  65. </div>
  66. <!-- 表格工具栏结束 -->
  67. <script>
  68. var place=request('plan_num');
  69. $(function () {
  70. /* //隐藏文本框录入订单号
  71. $("#pla").val(place); */
  72. var userDg = {
  73. type: 'datagrid',
  74. id: 'userDg'
  75. };
  76. $("#userDg").iDatagrid({
  77. id: 'userDg',
  78. url: 'placeplaceSchedule.action?place='+place,
  79. columns: [[
  80. {field: 'id', title: 'UID', checkbox: true},
  81. {field: 'p_num', title: '订单号', sortable: true},
  82. {field: 't_name', title: '工序名称', sortable: true},
  83. {field: 'cp_piece_num', title: '已完成件数', sortable: true},
  84. {field: 'performance', title: '已完成/总数量', sortable: true,formatter:performance},
  85. {field:'rate',title:'完成率',sortable:true,formatter:progressFormatter},
  86. {field:'buttom',title:'操作',sortable:true,formatter:function(value, row, index){
  87. //console.info(row);
  88. var plnum = row.t_name;
  89. var str = "<button class='layui-btn layui-btn-xs' onclick=openDiag(/"+plnum+"/)>查看</button>";
  90. return str;
  91. }}
  92. ]]
  93. });
  94. });
  95. function performance(value,row,index){
  96. var completed=Number(row['completed']);
  97. var unfinished=Number(row['unfinished']);
  98. var he = Number(completed+unfinished);
  99. return completed+" / "+he;
  100. }
  101. function openDiag(p){
  102. str=p+"";
  103. str=str.replace("/","").replace("/","");
  104. //console.info(p+"--"+str);
  105. $(this).iDialog('openDialog', {
  106. id: 'businessDialog2',
  107. title: str,
  108. iconCls: 'fa fa-binoculars',
  109. href: "jinduInfo1.jsp?str="+str,
  110. height:500,
  111. width:500,
  112. });
  113. }
  114. function progressFormatter(value, row, index) {
  115. var completed=Number(row['completed']);
  116. var unfinished=Number(row['unfinished']);
  117. var he = Number(completed+unfinished);
  118. //console.info(he+"---"+completed);
  119. value=parseInt(completed/he*100);
  120. var htmlstr = '<div id="p" class="topjui-progressbar progressbar" data-options="value:' + value + '" style="width: 100px; height: 26px;">';
  121. htmlstr += '<div class="progressbar-text" style="width: 100px; height: 26px; line-height: 26px;">' + value + '%</div>';
  122. htmlstr += '<div class="progressbar-value" style="width: ' + value + '%; height: 26px; line-height: 26px;">';
  123. htmlstr += '<div class="progressbar-text" style="width: 100px; height: 26px; line-height: 26px;">' + value + '%</div>';
  124. htmlstr += '</div>';
  125. htmlstr += '</div>';
  126. return htmlstr;
  127. }
  128. //获取传入id
  129. function request(paras) {
  130. var url = location.href;
  131. var paraString = url.substring(url.indexOf("?") + 1, url.length).split("&");
  132. var paraObj = { };
  133. for (var i = 0; j = paraString[i]; i++) {
  134. paraObj[j.substring(0, j.indexOf("=")).toLowerCase()] = j.substring(j.indexOf("=") + 1, j.length);
  135. }
  136. var returnValue = paraObj[paras.toLowerCase()];
  137. if (typeof (returnValue) == "undefined") {
  138. return "";
  139. } else {
  140. return returnValue;
  141. }
  142. }
  143. </script>
  144. </body>
  145. </html>