299 lines
14 KiB
Plaintext
299 lines
14 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8"%>
|
||
<%@page import="com.sipai.entity.equipment.FacilitiesCard"%>
|
||
<%request.setAttribute("Type_Facilities", FacilitiesCard.Type_Facilities);%>
|
||
<%request.setAttribute("Type_Pipeline", FacilitiesCard.Type_Pipeline);%>
|
||
<style type="text/css">
|
||
.select2-container .select2-selection--single{
|
||
height:34px;
|
||
line-height: 34px;
|
||
}
|
||
.select2-selection__arrow{
|
||
margin-top:3px;
|
||
}
|
||
</style>
|
||
<script type="text/javascript">
|
||
function dosave() {
|
||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
$.post(ext.contextPath + "/equipment/facilitiesCard/dosave.do", $("#subForm").serialize(), function(data) {
|
||
if (data.code == 1) {
|
||
closeModal('subModal');
|
||
$("#table").bootstrapTable('refresh');
|
||
}else if(data.code == 0){
|
||
showAlert('d',data.msg);
|
||
}else{
|
||
showAlert('d',data.msg);
|
||
}
|
||
},'json');
|
||
}
|
||
|
||
}
|
||
|
||
$("#subForm").bootstrapValidator({
|
||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||
fields: {
|
||
code:{
|
||
validators: {
|
||
notEmpty: {
|
||
message: '管道编号不能为空'
|
||
}
|
||
}
|
||
},
|
||
name: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '管道名称不能为空'
|
||
}
|
||
}
|
||
},
|
||
position:{
|
||
validators: {
|
||
notEmpty: {
|
||
message: '位置不能为空'
|
||
}
|
||
}
|
||
},
|
||
completedTime: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '建成年月不能为空'
|
||
}
|
||
}
|
||
},
|
||
useYearsLimit: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '使用年限不能为空'
|
||
}
|
||
}
|
||
},
|
||
assetStatusName: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '请选择资产状态'
|
||
}
|
||
}
|
||
},
|
||
facilitiesClassName: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '请选择管道类别'
|
||
}
|
||
}
|
||
},
|
||
}
|
||
});
|
||
|
||
$(function () {
|
||
$("#completedTime").datepicker({
|
||
language: 'zh-CN',
|
||
autoclose: true,
|
||
todayHighlight: true,
|
||
format:'yyyy-mm-dd',
|
||
});
|
||
|
||
//管道分类下拉数据
|
||
var selectType = $("#facilitiesClassName").select2({minimumResultsForSearch: 10})
|
||
$.post(ext.contextPath + "/equipment/facilitiesClass/getJson4Select.do", {}, function(data) {
|
||
$("#facilitiesClassName").empty();
|
||
var selelct_ =$("#facilitiesClassName").select2({
|
||
data: data,
|
||
placeholder:'请选择',//默认文字提示
|
||
allowClear: false,//允许清空
|
||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||
language: "zh-CN",
|
||
minimumInputLength: 0,
|
||
minimumResultsForSearch: 10,//数据超过10个启用搜索框
|
||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||
});
|
||
selelct_.val('').trigger("change");
|
||
selelct_.on('change',function(e){
|
||
$('#facilitiesClassId').val(e.target.value);
|
||
})
|
||
},'json');
|
||
|
||
//资产状态下拉数据
|
||
var selectType = $("#assetStatusName").select2({minimumResultsForSearch: 10})
|
||
$.post(ext.contextPath + "/equipment/equipmentStatusManagement/getEquipmentstatus4Select.do", {}, function(data) {
|
||
$("#assetStatusName").empty();
|
||
var selelct_ =$("#assetStatusName").select2({
|
||
data: data,
|
||
placeholder:'请选择',//默认文字提示
|
||
allowClear: false,//允许清空
|
||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||
language: "zh-CN",
|
||
minimumInputLength: 0,
|
||
minimumResultsForSearch: 10,//数据超过10个启用搜索框
|
||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||
});
|
||
selelct_.val('').trigger("change");
|
||
selelct_.on('change',function(e){
|
||
$('#assetStatus').val(e.target.value);
|
||
})
|
||
},'json');
|
||
|
||
});
|
||
</script>
|
||
<div class="modal fade" id="subModal">
|
||
<div class="modal-dialog">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||
<span aria-hidden="true">×</span></button>
|
||
<h4 class="modal-title">新增</h4>
|
||
</div>
|
||
<div class="modal-body">
|
||
<!-- 新增界面formid强制为subForm -->
|
||
<form class="form-horizontal" id="subForm">
|
||
<input type="hidden" id="unitId" name="unitId" value="${param.unitId}">
|
||
<input type="hidden" id="id" name="id" value="${id}">
|
||
<input type="hidden" id="type" name="type" value="${Type_Pipeline}">
|
||
<!-- 界面提醒div强制id为alertDiv -->
|
||
<div id="alertDiv"></div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">*管道编号</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="code" name="code" placeholder="管道编号" autocomplete="off" value="${facilitiesCard.code}">
|
||
</div>
|
||
<label class="col-sm-2 control-label">*管道名称</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="name" name="name" placeholder="管道名称" autocomplete="off" value="${facilitiesCard.name}">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">*厂区</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="companyName" name="companyName" placeholder="厂区" autocomplete="off" value="${companyName}" readonly="true">
|
||
</div>
|
||
<label class="col-sm-2 control-label">*管道类别</label>
|
||
<div class="col-sm-4">
|
||
<select class="form-control select2" id="facilitiesClassName" name ="facilitiesClassName" style="width: 170px;"></select>
|
||
<input type="hidden" class="form-control" id="facilitiesClassId" name="facilitiesClassId" value="${facilitiesCard.facilitiesClassId}"/>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">规格型号</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="model" name="model" placeholder="规格型号" autocomplete="off" value="${facilitiesCard.model}">
|
||
</div>
|
||
<label class="col-sm-2 control-label">材质</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="materialQuality" name="materialQuality" placeholder="材质" autocomplete="off" value="${facilitiesCard.materialQuality}">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">计量单位</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="measureUnit" name="measureUnit" placeholder="计量单位(如:km)" autocomplete="off" value="${facilitiesCard.measureUnit}">
|
||
</div>
|
||
<label class="col-sm-2 control-label">长度</label>
|
||
<div class="col-sm-4">
|
||
<input type="number" class="form-control" id="length" name="length" placeholder="长度" autocomplete="off" value="${facilitiesCard.length}" step="0.01">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">*建成年月</label>
|
||
<div class="col-sm-4">
|
||
<div class="input-group date">
|
||
<div class="input-group-addon">
|
||
<i class="fa fa-calendar"></i>
|
||
</div>
|
||
<input type="text" class="form-control" id="completedTime" name="completedTime" style="width: 132px;" value="${facilitiesCard.completedTime}" placeholder="请选择"/>
|
||
</div>
|
||
</div>
|
||
<label class="col-sm-2 control-label">*使用年限</label>
|
||
<div class="col-sm-4">
|
||
<input type="number" class="form-control" id="useYearsLimit" name="useYearsLimit" placeholder="使用年限" autocomplete="off" value="${facilitiesCard.useYearsLimit}" step="0.01">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">折旧年限(年)</label>
|
||
<div class="col-sm-4">
|
||
<input type="number" class="form-control" id="depreciationYearsLimit" name="depreciationYearsLimit" placeholder="折旧年限(年)" autocomplete="off" value="${facilitiesCard.depreciationYearsLimit}" step="0.01">
|
||
</div>
|
||
<label class="col-sm-2 control-label">*安装位置</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="position" name="position" placeholder="位置" autocomplete="off" value="${facilitiesCard.position}">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">账面原值(元)</label>
|
||
<div class="col-sm-4">
|
||
<input type="number" class="form-control" id="originalValue" name="originalValue" placeholder="账面原值(元)" autocomplete="off" value="${facilitiesCard.originalValue}" step="0.01">
|
||
</div>
|
||
<label class="col-sm-2 control-label">账面净值(元)</label>
|
||
<div class="col-sm-4">
|
||
<input type="number" class="form-control" id="nowValue" name="nowValue" placeholder="账面净值(元)" autocomplete="off" value="${facilitiesCard.nowValue}" step="0.01">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">设计单位</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="designUnit" name="designUnit" placeholder="设计单位" autocomplete="off" value="${facilitiesCard.designUnit}">
|
||
</div>
|
||
<label class="col-sm-2 control-label">承建单位</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="constructionUnit" name="constructionUnit" placeholder="承建单位" autocomplete="off" value="${facilitiesCard.constructionUnit}">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">资产类型</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="assetClassName" name ="assetClassName" onclick="selectAsset()" placeholder="点击选择" value="${assetClassName}">
|
||
<input type="hidden" class="form-control" id="assetClassId" name ="assetClassId" value="${facilitiesCard.assetClassId}">
|
||
</div>
|
||
<label class="col-sm-2 control-label">资产编号</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="assetClassCode" name ="assetClassCode" value="${facilitiesCard.assetClassCode}">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">*资产状态</label>
|
||
<div class="col-sm-4">
|
||
<select class="form-control select2" id="assetStatusName" name ="assetStatusName" style="width: 170px;"></select>
|
||
<input type="hidden" class="form-control" id="assetStatus" name="assetStatus" value="${facilitiesCard.assetStatus}"/>
|
||
</div>
|
||
<label class="col-sm-2 control-label">资产状况评价</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="assetEvaluate" name="assetEvaluate" placeholder="资产状况评价" autocomplete="off" value="${facilitiesCard.assetEvaluate}">
|
||
</div>
|
||
</div>
|
||
|
||
<!-- <div class="form-group">
|
||
<label class="col-sm-2 control-label">主要参数</label>
|
||
<div class="col-sm-10">
|
||
<textarea class="form-control" rows="2" id ="mainParams" name ="mainParams" placeholder="请输入" autocomplete="off">${facilitiesCard.mainParams}</textarea>
|
||
</div>
|
||
</div> -->
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">备注</label>
|
||
<div class="col-sm-10">
|
||
<textarea class="form-control" rows="2" id ="remarks" name ="remarks" placeholder="请输入" autocomplete="off">${facilitiesCard.remarks}</textarea>
|
||
</div>
|
||
</div>
|
||
|
||
</form>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||
</div>
|
||
</div>
|
||
<!-- /.modal-content -->
|
||
</div>
|
||
<!-- /.modal-dialog -->
|
||
</div>
|