221 lines
6.8 KiB
Plaintext
221 lines
6.8 KiB
Plaintext
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|||
|
|
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
|||
|
|
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
|||
|
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
|||
|
|
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
|
|||
|
|
<html>
|
|||
|
|
<head>
|
|||
|
|
<title></title>
|
|||
|
|
<jsp:include page="../inc.jsp"></jsp:include>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
function dosave(dialog,grid) {
|
|||
|
|
if ($(".form").form('validate')) {
|
|||
|
|
$.post(ext.contextPath + "/equipment/saveEquipmentCard.do", $(".form").serialize(), function(data) {
|
|||
|
|
if (data.res == 1) {
|
|||
|
|
$.post(ext.contextPath + "/equipment/saveEquipmentPoints.do",{no:data.id,mids:getMids()},function(data1){
|
|||
|
|
|
|||
|
|
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
|||
|
|
//刷新列表
|
|||
|
|
grid.datagrid('reload');
|
|||
|
|
dialog.dialog('destroy');
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
}else if(data.res == 0){
|
|||
|
|
top.$.messager.alert('提示', "保存失败", 'info');
|
|||
|
|
}else{
|
|||
|
|
top.$.messager.alert('提示', data.res, 'info');
|
|||
|
|
}
|
|||
|
|
},'json');
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
function getMids(){
|
|||
|
|
var mrows= $('#grid').datagrid("getRows");
|
|||
|
|
var mids="";
|
|||
|
|
$.each(mrows, function(index, item){
|
|||
|
|
mids+=item.id+",";
|
|||
|
|
});
|
|||
|
|
mids=mids.replace(/,$/gi,"");
|
|||
|
|
|
|||
|
|
return mids;
|
|||
|
|
}
|
|||
|
|
function doadd_M(){
|
|||
|
|
$("#mids").val(getMids());
|
|||
|
|
localStorage.setItem("mids",$("#mids").val().split(","));
|
|||
|
|
/* //清除旧数据
|
|||
|
|
var mrows= grid.datagrid("getRows");
|
|||
|
|
|
|||
|
|
//复制rows,否则deleteRow的index会出错
|
|||
|
|
var copyRows = [];
|
|||
|
|
for ( var j= 0; j < mrows.length; j++) {
|
|||
|
|
copyRows.push(mrows[j]);
|
|||
|
|
}
|
|||
|
|
$.each(copyRows, function(index, item){
|
|||
|
|
grid.datagrid('deleteRow', grid.datagrid('getRowIndex',copyRows[index]));
|
|||
|
|
});
|
|||
|
|
*/
|
|||
|
|
var dialog = parent.ext.modalDialog({
|
|||
|
|
title : '添加测量点',
|
|||
|
|
height:500,
|
|||
|
|
url : ext.contextPath + '/work/mpoint/showlistForSelects.do',
|
|||
|
|
buttons : [ {
|
|||
|
|
iconCls:'icon-ok',
|
|||
|
|
text : '确认',
|
|||
|
|
handler : function() {
|
|||
|
|
var data = dialog.find('iframe').get(0).contentWindow.selectFun(dialog, grid);
|
|||
|
|
var datas= $.parseJSON(data);
|
|||
|
|
|
|||
|
|
if(datas.length>0){
|
|||
|
|
for(var i=0;i<datas.length;i++){
|
|||
|
|
grid.datagrid('appendRow',{
|
|||
|
|
id:datas[i].id,
|
|||
|
|
id:datas[i].id,
|
|||
|
|
parmname:datas[i].parmname,
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
dialog.dialog('destroy');
|
|||
|
|
}
|
|||
|
|
} ]
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
function dodelete_M(){
|
|||
|
|
var rows = $('#grid').datagrid('getChecked');
|
|||
|
|
if(rows.length==0){
|
|||
|
|
top.$.messager.alert("提示","请选择需要删除的数据","info");
|
|||
|
|
}else{
|
|||
|
|
top.$.messager.confirm("提示", "确定删除这些数据?", function(r) {
|
|||
|
|
if (r) {
|
|||
|
|
//复制rows,否则deleteRow的index会出错
|
|||
|
|
var copyRows = [];
|
|||
|
|
for ( var j= 0; j < rows.length; j++) {
|
|||
|
|
copyRows.push(rows[j]);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$.each(copyRows, function(index, item){
|
|||
|
|
$('#grid').datagrid('deleteRow',$('#grid').datagrid('getRowIndex',copyRows[index]));
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
$(function() {
|
|||
|
|
$('#equipmentclassid').combobox({
|
|||
|
|
url:ext.contextPath + '/equipment/getEquipmentClassname.do',
|
|||
|
|
valueField:'id',
|
|||
|
|
textField:'name',
|
|||
|
|
editable:false,
|
|||
|
|
panelHeight:'auto',
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
$('#areaid').combobox({
|
|||
|
|
url:ext.contextPath + '/equipment/getGeographyAreaname.do',
|
|||
|
|
valueField:'id',
|
|||
|
|
textField:'name',
|
|||
|
|
editable:false,
|
|||
|
|
panelHeight:'auto',
|
|||
|
|
});
|
|||
|
|
$('#m').panel({
|
|||
|
|
width:"100%",
|
|||
|
|
height:"300",
|
|||
|
|
title: '添加测量点',
|
|||
|
|
tools: [{
|
|||
|
|
iconCls:'icon-add',
|
|||
|
|
handler:function(){doadd_M();}
|
|||
|
|
},{
|
|||
|
|
iconCls:'icon-remove',
|
|||
|
|
handler:function(){dodelete_M();}
|
|||
|
|
}]
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
grid = $('#grid').datagrid({
|
|||
|
|
title : '',
|
|||
|
|
striped : true,
|
|||
|
|
rownumbers : true,
|
|||
|
|
idField : 'id',
|
|||
|
|
columns : [ [
|
|||
|
|
{checkbox:true , field : 'ck'},
|
|||
|
|
{width : '100', title : '测量点ID', field : 'id', sortable : true, halign:'center'},
|
|||
|
|
|
|||
|
|
{width : '180', title : '名称', field : 'parmname', sortable : false, halign:'center'},
|
|||
|
|
|
|||
|
|
] ]
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
</script>
|
|||
|
|
</head>
|
|||
|
|
<body>
|
|||
|
|
<form method="post" class="form">
|
|||
|
|
<table class="table">
|
|||
|
|
<input id="mids" name="mids" type="hidden" value="" />
|
|||
|
|
<tr>
|
|||
|
|
<th >设备编号</th>
|
|||
|
|
<td ><input id="equipmentcardid" name="equipmentcardid" class="easyui-textbox" data-options="required:true,validType:'isBlank'" style="overflow:auto;" value="" /></td>
|
|||
|
|
</tr>
|
|||
|
|
<tr>
|
|||
|
|
<th >设备名称</th>
|
|||
|
|
<td ><input id="equipmentname" name="equipmentname" class="easyui-textbox" data-options="required:true,validType:'isBlank'" style="overflow:auto;" value="" /></td>
|
|||
|
|
</tr>
|
|||
|
|
<tr>
|
|||
|
|
<th >设备型号</th>
|
|||
|
|
<td ><input id="equipmentmodel" name="equipmentmodel" class="easyui-textbox" style="overflow:auto;" value="" /></td>
|
|||
|
|
</tr>
|
|||
|
|
<tr>
|
|||
|
|
<th>设备类型</th>
|
|||
|
|
<td>
|
|||
|
|
<input id="equipmentclassid" name="equipmentclassid" class="easyui-combobox" value="" />
|
|||
|
|
</td>
|
|||
|
|
|
|||
|
|
</tr>
|
|||
|
|
<tr>
|
|||
|
|
<th>存放位置</th>
|
|||
|
|
<td>
|
|||
|
|
<input id="areaid" name="areaid" class="easyui-combobox" value="" />
|
|||
|
|
</td>
|
|||
|
|
|
|||
|
|
</tr>
|
|||
|
|
<tr>
|
|||
|
|
<th >管理状态</th>
|
|||
|
|
<td ><select id="currentmanageflag" name="currentmanageflag" class="easyui-combobox" data-options="panelHeight:'auto'">
|
|||
|
|
<option value="启用" selected>启用</option>
|
|||
|
|
<option value="禁用">禁用</option>
|
|||
|
|
</select></td>
|
|||
|
|
</tr>
|
|||
|
|
<tr>
|
|||
|
|
<th >设备厂商</th>
|
|||
|
|
<td ><input id="equipmentmanufacturer" name="equipmentmanufacturer" class="easyui-textbox" style="overflow:auto;" value="" /></td>
|
|||
|
|
</tr>
|
|||
|
|
<tr>
|
|||
|
|
<th >责任人</th>
|
|||
|
|
<td ><input id="responsibleperson" name="responsibleperson" class="easyui-textbox" style="overflow:auto;" value="" /></td>
|
|||
|
|
</tr>
|
|||
|
|
<tr>
|
|||
|
|
<th >使用部门</th>
|
|||
|
|
<td ><input id="responsibledepartment" name="responsibledepartment" class="easyui-textbox" style="overflow:auto;" value="" /></td>
|
|||
|
|
</tr>
|
|||
|
|
|
|||
|
|
<tr>
|
|||
|
|
<th>使用日期</th>
|
|||
|
|
<td><input id="productiondate" name="productiondate" class="Wdate"
|
|||
|
|
value="" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
|
|||
|
|
readonly>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
<tr>
|
|||
|
|
<th >资产原值</th>
|
|||
|
|
<td ><input id="equipmentvalue" name="equipmentvalue" class="easyui-textbox" style="overflow:auto;" value="" /></td>
|
|||
|
|
</tr>
|
|||
|
|
<tr>
|
|||
|
|
<th >备注</th>
|
|||
|
|
<td ><input id="remark" name="remark" class="easyui-textbox"
|
|||
|
|
data-options="multiline:true" style="overflow:auto;width:100%;height:80px;" value=""
|
|||
|
|
validtype="length[0,250]" invalidMessage="有效长度0-250"/></td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
</form>
|
|||
|
|
<div id="m">
|
|||
|
|
<table id="grid" data-options="border:false"></table>
|
|||
|
|
</div>
|
|||
|
|
</body>
|
|||
|
|
</html>
|