contract_view.html 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. {extend name="layout/content"}
  2. {block name="content"}
  3. <style type="text/css">
  4. .spacing {
  5. margin-bottom: 10px;
  6. padding-right:4px;
  7. padding-left: 4px;
  8. }
  9. #talentInfoForm label {
  10. font-size: xx-small;
  11. }
  12. .has-feedback .form-control {
  13. padding-right: 5px;
  14. }
  15. #projectForm ul li{
  16. width:16%;
  17. padding-top: 10px;
  18. }
  19. #jjAttendanceForm ul li{
  20. width:16%;
  21. padding-top: 10px;
  22. }
  23. #field ul li{
  24. width:33%;
  25. padding-top: 5px;
  26. }
  27. ul li{
  28. list-style: none;
  29. display:inline-block;
  30. }
  31. .imgs li {
  32. float: left;
  33. border: 1px solid #d8d1d1;
  34. text-align: center;
  35. height: 30px;
  36. }
  37. .showImgs li {
  38. float: left;
  39. border: 1px solid #d8d1d1;
  40. text-align: center;
  41. height: 30px;
  42. }
  43. .project-detail li{width:30px;text-align:center;line-height:20px;color:#fff;margin:0 2px;}
  44. .project-detail li.gray{background:#d8d1d1;}
  45. .project-detail li.green{background:#1cc09f;}
  46. </style>
  47. <div id="showBigPic">
  48. <input type="hidden" id="id" value="{$id}"/>
  49. <input type="hidden" id="type" value="{$type}"/>
  50. <div class="panel panel-default">
  51. <div class="panel-heading" onclick="$(this).next().toggle()">
  52. <h3 class="panel-title">
  53. 工作合同相关附件
  54. </h3>
  55. </div>
  56. <div class="panel-body" >
  57. <table id="fileTable" class="table-condensed" style="font-size: 10px;table-layout: fixed!important;" data-mobile-responsive="true" data-click-to-select="true">
  58. <thead>
  59. <tr>
  60. <th data-field="selectItem" data-checkbox="true"></th>
  61. </tr>
  62. </thead>
  63. </table>
  64. </div>
  65. </div>
  66. </div>
  67. <script type="text/javascript">
  68. var __initialize = function () {
  69. initFileTable();
  70. function initFileTable() {
  71. var queryData = {};
  72. queryData['type'] = $("#type").val();
  73. $("#fileTable").bootstrapTable({
  74. url: Feng.ctxPath + "/common/api/findContractFileType",
  75. method: 'POST',
  76. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  77. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  78. showRefresh: false, // 是否显示刷新按钮
  79. clickToSelect: true, // 是否启用点击选中行
  80. singleSelect: true, // 设置True 将禁止多选
  81. striped: true, // 是否显示行间隔色
  82. escape: true,
  83. pagination: false, // 设置为 true 会在表格底部显示分页条
  84. paginationHAlign: "left",
  85. paginationDetailHAlign: "right",
  86. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  87. showColumns: false,
  88. detailView: true, //是否显示父子表
  89. pageList: [10, 30, 50],
  90. queryParams: function (params) {
  91. return $.extend(queryData, params)
  92. },
  93. rowStyle: function (row, index) {
  94. return {classes: "info"};
  95. },
  96. columns: initFileTypeColumn(),
  97. onPostBody: function () {
  98. $("td.uitd_showTip").bind("mouseover", function () {
  99. var htm = $(this).html();
  100. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  101. });
  102. },
  103. onLoadSuccess: function (data) {
  104. $("#fileTable").bootstrapTable('expandAllRows');
  105. },
  106. onExpandRow: function (index, row, $detail) {
  107. var ajax = new $ax(Feng.ctxPath + "/common/api/listTalentFile", function (data) {
  108. if (data == null || data.length == 0) {
  109. return;
  110. }
  111. var html = '<ul class="imgs"><li style="width: 70%;font-weight: bold;padding-top: 5px;">附件原名</li><li style="width: 10%;font-weight: bold;padding-top: 5px;">预览</li><li style="width: 20%;font-weight: bold;padding-top: 5px;">操作</li>';
  112. for (var key in data) {
  113. var sn = data[key].url.lastIndexOf(".");
  114. var suffix = data[key].url.substring(sn + 1, data[key].url.length);
  115. var imgStr = "";
  116. if (suffix == "pdf" || suffix == "PDF") {
  117. imgStr = "<button type='button' onclick=\"Feng.showPdf('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i></button>";
  118. } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') {
  119. imgStr = "<button type='button' onclick=\"Feng.showExcel('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
  120. } else {
  121. imgStr = '<img class=\"imgUrl\" src=\"' + data[key].url + '\" style=\"width:25px;height:25px;\">';
  122. }
  123. html = html + '<li style="display: none">' + data[key].id + '</li>\n' +
  124. '<li style="width: 70%;padding-top: 5px;">' + data[key].orignName + '</li>\n' +
  125. '<li style="width: 10%;">' + imgStr + '</li>\n' +
  126. "<li style='width: 20%;padding-top: 2px;'><button type='button' onclick=\"Feng.downloadFile('" + data[key].id + "',1)\" style=\'margin-left: 5px\' class=\"btn btn-xs btn-success\"><i class=\"fa fa-download\" aria-hidden=\"true\"></i>下载</button></li>";
  127. }
  128. html = html + '</ul>';
  129. $detail.html(html);
  130. $(".imgs").viewer({
  131. // toolbar:false,
  132. fullscreen: false
  133. });
  134. }, function (data) {
  135. Feng.error("查询失败!" + data.responseJSON.message + "!");
  136. });
  137. var queryData = {};
  138. queryData["mainId"] = $("#id").val();
  139. queryData["fileTypeId"] = row.id;
  140. ajax.set(queryData);
  141. ajax.start();
  142. }
  143. });
  144. }
  145. /**
  146. * 初始化附件类别表的列
  147. */
  148. function initFileTypeColumn() {
  149. var title = [];
  150. title = [
  151. {field: 'selectItem', checkbox: false, visible: false},
  152. {title: '名称', field: 'name', visible: true, align: 'center', valign: 'middle', width: "52%", 'class': 'uitd_showTip',
  153. formatter: function (value, row, index) {
  154. if (row.must == 1) {
  155. return '<i class="fa fa-paste"></i><span style="font-weight:bold;color:red;font-size:14px;font-family:宋体"> * </span> ' + value;
  156. }
  157. if (row.must == 2) {
  158. return '<i class="fa fa-paste"></i>' + value;
  159. }
  160. }
  161. },
  162. {title: '模板', field: 'templateUrl', visible: true, align: 'center', valign: 'middle', width: "8%",
  163. formatter: function (value, row, index) {
  164. if (value == null || value == '' || value == 'null') {
  165. return '无';
  166. }
  167. return "<button type='button' onclick=\"Feng.downloadFile('" + value + "',3)\" style='margin-right: 10px' class=\"btn btn-xs btn-primary\">" +
  168. "<i class=\"fa fa-download\"></i>下载" +
  169. "</button>";
  170. }
  171. },
  172. {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle', width: "40%", 'class': 'uitd_showTip'},
  173. ]
  174. return title;
  175. }
  176. }();
  177. </script>
  178. {/block}