w-project-section-files.html 20 KB

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