321 lines
14 KiB
Plaintext
321 lines
14 KiB
Plaintext
|
|
<%@ page language="java" pageEncoding="UTF-8" %>
|
|||
|
|
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
|||
|
|
<%@page import="com.sipai.tools.CommString" %>
|
|||
|
|
<% request.setAttribute("Flag_Active", CommString.Flag_Active); %>
|
|||
|
|
<% request.setAttribute("Flag_Unactive", CommString.Flag_Unactive); %>
|
|||
|
|
<%@page import="com.sipai.entity.document.DocFileRelation" %>
|
|||
|
|
<% request.setAttribute("Type_libraryProcessAdjustment", DocFileRelation.Type_libraryProcessAdjustment); %>
|
|||
|
|
<style type="text/css">
|
|||
|
|
|
|||
|
|
</style>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
|
|||
|
|
function dosave() {
|
|||
|
|
$("#subForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
|||
|
|
//获取验证结果,如果成功,执行下面代码
|
|||
|
|
$.post(ext.contextPath + "/process/libraryProcessAdjustment/doupdate.do", $("#subForm").serialize(), function (data) {
|
|||
|
|
if (data.res == 1) {
|
|||
|
|
$("#tableAdjustment").bootstrapTable('refresh');
|
|||
|
|
closeModal("subModal");
|
|||
|
|
} else if (data.res == 0) {
|
|||
|
|
showAlert('d', '保存失败');
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', data.res);
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$("#subForm").bootstrapValidator({
|
|||
|
|
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
|||
|
|
fields: {
|
|||
|
|
// typeName: {
|
|||
|
|
// validators: {
|
|||
|
|
// notEmpty: {
|
|||
|
|
// message: '工艺调整类型不能为空'
|
|||
|
|
// }
|
|||
|
|
// }
|
|||
|
|
// },
|
|||
|
|
abnormalCode: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '异常编号不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
abnormalName: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '异常名称不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
abnormalName: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '异常名称不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
|
|||
|
|
proCode: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '工艺调整代码不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
proName: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '工艺调整名称不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
proMeasuresCode: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '工艺调整措施代码不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
receiveRatedTime: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '接单额定工时不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
proMeasures: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '工艺调整措施'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
var fileRelation = function () {
|
|||
|
|
$.post(ext.contextPath + '/document/docFileRelation/show4select.do', {
|
|||
|
|
unitId: unitId,
|
|||
|
|
type: '${Type_libraryProcessAdjustment}',
|
|||
|
|
masterid: $("#id").val()
|
|||
|
|
}, function (data) {
|
|||
|
|
$("#docFileRelationDiv").html(data);
|
|||
|
|
openModal('docFileRelationModal');
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
//下载文件
|
|||
|
|
var fileDownload = function (id) {
|
|||
|
|
window.open(ext.contextPath + "/base/downloadFile.do?key=" + id + "&tbName=tb_doc_file");
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
function delRelation(id) {
|
|||
|
|
stopBubbleDefaultEvent();
|
|||
|
|
swal({
|
|||
|
|
text: "您确定要删除此记录?",
|
|||
|
|
dangerMode: true,
|
|||
|
|
buttons: {
|
|||
|
|
cancel: {
|
|||
|
|
text: "取消",
|
|||
|
|
value: null,
|
|||
|
|
visible: true,
|
|||
|
|
className: "btn btn-default btn-sm",
|
|||
|
|
closeModal: true,
|
|||
|
|
},
|
|||
|
|
confirm: {
|
|||
|
|
text: "确定",
|
|||
|
|
value: true,
|
|||
|
|
visible: true,
|
|||
|
|
className: "btn btn-danger btn-sm",
|
|||
|
|
closeModal: true
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
})
|
|||
|
|
.then(function (willDelete) {
|
|||
|
|
if (willDelete) {
|
|||
|
|
$.post(ext.contextPath + '/document/docFileRelation/delete.do', {id: id}, function (data) {
|
|||
|
|
if (data.code == 1) {
|
|||
|
|
$("#fileRelationTable").bootstrapTable('refresh');
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', '删除失败', 'mainAlertdiv');
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$(function () {
|
|||
|
|
$("#fileRelationTable").bootstrapTable({ // 对应table标签的id
|
|||
|
|
url: ext.contextPath + '/document/docFileRelation/getList.do', // 获取表格数据的url
|
|||
|
|
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
|||
|
|
striped: true, //表格显示条纹,默认为false
|
|||
|
|
pagination: true, // 在表格底部显示分页组件,默认false
|
|||
|
|
pageList: [10], // 设置页面可以显示的数据条数
|
|||
|
|
pageSize: 10, // 页面数据条数
|
|||
|
|
pageNumber: 1, // 首页页码
|
|||
|
|
sidePagination: 'server', // 设置为服务器端分页
|
|||
|
|
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
|||
|
|
return {
|
|||
|
|
rows: params.limit, // 每页要显示的数据条数
|
|||
|
|
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
|||
|
|
sort: params.sort, // 要排序的字段
|
|||
|
|
order: params.order,
|
|||
|
|
masterid: $("#id").val()
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
sortName: 'id', // 要排序的字段
|
|||
|
|
sortOrder: 'asc', // 排序规则
|
|||
|
|
// onClickRow: function (row) {//单击行事件,执行查看功能
|
|||
|
|
|
|||
|
|
// },
|
|||
|
|
columns: [
|
|||
|
|
// {
|
|||
|
|
// checkbox: true, // 显示一个勾选框
|
|||
|
|
// },
|
|||
|
|
{
|
|||
|
|
field: '', // 返回json数据中的name
|
|||
|
|
title: '资料名称', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle',
|
|||
|
|
formatter: function (value, row, index) {
|
|||
|
|
return row.commonFile.filename;
|
|||
|
|
}
|
|||
|
|
}, {
|
|||
|
|
field: '', // 返回json数据中的name
|
|||
|
|
title: '上传者', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle',
|
|||
|
|
formatter: function (value, row, index) {
|
|||
|
|
return row.insuserName;
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
title: "操作",
|
|||
|
|
align: 'center',
|
|||
|
|
valign: 'middle',
|
|||
|
|
width: '100',
|
|||
|
|
formatter: function (value, row, index) {
|
|||
|
|
var buts = '';
|
|||
|
|
buts += '<button class="btn btn-default btn-sm" title="下载" onclick="fileDownload(\'' + row.docId + '\')"><i class="fa fa-download"></i><span class="hidden-md hidden-lg">下载</span></button>';
|
|||
|
|
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="delRelation(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button>';
|
|||
|
|
buts = '<div class = "btn-group">' + buts + '</div>';
|
|||
|
|
return buts;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
],
|
|||
|
|
onLoadSuccess: function () { //加载成功时执行
|
|||
|
|
adjustBootstrapTableView("table");
|
|||
|
|
},
|
|||
|
|
onLoadError: function () { //加载失败时执行
|
|||
|
|
console.info("加载数据失败");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
|
|||
|
|
</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" autocomplete="off">
|
|||
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|||
|
|
<div id="alertDiv"></div>
|
|||
|
|
<input type="hidden" id="id" name="id" value="${libraryProcessAdjustment.id}"/>
|
|||
|
|
<input type="hidden" id="pid" name="pid" value="${libraryProcessAdjustment.pid}"/>
|
|||
|
|
<input type="hidden" id="unitId" name="unitId" value="${libraryProcessAdjustment.unitId}"/>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">*工艺调整代码</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="proCode" name="proCode" placeholder="工艺调整代码"
|
|||
|
|
value="${libraryProcessAdjustment.proCode}">
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">*工艺调整名称</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="proName" name="proName" placeholder="工艺调整名称"
|
|||
|
|
value="${libraryProcessAdjustment.proName}">
|
|||
|
|
</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="proMeasuresCode" name="proMeasuresCode"
|
|||
|
|
placeholder="工艺调整措施代码"
|
|||
|
|
value="${libraryProcessAdjustment.proMeasuresCode}">
|
|||
|
|
</div>--%>
|
|||
|
|
<label class="col-sm-2 control-label">*接单额定工时</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="number" class="form-control" id="receiveRatedTime" name="receiveRatedTime"
|
|||
|
|
placeholder="接单额定工时" value="${libraryProcessAdjustment.receiveRatedTime}"
|
|||
|
|
step="0.01">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">*工艺调整措施</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<textarea class="form-control" id="proMeasures" name="proMeasures"
|
|||
|
|
placeholder="工艺调整措施">${libraryProcessAdjustment.proMeasures}</textarea>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">工艺调整监控指标</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<textarea class="form-control" id="monitorTarget" name="monitorTarget"
|
|||
|
|
placeholder="工艺调整监控指标">${libraryProcessAdjustment.monitorTarget}</textarea>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">工艺调整验收标准</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<textarea class="form-control" id="checkStandard" name="checkStandard"
|
|||
|
|
placeholder="工艺调整验收标准">${libraryProcessAdjustment.checkStandard}</textarea>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</form>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="box-body ">
|
|||
|
|
<div>
|
|||
|
|
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
|||
|
|
<button type="button" class="btn btn-default" onclick="fileRelation();"><i
|
|||
|
|
class="fa fa-plus"></i>文件关联
|
|||
|
|
</button>
|
|||
|
|
<!-- <button type="button" class="btn btn-default" onclick="delDocFun();"><i class="fa fa-trash"></i> 删除</button> -->
|
|||
|
|
</div>
|
|||
|
|
<!-- <div class="input-group input-group-sm pull-right" style="width:250px" >
|
|||
|
|
<input type="text" id="search_fileName" name="search_fileName" autocomplete="off" style="height:35px" class="form-control pull-right" placeholder="资料名称...">
|
|||
|
|
<div class="input-group-btn">
|
|||
|
|
<button class="btn btn-default" style="height:35px" onclick="dosearchFile();"><i class="fa fa-search"></i></button>
|
|||
|
|
</div>
|
|||
|
|
</div> -->
|
|||
|
|
<table id="fileRelationTable"></table>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="modal-footer">
|
|||
|
|
<button type="button" class="btn btn-default" 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>
|