w-project-section-files.html 20 KB

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