contract_view.html 8.7 KB

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