contract_view.html 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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['talentId'] = $("#id").val();
  73. queryData['type'] = $("#type").val();
  74. $("#fileTable").bootstrapTable({
  75. url: Feng.ctxPath + "/common/api/findContractFileType",
  76. method: 'POST',
  77. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  78. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  79. showRefresh: false, // 是否显示刷新按钮
  80. clickToSelect: true, // 是否启用点击选中行
  81. singleSelect: true, // 设置True 将禁止多选
  82. striped: true, // 是否显示行间隔色
  83. escape: true,
  84. pagination: false, // 设置为 true 会在表格底部显示分页条
  85. paginationHAlign: "left",
  86. paginationDetailHAlign: "right",
  87. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  88. showColumns: false,
  89. detailView: true, //是否显示父子表
  90. pageList: [10, 30, 50],
  91. queryParams: function (params) {
  92. return $.extend(queryData, params)
  93. },
  94. rowStyle: function (row, index) {
  95. return {classes: "info"};
  96. },
  97. columns: initFileTypeColumn(),
  98. onPostBody: function () {
  99. $("td.uitd_showTip").bind("mouseover", function () {
  100. var htm = $(this).html();
  101. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  102. });
  103. },
  104. onLoadSuccess: function (data) {
  105. $("#fileTable").bootstrapTable('expandAllRows');
  106. },
  107. onExpandRow: function (index, row, $detail) {
  108. var ajax = new $ax(Feng.ctxPath + "/common/api/listTalentFile", function (data) {
  109. if (data == null || data.length == 0) {
  110. return;
  111. }
  112. 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>';
  113. for (var key in data) {
  114. var sn = data[key].url.lastIndexOf(".");
  115. var suffix = data[key].url.substring(sn + 1, data[key].url.length);
  116. var imgStr = "";
  117. if (suffix == "pdf" || suffix == "PDF") {
  118. 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>";
  119. } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') {
  120. 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>";
  121. } else {
  122. imgStr = '<img class=\"imgUrl\" src=\"' + data[key].url + '\" style=\"width:25px;height:25px;\">';
  123. }
  124. html = html + '<li style="display: none">' + data[key].id + '</li>\n' +
  125. '<li style="width: 70%;padding-top: 5px;">' + data[key].orignName + '</li>\n' +
  126. '<li style="width: 10%;">' + imgStr + '</li>\n' +
  127. "<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>";
  128. }
  129. html = html + '</ul>';
  130. $detail.html(html);
  131. $(".imgs").viewer({
  132. // toolbar:false,
  133. fullscreen: false
  134. });
  135. }, function (data) {
  136. Feng.error("查询失败!" + data.responseJSON.message + "!");
  137. });
  138. var queryData = {};
  139. queryData["mainId"] = $("#id").val();
  140. queryData["fileTypeId"] = row.id;
  141. ajax.set(queryData);
  142. ajax.start();
  143. }
  144. });
  145. }
  146. /**
  147. * 初始化附件类别表的列
  148. */
  149. function initFileTypeColumn() {
  150. var title = [];
  151. title = [
  152. {field: 'selectItem', checkbox: false, visible: false},
  153. {title: '名称', field: 'name', visible: true, align: 'center', valign: 'middle', width: "52%", 'class': 'uitd_showTip',
  154. formatter: function (value, row, index) {
  155. if (row.must == 1) {
  156. return '<i class="fa fa-paste"></i><span style="font-weight:bold;color:red;font-size:14px;font-family:宋体"> * </span> ' + value;
  157. }
  158. if (row.must == 2) {
  159. return '<i class="fa fa-paste"></i>' + value;
  160. }
  161. }
  162. },
  163. {title: '模板', field: 'templateUrl', visible: true, align: 'center', valign: 'middle', width: "8%",
  164. formatter: function (value, row, index) {
  165. if (value == null || value == '' || value == 'null') {
  166. return '无';
  167. }
  168. return "<button type='button' onclick=\"Feng.downloadFile('" + value + "',3)\" style='margin-right: 10px' class=\"btn btn-xs btn-primary\">" +
  169. "<i class=\"fa fa-download\"></i>下载" +
  170. "</button>";
  171. }
  172. },
  173. {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle', width: "40%", 'class': 'uitd_showTip'},
  174. ]
  175. return title;
  176. }
  177. }();
  178. </script>
  179. {/block}