mesProcessCntDetail.html 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <% layout('/layouts/default.html', {title: '工序件数明细', libs: ['dataGrid']}){ %>
  2. <style>
  3. .pc-proc { margin-left: 12px; font-weight: normal; color: #2f80ed; font-size: 14px; }
  4. .pc-oprno { display: inline-block; margin-right: 8px; font-weight: 600; }
  5. .pc-ok { color: #27ae60; font-weight: 600; }
  6. .pc-ng { color: #e74c3c; font-weight: 600; }
  7. .pc-udf { color: #95a5a6; }
  8. .pc-tip { margin-left: 10px; font-weight: normal; font-size: 12px; color: #999; }
  9. </style>
  10. <div class="main-content">
  11. <div class="box box-main">
  12. <div class="box-header">
  13. <div class="box-title">
  14. <i class="fa fa-list-alt"></i> ${text('工序件数明细')}
  15. <span class="pc-proc">
  16. <span class="pc-oprno">${mesProcessCnt.oprno!}</span>
  17. <span>${mesProcessCnt.processTitle!}</span>
  18. </span>
  19. <span class="pc-tip">${text('默认只显示有 OK/NG 判定结果的记录(与列表件数一致);查未判定的请把结果选为 UDF')}</span>
  20. </div>
  21. <div class="box-tools pull-right">
  22. <a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
  23. <a href="#" class="btn btn-default" id="btnSetting" title="${text('设置')}"><i class="fa fa-navicon"></i></a>
  24. </div>
  25. </div>
  26. <div class="box-body">
  27. <#form:form id="searchForm" model="${mesProcessCnt}" action="${ctx}/mes/mesProcessCnt/detailData" method="post" class="form-inline hide"
  28. data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
  29. <#form:hidden path="oprno"/>
  30. <#form:hidden path="lineSn"/>
  31. <#form:hidden path="startDate"/>
  32. <#form:hidden path="endDate"/>
  33. <div class="form-group">
  34. <label class="control-label">${text('产品二维码')}:</label>
  35. <div class="control-inline">
  36. <#form:input path="sn" maxlength="50" class="form-control width-260" placeholder="支持模糊查询"/>
  37. </div>
  38. </div>
  39. <div class="form-group">
  40. <label class="control-label">${text('结果')}:</label>
  41. <div class="control-inline" style="width:120px;">
  42. <select name="content" id="content" class="form-control width-120">
  43. <option value="">${text('全部(有判定)')}</option>
  44. <option value="OK">OK</option>
  45. <option value="NG">NG</option>
  46. <option value="UDF">${text('未判定(UDF)')}</option>
  47. </select>
  48. </div>
  49. </div>
  50. <div class="form-group">
  51. <button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
  52. <button type="button" class="btn btn-default btn-sm" id="btnReset">${text('重置')}</button>
  53. </div>
  54. </#form:form>
  55. <table id="dataGrid"></table>
  56. <div id="dataGridPage"></div>
  57. </div>
  58. </div>
  59. </div>
  60. <% } %>
  61. <script>
  62. // 初始化DataGrid对象
  63. $('#dataGrid').dataGrid({
  64. searchForm: $("#searchForm"),
  65. pageSize: 50,
  66. columnModel: [
  67. {header:'${text("产品二维码")}', name:'sn', width:280, align:"left", frozen:true, sortable:false, formatter: function(val, obj, row, act){
  68. return val ? '<a href="${ctx}/mes/mesProductRecord/list?sn=' + encodeURIComponent(val) + '" class="btnList" data-title="${text("生产记录")}">' + val + '</a>' : '';
  69. }},
  70. {header:'${text("工位号")}', name:'oprno', width:100, align:"center", sortable:false},
  71. {header:'${text("工序名称")}', name:'processTitle', width:200, align:"left", sortable:false},
  72. {header:'${text("工件类型")}', name:'cateSn', width:110, align:"center", sortable:false},
  73. {header:'${text("结果")}', name:'content', width:90, align:"center", sortable:false, formatter: function(val){
  74. if(val === 'OK'){ return '<span class="pc-ok">OK</span>'; }
  75. if(val === 'NG'){ return '<span class="pc-ng">NG</span>'; }
  76. return '<span class="pc-udf">' + (val || 'UDF') + '</span>';
  77. }},
  78. {header:'${text("产线")}', name:'lineSn', width:90, align:"center", sortable:false},
  79. {header:'${text("工序时间")}', name:'workTime', width:170, align:"center", sortable:false, formatter: function(val){
  80. return val ? val : '-';
  81. }},
  82. {header:'${text("备注")}', name:'remark', width:200, align:"left", sortable:false, formatter: function(val){
  83. return val ? val : '';
  84. }}
  85. ]
  86. });
  87. // 重置(只清空本页查询条件,保留工序参数)
  88. $('#btnReset').click(function(){
  89. $('#sn').val('');
  90. $('#content').val('');
  91. $('#dataGrid').trigger('reloadGrid');
  92. });
  93. </script>