<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
<%
|
String path = request.getContextPath();
|
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
|
+ path + "/";
|
%>
|
|
<!DOCTYPE html>
|
<html>
|
<head>
|
<base href="<%=basePath%>">
|
<title>人工添加实物利用</title>
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
<link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
|
<link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">
|
<link rel="stylesheet" href="static/styles/material-teal.css" type="text/css">
|
<link rel="stylesheet" type="text/css" href="static/plugins/webuploader/webuploader.css">
|
<link rel="stylesheet" href="static/styles/initialize.css" type="text/css">
|
<link rel="stylesheet" href="static/styles/archives.css" type="text/css">
|
<link rel="stylesheet" href="static/styles/common.css" type="text/css">
|
<link rel="stylesheet" href="static/plugins/icheck/skins/all.css" type="text/css">
|
|
<script type="text/javascript" src="static/plugins/jquery/jquery.min.js"></script>
|
<script type="text/javascript" src="static/plugins/jquery-easyui/jquery.easyui.min.js"></script>
|
<script type="text/javascript" src="static/plugins/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
|
<script type="text/javascript" src="static/scripts/easyuiExtend.js"></script>
|
<script type="text/javascript" src="static/scripts/jquery-extend.js"></script>
|
<script type="text/javascript" src="static/plugins/layer/layer.js"></script>
|
<script type="text/javascript" src="static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
|
<script type="text/javascript" src="static/plugins/jquery-easyui-edatagrid/jquery.edatagrid.js"></script>
|
<script type="text/javascript" src="static/plugins/jquery-afterresize/jquery.afterresize.min.js"></script>
|
|
<!-- 弹窗加载组件 -->
|
<script type="text/javascript" src="static/plugins/layer/layer.js"></script>
|
<script type="text/javascript" src="static/plugins/spinjs/spin.js"></script>
|
<script type="text/javascript" src="static/plugins/spinjs/jquery.spin.js"></script>
|
<script type="text/javascript" src="static/plugins/jquery.blockUI.js"></script>
|
<script type="text/javascript" src="static/plugins/ace/src-noconflict/ace.js"></script>
|
<!-- wcp组件 -->
|
<script type="text/javascript" src="static/wcp/scripts/wcp.js"></script>
|
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.layer.js"></script>
|
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.blockUI.js"></script>
|
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.spin.js"></script>
|
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.jquery.js"></script>
|
|
<!--[if lt IE 9]>
|
<script type="text/javascript" src="static/plugins/json2.js"></script>
|
<![endif]-->
|
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.infoPicker.js"></script>
|
<script type="text/javascript" src="static/plugins/webuploader/webuploader.js"></script>
|
<script src="static/plugins/webuploader/webuploader.min.js"></script>
|
<script src="static/plugins/ptfileupload/pt.fileupload.js"></script>
|
<style>
|
body {
|
background: #f3f5fa;
|
width: 1020px;
|
margin: 0 auto;
|
}
|
|
.pt-form table {
|
margin: 20px auto 0px auto;
|
}
|
|
.webuploader-pick {
|
background-color: #d81b60;
|
border: 1px solid #c40a4e;
|
border-radius: 4px;
|
color: #fff;
|
padding: 5px 10px;
|
float: right;
|
margin: -10px 32px 0 0;
|
}
|
|
.webuploader-pick i.fa-upload {
|
padding-right: 0.3em;
|
color: #fff;
|
}
|
</style>
|
|
</head>
|
<body>
|
<div class="margin-lr">
|
<div class="pt-title-theme3"><i class="fa fa-file-text"></i><h4>实物利用单</h4></div>
|
<div class="ptbody">
|
<div class="pt-application-row">
|
<div class="pt-subtitle"><i></i><span>实物利用单</span></div>
|
<div class="pt-form">
|
<form id="form1">
|
<table style="width: 100%;">
|
<tr>
|
<td class="tbtitle">实物利用单编号:</td>
|
<td colspan="3">[自动生成]</td>
|
</tr>
|
<tr>
|
<td class="tbtitle"><em class="pt-color-danger">*</em> 申请人:</td>
|
<td style="width: 35%;">
|
<input class="easyui-textbox" id="applyUser" name="applyUser"
|
type="text" style="width:300px;" value="${curUserName}"
|
data-options="required:true,tipPosition:'bottom',buttonText:'选',prompt:'请选择加工人...',onClickButton:function(){selectPhysicalName(); }"/>
|
<input id="applyUserId" class="easyui-textbox" name="applyUserId"
|
type="hidden"
|
value="${curUserId}"/>
|
</td>
|
<td class="tbtitle"><em class="pt-color-danger">*</em>工作单位:</td>
|
<td style="width: 35%;">
|
<input class="easyui-textbox" id="deptName"
|
name="deptName" type="text" style="width:300px"
|
data-options="required:true"
|
value=""/>
|
<input id="deptId" class="easyui-textbox" name="deptId"
|
type="hidden"
|
value="${curDeptId}"/>
|
</td>
|
</tr>
|
<tr>
|
<td class="tbtitle"><em class="pt-color-danger">*</em>单位地址:</td>
|
<td style="width: 30%;">
|
<input class="easyui-textbox" id="deptAddress"
|
name="deptAddress" type="text" style="width:300px"
|
value="" data-options="required:true"/>
|
</td>
|
<td class="tbtitle"><em class="pt-color-danger">*</em>身份证号码:</td>
|
<td style="width: 30%;">
|
<input class="easyui-textbox" id="cardId"
|
name="cardId" type="text" style="width:300px"
|
value="" data-options="required:true"/>
|
</td>
|
</tr>
|
|
|
<tr>
|
<td class="tbtitle"><em class="pt-color-danger">*</em>联系电话:</td>
|
<td style="width: 30%;">
|
<input class="easyui-textbox" id="telNumber"
|
name="telNumber" type="text" style="width:300px"
|
value="" data-options="required:true"/>
|
</td>
|
<td class="tbtitle"><em class="pt-color-danger">*</em>邮箱:</td>
|
<td style="width: 30%;">
|
<input class="easyui-textbox" id="email"
|
name="email" type="text" style="width:300px"
|
value="" data-options="required:true"/>
|
</td>
|
</tr>
|
<tr>
|
<td class="tbtitle">职称:</td>
|
<td style="width: 30%;">
|
<input class="easyui-textbox" id="jobTitle"
|
name="jobTitle" type="text" style="width:300px"
|
value="" data-options="required:false"/>
|
</td>
|
|
</tr>
|
<tr>
|
<td class="tbtitle"><em class="pt-color-danger">*</em>观察取样时间:</td>
|
<td style="width: 30%;">
|
<input class="easyui-textbox" id="observationTime"
|
name="observationTime" type="date" style="width:300px"
|
value="" data-options="required:true"/>
|
</td>
|
<td class="tbtitle"><em class="pt-color-danger">*</em>取样数量:</td>
|
<td style="width: 30%;">
|
<input class="easyui-textbox" id="sampleNum"
|
name="sampleNum" type="text" style="width:300px"
|
value="" data-options="required:true"/>
|
</td>
|
</tr>
|
<tr>
|
<td class="tbtitle"><em class="pt-color-danger">*</em>项目名称及来源:</td>
|
<td colspan="3">
|
<input class="easyui-textbox" name="projectName"
|
data-options="required:true,multiline:true"
|
style="height:60px;width:850px" value="" />
|
</td>
|
</tr>
|
|
<tr>
|
<td class="tbtitle"><em class="pt-color-danger">*</em>取样方式:</td>
|
<td colspan="3">
|
<input class="easyui-textbox" name="sampleMethod"
|
data-options="required:true,multiline:true"
|
style="height:60px;width:850px" value=""/>
|
</td>
|
</tr>
|
<tr>
|
<td class="tbtitle"><em class="pt-color-danger">*</em>测试项目及样品量需求:</td>
|
<td colspan="3">
|
<input class="easyui-textbox" name="testProject"
|
data-options="required:true,multiline:true"
|
style="height:60px;width:850px" value=""/>
|
</td>
|
</tr>
|
<tr>
|
<td class="tbtitle"><em class="pt-color-danger">*</em>送检机构:</td>
|
<td colspan="3">
|
<input class="easyui-textbox" name="sendInstitution"
|
data-options="required:true,multiline:true"
|
style="height:60px;width:850px" value=""/>
|
</td>
|
</tr>
|
<tr>
|
<td class="tbtitle"><em class="pt-color-danger">*</em>研究目的:</td>
|
<td colspan="3">
|
<input class="easyui-textbox" name="researchPurpose"
|
data-options="required:true,multiline:true"
|
style="height:60px;width:850px" value=""/>
|
</td>
|
</tr>
|
<tr>
|
<td class="tbtitle"><em class="pt-color-danger">*</em>研究内容:</td>
|
<td colspan="3">
|
<input class="easyui-textbox" name="researchContent"
|
data-options="required:true,multiline:true"
|
style="height:60px;width:850px" value=""/>
|
</td>
|
</tr>
|
<tr>
|
<td class="tbtitle"><em class="pt-color-danger">*</em>预期成果:</td>
|
<td colspan="3">
|
<input class="easyui-textbox" name="expectedResult"
|
data-options="required:true,multiline:true"
|
style="height:60px;width:850px" value=""/>
|
</td>
|
</tr>
|
<tr>
|
<td class="tbtitle"><em class="pt-color-danger">*</em>申请单位意见:</td>
|
<td colspan="3">
|
<input class="easyui-textbox" name="applyDeptOpinion"
|
data-options="required:true,multiline:true"
|
style="height:60px;width:850px" value=""/>
|
</td>
|
</tr>
|
</table>
|
</form>
|
</div>
|
</div>
|
<div class="pt-application-row">
|
<div class="pt-subtitle"><i></i><span>实物利用明细</span></div>
|
<div class="pt-spacing">
|
<div>
|
<div id="toolbar" style="height: auto">
|
<div>
|
<a onclick="addRow();" class="pt-btn pt-btn-success">
|
<i class="fa fa-plus"></i> 新增
|
</a>
|
|
<a onclick="$('#tb_physicalDetail').edatagrid('saveRow');" class="pt-btn pt-btn-info">
|
<i class="fa fa-save"></i>
|
确认修改
|
</a>
|
|
<a onclick="$('#tb_physicalDetail').edatagrid('cancelRow');"
|
class="pt-btn pt-btn-warning">
|
<i class="fa fa-scissors"></i>
|
撤销
|
</a>
|
<a onclick="saveData();" class="pt-btn pt-btn-info">
|
<i class="fa fa-save"></i>
|
保存
|
</a>
|
<a onclick="$('#tb_physicalDetail').edatagrid('destroyRow');"
|
class="pt-btn pt-btn-danger">
|
<i class="fa fa-trash-o"></i>
|
删除
|
</a>
|
</div>
|
</div>
|
<div>
|
|
<table id="tb_physicalDetail" singleselect="true" idfield="detailId" style="width: 100%;"
|
toolbar="#toolbar">
|
<thead>
|
<tr>
|
<th field="archivalCode" width="15%" align="center"
|
editor="{type:'validatebox',options:{required:true}}">档号
|
</th>
|
<th field="itemNumber" width="15%" align="center"
|
editor="{type:'validatebox',options:{required:true}}">件号
|
</th>
|
<th field="itemTitle" width="40%" align="center"
|
editor="{type:'validatebox',options:{required:true}}">题名
|
</th>
|
<th field="utilizationType" width="100" align="center"
|
editor="{type:'combobox',options:{valueField:'csmc',textField:'csmc',
|
data:uniqueList,multiple:false,editable:false,panelHeight:'auto'}}">利用类型
|
</th>
|
</tr>
|
</thead>
|
</table>
|
</div>
|
|
</div>
|
</div>
|
</div>
|
<div class="pt-application-btn">
|
<button class="pt-btn pt-btn-purple" onclick="savePhysicalForm()">提交</button>
|
<button class="pt-btn pt-btn-default" onclick="closeWindow()">关闭</button>
|
</div>
|
</div>
|
</div>
|
</body>
|
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
|
<script>
|
|
var selectId = '0';
|
var params = {
|
callBack: null,
|
callBackParams: null
|
};
|
var createUserId = '${curUserId}';
|
var uniqueList = [
|
{
|
"csid": "观察",
|
"csmc": "观察",
|
"selected": "true"
|
},
|
{
|
"csid": "取样",
|
"csmc": "取样"
|
}
|
];
|
|
$(function () {
|
new ResizeScroll({
|
"id": ".ptbody", fun: function () {
|
var wh = $(window).height();
|
return (wh - 36 - 28 - 10);
|
}
|
});
|
|
//人员变换时事件
|
$('#applyUser').textbox({
|
onChange: function (value) {
|
setTimeout(function () {
|
getPhysicalUserInfo(value);
|
}, 500);
|
}
|
});
|
getPhysicalDetailList();
|
// loadCategories();
|
})
|
|
|
//提交
|
function savePhysicalForm() {
|
var physicalDetailList = $('#tb_physicalDetail').datagrid("getRows");
|
if (physicalDetailList.length == 0) {
|
wcp.notify.error('实物利用目录为空,不能提交!');
|
return;
|
}
|
|
var state = {'state': 0};
|
var flowState = {'flowState': 0};
|
|
//验证表单信息
|
var isValid = $('#form1').form('validate');
|
if (!isValid) {
|
wcp.notify.error('表单验证有误,请检查表单输入项!');
|
return false;
|
}
|
|
var formData = $.extend({}, $("#form1").serializeObject(), state, flowState);
|
wcp.ui.setBusy("body", wcp.ajax({
|
url: "physical/savePhysicalForm",
|
data: JSON.stringify(formData),
|
}).done(function (result) {
|
wcp.notify.info('提交成功!');
|
params.parent.refreshData();//刷新父亲
|
closeWindow();
|
}));
|
}
|
|
function closeWindow() {
|
var title = top.$('#tt').tabs('getSelected').panel("options").title;
|
top.$("#tt").tabs("close", title);
|
}
|
|
|
//绑定字段列表 这个命名改一下
|
function getPhysicalDetailList() {
|
var wh = $(window).height();// 移除所有 change 事件监听器
|
$('#tb_physicalDetail').edatagrid({
|
rownumbers: true,
|
pagination: false,
|
fitColumns: true,
|
method: "get",
|
url: "physical/getPhysicalDetailListByPeople",
|
saveUrl: "",
|
updateUrl: "",
|
onDestroy: function (index, row) {
|
$.ajax({
|
type: 'POST',
|
contentType: "application/json; charset=utf-8",
|
url: "physical/deletePhysicalDetailById?detailId=" + row.detailId,
|
success: function (data) {
|
}
|
});
|
},
|
onLoadSuccess: function (data) {
|
for (var i = 0; i < data.rows.length; i++) {
|
var row = data.rows[i];
|
var value = ""
|
|
if (row.survey == 1) {
|
value = "观察";
|
}
|
if (row.sampling == 1) {
|
value = "取样";
|
}
|
$('#tb_physicalDetail').datagrid('beginEdit', i);
|
// 获取编辑器对象
|
var editors = $('#tb_physicalDetail').datagrid('getEditors', i);
|
|
$(editors[4].target[0]).combobox("setValue", value);
|
$(editors[4].target[0]).combobox("setText", value);
|
$('#tb_physicalDetail').datagrid('endEdit', i);
|
}
|
}
|
});
|
}
|
|
function saveData() {
|
var editIndex = $('#tb_physicalDetail').datagrid('getRows').length;
|
for (var i = 0; i < editIndex; i++) {
|
$('#tb_physicalDetail').datagrid("endEdit", i);
|
}
|
var physicalDetailList = $('#tb_physicalDetail').datagrid("getRows");
|
for (i = 0; i < physicalDetailList.length; i++) {
|
if (physicalDetailList[i].hasOwnProperty('isNewRecord')) {
|
var isNewRecord = physicalDetailList[i].isNewRecord;
|
if (isNewRecord) {
|
layer.alert("请先确认字段!");
|
return false;
|
}
|
//删除isNewRecord属性
|
delete physicalDetailList[i].isNewRecord;
|
}
|
|
physicalDetailList[i]["createUserId"] = createUserId;
|
physicalDetailList[i]["formId"] = 0;
|
physicalDetailList[i]["fileTitle"] = "人工添加";
|
physicalDetailList[i]["fileId"] = 0;
|
if (physicalDetailList[i]["utilizationType"] == "观察") {
|
physicalDetailList[i]["survey"] = 1;
|
physicalDetailList[i]["sampling"] = 0;
|
}
|
if (physicalDetailList[i]["utilizationType"] == "取样") {
|
physicalDetailList[i]["survey"] = 0;
|
physicalDetailList[i]["sampling"] = 1;
|
}
|
|
physicalDetailList[i]["agree"] = 1;
|
delete physicalDetailList[i].utilizationType;
|
}
|
$.ajax({
|
type: 'POST',
|
contentType: "application/json; charset=utf-8",
|
url: "physical/savePhysicalDetail",
|
dataType: 'json',
|
data: JSON.stringify(physicalDetailList),
|
success: function (data) {
|
$('#tb_physicalDetail').datagrid("reload");
|
}
|
});
|
|
|
}
|
|
function addRow() {
|
var rows = $("#tb_physicalDetail").datagrid("getRows");
|
|
var index = rows.length;
|
$('#tb_physicalDetail').edatagrid('addRow', {
|
index: index,
|
row: {
|
"archivalCode": "",
|
"itemNumber": "",
|
"itemTitle": "",
|
"utilizationType": "",
|
}
|
});
|
}
|
|
|
//选择利用人
|
function selectPhysicalName() {
|
wcp.picker.selectUser({
|
title: "请选择利用人",
|
multiSelect: false,
|
idElement: "applyUserId",
|
nameElement: "applyUser",
|
deptNameElement: "deptName",
|
deptIdElement: "deptId",
|
layerOpener: window
|
});
|
}
|
|
|
//添加信息
|
function getPhysicalUserInfo() {
|
var deptName = $("#deptName").textbox('getValue');
|
var applyUserId = $("#applyUserId").textbox('getValue');
|
|
if (deptName != null && deptName == "外部用户") {
|
wcp.ui.setBusy("body", wcp.ajax({
|
url: "physical/getPhysicalUserInfo?userId=" + applyUserId,
|
}).done(function (result) {
|
$("#deptName").textbox('setValue', result.deptName);
|
$("#deptAddress").textbox('setValue', result.deptAddress);
|
$("#telNumber").textbox('setValue', result.telNumber);
|
|
}));
|
}
|
}
|
|
|
</script>
|
</html>
|