w-project-section-files.html 22 KB

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