| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- <% layout('/layouts/default.html', {title: '设备管理', libs: ['dataGrid']}){ %>
- <div class="main-content">
- <div class="box box-main">
- <div class="box-header">
- <div class="box-title">
- <i class="fa icon-notebook"></i> ${text('设备信息管理')}
- </div>
- <div class="box-tools pull-right">
- <a href="javascript:;" class="btn btn-default" onclick="work()" title="${text('工作面板')}"><i class="fa fa-fw fa-refresh"></i>工作面板</a>
- <!-- <a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>-->
- <a href="#" class="btn btn-default" id="btnRefreshTree" title="${text('刷新')}"><i class="fa fa-refresh"></i> ${text('刷新')}</a>
- <!-- <a href="#" class="btn btn-default" id="btnExpandTreeNode" title="${text('展开一级')}"><i class="fa fa-angle-double-down"></i> ${text('展开')}</a>-->
- <!-- <a href="#" class="btn btn-default" id="btnCollapseTreeNode" title="${text('折叠全部')}"><i class="fa fa-angle-double-up"></i> ${text('折叠')}</a>-->
- <!-- <a href="#" class="btn btn-default" id="btnExport"><i class="glyphicon glyphicon-export"></i> 导出</a>-->
- <% if(hasPermi('mes:mesDevice:edit')){ %>
- <!-- <a href="#" class="btn btn-default" id="btnImport"><i class="glyphicon glyphicon-import"></i> 导入</a>-->
- <a href="${ctx}/mes/mesDevice/form" class="btn btn-default btnTool" title="${text('新增设备')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
- <% } %>
- <a href="#" class="btn btn-default" id="btnSetting" title="${text('设置')}"><i class="fa fa-navicon"></i></a>
- </div>
- </div>
- <div class="box-body">
- <#form:form id="searchForm" model="${mesDevice}" action="${ctx}/mes/mesDevice/listData" method="post" class="form-inline hide"
- data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
- <#form:hidden path="treeCode"/>
- <#form:hidden path="gw"/>
- <#form:hidden path="lineSn"/>
- <!-- <div class="form-group">-->
- <!-- <label class="control-label">${text('状态')}:</label>-->
- <!-- <div class="control-inline width-120">-->
- <!-- <#form:select path="status" dictType="sys_search_status" blankOption="true" class="form-control isQuick"/>-->
- <!-- </div>-->
- <!-- </div>-->
- <!-- <div class="form-group">-->
- <!-- <label class="control-label">${text('班次')}:</label>-->
- <!-- <div class="control-inline width-120">-->
- <!-- <#form:select path="bc" dictType="mes_device_bc" blankOption="true" class="form-control isQuick"/>-->
- <!-- </div>-->
- <!-- </div>-->
- <!-- <div class="form-group">-->
- <!-- <label class="control-label">${text('设备工作状态')}:</label>-->
- <!-- <div class="control-inline width-120">-->
- <!-- <#form:select path="workStatus" dictType="mes_device_work_status" blankOption="true" class="form-control isQuick"/>-->
- <!-- </div>-->
- <!-- </div>-->
- <!-- <div class="form-group">-->
- <!-- <label class="control-label">${text('设备类型')}:</label>-->
- <!-- <div class="control-inline width-120">-->
- <!-- <#form:select path="deviceType" dictType="mes_device_type" blankOption="true" class="form-control isQuick"/>-->
- <!-- </div>-->
- <!-- </div>-->
- <!-- <div class="form-group">-->
- <!-- <label class="control-label">${text('工作类型')}:</label>-->
- <!-- <div class="control-inline width-120">-->
- <!-- <#form:select path="workType" dictType="mes_device_work_type" blankOption="true" class="form-control isQuick"/>-->
- <!-- </div>-->
- <!-- </div>-->
- <!-- <div class="form-group">-->
- <!-- <label class="control-label">${text('设备名称')}:</label>-->
- <!-- <div class="control-inline">-->
- <!-- <#form:input path="treeName" maxlength="200" class="form-control width-120"/>-->
- <!-- </div>-->
- <!-- </div>-->
- <!-- <div class="form-group">-->
- <!-- <label class="control-label">${text('唯一编号')}:</label>-->
- <!-- <div class="control-inline">-->
- <!-- <#form:input path="sn" maxlength="255" class="form-control width-120"/>-->
- <!-- </div>-->
- <!-- </div>-->
- <!-- <div class="form-group">-->
- <!-- <button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>-->
- <!-- <button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>-->
- <!-- </div>-->
- </#form:form>
- <table id="dataGrid"></table>
- <div id="dataGridPage"></div>
- </div>
- </div>
- </div>
- <% } %>
- <script>
- // 初始化DataGrid对象
- $('#dataGrid').dataGrid({
- searchForm: $("#searchForm"),
- columnModel: [
- {header:'${text("设备名称")}', name:'treeName', index:'a.tree_name', width:250, align:"center"},
- {header:'${text("唯一编号")}', name:'sn', index:'a.sn', width:150, align:"center"},
- //{header:'${text("上一级编号")}', name:'parentSn', index:'a.parentSn', width:150, align:"left"},
- {header:'${text("分类")}', name:'cateName', index:'a.cate_name', width:150, align:"center"},
- {header:'${text("IP地址")}', name:'ip', index:'a.ip', width:150, align:"center"},
- {header:'${text("产线编号")}', name:'lineSn', index:'a.line_sn', width:150, align:"center"},
- {header:'${text("工位")}', name:'gw', index:'a.gw', width:150, align:"center"},
- {header:'${text("设备识别码")}', name:'deviceCode', index:'a.device_code', width:150, align:"center"},
- // {header:'${text("工位地图位置")}', name:'postion', index:'a.postion', width:150, align:"left"},
- // {header:'${text("班次")}', name:'bc', index:'a.bc', width:150, align:"center", formatter: function(val, obj, row, act){
- // return js.getDictLabel(${@DictUtils.getDictListJson('mes_device_bc')}, val, '${text("未知")}', true);
- // }},
- {header:'${text("设备工作状态")}', name:'workStatus', index:'a.work_status', width:150, align:"center", formatter: function(val, obj, row, act){
- return js.getDictLabel(${@DictUtils.getDictListJson('mes_device_work_status')}, val, '${text("未知")}', true);
- }},
- // {header:'${text("设备工作状态时间")}', name:'workTime', index:'a.work_time', width:150, align:"center"},
- // {header:'${text("设备类型")}', name:'deviceType', index:'a.device_type', width:150, align:"center", formatter: function(val, obj, row, act){
- // return js.getDictLabel(${@DictUtils.getDictListJson('mes_device_type')}, val, '${text("未知")}', true);
- // }},
- // {header:'${text("工作类型")}', name:'workType', index:'a.work_type', width:150, align:"center", formatter: function(val, obj, row, act){
- // return js.getDictLabel(${@DictUtils.getDictListJson('mes_device_work_type')}, val, '${text("未知")}', true);
- // }},
- // {header:'${text("排序号")}', name:'treeSort', index:'a.tree_sort', width:150, align:"center"},
- {header:'${text("状态")}', name:'status', index:'a.status', width:150, align:"center", formatter: function(val, obj, row, act){
- return js.getDictLabel(${@DictUtils.getDictListJson('sys_search_status')}, val, '${text("未知")}', true);
- }},
- {header:'${text("备注")}', name:'remark', index:'a.remark', width:150, align:"left"},
- //{header:'${text("创建时间")}', name:'createDate', index:'a.create_date', width:150, align:"center"},
- {header:'${text("更新时间")}', name:'updateDate', index:'a.update_date', width:150, align:"center"},
- {header:'${text("操作")}', name:'actions', width:150, formatter: function(val, obj, row, act){
- var actions = [];
- //<% if(hasPermi('mes:mesDevice:edit')){ %>
- actions.push('<a href="${ctx}/mes/mesDevice/form?treeCode='+row.treeCode+'" class="btnList" title="${text("编辑设备")}"><i class="fa fa-pencil"></i></a> ');
- if (row.status == Global.STATUS_NORMAL){
- actions.push('<a href="${ctx}/mes/mesDevice/disable?treeCode='+row.treeCode+'" class="btnList" title="${text("停用设备")}" data-confirm="${text("确认要停用该设备吗?")}"><i class="glyphicon glyphicon-ban-circle"></i></a> ');
- } else if (row.status == Global.STATUS_DISABLE){
- actions.push('<a href="${ctx}/mes/mesDevice/enable?treeCode='+row.treeCode+'" class="btnList" title="${text("启用设备")}" data-confirm="${text("确认要启用该设备吗?")}"><i class="glyphicon glyphicon-ok-circle"></i></a> ');
- }
- actions.push('<a href="${ctx}/mes/mesDevice/delete?treeCode='+row.treeCode+'" class="btnList" title="${text("删除设备")}" data-confirm="${text("确认要删除该设备及所有子设备吗?")}" data-deltreenode="'+row.id+'"><i class="fa fa-trash-o"></i></a> ');
- // actions.push('<a href="${ctx}/mes/mesDevice/form?parentCode='+row.id+'" class="btnList" title="${text("新增下级设备")}"><i class="fa fa-plus-square"></i></a> ');
- // actions.push('<a href="${ctx}/mes/mesDevice/detail?treeCode='+row.treeCode+'" class="btnList" title="${text("详情")}"><i class="fa fa-eye"></i></a> ');
- //<% } %>
- return actions.join('');
- }}
- ],
- frozenCols: true,
- // treeGrid: true, // 启用树结构表格
- // defaultExpandLevel: 0, // 默认展开的层次
- // expandNodeClearPostData: 'cateId,workStatus,deviceType,workType,remark,treeName,sn,ip,', // 展开节点清理请求参数数据(一般设置查询条件的字段属性,否则在查询后,不能展开子节点数据)
- // 加载成功后执行事件
- ajaxSuccess: function(data){
-
- }
- });
- </script><script>
- $('#btnExport').click(function(){
- js.ajaxSubmitForm($('#searchForm'), {
- url:'${ctx}/mes/mesDevice/exportData',
- downloadFile:true
- });
- });
- function work(){
- window.location.href = '${ctx}/mes/mesProductRecord/work?oprno=${mesDevice.gw}&lineSn=${mesDevice.lineSn}';
- }
- $('#btnImport').click(function(){
- js.layer.open({
- type: 1,
- area: ['400px'],
- title: '${text("导入设备")}',
- resize: false,
- scrollbar: true,
- content: js.template('importTpl'),
- btn: ['<i class="fa fa-check"></i> ${text("导入")}',
- '<i class="fa fa-remove"></i> ${text("关闭")}'],
- btn1: function(index, layero){
- var form = {
- inputForm: layero.find('#inputForm'),
- file: layero.find('#file').val()
- };
- if (form.file == '' || (!js.endWith(form.file, '.xls') && !js.endWith(form.file, '.xlsx'))){
- js.showMessage("${text('文件不正确,请选择后缀为“xls”或“xlsx”的文件。')}", null, 'warning');
- return false;
- }
- js.ajaxSubmitForm(form.inputForm, function(data){
- js.showMessage(data.message);
- if(data.result == Global.TRUE){
- js.layer.closeAll();
- }
- page();
- }, "json");
- return true;
- }
- });
- });
- </script>
- <script id="importTpl" type="text/template">//<!--
- <form id="inputForm" action="${ctx}/mes/mesDevice/importData" method="post" enctype="multipart/form-data"
- class="form-horizontal mt20 mb10" style="overflow:auto;max-height:200px;">
- <div class="row">
- <div class="col-xs-12 col-xs-offset-1">
- <input type="file" id="file" name="file" class="form-file"/>
- <div class="mt10 pt5" style="color:red">
- ${text('提示:仅允许导入“xls”或“xlsx”格式文件!')}
- </div>
- <div class="mt10 pt5">
- <a href="${ctx}/mes/mesDevice/importTemplate" class="btn btn-default btn-xs"><i class="fa fa-file-excel-o"></i> ${text('下载模板')}</a>
- </div>
- </div>
- </div>
- </form>
- //--></script>
|