mesDevicePreventTaskMyDeal.html 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <% layout('/layouts/default.html', {title: '预防性维修计划管理', libs: ['validate','fileupload','dataGrid']}){ %>
  2. <div class="main-content">
  3. <div class="box box-main">
  4. <div class="box-header with-border">
  5. <div class="box-title">
  6. <i class="fa icon-note"></i> ${text('提交维修结果')}
  7. </div>
  8. <div class="box-tools pull-right">
  9. <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
  10. </div>
  11. </div>
  12. <#form:form id="inputForm" model="${mesDevicePreventTask}" action="${ctx}/mes/mesDevicePreventTask/dealsave" method="post" class="form-horizontal">
  13. <div class="box-body">
  14. <div class="form-unit">${text('基本信息')}</div>
  15. <#form:hidden path="id"/>
  16. <table class="table table-bordered">
  17. <tr>
  18. <th class="mpc-header">任务清单</th>
  19. <td>
  20. <div>
  21. 名称:${mesDevicePrevent.title};技术类型:${mesDevicePrevent.cate};周期:${mesDevicePrevent.cycle};时长:${mesDevicePrevent.laborHour};
  22. </div>
  23. <div>
  24. <% if(mesDevicePrevent.mesDevicePreventFormList! != null && mesDevicePrevent.mesDevicePreventFormList.~size > 0){ %>
  25. <% for(var item in mesDevicePrevent.mesDevicePreventFormList){ %>
  26. <div>${item.title}[时长:${item.laborHour}分钟]</div>
  27. <% } %>
  28. <% } %>
  29. </div>
  30. </td>
  31. </tr>
  32. <tr>
  33. <th class="mpc-header">执行人员</th>
  34. <td>${mesDevicePreventTask.userName}</td>
  35. </tr>
  36. <tr>
  37. <th class="mpc-header">设备</th>
  38. <td>${mesDevicePreventTask.deviceName}</td>
  39. </tr>
  40. <tr>
  41. <th class="mpc-header">任务开始时间</th>
  42. <td>${mesDevicePreventTask.startDate,dateFormat='yyyy-MM-dd HH:mm'}</td>
  43. </tr>
  44. </table>
  45. <p><br></p>
  46. <div class="row">
  47. <div class="col-xs-6">
  48. <div class="form-group">
  49. <label class="control-label col-sm-4" title="">
  50. <span class="required">*</span> ${text('任务结束时间')}:<i class="fa icon-question hide"></i></label>
  51. <div class="col-sm-8">
  52. <#form:input path="endDate" readonly="true" maxlength="20" class="form-control laydate required"
  53. dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. <div class="row">
  59. <div class="col-xs-12">
  60. <div class="form-group">
  61. <label class="control-label col-sm-2" title="">
  62. <span class="required hide">*</span> ${text('提交内容')}:<i class="fa icon-question hide"></i></label>
  63. <div class="col-sm-10">
  64. <#form:textarea path="content" rows="4" maxlength="255" class="form-control"/>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. <div class="row">
  70. <div class="col-xs-12">
  71. <div class="form-group">
  72. <label class="control-label col-sm-2">
  73. <span class="required hide">*</span> ${text('图片上传')}:</label>
  74. <div class="col-sm-10">
  75. <#form:fileupload id="uploadImage" bizKey="${mesDevicePreventTask.id}" bizType="mesDevicePreventTask_image"
  76. uploadType="image" class="" readonly="false" preview="true"/>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. <h4 class="form-unit">${text('易耗品使用记录')}</h4>
  82. <div class="ml10 mr10 table-form">
  83. <table id="mesDeviceConsumableRecordDataGrid"></table>
  84. <% if (hasPermi('mes:mesDeviceRecord:edit')){ %>
  85. <a href="#" id="mesDeviceConsumableRecordDataGridAddRowBtn" class="btn btn-primary btn-sm mt10 mb10"><i class="fa fa-plus"></i> ${text('增行')}</a>
  86. <% } %>
  87. </div>
  88. </div>
  89. <div class="box-footer">
  90. <div class="row">
  91. <div class="col-sm-offset-2 col-sm-10">
  92. <% if (hasPermi('mes:mesDevicePreventTask:deal')){ %>
  93. <button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('保 存')}</button>&nbsp;
  94. <% } %>
  95. <button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
  96. </div>
  97. </div>
  98. </div>
  99. </#form:form>
  100. </div>
  101. </div>
  102. <% } %>
  103. <script>
  104. //初始化易耗品使用记录DataGrid对象
  105. $("#mesDeviceConsumableRecordDataGrid").dataGrid({
  106. data: ${toJson(mesDevicePreventTask.mesDeviceConsumableRecordList)},
  107. datatype: "local", // 设置本地数据
  108. autoGridHeight: function(){return 'auto'}, // 设置自动高度
  109. // 设置数据表格列
  110. columnModel: [
  111. {header:'主键', name:'id', editable:true, hidden:true},
  112. {header:'易耗品', name:'consumableId', width:100,
  113. formatter: function(val, obj, row, act){
  114. return js.val(row, 'consumableId')+'|'+js.val(row, 'consumable.title');
  115. }, editable: true, edittype: "custom", editoptions: {
  116. custom_element: function(val, editOptions) {
  117. return js.template('listselectTpl', {
  118. id: 'consumable_'+editOptions.id, title: '易耗品选择',
  119. name: 'consumableId', value: val.split('|')[0],
  120. labelName: 'title', labelValue: val.split('|')[1],
  121. url: '${ctx}/mes/mesDeviceConsumable/consumableSelect', cssClass: 'required', readonly: false,
  122. itemCode: 'id', itemName: 'title'
  123. });
  124. }
  125. }
  126. },
  127. {header:'${text("使用数量")}', name:'num', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'9', 'class':'form-control required digits'}},
  128. {header:'${text("操作")}', name:'actions', width:80, align:'center', formatter: function(val, obj, row, act){
  129. var actions = [];
  130. if (val == 'new'){
  131. actions.push('<a href="#" onclick="js.confirm(\'${text("你确认要删除这条数据吗?")}\', function(){$(\'#mesDeviceConsumableRecordDataGrid\').dataGrid(\'delRowData\',\''+obj.rowId+'\')});return false;"><i class="fa fa-trash-o"></i></a>&nbsp;');
  132. }else{
  133. actions.push('<a href="#" onclick="js.confirm(\'${text("你确认要删除这条数据吗?")}\', function(){$(\'#mesDeviceConsumableRecordDataGrid\').dataGrid(\'setRowData\',\''+obj.rowId+'\',null,{display:\'none\'});$(\'#'+obj.rowId+'_status\').val(\''+Global.STATUS_DELETE+'\');});return false;"><i class="fa fa-trash-o"></i></a>&nbsp;');
  134. }
  135. return actions.join('');
  136. }, editoptions: {defaultValue: 'new'}}
  137. ],
  138. // 编辑表格参数
  139. editGrid: true, // 是否是编辑表格
  140. editGridInitRowNum: 1, // 编辑表格的初始化新增行数
  141. editGridAddRowBtn: $('#mesDeviceConsumableRecordDataGridAddRowBtn'), // 子表增行按钮
  142. editGridAddRowBtnToHeader: true, // 子表增行按钮是否显示到表头上
  143. editGridAddRowInitData: {id: '', status: Global.STATUS_NORMAL}, // 新增行的时候初始化的数据
  144. // 编辑表格的提交数据参数
  145. editGridInputFormListName: 'mesDeviceConsumableRecordList', // 提交的数据列表名
  146. editGridInputFormListAttrs: 'id,consumableId,num,status', // 提交数据列表的属性字段
  147. // 加载成功后执行事件
  148. ajaxSuccess: function(data){
  149. }
  150. });
  151. $("#inputForm").validate({
  152. submitHandler: function(form){
  153. js.ajaxSubmitForm($(form), function(data){
  154. js.showMessage(data.message);
  155. if(data.result == Global.TRUE){
  156. js.closeCurrentTabPage(function(contentWindow){
  157. contentWindow.page();
  158. });
  159. }
  160. }, "json");
  161. }
  162. });
  163. </script>
  164. <script id="listselectTpl" type="text/template">//<!--<div>
  165. <#form:listselect id="{{d.id}}" title="{{d.title}}" name="{{d.name}}" value="{{d.value}}"
  166. labelName="{{d.labelName}}" labelValue="{{d.labelValue}}" url="{{d.url}}"
  167. class="{{d.cssClass}}" btnClass="btn-sm" allowClear="true" readonly="{{d.readonly}}"
  168. itemCode="{{d.itemCode}}" itemName="{{d.itemName}}"/>
  169. </div>//--></script>