201 lines
7.1 KiB
Plaintext
201 lines
7.1 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/updateEquipmentCard.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 dialog = parent.ext.modalDialog({
|
||
title : '关联测量点',
|
||
height:500,
|
||
url : ext.contextPath + '/work/mpoint/showlistForSelects.do?iframeId=equipmentCardAdd',
|
||
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() {
|
||
$('#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'},
|
||
|
||
] ],
|
||
data:${equipmentPointList}
|
||
});
|
||
});
|
||
</script>
|
||
</head>
|
||
<body>
|
||
<input id="mids" name="mids" type="hidden" value="" />
|
||
<form method="post" class="form">
|
||
<input id="id" name="id" type="hidden" value="${ equipmentcard.id}"/>
|
||
<table class="table">
|
||
<tr>
|
||
<th >设备编号</th>
|
||
<td ><input id="equipmentcardid" name="equipmentcardid" class="easyui-textbox" data-options="required:true,validType:'isBlank'" style="overflow:auto;" value="${ equipmentcard.equipmentcardid}" /></td>
|
||
</tr>
|
||
<tr>
|
||
<th >设备名称</th>
|
||
<td ><input id="equipmentname" name="equipmentname" class="easyui-textbox" data-options="required:true,validType:'isBlank'" style="overflow:auto;" value="${ equipmentcard.equipmentname}" /></td>
|
||
</tr>
|
||
<tr>
|
||
<th >设备型号</th>
|
||
<td ><input id="equipmentmodel" name="equipmentmodel" class="easyui-textbox" style="overflow:auto;" value="${ equipmentcard.equipmentmodel}" /></td>
|
||
</tr>
|
||
<tr>
|
||
<th >设备类型</th>
|
||
<td ><select id="equipmentclassid" name="equipmentclassid" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||
<c:forEach items="${equipmentClassList}" var="ecObj">
|
||
<option value="${ecObj.id}" <c:if test="${equipmentcard.equipmentclassid==ecObj.id }"> selected</c:if>><c:out value="${ecObj.name}"></c:out></option>
|
||
</c:forEach>
|
||
</select></td>
|
||
</tr>
|
||
<tr>
|
||
<th >存放位置</th>
|
||
<td ><select id="areaid" name="areaid" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||
<c:forEach items="${geographyAreaList}" var="gaObj">
|
||
<option value="${gaObj.id}" <c:if test="${equipmentcard.areaid==gaObj.id }"> selected</c:if>><c:out value="${gaObj.name}"></c:out></option>
|
||
</c:forEach>
|
||
</select></td>
|
||
</tr>
|
||
<tr>
|
||
<th >管理状态</th>
|
||
<td ><select id="currentmanageflag" name="currentmanageflag" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||
<option value="启用" <c:if test="${equipmentcard.currentmanageflag=='启用' }"> selected</c:if>>启用</option>
|
||
<option value="禁用" <c:if test="${equipmentcard.currentmanageflag=='禁用' }"> selected</c:if>>禁用</option>
|
||
</select></td>
|
||
</tr>
|
||
</tr>
|
||
<tr>
|
||
<th >设备厂商</th>
|
||
<td ><input id="equipmentmanufacturer" name="equipmentmanufacturer" class="easyui-textbox" style="overflow:auto;" value="${equipmentcard.equipmentmanufacturer}" /></td>
|
||
</tr>
|
||
<tr>
|
||
<th >责任人</th>
|
||
<td ><input id="responsibleperson" name="responsibleperson" class="easyui-textbox" style="overflow:auto;" value="${equipmentcard.responsibleperson}" /></td>
|
||
</tr>
|
||
<tr>
|
||
<th >使用部门</th>
|
||
<td ><input id="responsibledepartment" name="responsibledepartment" class="easyui-textbox" style="overflow:auto;" value="${equipmentcard.responsibledepartment}" /></td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<th>使用日期</th>
|
||
<td><input id="productiondate" name="productiondate"class="Wdate"
|
||
value="${equipmentcard.productiondate}" 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="${equipmentcard.equipmentvalue}" /></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;"
|
||
validtype="length[0,250]" invalidMessage="有效长度0-250"
|
||
value="${ equipmentcard.remark}" /></td>
|
||
</tr>
|
||
|
||
</table>
|
||
</form>
|
||
<div id="m">
|
||
<table id="grid" data-options="border:false"></table>
|
||
</div>
|
||
</body>
|
||
</html>
|