| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544 |
- <%@ page language="java" contentType="text/html;charset=GBK"
- pageEncoding="GBK"%>
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html;charset=GBK">
- <title>创建表单</title>
- <link href="${ pageContext.request.contextPath}/main.css" rel="stylesheet" type="text/css" />
- <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
- <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
- <script type="text/javascript" src="/shares/js/constant.js"></script>
- <script type="text/javascript" src="/shares/js/common.js"></script>
- <script type="text/javascript" src="/shares/js/yw/bpm/oa.js"></script>
- <script type="text/javascript" src="/shares/js/yw/bpm/promptDefine.js"></script>
- <script type="text/javascript" src="/shares/js/yw/bpm/form/form.js"></script>
- <script type="text/javascript">
- var win1 = null;
- var win_old = null;
- var comboBox = null;
- var grid = null;
- $(document).ready(function(){
- var hasGen = "${requestScope.formInfo.hasGen.value}";
- if(hasGen != ""){
- $("#hasGen").val(hasGen);
- }
-
- //$("#hasGen").ligerComboBox();
-
- comboBox=$("#version").ligerComboBox({
- width: 150,
- onBeforeOpen: f_selectContact,
- // slide: false,
- // selectBoxWidth: 600,
- //selectBoxHeight: 10
- // grid: getGridOptions(false)
- });
- var formVid = "${requestScope.formInfo.formVid }";
- grid = $("#maingrid4").ligerGrid({
- columns: [
- { display: '版本', name: 'version', width: 50 },
- { display: '备注', name: 'remark', width: 100 },
- { display: '创建人', name: 'creator.username', width: 100,
- render: function (row){
- var html = row.creator.username;
- return html;
- }},
- { display: '创建时间', name: 'createdate', width: 150 },
- { display: '在办流程数量', name: 'flowCount', width: 100 },
- {
- display: '操作', isAllowHide: false,width: 150,
- render: function (row)
- {
- var html = '';
- if(row.state.value == "0" || row.state.value == "1"){
- html = '<font color="red">当前默认版本</font>';
- } else if (row.state.value == "2") {
- html += '<a href=\"#\" onclick=\"openOldVerWin('+row.formId+');\">查看</a> ';
- html += '<a href=\"#\" onclick=\"changeVersion('+row.formId+');\">切换</a> ';
- html += '<a href=\"#\" onclick=\"if(confirm(\'确定删除该表单?\')){beforedeleteForm('+row.flowCount+','+row.formId+');}\">删除</a> ';
- }
- return html;
- }
- }
- ],
- pageSize:20,
- url: 'FormAction.do?task=listVersion&formVid='+formVid+'&time=' + new Date().getTime(),
- parms: [{name: "formName", value: ""}],
- pageParmName: 'p', //页索引参数名,(提交给服务器)
- pagesizeParmName: 'pSize', //页记录数参数名,(提交给服务器)
- width: '99.9%',
- height: 200,
- enabledSort: true,
- // usePager:false,
- onError: function(){alert("数据加载失败,请刷新页面!");}
- });
- });
- function setFrame() {
- var iformIns = document.getElementById("formIns");
- iformIns.height = "100px";
- iformIns.height = formIns.document.body.scrollHeight;
- }
- function openWin(){
- var formId = $("#formId").val();
- var formVid = $("#formVid").val();
- win1 = $.ligerDialog.open({ width : 500, height: 250,url: '/ynet/FormAction.do?task=toUpload&formId='+formId+'&formVid='+formVid});
- }
- function closeWin(formId){
- win1.close();
- var oldTabid = "${param.tabid }";
- if (oldTabid.length > 0) {
- window.parent.f_reloadTab(oldTabid);
- //window.parent.f_addTab(new Date().getTime(), '编辑表单', '${pageContext.request.contextPath }/FormAction.do?task=toCreate&formId=' + formId + '&tabid='+oldTabid);
- var tabid = getCurrentTabId();
- window.parent.f_addTab('create'+new Date().getTime(), '编辑表单', '${pageContext.request.contextPath }/FormAction.do?task=toCreate&formId=' + formId + '&tabid='+oldTabid);
- window.parent.f_closeTab(tabid);
- }
- }
- function openOldVerWin(formId){
- //var formId = $("#oldFormId").val();
- var dialogId = formId + new Date().getTime();
- //win_old = $.ligerDialog.open({ width : 900, height: 400,url: '/ynet/FormAction.do?task=toSeeOld&formId='+formId });
- //+'&tabid='+getCurrentTabId()+'&dialogId=' + dialogId });
- openODialog('/ynet/FormAction.do?task=toSeeOld&formId='+formId+'&tabid='+getCurrentTabId()+'&dialogId=' + dialogId, '查看版本', dialogId);
- }
- function refreshWindow(formId,dialogId){
- if(dialogId != ''){
- closeODialog(dialogId);
- }
- if(formId != ''){
- var oldTabid = "${param.tabid }";
- if (oldTabid.length > 0) {
- window.parent.f_reloadTab(oldTabid);
- }
- var tabid = getCurrentTabId();
- window.parent.f_addTab("create"+new Date().getTime(), '编辑表单', '${pageContext.request.contextPath }/FormAction.do?task=toCreate&formId=' + formId + '&tabid='+oldTabid);
- window.parent.f_closeTab(tabid);
- }
- }
- <%--
- function getGridOptions(checkbox)
- {
- var formVid = "${requestScope.formInfo.formVid }";
- var options = {
- columns: [
- { display: '表单版本', name: 'version', width: 150 },
- { display: '备注', name: 'remark', width: 150 },
- { display: '状态', name: 'state.dataName', width: 120,
- render: function (row){
- var html = row.state.dataName;
- return html;
- }},
- { display: '创建人', name: 'creator.username', width: 120,
- render: function (row){
- var html = row.creator.username;
- return html;
- }},
- { display: '创建时间', name: 'createdate', width: 200 },
- {
- display: '操作', isAllowHide: false,width: 200,
- render: function (row)
- {
- var html = '';
- if(row.state.value == "0" || row.state.value == "1"){
- html = '<font color="red">当前默认版本,不允许操作</font>';
- } else if (row.state.value == "2") {
- html = '<a href=\"#\" onclick=\"\">查看</a> ';
- html += '<a href=\"#\" onclick=\"if(confirm(\'确定删除该表单?\')){deleteForm('+row.formId+');}\">删除</a>';
- }
- return html;
- }
- }
- ], switchPageSizeApplyComboBox: false,
- pageSize:10,
- url: 'FormAction.do?task=listVersion&formVid='+formVid+'&time=' + new Date().getTime(),
- pageParmName: 'p', //页索引参数名,(提交给服务器)
- pagesizeParmName: 'pSize', //页记录数参数名,(提交给服务器)
- width: '99.9%',
- height: '99%',
- checkbox: checkbox,
- onError: function(){alert("数据加载失败,请刷新页面!");}
- };
- return options;
- }
- --%>
- function f_selectContact()
- {
- $.ligerDialog.open({ title: '版本信息', width: 700, height: 200, target: $("#maingrid4"), buttons: [
- { text: '关闭', onclick: f_selectContactCancel }
- ]
- });
- return false;
- }
- function f_selectContactCancel(item, dialog)
- {
- dialog.hide();
- }
- function changeVersion(formId) {
- if(confirm('确定将表单版本切换为该版本?')){
- $.ajax({
- url : 'FormAction.do',
- async : true,
- type : "post",
- data : {"task": "changeVersion", "formId": formId},
- success : function(data) {
- if (data == "10010") {
- addError("切换失败!");
- } else if (data == "10011") {
- addInfo("切换成功!");
- refreshWindow(formId,'${param.dialogId }');
- //window.parent.frames['${param.tabid }'].closeODialog('${param.dialogId }');
- } else if (data == "10017") {
- addInfo("版本切换成功!部分动作无法关联,请检查后重新配置相关动作!");
- refreshWindow(formId,'${param.dialogId }');
- //window.parent.frames['${param.tabid }'].refreshWindow(formId,'${param.dialogId }');
- } else {
- addError(data);
- }
- },
- error : function() {
- alert("数据处理失败,请检查网络重新登录或联系管理员!");
- }
- });
- }
- }
- function beforedeleteForm(flowcount,formId){
- /*
- $.ajax({
- url : 'FormAction.do',
- async : true,
- type : "post",
- data : {"task": "getCountOfDealingFlowByFormId", "formId": formId},
- success : function(data) {
- if (data > 0) {
- addError("该表单还有未办结流程与其关联,不可删除!");
- } else {
- deleteForm(formId);
- }
- },
- error : function() {
- alert("数据处理失败,请检查网络重新登录或联系管理员!");
- }
- });
- */
- if (flowcount > 0) {
- addError("该表单还有未办结流程与其关联,不可删除!");
- } else {
- deleteForm(formId);
- }
- }
- </script>
- <style type="text/css">
- .l-dialog-content{
- overflow:hidden;
- }
- </style>
- </head>
- <body>
- <form action="FormAction.do" method="post" id="cform" name="cform">
- <div id="title" class="form-button" style="width: 100%;">
- <input type="button" onclick="save();" class="l-button" value="保存" />
- <c:if test="${requestScope.formInfo.state.value != '3' }">
- <input onclick="openWin();" type="button" value="创建新版本" class="l-button">
- </c:if>
- <input onclick="closeTabUseInOA();" type="button" value="关闭" class="l-button">
- </div>
- <div class="container-layout">
- <div class="forum-container">
-
- <center>
- <table class="l-table-edit line" style="width: 100%;">
- <tr>
- <th colspan="2">创建表单</th>
- </tr>
- <tr>
- <td class="l-table-edit-text">表单名称<FONT COLOR="red">*</FONT>:</td>
- <td class="l-table-edit-td">
- <input type="text" class="width_150" id="formName" name="formName" value="${requestScope.formInfo.formName }">
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">表单备注:</td>
- <td class="l-table-edit-td">
- <textarea id="remark" name="remark" rows="5" cols="50">${requestScope.formInfo.remark }</textarea>
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">是否启用印章<FONT COLOR="red">*</FONT>:</td>
- <td class="l-table-edit-td">
- <select name="hasGen" class="width_150" id="hasGen" >
- <c:forEach items="${requestScope.hasGens }" var="state">
- <option value="${state.value }" >${state.dataName }</option>
- </c:forEach>
- </select>
- </td>
- </tr>
- <%--
- <tr>
- <td class="l-table-edit-text">现在使用版本:</td>
- <td class="l-table-edit-td">${requestScope.formInfo.version }
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">历史版本:</td>
- <td class="l-table-edit-td">
- <c:choose>
- <c:when test="${requestScope.size != '' }">
- <select name="oldFormId" class="width_150" id="oldFormId" >
- <c:forEach items="${requestScope.oldFormInfos }" var="oldFormInfo">
- <option value="${oldFormInfo.formId }" >${oldFormInfo.version }</option>
- </c:forEach>
- </select> <input type="button" onclick="openOldVerWin();" class="l-button" value="查看该版本" />
- </c:when>
- <c:otherwise>
- 没有其它历史版本
- </c:otherwise>
- </c:choose>
-
- </td>
- </tr>
- --%>
- <tr>
- <td class="l-table-edit-text">版本信息:</td>
- <td class="l-table-edit-td">
- <input type="text" class="width_150" id="version" name="version" value="${requestScope.formInfo.version }" readonly="readonly">
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">表单保存方式<FONT COLOR="red">*</FONT>:</td>
- <td class="l-table-edit-td">
- <c:choose>
- <c:when test="${requestScope.formInfo.saveType.value == null }">
- <select name="saveType" class="width_150" id="saveType" >
- <c:forEach items="${requestScope.saveTypes }" var="state">
- <option value="${state.value }" >${state.dataName }</option>
- </c:forEach>
- </select>
- </c:when>
- <c:otherwise>
- ${requestScope.formInfo.saveType.dataName}
- <input type="hidden" id="saveType" name="saveType" value="${requestScope.formInfo.saveType.value }">
- </c:otherwise>
- </c:choose>
- </td>
- </tr>
- </table>
- <input type="hidden" id="formId" name="formId" value="${requestScope.formInfo.formId }">
- <input type="hidden" id="formVid" name="formVid" value="${requestScope.formInfo.formVid }">
- <input type="hidden" id="isCreate" name="isCreate" value="${requestScope.formInfo.isCreate.value }">
- <%-- <input type="hidden" id="version" name="version" value="${requestScope.formInfo.version }"> --%>
- <input type="hidden" id="fileId" name="fileId" value="${requestScope.formInfo.fileId.universalid }">
- <input type="hidden" id="task" name="task" value="edit">
- <input type="hidden" id="dept" name="dept" value="${session.unit.id }">
- <input type="hidden" id="tabid" name="tabid" value="${param.tabid }">
- <c:choose>
- <c:when test="${requestScope.formInfo.state.value != '3' }">
- <input type="hidden" id="state" name="state" value="${requestScope.formInfo.state.value }">
- </c:when>
- <c:otherwise>
- <input type="hidden" id="state" name="state" value="1">
- </c:otherwise>
- </c:choose>
-
- </center>
- </div>
- <div class="forum-container">
- <center>
- <table style="width: 100%;">
- <tbody>
- <tr>
- <th style="width: 15%; text-align: center;">字段名称</th>
- <th style="width: 15%; text-align: center;">字段标题</th>
- <th style="width: 20%; text-align: center;">展示内容</th>
- <th style="width: 15%; text-align: center;">字段类型</th>
- <!-- <th style="width: 20%; text-align: center;">默认值</th> -->
- <!-- <th style="width: 5%; text-align: center;">非空验证</th> -->
- <th style="width: 10%; text-align: center;">长度验证</th>
- </tr>
- </tbody>
- <tbody>
- <c:forEach items="${requestScope.formElementList }" var="formElement">
- <input name="elementId" value="${formElement.elementId }" type="hidden">
- <input name="tableField${formElement.elementId }" id="tableField${formElement.elementId }"
- value="${formElement.tableField }" type="hidden">
- <input name="elementCode${formElement.elementId }" id="elementCode${formElement.elementId }"
- value="${formElement.elementCode }" type="hidden">
- <tr style="height: ">
- <td style="text-align: center;">${formElement.elementCode }</td>
- <td style="text-align: center;">
- <input name="elementName${formElement.elementId }" id="elementName${formElement.elementId }"
- value="${formElement.elementName }" type="text">
- </td>
- <td style="text-align: center;">
- <select id="type${formElement.elementId }" name="type${formElement.elementId }">
- <c:forEach items="${requestScope.types }" var="type">
- <option value="${type.value }">${type.dataName }</option>
- </c:forEach>
- </select>
- <span id="xlkSpan${formElement.elementId }">
- <select name="xlk${formElement.elementId }" id="xlk${formElement.elementId }">
- <option value="">请选择</option>
- <c:forEach items="${requestScope.xlks }" var="xlk">
- <option value="${xlk.enumId }">${xlk.enumName }</option>
- </c:forEach>
- </select>
- </span>
- <span id="skjSpan${formElement.elementId }">
- <select name="skj${formElement.elementId }" id="skj${formElement.elementId }">
- <option value="">请选择</option>
- <c:forEach items="${requestScope.skjs }" var="skj">
- <option value="${skj.value }">${skj.dataName }</option>
- </c:forEach>
- </select>
- </span>
- <span id="pluginSpan${formElement.elementId }">
- <select name="plugin${formElement.elementId }" id="plugin${formElement.elementId }">
- <option value="">请选择</option>
- <c:forEach items="${requestScope.pluginInfos }" var="plugin">
- <option value="${plugin.pluginId }">${plugin.pluginName }</option>
- </c:forEach>
- </select>
- </span>
- <span id="dxkSpan${formElement.elementId }">
- <select name="dxk${formElement.elementId }" id="dxk${formElement.elementId }">
- <option value="">请选择</option>
- <c:forEach items="${requestScope.dxks }" var="dxk">
- <option value="${dxk.enumId }">${dxk.enumName }</option>
- </c:forEach>
- </select>
- </span>
- <span id="fxkSpan${formElement.elementId }">
- <select name="fxk${formElement.elementId }" id="fxk${formElement.elementId }">
- <option value="">请选择</option>
- <c:forEach items="${requestScope.fxks }" var="fxk">
- <option value="${fxk.enumId }">${fxk.enumName }</option>
- </c:forEach>
- </select>
- </span>
- <%-- <span id="cxlkSpan${formElement.elementId }"> --%>
- <%-- <select name="cxlk${formElement.elementId }" id="cxlk${formElement.elementId }"> --%>
- <!-- <option value="">请选择</option> -->
- <%-- <c:forEach items="${requestScope.cxlks }" var="cxlk"> --%>
- <%-- <option value="${cxlk.pluginId }">${cxlk.pluginName }</option> --%>
- <%-- </c:forEach> --%>
- <!-- </select> -->
- <!-- </span> -->
- <script type="text/javascript">
-
- $("#type${formElement.elementId }").val("${formElement.type.value }");
- if("${formElement.type.value }" != 2){
- $("#xlkSpan${formElement.elementId }").hide();
- } else {
- $("#xlk${formElement.elementId }").val("${formElement.typeDetail }");
- }
- if("${formElement.type.value }" != 7){
- $("#skjSpan${formElement.elementId }").hide();
- } else {
- $("#skj${formElement.elementId }").val("${formElement.typeDetail }");
- }
- if("${formElement.type.value }" != 11){
- $("#pluginSpan${formElement.elementId }").hide();
- } else {
- $("#plugin${formElement.elementId }").val("${formElement.typeDetail }");
- }
- if("${formElement.type.value }" != 4){
- $("#dxkSpan${formElement.elementId }").hide();
- } else {
- $("#dxk${formElement.elementId }").val("${formElement.typeDetail }");
- }
- if("${formElement.type.value }" != 5){
- $("#fxkSpan${formElement.elementId }").hide();
- } else {
- $("#fxk${formElement.elementId }").val("${formElement.typeDetail }");
- }
- // if("${formElement.type.value }" != 16){
- // $("#cxlkSpan${formElement.elementId }").hide();
- // } else {
- // $("#cxlk${formElement.elementId }").val("${formElement.typeDetail }");
- // }
- $("#type${formElement.elementId }").change(function(){
- var value = $(this).val();
- if(value == 2){
- $("#xlkSpan${formElement.elementId }").show();
- } else {
- $("#xlkSpan${formElement.elementId }").hide();
- }
- if(value == 7){
- $("#skjSpan${formElement.elementId }").show();
- } else {
- $("#skjSpan${formElement.elementId }").hide();
- }
- if(value == 11){
- $("#pluginSpan${formElement.elementId }").show();
- } else {
- $("#pluginSpan${formElement.elementId }").hide();
- }
- if(value == 4){
- $("#dxkSpan${formElement.elementId }").show();
- } else {
- $("#dxkSpan${formElement.elementId }").hide();
- }
- if(value == 5){
- $("#fxkSpan${formElement.elementId }").show();
- } else {
- $("#fxkSpan${formElement.elementId }").hide();
- }
- // if(value == 16){
- // $("#cxlkSpan${formElement.elementId }").show();
- // } else {
- // $("#cxlkSpan${formElement.elementId }").hide();
- // }
- });
-
- </script>
- </td>
- <td style="text-align: center;">
- <select id="fieldType${formElement.elementId }" name="fieldType${formElement.elementId }">
- <c:forEach items="${requestScope.fieldTypes }" var="fieldType">
- <option value="${fieldType.value }">${fieldType.dataName }</option>
- </c:forEach>
- </select>
- <script type="text/javascript">
- $("#fieldType${formElement.elementId }").val("${formElement.fieldType.value }");
- </script>
- </td>
- <td style="text-align: center;" >
- <input style="width: 30px;" type="text" name="long${formElement.elementId }" id="long${formElement.elementId }" value="${formElement.length }">
- </td>
- <input type="hidden" name="elementId${formElement.elementId }"
- id="elementId${formElement.elementId }" value="${formElement.elementId }">
- </tr>
- </c:forEach>
- </tbody>
- </table>
- </center>
- </div>
-
- <div class="forum-container">
-
- <center>
- <table class="l-table-edit line" style="width: 100%;">
- <tr>
- <th>表单预览</th>
- </tr>
- </table>
- </center>
- <iframe width="100%" onload="setFrame();" id="formIns" name="formIns" frameborder="0" scrolling="no" style="width:100%;"
- src="bpmFormInstanceAction.do?task=previewIns&formId=${requestScope.formInfo.formId}&version=${requestScope.formInfo.version}" >
- </iframe>
- </div>
- <div id="maingrid4" style="display:none;">
-
- </div>
- </div>
- </form>
- <%@ include file="/include/message.jsp"%>
- </body>
- </html>
|