oaNotifyAudit.jsp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. <%@ page contentType="text/html;charset=UTF-8" %>
  2. <%@ include file="/webpage/include/taglib.jsp"%>
  3. <html>
  4. <head>
  5. <title>通知管理</title>
  6. <meta name="decorator" content="default"/>
  7. <style type="text/css">
  8. img {width: 50px; height: 50px;}
  9. </style>
  10. <%--<script type="text/javascript" src="${ctxStatic}/ckeditor/ckeditor.js"></script>--%>
  11. <script type="text/javascript" language="JavaScript" for="window" event="onload">
  12. var validateForm;
  13. function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
  14. if(validateForm.form()){
  15. if(obj == 1){
  16. $('#flag').val('yes');
  17. }else{
  18. $('#flag').val('no');
  19. }
  20. $("#inputForm").submit();
  21. return true;
  22. }
  23. return false;
  24. }
  25. $(document).ready(function() {
  26. //$("#name").focus();
  27. validateForm = $("#inputForm").validate({
  28. submitHandler: function(form){
  29. loading('正在提交,请稍等...');
  30. form.submit();
  31. },
  32. errorContainer: "#messageBox",
  33. errorPlacement: function(error, element) {
  34. $("#messageBox").text("输入有误,请先更正。");
  35. if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
  36. error.appendTo(element.parent().parent());
  37. } else {
  38. error.insertAfter(element);
  39. }
  40. }
  41. });
  42. //只做查看时,禁用掉以下标签
  43. <%--$('input,textarea,select').attr('disabled',<%=request.getAttribute("disabled")%>);--%>
  44. });
  45. </script>
  46. <script type="text/javascript">
  47. function insertTitle(tValue){
  48. var list = "${oaNotify.workAttachments}";
  49. var size = (list.split('url')).length-1;
  50. var files = $("#attachment_file")[0].files;
  51. for(var i = 0;i<files.length;i++) {
  52. var file = files[i];
  53. var attachmentId = "";
  54. var attachmentFlag = "107";
  55. console.log(file);
  56. var timestamp = new Date().getTime();
  57. var storeAs = "attachment-file/oaNotify/" + timestamp + "/" + file['name'];
  58. var uploadPath = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/" + storeAs;
  59. /*将这段字符串存到数据库即可*/
  60. var divId = "_attachment";
  61. $("#addFile" + divId).show();
  62. multipartUploadWithSts(storeAs, file, attachmentId, attachmentFlag, uploadPath, divId, size);
  63. }
  64. }
  65. function changeUser(ids,names,parents) {
  66. var split = ids.split(',');
  67. var split2 = names.split(',');
  68. $("#userTableList").html("");
  69. userIdx=0;
  70. for(var i=0;i<split.length;i++){
  71. var id = split[i];
  72. if(id==''||id==null){
  73. continue;
  74. }
  75. var obj = {'id':id,'name':split2[i],'officeName':parents[i]};
  76. addRow('#userTableList',userIdx,userTpl,obj);
  77. userIdx+=1;
  78. }
  79. }
  80. function changeOffice(ids,names,parentIds) {
  81. $("#officeTableList").html("");
  82. officeIdx=0;
  83. for(var i=0;i<ids.length;i++){
  84. var obj = {'id':ids[i],'name':parentIds[i]};
  85. addRow('#officeTableList',officeIdx,officeTpl,obj);
  86. officeIdx+=1;
  87. }
  88. }
  89. function getSelectOfficeIds() {
  90. var selectedIds = "";
  91. var pidArr = $("#officeTableList tr .officeId");
  92. for(var i=0;i<pidArr.length;i++){
  93. selectedIds+=$(pidArr[i]).val();
  94. selectedIds+=",";
  95. }
  96. return selectedIds;
  97. }
  98. function getSelectUserIds() {
  99. var selectedIds = "";
  100. var pidArr = $("#userTableList tr .userId");
  101. for(var i=0;i<pidArr.length;i++){
  102. selectedIds+=$(pidArr[i]).val();
  103. selectedIds+=",";
  104. }
  105. return selectedIds;
  106. }
  107. </script>
  108. </head>
  109. <body >
  110. <div class="single-form">
  111. <div class="container view-form">
  112. <form:form id="inputForm" modelAttribute="oaNotify" enctype="multipart/form-data" action="${ctx}/oa/oaNotify/saveAudit" method="post" class="form-horizontal">
  113. <form:hidden path="id"/>
  114. <form:hidden path="home"/>
  115. <form:hidden path="act.taskId"/>
  116. <form:hidden path="act.taskName"/>
  117. <form:hidden path="act.taskDefKey"/>
  118. <form:hidden path="act.procInsId"/>
  119. <form:hidden path="act.procDefId"/>
  120. <form:hidden id="flag" path="act.flag"/>
  121. <div class="form-group layui-row first">
  122. <div class="form-group-label"><h2>公告信息</h2></div>
  123. <div class="layui-item layui-col-sm6">
  124. <label class="layui-form-label">公告标题:</label>
  125. <div class="layui-input-block">
  126. <input htmlEscape="false" readonly="true" maxlength="30" class="form-control required layui-input"
  127. value="${oaNotify.title}"/>
  128. </div>
  129. </div>
  130. <div class="layui-item layui-col-sm6">
  131. <label class="layui-form-label">公告编号:</label>
  132. <div class="layui-input-block">
  133. <div class="input-group">
  134. <form:input path="number" htmlEscape="false" readonly="true" maxlength="30" class="form-control layui-input"/>
  135. <span class="input-group-btn">
  136. <label class="form-status"><c:choose><c:when test="${not empty oaNotify.status}">${fns:getDictLabel(oaNotify.status, 'audit_state', '')}</c:when><c:otherwise>新添</c:otherwise></c:choose></label>
  137. </span>
  138. </div>
  139. </div>
  140. </div>
  141. <div class="layui-item layui-col-sm6">
  142. <label class="layui-form-label">公告类型:</label>
  143. <div class="layui-input-block">
  144. <input htmlEscape="false" readonly="true" maxlength="30" class="form-control required layui-input"
  145. value="${fns:getMainDictLabel(oaNotify.type, 'oa_notify_type', '')}"/>
  146. </div>
  147. </div>
  148. <div class="layui-item layui-col-sm6">
  149. <label class="layui-form-label">创建日期:</label>
  150. <div class="layui-input-block">
  151. <input id="createDate" name="createDate" htmlEscape="false" readonly="true"
  152. class="laydate-icondate form-control layer-date layui-input laydate-icon"
  153. value="<fmt:formatDate value="${oaNotify.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
  154. </div>
  155. </div>
  156. <div class="layui-item layui-col-sm6">
  157. <label class="layui-form-label">开始日期:</label>
  158. <div class="layui-input-block">
  159. <input id="startDate" name="startDate" htmlEscape="false" readonly="true"
  160. class="laydate-icondate form-control layer-date layui-input laydate-icon required"
  161. value="<fmt:formatDate value="${oaNotify.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
  162. </div>
  163. </div>
  164. <div class="layui-item layui-col-sm6">
  165. <label class="layui-form-label">结束日期:</label>
  166. <div class="layui-input-block">
  167. <input id="endDate" name="endDate" htmlEscape="false" readonly="true"
  168. class="laydate-icondate form-control layer-date layui-input laydate-icon required"
  169. value="<fmt:formatDate value="${oaNotify.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
  170. </div>
  171. </div>
  172. <div class="layui-item layui-col-sm6">
  173. <label class="layui-form-label">创建人:</label>
  174. <div class="layui-input-block">
  175. <form:input id="cBName" path="createBy.name" htmlEscape="false" readonly="true"
  176. class="form-control layui-input"/>
  177. </div>
  178. </div>
  179. <div class="layui-item layui-col-sm6">
  180. <label class="layui-form-label">所属部门:</label>
  181. <div class="layui-input-block">
  182. <form:input id="office" path="office.name" htmlEscape="false" readonly="true"
  183. class="form-control layui-input"/>
  184. </div>
  185. </div>
  186. <div class="layui-item layui-col-sm12" style="padding-bottom: 20px;">
  187. <label class="layui-form-label"><span class="require-item">*</span>内容:</label>
  188. <div class="layui-input-block">
  189. <div class="wrapForm">
  190. <div class="mask">
  191. <form:textarea path="contents" disabled="true" htmlEscape="false" colspan="3" rows="6" maxlength="550"
  192. class="form-control "/>
  193. <form:hidden id="content" path="content" htmlEscape="false" maxlength="64"
  194. class="form-control required"/>
  195. <sys:ckeditorView replace="contents" uploadPath="/oa/oa"/>
  196. </div>
  197. </div>
  198. </div>
  199. </div>
  200. </div>
  201. <div class="form-group layui-row">
  202. <div class="form-group-label"><h2>公告范围-部门</h2></div>
  203. <table id="officeTable" class="table table-bordered table-condensed details">
  204. <thead>
  205. <tr>
  206. <th>部门</th>
  207. </tr>
  208. </thead>
  209. <tbody id="officeTableList">
  210. </tbody>
  211. </table>
  212. <script type="text/template" id="officeTpl">//<!--
  213. <tr id="officeList{{idx}}">
  214. <td>
  215. {{row.name}}
  216. </td>
  217. </tr>//-->
  218. </script>
  219. </div>
  220. <div class="form-group layui-row">
  221. <div class="form-group-label"><h2>公告范围-成员</h2></div>
  222. <table id="userTable" class="table table-bordered table-condensed details">
  223. <thead>
  224. <tr>
  225. <th>姓名</th>
  226. <th>部门</th>
  227. </tr>
  228. </thead>
  229. <tbody id="userTableList">
  230. </tbody>
  231. </table>
  232. <script type="text/template" id="userTpl">//<!--
  233. <tr id="userList{{idx}}">
  234. <td>
  235. {{row.name}}
  236. </td>
  237. <td>
  238. {{row.officeName}}
  239. </td>
  240. </tr>//-->
  241. </script>
  242. <script type="text/javascript">
  243. var userIdx = 0, userTpl = $("#userTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, "");
  244. var officeIdx = 0, officeTpl = $("#officeTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, "");
  245. $(document).ready(function () {
  246. var data = ${fns:toJson(oaNotify.officeList)};
  247. if (data != null) {
  248. for (var i = 0; i < data.length; i++) {
  249. addRow('#officeTableList', officeIdx, officeTpl, data[i]);
  250. officeIdx = officeIdx + 1;
  251. }
  252. }
  253. var dataBank = ${fns:toJson(oaNotify.userList)};
  254. if (dataBank != null) {
  255. for (var i = 0; i < dataBank.length; i++) {
  256. addRow('#userTableList', userIdx, userTpl, dataBank[i]);
  257. userIdx = userIdx + 1;
  258. }
  259. }
  260. });
  261. function addRow(list, idx, tpl, row) {
  262. var idx1 = 0;
  263. if ('#userTableList' == list) {
  264. idx1 = $("#userTableList tr").length
  265. } else if ('#officeTableList' == list) {
  266. idx1 = $("#officeTableList tr").length
  267. }
  268. bornTemplete(list, idx, tpl, row, idx1);
  269. }
  270. function bornTemplete(list, idx, tpl, row, idx1) {
  271. $(list).append(Mustache.render(tpl, {
  272. idx: idx, delBtn: true, row: row,
  273. order: idx1 + 1, idx1: idx1
  274. }));
  275. $(list + idx).find("select").each(function () {
  276. $(this).val($(this).attr("data-value"));
  277. });
  278. $(list + idx).find("input[type='checkbox'], input[type='radio']").each(function () {
  279. var ss = $(this).attr("data-value").split(',');
  280. for (var i = 0; i < ss.length; i++) {
  281. if ($(this).val() == ss[i]) {
  282. $(this).attr("checked", "checked");
  283. }
  284. }
  285. });
  286. }
  287. function delRow(obj, prefix, idx) {
  288. $(obj).parent().parent().remove();
  289. }
  290. </script>
  291. </div>
  292. <div class="form-group layui-row">
  293. <div class="form-group-label"><h2>公告附件</h2></div>
  294. <div class="layui-item layui-col-xs12" style="padding:0 16px;">
  295. <table id="upTable" class="table table-bordered table-condensed details">
  296. <thead>
  297. <tr>
  298. <%-- <th>序号</th>--%>
  299. <th>文件预览</th>
  300. <th>上传人</th>
  301. <th>上传时间</th>
  302. <th width="100px">操作</th>
  303. </tr>
  304. </thead>
  305. <tbody id="file_attachment">
  306. <c:forEach items="${oaNotify.workAttachments}" var="workClientAttachment" varStatus="status">
  307. <tr>
  308. <%-- <td>${status.index + 1}</td>--%>
  309. <c:choose>
  310. <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
  311. or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
  312. or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
  313. or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
  314. or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
  315. <td><img src="${workClientAttachment.url}" width="50" height="50"
  316. onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')"
  317. alt="${workClientAttachment.attachmentName}"></td>
  318. </c:when>
  319. <c:otherwise>
  320. <c:choose>
  321. <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
  322. <td><a class="attention-info" href="javascript:void(0)"
  323. onclick="preview('预览','${workClientAttachment.url}','90%','90%','1')">${workClientAttachment.attachmentName}</a>
  324. </td>
  325. </c:when>
  326. <c:otherwise>
  327. <td><a class="attention-info" href="javascript:void(0)"
  328. onclick="preview('预览','${workClientAttachment.url}','90%','90%')">${workClientAttachment.attachmentName}</a>
  329. </td>
  330. </c:otherwise>
  331. </c:choose>
  332. </c:otherwise>
  333. </c:choose>
  334. <td>${workClientAttachment.createBy.name}</td>
  335. <td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
  336. <td class="op-td">
  337. <div class="op-btn-box">
  338. <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent(encodeURIComponent('${workClientAttachment.url}'));"
  339. class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
  340. </div>
  341. </td>
  342. </tr>
  343. </c:forEach>
  344. </tbody>
  345. </table>
  346. </div>
  347. </div>
  348. <div class="form-group layui-row">
  349. <div class="form-group-label"><h2>审批意见</h2></div>
  350. <div class="layui-item layui-col-xs12 with-textarea" >
  351. <label class="layui-form-label">审批意见:</label>
  352. <div class="layui-input-block">
  353. <form:textarea path="act.comment" class="form-control" rows="4" maxlength="127" />
  354. <input type="file" name="upload_files" style="display: none;">
  355. </div>
  356. </div>
  357. </div>
  358. <div class="form-group layui-row">
  359. <div class="form-group-label"><h2>审批流程</h2></div>
  360. <div class="layui-item layui-col-xs12 form-table-container" >
  361. <act:flowChart procInsId="${oaNotify.act.procInsId}"/>
  362. <act:histoicFlow procInsId="${oaNotify.act.procInsId}"/>
  363. </div>
  364. </div>
  365. <div class="form-group layui-row page-end"></div>
  366. </form:form>
  367. </div>
  368. </div>
  369. </body>
  370. </html>