<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!--
- Author(s): tianxuanling
- Date: 2017-07-19 10:19:36
- Description:
-->
<head>
<title>审批流程</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link id="css_skin" rel="stylesheet" type="text/css" href="/default/coframe/tools/skins/skin1/css/style.css"/>
<link id="css_icon" rel="stylesheet" type="text/css" href="/default/coframe/tools/icons/icon.css"/>
<script src="/default/common/nui/jquery/jquery-1.6.2.min.js" type="text/javascript"></script>
<script type="text/javascript" src="/default/common/nui/nui.js"></script>
<style>
.mini-panel.max
{
position:fixed !important;
width:100% !important;
height:100% !important;
left:0 !important;
top:0 !important;
z-index:10000;
}
#p1 .mini-panel-body{
overflow:hidden;
}
.mini-textbox{
height:30px;
}
.mini-textbox .mini-textbox-border{
height:90%;
}
.mini-textbox input{
height:25px;
line-height: 25px;
}
</style>
</head>
<body>
<div id="form1" style="width: 100%;height: 100%">
<table style="width:100%;table-layout:fixed;">
<tr>
<td style="width:100%;" align="center">
<h1>VPN申请</h1>
</td>
</tr>
<tr style="width:40%;" colspan="3">
<td style="width:60%;" colspan="3">
<div id="p5" class="nui-panel" title="业务数据" style="width:100%;height:250px;"
buttons="max" onbuttonclick="onbuttonclick">
<iframe id="formIframe" name="child" src="" scrolling="no" frameborder="0" style="overflow: auto; margin: auto;width: 100%; height: 100%">
</iframe>
</div>
</td>
</tr>
<tr>
<td style="width:100%;" colspan="3">
<div id="p4" class="nui-panel" title="审批历史" style="width:100%;"
buttons="max" onbuttonclick="onbuttonclick">
<div id="searchForm1" style="width: 100%;height: 100%">
<input class="nui-hidden" id="processInstId" name="criteria/_expr[2]/processinstanceid" value=""/>
<input class="nui-hidden" name="criteria/_entity" value="com.qhnu.oneplatform.apply.uyil.util.WfApprovedetail">
<!-- 排序字段 -->
<input class="nui-hidden" name="criteria/_orderby[1]/_property" value="createtime">
<input class="nui-hidden" name="criteria/_orderby[1]/_sort" value="asc">
<table style="width: 100%;">
<tr>
<td align="right" style="white-space:nowrap;">
</td>
</tr>
</table>
<div id="datagrid1" class="nui-listbox" style="width: 100%; height: 200px;" ajaxData="getAjaxData"
dataField="wfapprovedetails">
<div property="columns">
<!-- <div type="checkcolumn" ></div> -->
<!-- <div header="行号" field="index" type="indexcolumn" width="40" headerAlign="center" align="center"></div> -->
<div header="执行环节" field="filed1" width="15%" headerAlign="center" align="center"></div>
<div header="审批人" field="name" width="10%" headerAlign="center" align="center"></div>
<div header="审批结果" field="result" width="10%" headerAlign="center" align="center" renderer="isTonGuo"></div>
<div header="审批意见" field="content" width="50%" headerAlign="center" align="center"></div>
<div header="审批时间" field="createtime" width="15%" headerAlign="center" dateFormat="yyyy-MM-dd HH:mm:ss"></div>
</div>
</div>
</div>
</div>
</td>
</tr>
<tr>
<td style="width:100%;" colspan="3">
<div id="form3" class="nui-form" align="center" style="width:100%;height:100%">
<!-- 数据实体的名称 -->
<input class="nui-hidden" name="criteria/_entity" value="com.qhnu.oneplatform.apply.util.accessory.EosAccessories">
<!-- 排序字段 -->
<input class="nui-hidden" name="criteria/_orderby[1]/_property" value="createTime">
<input class="nui-hidden" name="criteria/_orderby[1]/_sort" value="asc">
<input class="nui-hidden" name="criteria/_expr[1]/processinstId" id="processInstId2"/>
<input class="nui-hidden" name="criteria/_expr[1]/_op" value="=">
</div>
<div id="p5" class="nui-panel" title="附件" style="width:100%;height:221px;"
buttons="max" onbuttonclick="onbuttonclick">
<div id="listbox2" dataField="eosaccessoriess" class="nui-listbox" style="width:100%;height:100%;"
ajaxData="getAjaxData2" itemdblclick="download" itemclick="download()">
<div property="columns">
<div header="文件名" field="originalName" width="70%" headerAlign="left" align="left"></div>
<div header="操作" width="30%" renderer="returnDown" headerAlign="left" align="left"><a href="return download()">下载</a></div>
</div>
</div>
</div>
</td>
</tr>
<tr>
<td style="width:40%;" colspan="3">
<div id="p1" class="nui-panel" title="审批意见" style="width:100%;height:120px;"
buttons="max" onbuttonclick="onbuttonclick">
<div style="width:100%;">
<input type="radio" name="b" value="1" onclick="isAgreeFun(1)" checked="checked">同意
<input type="radio" name="b" value="0" onclick="isAgreeFun(0)">不同意
<input id="content" name="content" class="nui-textarea" value="同意" required="false" style="width:100%;height: 60px;"/>
</div>
</div>
</td>
</tr>
</table>
<table style="width: 100%;">
<tr>
<td align="center">
<a class="nui-button" iconCls="icon-ok" onclick="submit" id="submit">提交</a>
</td>
</tr>
</table>
</div>
<script type="text/javascript">
nui.parse();
$("#formIframe").attr("src","/default/vpn/QhnuApplyVpnForm_approve.jsp");
var form1 = new nui.Form("#form1");
var searchForm = new nui.Form("#searchForm1");
var grid = nui.get("datagrid1");
var grid2 = nui.get("listbox2");
var workItemID;
var activityInstId;
var processInstId;
var activityInstName;
var isAgree=1;
var opertionId;
var notice = {};
var isIframeLoad = false;
//查询审批意见
//search();
/* function search(){
grid.load(".biz.ext");
} */
$('#formIframe').load(function(){
isIframeLoad = true;
debugger;
$("#formIframe").contents().find(".cancel").css("display","none");
child.window.setFormData(notice);
});
function getAjaxData(){
var form = new nui.Form("#searchForm1");
return form.getData(false, false);
}
function search(){
grid.load("com.qhnu.oneplatform.apply.util.wfapprovedetailbiz.queryWfApprovedetails.biz.ext");
grid2.load("com.qhnu.oneplatform.apply.util.eosaccessoriesbiz.queryEosAccessoriess.biz.ext");
}
function initData(row,b,c){
workItemID = row.workItemID;
activityInstId = row.activityInstID;
processInstId = row.processInstID;
activityInstName = row.activityInstName;
processDefID = row.processDefID;
activityDefID = row.activityDefID;
nui.get("processInstId").setValue(processInstId);
nui.get("processInstId2").setValue(processInstId);
getOperationId();
search();
}
//同意不同意赋值
function isAgreeFun(e){
isAgree = e;
nui.get("content").setValue(isAgree==1?"同意":"不同意");
}
function getOperationId(){
var json = nui.encode({processInstId:processInstId});
$.ajax({
url:"com.qhnu.oneplatform.apply.vpn.qhnuapplyvpnbiz.queryQhnuApplyVpn.biz.ext",
type:'POST',
data:json,
async:false,
cache:false,
contentType:'text/json',
success:function(text){
debugger;
opertionId = text.data.id;
notice.record={};
notice.record.applyVpn = text.data;
notice.record.pageApprove = "apprvoe";
notice.pageType = "edit";
//如果子页面已经加载向子页面传递数据
if(isIframeLoad){
var childWindow = document.getElementById('formIframe').contentWindow;
childWindow.setFormData(notice);
}
}
});
}
function submit(){
var json = nui.encode({isAgree:isAgree,
workItemID:workItemID,
wfapproveDtile:{
operationid:opertionId,
content:nui.get("content").getValue(),
workitemid:workItemID,
processinstanceid:processInstId,
activityid:activityInstId,
filed1:activityInstName
}});
$.ajax({
url:"com.qhnu.oneplatform.apply.vpn.processBiz.finishWorkitem_vpn.biz.ext",
type:'POST',
data:json,
cache:false,
contentType:'text/json',
success:function(text){
var returnJson = nui.decode(text);
if(returnJson.exception == null){
CloseWindow("ok");
}else{
nui.alert("保存失败", "系统提示", function(action){
if(action == "ok" || action == "close"){
//CloseWindow("saveFailed");
}
});
}
}
});
}
function download() {
var listbox2 = nui.get("listbox2");
var rows = listbox2.getSelecteds();;
var contextPath = "/default";
for(var i = 0; i < rows.length; ++i) {
var relativePath = "/" + rows[i].path + "/" + rows[i].name;
var relativePath = rows[i].path;
relativePath = relativePath.replace(/\\/g, "/");
var downloadPath = contextPath + relativePath;
window.open(downloadPath);
}
}
function returnDown(e){
return "<a href='javascript:download()'>查看</a>";
}
function getAjaxData2(){
var form3 = new nui.Form("#form3");
return form3.getData(false, false);
}
function isTonGuo(e){
if(e.item.result==0){
return "不通过";
}else{
return "通过";
}
}
//放大缩小
function maxPanel(id) {
var panel = nui.get(id);
panel.maxed = true;
$(panel.el).addClass("max");
$(panel.el).find(".mini-tools-max").addClass("mini-tools-restore");
nui.layout();
}
function restorePanel(id) {
var panel = nui.get(id);
panel.maxed = false;
$(panel.el).find(".mini-tools-max").removeClass("mini-tools-restore");
$(panel.el).removeClass("max");
nui.layout();
}
function onbuttonclick(e) {
var panel = this;
if (e.name == "max") {
if (panel.maxed) {
restorePanel(panel);
} else {
maxPanel(panel);
}
}
}
//关闭窗口
function CloseWindow(action) {
if (action == "close" && form.isChanged()) {
if (confirm("数据被修改了,是否先保存?")) {
saveData();
}
}
if (window.CloseOwnerWindow)
return window.CloseOwnerWindow(action);
else window.close();
}
</script>
</body>
</html>