w-project-section-files.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. <!DOCTYPE html>
  2. <html lang=zh-cn>
  3. <head>
  4. <meta charset=utf-8>
  5. <title>纵横计量支付系统</title>
  6. <meta name=description content=计量支付>
  7. <meta name=copyright content=smartcost.com.cn>
  8. <link rel=stylesheet href={{rootUrl}}global/css/fixedheadertable.css>
  9. <link rel=stylesheet href="{{rootUrl}}global/css/bootstrap.css">
  10. <link rel=stylesheet href="{{rootUrl}}global/css/style.css">
  11. <script src="{{rootUrl}}global/js/jquery-1.9.1.min.js"></script>
  12. <script src="{{rootUrl}}global/js/bootstrap.js"></script>
  13. <script src="{{rootUrl}}global/js/jl.js"></script>
  14. <script src={{rootUrl}}global/js/jquery.fixedheadertable.js></script>
  15. </head>
  16. <body>
  17. <!-- include "top" -->
  18. <div class="wrapContent">
  19. <!-- include "left" -->
  20. <div class="mainContainer">
  21. <!--内容-->
  22. <div class="mainContent">
  23. <div class="title clearfix">
  24. <ul class="nav nav-pills">
  25. <li class="dropdown"><a title="返回" href="{{rootUrl}}project/{{currproArray.pid}}/section"><span
  26. class="closePanel" aria-hidden="true" data-icon="Z"></span></a></li>
  27. <li class="dropdown">
  28. </li>
  29. <li class="dropdown">
  30. <a href="{{rootUrl}}project/{{currproArray.pid}}/section" data-toggle="dropdown"
  31. class="dropdown-toggle">
  32. {{currconArray.stname}}<b class="caret"></b>
  33. </a>
  34. <ul class="dropdown-menu">
  35. <!-- loop allconArray -->
  36. <li><a href="{{rootUrl}}project/{{currproArray.pid}}/section">{{allconArray' value.stname}}</a></li>
  37. <!-- endloop -->
  38. </ul>
  39. </li>
  40. <li class="dropdown">
  41. <a href="{{rootUrl}}project/{{currproArray.pid}}/section" data-toggle="dropdown"
  42. class="dropdown-toggle">
  43. {{curractmeasureArray.pmname}}<b class="caret"></b>
  44. </a>
  45. <ul class="dropdown-menu">
  46. <!-- loop allactmeasureArray -->
  47. <li>
  48. <a href="{{rootUrl}}project/{{currproArray.pid}}/section/{{allactmeasureArray' value.pmid}}/detail">{{allactmeasureArray' value.pmname}}</a></li>
  49. <!-- endloop -->
  50. <!-- <li class="divider"></li>
  51. <li><a href="#">共18标段,查看更多</a></li>-->
  52. </ul>
  53. </li>
  54. </ul>
  55. </div>
  56. <!--导航-->
  57. <ul class="nav nav-tabs">
  58. <li>
  59. <a href="{{rootUrl}}project/{{pid}}/section/{{pmid}}/detail">标段概况</a>
  60. </li>
  61. <li class="active"><a href="{{rootUrl}}project/{{pid}}/section/{{pmid}}/files">附件</a></li>
  62. <!--<li><a href="w-project-section-measure.html">计量台帐</a></li>-->
  63. </ul>
  64. <!--导航-->
  65. <!--筛选工具-->
  66. <div class="clearfix">
  67. <form class="form-inline">
  68. <select id="numpname" class="span2">
  69. <option value="0">不限期数</option>
  70. <!-- loop groupArray -->
  71. <option <!-- if {{num}} == {{groupArray' value.numpname}} --> selected <!-- endif -->
  72. value="{{groupArray' value.numpname}}">第{{ToChinaseNum(groupArray' value.numpname)}}期
  73. </option>
  74. <!-- endloop -->
  75. </select>
  76. <select id="uploaduser" class="span2">
  77. <option value="0">上传者</option>
  78. <!-- loop owneridArray -->
  79. <option <!-- if {{userid}} == {{owneridArray' value.ownerid}} --> selected <!-- endif -->
  80. value="{{owneridArray' value.ownerid}}">{{owneridArray' value.name}}</option>
  81. <!-- endloop -->
  82. </select>
  83. <a href="/project/{{pid}}/section/{{pmid}}/files/recover" class="fR">附件回收站</a>
  84. </form>
  85. </div>
  86. <!--筛选工具-->
  87. <!--文件管理-->
  88. <div class="filesWrap">
  89. <div class="filesList">
  90. <table class="table table-striped table-hover">
  91. <thead>
  92. <tr>
  93. <th width="">文件名</th>
  94. <th width="">期</th>
  95. <!--<th width="">节点</th>-->
  96. <th width="">上传者</th>
  97. <th width="">上传时间</th>
  98. <th width="40">操作</th>
  99. </tr>
  100. </thead>
  101. <tbody>
  102. <!-- loop itemMeasureArray -->
  103. <tr id="tr_{{itemMeasureArray' value.imnid}}">
  104. <td width=""><span class="fileico ico-jpg"></span><a
  105. fileext="{{itemMeasureArray' value.fileext}}"
  106. imnid="{{itemMeasureArray' value.imnid}}"
  107. iaid="{{itemMeasureArray' value.iaid}}"
  108. filename="{{itemMeasureArray' value.filename}}"
  109. realname="{{itemMeasureArray' value.realname}}"
  110. intime="{{formatDate(itemMeasureArray' value.intime,'Y-m-d')}}"
  111. tips="{{itemMeasureArray' value.tips}}"
  112. href="#"
  113. numpname="第{{ToChinaseNum(itemMeasureArray' value.numpname)}}期"
  114. id="fname_{{itemMeasureArray' value.imnid}}">{{itemMeasureArray' value.filename}}</a></td>
  115. <td>第{{ToChinaseNum(itemMeasureArray' value.numpname)}}期</td>
  116. <!--<td>{{itemMeasureArray' value.pmname}}</td>-->
  117. <td width="">{{itemMeasureArray' value.realname}}</td>
  118. <td width="">{{formatDate(itemMeasureArray' value.intime,'Y-m-d')}}</td>
  119. <td>
  120. <div class="btn-group">
  121. <a imnid="{{itemMeasureArray' value.imnid}}"
  122. id="dropdown_{{itemMeasureArray' value.imnid}}"
  123. class="btn btn-mini dropdown-toggle" data-toggle="dropdown" href="#">
  124. <span class="caret"></span>
  125. </a>
  126. <ul class="dropdown-menu">
  127. <!--<li><a><i class="icon-eye-open"></i>&nbsp;预览</a></li>-->
  128. <li><a href="#file-edit" data-toggle="modal"><i class="icon-pencil"></i>&nbsp;编辑</a>
  129. </li>
  130. <li><a id="down_{{itemMeasureArray' value.imnid}}" iaid="{{itematta' value.iaid}}"><i class="icon-download-alt"></i>&nbsp;下载</a></li>
  131. </ul>
  132. </div>
  133. </td>
  134. </tr>
  135. <!-- endloop -->
  136. </tbody>
  137. </table>
  138. <div class="pagination">
  139. <ul>
  140. {{pager}}
  141. </ul>
  142. </div>
  143. </div>
  144. <div class="filesDetail hide">
  145. <table class="table table-striped">
  146. <thead>
  147. <tr>
  148. <th colspan="4">文件详情</th>
  149. </tr>
  150. </thead>
  151. <tr>
  152. <th width="60">文件名</th>
  153. <td colspan="3" id="fn"> K0+800-K1+000图纸</td>
  154. </tr>
  155. <tr>
  156. <th width="60">格式</th>
  157. <td id="fileico"><span class="fileico ico-jpg"></span>.jpg</td>
  158. <th width="60">所在期</th>
  159. <td id="numpname2">第二期</td>
  160. </tr>
  161. <tr>
  162. <th width="60">上传者</th>
  163. <td id="realname">陈工</td>
  164. <th width="60">上传时间</th>
  165. <td id="intime">2014-11-20 14:20</td>
  166. </tr>
  167. <tr>
  168. <th width="60">备注/描述</th>
  169. <td colspan="3" id="tips">内容内容内容内容</td>
  170. </tr>
  171. <tr>
  172. <th width="60">更多操作</th>
  173. <td colspan="3">
  174. <!--<button class="btn btn-mini btn-primary" type="button" href="#file-replace"-->
  175. <!--data-toggle="modal"><i class="icon-retweet icon-white"></i>替换-->
  176. <!--</button>-->
  177. <!--<button class="btn btn-mini btn-info" id="historyAtt" type="button" href="#file-history"-->
  178. <!--data-toggle="modal"><i class="icon-time icon-white"></i>历史版本-->
  179. <!--</button>-->
  180. <!--&nbsp;&nbsp;&nbsp;&nbsp;-->
  181. <button id="del"
  182. imnid="" class="btn btn-mini btn-danger"
  183. type="button" href="#file-del"
  184. data-toggle="modal"><i class="icon-remove icon-white"></i>删除
  185. </button>
  186. </td>
  187. </tr>
  188. </table>
  189. </div>
  190. </div>
  191. <!--文件管理-->
  192. </div>
  193. <!--内容-->
  194. </div>
  195. </div>
  196. <!-- 编辑弹出 -->
  197. <div id="file-edit" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
  198. aria-hidden="true">
  199. <div class="modal-header">
  200. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
  201. <h3 id="myModalLabel">文件编辑</h3>
  202. </div>
  203. <div class="modal-body">
  204. <div class="form">
  205. <form class="form-horizontal">
  206. <input type="hidden" id="upimnid" name="upimnid" value=""/>
  207. <div class="control-group">
  208. <label class="control-label" for="inputEmail">文件名称</label>
  209. <div class="controls">
  210. <input name="upfilename" id="upfilename" type="text"/>
  211. </div>
  212. </div>
  213. <div class="control-group">
  214. <label class="control-label" for="inputEmail">备注/描述</label>
  215. <div class="controls">
  216. <textarea name="upfiledesc" id="upfiledesc"></textarea>
  217. </div>
  218. </div>
  219. </form>
  220. </div>
  221. </div>
  222. <div class="modal-footer">
  223. <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
  224. <button id="updateFileDesc" class="btn btn-primary">确定修改</button>
  225. </div>
  226. </div>
  227. <!-- 编辑弹出 -->
  228. <!-- 替换弹出 -->
  229. <div id="file-replace" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
  230. aria-hidden="true">
  231. <div class="modal-header">
  232. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
  233. <h3 id="myModalLabel">文件替换</h3>
  234. </div>
  235. <div class="modal-body">
  236. <div class="form">
  237. <form class="form-horizontal">
  238. <input type="hidden" name="fid" value="0" id="fid"/>
  239. <div class="control-group">
  240. <label class="control-label" for="inputEmail">选择文件</label>
  241. <div class="controls">
  242. <input name="file" id="file" type="file">
  243. <span class="help-block">替换新文件后,所有已下挂该文件的清单都将更新。</span>
  244. </div>
  245. </div>
  246. </form>
  247. </div>
  248. </div>
  249. <div class="modal-footer">
  250. <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
  251. <button id="btreplacefile" class="btn btn-primary">确定替换</button>
  252. </div>
  253. </div>
  254. <!-- 替换弹出 -->
  255. <!-- 删除弹出 -->
  256. <div id="file-del" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
  257. aria-hidden="true">
  258. <div class="modal-header">
  259. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
  260. <h3 id="myModalLabel">文件删除</h3>
  261. </div>
  262. <div class="modal-body">
  263. <h5 class="text-success">文件删除成功,您可以在附件回收站恢复它。</h5>
  264. </div>
  265. <div class="modal-footer">
  266. <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
  267. </div>
  268. </div>
  269. </div>
  270. <!-- 删除弹出 -->
  271. <!-- 历史版本弹出 -->
  272. <div id="file-history" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
  273. aria-hidden="true">
  274. <input type="hidden" name="iaid" value="0" id="iaid"/>
  275. <div class="modal-header">
  276. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
  277. <h3 id="myModalLabel">历史版本</h3>
  278. </div>
  279. <div id="historyHTML" class="modal-body">
  280. </div>
  281. <div class="modal-footer">
  282. <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
  283. </div>
  284. </div>
  285. </div>
  286. <!-- 历史版本1弹出 -->
  287. <script type="text/javascript">autoFlashHeight();</script>
  288. <script type="text/javascript">
  289. $(document).ready(function () {
  290. $("a[id^='fname_']").click(function () {
  291. var fileext = $(this).attr('fileext');
  292. var filename = $(this).attr('filename');
  293. var realname = $(this).attr('realname');
  294. var intime = $(this).attr('intime');
  295. var tips = $(this).attr('tips');
  296. var numpname = $(this).attr('numpname');
  297. var imnid = $(this).attr('imnid');
  298. var iaid = $(this).attr('iaid');
  299. $("#fn").html(filename);
  300. $("#fileico").html(fileext);
  301. $("#realname").html(realname);
  302. $("#intime").html(intime);
  303. $("#tips").html(tips);
  304. $("#numpname2").html(numpname);
  305. $(".filesDetail").show();
  306. $("#fid").val(imnid);
  307. $("#iaid").val(iaid);
  308. $("#del").attr("imnid", imnid);
  309. });
  310. $("a[id^='dropdown_']").click(function () {
  311. var imnid = $(this).attr('imnid');
  312. $("#upimnid").val(imnid);
  313. });
  314. $("#del").click(function () {
  315. var imnid = $(this).attr('imnid');
  316. $.ajax({
  317. type: "POST",
  318. dataType: "json",
  319. cache: false,
  320. data: {"imnid": imnid, "optype": 'del'},
  321. url: "/project/{{pid}}/section/{{pmid}}/files",
  322. success: function (data) {
  323. if (data['status'] == 1) {
  324. $('#file-del').modal('show');
  325. $('#file-del').on('shown.bs.modal',function () {
  326. // window.location.href = "{{rootUrl}}rproject/{{pid}}/section/{{pmid}}/files";
  327. $('#tr_' + imnid).remove();
  328. });
  329. }
  330. }
  331. });
  332. });
  333. $("#updateFileDesc").click(function () {
  334. var upfilename = $("#upfilename").val();
  335. var upfiledesc = $("#upfiledesc").val();
  336. var imnid = $("#upimnid").val();
  337. $.ajax({
  338. type: "POST",
  339. dataType: "json",
  340. cache: false,
  341. data: {"upimnid": imnid, "filename": upfilename, "filedesc": upfiledesc},
  342. url: "/project/{{pid}}/section/{{pmid}}/files",
  343. success: function (data) {
  344. if (data['status'] == 1) {
  345. window.location.href = "{{rootUrl}}project/{{pid}}/section/{{pmid}}/files";
  346. }
  347. }
  348. });
  349. });
  350. $("#btreplacefile").click(function () {
  351. var file_data = $('#file').prop('files')[0];
  352. var form_data = new FormData();
  353. form_data.append('file', file_data);
  354. form_data.append('optype', 'replace');
  355. var imnid = $("#fid").val();
  356. form_data.append('imnid', imnid);
  357. $.ajax({
  358. type: "POST",
  359. dataType: "text",
  360. cache: false,
  361. contentType: false,
  362. data: form_data,
  363. url: "/project/{{pid}}/section/{{pmid}}/files",
  364. processData: false,
  365. success: function (data) {
  366. if (data['status'] == 1) {
  367. window.location.href = "{{rootUrl}}project/{{pid}}/section/{{pmid}}/files";
  368. }
  369. }
  370. });
  371. });
  372. $("#historyAtt").click(function () {
  373. var iaid = $("#iaid").val();
  374. $("#historyHTML").html('');
  375. $.ajax({
  376. type: "POST",
  377. dataType: "json",
  378. cache: false,
  379. data: {"iaid": iaid},
  380. url: "/project/section/" + iaid + "/file",
  381. success: function (data) {
  382. $("#historyHTML").html(data['html']);
  383. }
  384. });
  385. });
  386. $("#numpname").change(function () {
  387. var localurl = window.location.href;
  388. var page = localurl.indexOf("page/");
  389. var user = localurl.indexOf("user/");
  390. var num = localurl.indexOf("num/");
  391. if($(this).val() > 0){
  392. if (num != "-1") {
  393. var nowurl = localurl.replace(/num\/\d+/, "num/" + $(this).val());
  394. window.location.href = nowurl;
  395. }else {
  396. if (page == "-1") {
  397. var url = window.location.href + "/num/" + $(this).val() + "/page/1";
  398. window.location.href = url;
  399. }else{
  400. var url = window.location.href + "/num/" + $(this).val();
  401. window.location.href = url;
  402. }
  403. }
  404. }else{
  405. var nowurl = localurl.replace(/\/num\/\d+\/page\/1/,'');
  406. var nowurl = localurl.replace(/\/num\/\d+/,'');
  407. window.location.href = nowurl;
  408. }
  409. });
  410. $("#uploaduser").change(function () {
  411. var localurl = window.location.href;
  412. var page = localurl.indexOf("page/");
  413. var user = localurl.indexOf("user/");
  414. var num = localurl.indexOf("num/");
  415. if($(this).val() > 0){
  416. if (user != "-1") {
  417. var nowurl = localurl.replace(/user\/\d+/, "user/" + $(this).val());
  418. window.location.href = nowurl;
  419. }else {
  420. if (page == "-1") {
  421. var url = window.location.href + "/user/" + $(this).val() + "/page/1";
  422. window.location.href = url;
  423. }else{
  424. var url = window.location.href + "/user/" + $(this).val();
  425. window.location.href = url;
  426. }
  427. }
  428. }else{
  429. var nowurl = localurl.replace(/\/user\/\d+\/page\/1/,'');
  430. var nowurl = localurl.replace(/\/user\/\d+/,'');
  431. window.location.href = nowurl;
  432. }
  433. });
  434. });
  435. </script>
  436. </body>