edit.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. <!DOCTYPE HTML>
  2. <html xmlns:th="http://www.thymeleaf.org"
  3. xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
  4. layout:decorate="~{admin/common/common}">
  5. <head>
  6. <title>详情</title>
  7. <style>
  8. .childTit{
  9. font-size:14px;
  10. color:#333;
  11. padding:8px 5px;
  12. /*margin: 15px 0;*/
  13. border-left: 3px solid #409EFF;
  14. background: rgba(240,240,240,0.9);
  15. text-align: left;
  16. }
  17. .line {
  18. display: block;
  19. text-align: left;
  20. background-color: #fff;
  21. color: #333;
  22. border-bottom: 1px solid #0a6999;
  23. border-color: #fff;
  24. border-bottom: 1px solid #0a6999;
  25. margin-top: 10px;
  26. vertical-align: middle;
  27. padding: 4px 12px;
  28. height: 31px;
  29. line-height: 31px;
  30. font-size: 14px;
  31. font-weight: bold;
  32. }
  33. </style>
  34. </head>
  35. <body layout:fragment="content">
  36. <article class="page-container">
  37. <form class="form form-horizontal" id="form-add">
  38. <input type="hidden" name = "status" value="1" readonly/>
  39. <div class="line">基本信息</div>
  40. <div class="row cl">
  41. <div class="col-xs-6 col-sm-6">
  42. <input type="hidden" name = "id" th:value="${retreatOptimization.id}" readonly/>
  43. <label class="form-label col-xs-3 col-sm-3">板块:</label>
  44. <div class="formControls col-xs-6 col-sm-6">
  45. <input type="test" class="input-text" name = "plateName" th:value="${retreatOptimization.plateName}" readonly/>
  46. </div>
  47. </div>
  48. <div class="col-xs-6 col-sm-6">
  49. <label class="form-label col-xs-3 col-sm-3">上传用户:</label>
  50. <div class="formControls col-xs-6 col-sm-6">
  51. <input type="test" class="input-text" name = "userNsme" th:value="${retreatOptimization.userName}" readonly/>
  52. </div>
  53. </div>
  54. </div>
  55. <div class="row cl">
  56. <div class="col-xs-6 col-sm-6">
  57. <label class="form-label col-xs-3 col-sm-3">上传时间:</label>
  58. <div class="formControls col-xs-6 col-sm-6">
  59. <input type="test" class="input-text" name = "createTime" th:value="${retreatOptimization.commit_time}" readonly/>
  60. </div>
  61. </div>
  62. <div class="col-xs-6 col-sm-6">
  63. <label class="form-label col-xs-3 col-sm-3">状态:</label>
  64. <div class="formControls col-xs-6 col-sm-6">
  65. <input type="test" class="input-text" name = "statusStr" th:value="${retreatOptimization.statusStr}" readonly/>
  66. </div>
  67. </div>
  68. </div>
  69. <div class="row cl">
  70. <div class="col-xs-6 col-sm-6">
  71. <label class="form-label col-xs-3 col-sm-3">类型:</label>
  72. <div class="formControls col-xs-6 col-sm-6">
  73. <input type="test" class="input-text" name = "typeStr" th:value="${retreatOptimization.typeStr}" readonly/>
  74. </div>
  75. </div>
  76. </div>
  77. <!--<div class="row cl">-->
  78. <!--<h2 class="childTit">文件资料</h2>-->
  79. <!--</div>-->
  80. <div class="line">文件资料</div>
  81. <div class="row cl">
  82. <div class="col-xs-6 col-sm-6">
  83. <label class="form-label col-xs-3 col-sm-3">类型:</label>
  84. <select class=" col-xs-6 col-sm-6" th:name="type" id="type" onChange="changeType()" style="height: 30px;">
  85. <option value="">-- 请选择类型 --</option>
  86. <option th:value="1" th:text="每年度初上报材料"></option>
  87. <option th:value="2" th:text="季度进展情况"></option>
  88. <option th:value="3" th:text="项目完成上报材料"></option>
  89. <option th:value="4" th:text="需提交会办材料"></option>
  90. </select>
  91. </div>
  92. </div>
  93. <div class="row cl" id="template">
  94. <table class="table table-border table-bordered table-bg table-hover" style="margin-top: 15px">
  95. <thead>
  96. <tr class="text-c">
  97. <th>编号</th>
  98. <th>模版</th>
  99. <th>附件</th>
  100. <!--<th>上传材料</th>-->
  101. </tr>
  102. </thead>
  103. <tbody>
  104. <tr class="text-c" th:each="model,iterStat:${materials}" th:object="${model}">
  105. <td class="index" th:text="${iterStat.index+1}"></td>
  106. <td class="templateFile">
  107. <div>
  108. <a th:href="${fileUrl} + *{url} " target="_blank" style="color: #5b98dd;">[[*{item_name}]]</a>
  109. </div>
  110. </td>
  111. <td class="td_material">
  112. <div th:if="*{fileDown}">
  113. <a th:href="${fileUrl} + *{fileDown.file_url}" target="_blank" style="color: #5b98dd;">[[*{fileDown.file_name}]]</a>
  114. </div>
  115. </td>
  116. <!--<td>-->
  117. <!--<input class="uploadFileTemplateId" type="hidden" th:name="materials[+${iterStat.index}+].id" />-->
  118. <!--<input class="uploadFileName input-text" name="uploadFileName" readonly="readonly" type="text"-->
  119. <!--th:onclick="'javascript:addFile(\'添加文件\',\'/retreatOpt/addFile/1/'+*{id}+'\',\'800\',\'350\')'"/>-->
  120. <!--<input class="uploadFileId" type="hidden" th:name="materials[+${iterStat.index}+].fileDown.file_id" />-->
  121. <!--</td>-->
  122. </tr>
  123. </tbody>
  124. </table>
  125. </div>
  126. <!--<div class="row cl">-->
  127. <!--<h2 class="childTit">流程信息</h2>-->
  128. <!--</div>-->
  129. <div class="line">流程信息</div>
  130. <div class="row cl" id="approval">
  131. <table class="table table-border table-bordered table-bg table-hover processTb" style="margin-top: 15px">
  132. <thead>
  133. <tr class="text-c">
  134. <th>单位</th>
  135. <th>用户</th>
  136. <th>时间</th>
  137. <th>操作</th>
  138. <th>意见与建议</th>
  139. </tr>
  140. </thead>
  141. <tbody>
  142. <tr class="text-c" th:each="model,iterStat:${approvals}" th:object="${model}">
  143. <td th:text="*{department}"></td>
  144. <td th:text="*{create_name}"></td>
  145. <td th:text="*{create_time}"></td>
  146. <td th:text="*{oper_type}"></td>
  147. <td class="viewComment" th:data="*{approval_comment}" th:text="*{approval_comment}"></td>
  148. </tr>
  149. </tbody>
  150. </table>
  151. </div>
  152. <div class="row cl">
  153. <div class="col-xs-12 col-sm-9 col-xs-offset-5 col-sm-offset-5">
  154. <a class="btn btn-primary radius" onclick="save()">&nbsp;&nbsp;提交&nbsp;&nbsp;</a>
  155. <button onClick="removeIframe();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
  156. </div>
  157. </div>
  158. </form>
  159. </article>
  160. <script type="text/javascript" th:src="@{/js/common/page.js}"></script>
  161. <script th:inline="javascript">
  162. var fileUrl = [[${fileUrl}]];
  163. var type = [[${retreatOptimization.type}]];
  164. $("#type").val(type);
  165. function changeType(){
  166. $.ajax({
  167. url :pagePath+"/retreatOpt/getTemplateFile",
  168. type : "get",
  169. data : {
  170. 'type': $("#type").val()
  171. },
  172. dataType : "json",
  173. success: function (result) {
  174. if (result.success) {
  175. var templates = result.obj;
  176. if(templates.length>0){
  177. $("#template").find("tbody tr").remove();
  178. for(var i=0;i< templates.length;i++){
  179. var file = templates[i].fileDown;
  180. var tr = '<tr class="text-c" >';
  181. //编号
  182. tr +='<td class="index" > '+(i+1)+' </td>';
  183. //模板
  184. tr += '<td class ="templateFile">'
  185. if(file && file.file_url){
  186. url = fileUrl + file.file_url;
  187. tr += '<a href="'+url+'" target="_blank">'+file.file_name+'</a>';
  188. }else{
  189. tr += '<span>'+templates[i].item_name+'</span>';
  190. }
  191. tr += '</td>';
  192. //上传文件
  193. tr += '<td id="materials">';
  194. tr += '<input class="uploadFileTemplateId" type="hidden" name="materials['+i+'].id" value="'+templates[i].id+'"/>';
  195. tr += '<input class="uploadFileName input-text" name="uploadFileName" readonly="readonly" type="text" onclick="javascript:addFile(\'添加文件\',\'/retreatOpt/addFile/1/'+templates[i].id+'\',\'800\',\'350\');"/>';
  196. tr += '<input class="uploadFileId" type="hidden" name="materials['+i+'].fileDown.file_id" />';
  197. tr += '</td>';
  198. $("#template").find("tbody").append(tr);
  199. }
  200. }else{
  201. $("#template").find("tbody tr").remove();
  202. }
  203. } else {
  204. errorMessage(result.message);
  205. }
  206. },
  207. error: function () {
  208. errorMessage('系统错误!');
  209. }
  210. });
  211. }
  212. //添加文件
  213. function addFile(title, url, w, h) {
  214. layer_show(title, pagePath + url, w, h);
  215. }
  216. function save(){
  217. var validateFile = true;
  218. $("#materials").find(".uploadFileName").each(function(){
  219. if($(this).val()==""){
  220. errorMessage('请上传所有材料!');
  221. validateFile = false;
  222. }
  223. });
  224. if($("#type").val() === ""){
  225. errorMessage('请选择类型!');
  226. validateFile = false;
  227. }
  228. if (validateFile){
  229. $("#form-add").ajaxSubmit({
  230. type: 'post',
  231. url: pagePath + "/retreatOpt/edit",
  232. dataType: "json",
  233. success: function (data) {
  234. if (data.success) {
  235. succeedMessage(data.message);
  236. console.log(data.message)
  237. setTimeClose();
  238. // window.location.href =pagePath + "/retreatOpt/index";
  239. } else {
  240. errorMessage(data.message);
  241. }
  242. },
  243. error: function () {
  244. errorMessage('系统错误!');
  245. }
  246. });
  247. }
  248. }
  249. //查看完整意见
  250. $(".viewComment").on("click", function () {
  251. layer.alert(
  252. $(this).attr('data'),
  253. {area: ['800px', '500px']}
  254. )
  255. });
  256. /**
  257. * 取消
  258. */
  259. function removeIframe(){
  260. var index = parent.layer.getFrameIndex(window.name);
  261. parent.layer.close(index);
  262. }
  263. </script>
  264. </body>
  265. </html>