294 lines
14 KiB
Plaintext
294 lines
14 KiB
Plaintext
|
|
<%@ page language="java" pageEncoding="UTF-8"%>
|
|||
|
|
<%@page import="com.sipai.entity.timeefficiency.TimeEfficiencyCommStr"%>
|
|||
|
|
<%request.setAttribute("PatrolType_Product", TimeEfficiencyCommStr.PatrolType_Product);%>
|
|||
|
|
<%request.setAttribute("PatrolType_Equipment", TimeEfficiencyCommStr.PatrolType_Equipment);%>
|
|||
|
|
<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/doupdate.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('${facilitiesCard.facilitiesClassId}').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('${facilitiesCard.assetStatus}').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="${facilitiesCard.unitId}">
|
|||
|
|
<input type="hidden" id="id" name="id" value="${facilitiesCard.id}">
|
|||
|
|
<!-- 界面提醒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="assetStatusName" name ="assetStatusName" style="width: 170px;"></select>
|
|||
|
|
<input type="hidden" class="form-control" id="assetStatus" name="assetStatus" value="${facilitiesCard.assetStatus}"/>
|
|||
|
|
</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="position" name="position" placeholder="位置" autocomplete="off" value="${facilitiesCard.position}">
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">结构</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="structure" name="structure" placeholder="结构" autocomplete="off" value="${facilitiesCard.structure}">
|
|||
|
|
</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="text" class="form-control" id="builtArea" name="builtArea" placeholder="面积" autocomplete="off" value="${facilitiesCard.builtArea}">
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">数量</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="number" class="form-control" id="number" name="number" placeholder="数量" autocomplete="off" value="${facilitiesCard.number}" step="0.01">
|
|||
|
|
</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="facilitiesClassName" name ="facilitiesClassName" style="width: 170px;"></select>
|
|||
|
|
<input type="hidden" class="form-control" id="facilitiesClassId" name="facilitiesClassId" value="${facilitiesCard.facilitiesClassId}"/>
|
|||
|
|
</div>
|
|||
|
|
<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>
|
|||
|
|
</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-10">
|
|||
|
|
<textarea class="form-control" rows="2" id ="assetEvaluate" name ="assetEvaluate" placeholder="请输入" autocomplete="off">${facilitiesCard.assetEvaluate}</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 ="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>
|