| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- <% layout('/layouts/default.html', {title: '预防性维修计划管理', libs: ['validate','fileupload','dataGrid']}){ %>
- <div class="main-content">
- <div class="box box-main">
- <div class="box-header with-border">
- <div class="box-title">
- <i class="fa icon-note"></i> ${text('提交维修结果')}
- </div>
- <div class="box-tools pull-right">
- <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
- </div>
- </div>
- <#form:form id="inputForm" model="${mesDevicePreventTask}" action="${ctx}/mes/mesDevicePreventTask/dealsave" method="post" class="form-horizontal">
- <div class="box-body">
- <div class="form-unit">${text('基本信息')}</div>
- <#form:hidden path="id"/>
- <table class="table table-bordered">
- <tr>
- <th class="mpc-header">任务清单</th>
- <td>
- <div>
- 名称:${mesDevicePrevent.title};技术类型:${mesDevicePrevent.cate};周期:${mesDevicePrevent.cycle};时长:${mesDevicePrevent.laborHour};
- </div>
- <div>
- <% if(mesDevicePrevent.mesDevicePreventFormList! != null && mesDevicePrevent.mesDevicePreventFormList.~size > 0){ %>
- <% for(var item in mesDevicePrevent.mesDevicePreventFormList){ %>
- <div>${item.title}[时长:${item.laborHour}分钟]</div>
- <% } %>
- <% } %>
- </div>
- </td>
- </tr>
- <tr>
- <th class="mpc-header">执行人员</th>
- <td>${mesDevicePreventTask.userName}</td>
- </tr>
- <tr>
- <th class="mpc-header">设备</th>
- <td>${mesDevicePreventTask.deviceName}</td>
- </tr>
- <tr>
- <th class="mpc-header">任务开始时间</th>
- <td>${mesDevicePreventTask.startDate,dateFormat='yyyy-MM-dd HH:mm'}</td>
- </tr>
- </table>
- <p><br></p>
- <div class="row">
- <div class="col-xs-6">
- <div class="form-group">
- <label class="control-label col-sm-4" title="">
- <span class="required">*</span> ${text('任务结束时间')}:<i class="fa icon-question hide"></i></label>
- <div class="col-sm-8">
- <#form:input path="endDate" readonly="true" maxlength="20" class="form-control laydate required"
- dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
- </div>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-xs-12">
- <div class="form-group">
- <label class="control-label col-sm-2" title="">
- <span class="required hide">*</span> ${text('提交内容')}:<i class="fa icon-question hide"></i></label>
- <div class="col-sm-10">
- <#form:textarea path="content" rows="4" maxlength="255" class="form-control"/>
- </div>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-xs-12">
- <div class="form-group">
- <label class="control-label col-sm-2">
- <span class="required hide">*</span> ${text('图片上传')}:</label>
- <div class="col-sm-10">
- <#form:fileupload id="uploadImage" bizKey="${mesDevicePreventTask.id}" bizType="mesDevicePreventTask_image"
- uploadType="image" class="" readonly="false" preview="true"/>
- </div>
- </div>
- </div>
- </div>
- <h4 class="form-unit">${text('易耗品使用记录')}</h4>
- <div class="ml10 mr10 table-form">
- <table id="mesDeviceConsumableRecordDataGrid"></table>
- <% if (hasPermi('mes:mesDeviceRecord:edit')){ %>
- <a href="#" id="mesDeviceConsumableRecordDataGridAddRowBtn" class="btn btn-primary btn-sm mt10 mb10"><i class="fa fa-plus"></i> ${text('增行')}</a>
- <% } %>
- </div>
- </div>
- <div class="box-footer">
- <div class="row">
- <div class="col-sm-offset-2 col-sm-10">
- <% if (hasPermi('mes:mesDevicePreventTask:deal')){ %>
- <button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('保 存')}</button>
- <% } %>
- <button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
- </div>
- </div>
- </div>
- </#form:form>
- </div>
- </div>
- <% } %>
- <script>
- //初始化易耗品使用记录DataGrid对象
- $("#mesDeviceConsumableRecordDataGrid").dataGrid({
- data: ${toJson(mesDevicePreventTask.mesDeviceConsumableRecordList)},
- datatype: "local", // 设置本地数据
- autoGridHeight: function(){return 'auto'}, // 设置自动高度
- // 设置数据表格列
- columnModel: [
- {header:'主键', name:'id', editable:true, hidden:true},
- {header:'易耗品', name:'consumableId', width:100,
- formatter: function(val, obj, row, act){
- return js.val(row, 'consumableId')+'|'+js.val(row, 'consumable.title');
- }, editable: true, edittype: "custom", editoptions: {
- custom_element: function(val, editOptions) {
- return js.template('listselectTpl', {
- id: 'consumable_'+editOptions.id, title: '易耗品选择',
- name: 'consumableId', value: val.split('|')[0],
- labelName: 'title', labelValue: val.split('|')[1],
- url: '${ctx}/mes/mesDeviceConsumable/consumableSelect', cssClass: 'required', readonly: false,
- itemCode: 'id', itemName: 'title'
- });
- }
- }
- },
- {header:'${text("使用数量")}', name:'num', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'9', 'class':'form-control required digits'}},
- {header:'${text("操作")}', name:'actions', width:80, align:'center', formatter: function(val, obj, row, act){
- var actions = [];
- if (val == 'new'){
- actions.push('<a href="#" onclick="js.confirm(\'${text("你确认要删除这条数据吗?")}\', function(){$(\'#mesDeviceConsumableRecordDataGrid\').dataGrid(\'delRowData\',\''+obj.rowId+'\')});return false;"><i class="fa fa-trash-o"></i></a> ');
- }else{
- 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> ');
- }
- return actions.join('');
- }, editoptions: {defaultValue: 'new'}}
- ],
- // 编辑表格参数
- editGrid: true, // 是否是编辑表格
- editGridInitRowNum: 1, // 编辑表格的初始化新增行数
- editGridAddRowBtn: $('#mesDeviceConsumableRecordDataGridAddRowBtn'), // 子表增行按钮
- editGridAddRowBtnToHeader: true, // 子表增行按钮是否显示到表头上
- editGridAddRowInitData: {id: '', status: Global.STATUS_NORMAL}, // 新增行的时候初始化的数据
- // 编辑表格的提交数据参数
- editGridInputFormListName: 'mesDeviceConsumableRecordList', // 提交的数据列表名
- editGridInputFormListAttrs: 'id,consumableId,num,status', // 提交数据列表的属性字段
- // 加载成功后执行事件
- ajaxSuccess: function(data){
- }
- });
- $("#inputForm").validate({
- submitHandler: function(form){
- js.ajaxSubmitForm($(form), function(data){
- js.showMessage(data.message);
- if(data.result == Global.TRUE){
- js.closeCurrentTabPage(function(contentWindow){
- contentWindow.page();
- });
- }
- }, "json");
- }
- });
- </script>
- <script id="listselectTpl" type="text/template">//<!--<div>
- <#form:listselect id="{{d.id}}" title="{{d.title}}" name="{{d.name}}" value="{{d.value}}"
- labelName="{{d.labelName}}" labelValue="{{d.labelValue}}" url="{{d.url}}"
- class="{{d.cssClass}}" btnClass="btn-sm" allowClear="true" readonly="{{d.readonly}}"
- itemCode="{{d.itemCode}}" itemName="{{d.itemName}}"/>
- </div>//--></script>
|