talentAllowance_info_supple.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. //回调
  2. TalentAllowanceInfoDlg.callBack = function (data){
  3. layer.close(data.obj);
  4. Feng.info(data.msg);
  5. if (data.code == 200) {
  6. $("#fileTable").bootstrapTable("refresh", {});
  7. }
  8. }
  9. //全选
  10. TalentAllowanceInfoDlg.checkAll = function (id) {
  11. $("#"+id+" input").each(function () {
  12. $(this).iCheck("check");
  13. })
  14. }
  15. //反选
  16. TalentAllowanceInfoDlg.unCheckAll = function (id) {
  17. $("#"+id+" input").each(function () {
  18. if(this.checked){
  19. $(this).iCheck("uncheck");
  20. }else{
  21. $(this).iCheck("check");
  22. }
  23. })
  24. }
  25. //初始化工作单位表的列
  26. TalentAllowanceInfoDlg.initContractColumns = function(){
  27. var type = $("#type").val();
  28. var checkState = $("#checkState").val();
  29. var concats = $("#concats").val();
  30. if(type==1){
  31. return [
  32. {field: 'selectItem', checkbox:false,visible:false},
  33. {title: '企业名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  34. {title: '合同起始时间', field: 'startTime', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  35. {title: '合同截止时间', field: 'endTime', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  36. {title: '入职时间', field: 'entryTime', visible: true, align: 'center', valign: 'middle',width:"100px"},
  37. {title: '离职时间(未离职则模拟离职)', field: 'quitTime', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'},
  38. {title: '人才标签', field: 'talentTypeName', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'},
  39. {title: '首次来晋行政介绍信时间', field: 'letterTime', visible: true, align: 'center', valign: 'middle',width:"120px"},
  40. {title: '操作', field: 'id', visible: true, align: 'left', valign: 'middle',width:"120px",
  41. formatter : function(value,row,index){
  42. var html = "";
  43. if(checkState == 1 || (checkState == 10 && concats.indexOf(value)!=-1) ){
  44. html = html + "<button type='button' onclick='TalentAllowanceInfoDlg.showEditContractModel(\""+value+"\")' style='margin-left: 5px' class='btn btn-xs btn-danger'>" +
  45. "<i class=\"fa fa-edit\"></i>修改" +
  46. "</button>";
  47. }
  48. html = html + "<button type='button' onclick='TalentAllowanceInfoDlg.showLog(\""+row.id+"\")' style='margin-left: 5px' class='btn btn-xs btn-success'>" +
  49. "<i class=\"fa fa-book\"></i>日志" +
  50. "</button>";
  51. return html;
  52. }
  53. }
  54. ];
  55. }
  56. if(type==2){
  57. return [
  58. {field: 'selectItem', checkbox:false,visible:false},
  59. {title: '企业名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  60. {title: '合同起始时间', field: 'startTime', visible: true, align: 'center', valign: 'middle',width:"120px"},
  61. {title: '合同截止时间', field: 'endTime', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  62. {title: '入职时间', field: 'entryTime', visible: true, align: 'center', valign: 'middle',width:"100px"},
  63. {title: '离职时间(未离职则模拟离职)', field: 'quitTime', visible: true, align: 'center', valign: 'middle',width:"100px"},
  64. {title: '操作', field: 'id', visible: true, align: 'left', valign: 'middle',width:"120px",
  65. formatter : function(value,row,index){
  66. var html = "";
  67. if(checkState == 1 || (checkState == 10 && concats.indexOf(value)!=-1) ){
  68. html = html + "<button type='button' onclick='TalentAllowanceInfoDlg.showEditContractModel(\""+value+"\")' style='margin-left: 5px' class='btn btn-xs btn-danger'>" +
  69. "<i class=\"fa fa-edit\"></i>修改" +
  70. "</button>";
  71. }
  72. html = html + "<button type='button' onclick='TalentAllowanceInfoDlg.showLog(\""+row.id+"\")' style='margin-left: 5px' class='btn btn-xs btn-success'>" +
  73. "<i class=\"fa fa-book\"></i>日志" +
  74. "</button>";
  75. return html;
  76. }
  77. }
  78. ];
  79. }
  80. }
  81. //初始化项目表的列
  82. TalentAllowanceInfoDlg.initProjectColumns = function () {
  83. return [
  84. {field: 'selectItem', checkbox:false,visible:false},
  85. {title: '核查项目名称', field: 'projectName', visible: true, align: 'center', valign: 'middle',width:"15%",'class': 'uitd_showTip'},
  86. {title: '详情', field: 'months', visible: true, align: 'center', valign: 'middle',width:"35%",
  87. formatter : function(value,row,index){
  88. if(value!=null && value!=''){
  89. return value;
  90. }else if(row.days!=null && row.days!=''){
  91. return row.days + "天";
  92. }else{
  93. return "";
  94. }
  95. }
  96. },
  97. {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle',width:"35%",'class': 'uitd_showTip'},
  98. {title: '操作', field: 'project', visible: true, align: 'left', valign: 'middle',width:"15%",
  99. formatter : function(value,row,index){
  100. var butHtml = "";
  101. if(row.isEdit == 1){
  102. butHtml = butHtml + "<button type='button' data-value='"+row.description+"' onclick=\"TalentAllowanceInfoDlg.showEditProjectModal('"+row.project+"','"+row.id+"','"+row.enterpriseId+"','"+row.months+"','"+row.days+"',this)\" style='margin-left: 5px' class=\"btn btn-xs btn-danger tips\">" +
  103. "<i class=\"fa fa-edit\"></i>修改</button>";
  104. }
  105. butHtml = butHtml +"<button type='button' onclick='TalentAllowanceInfoDlg.showLog(\""+row.id+"\")' style='margin-left: 5px' class='btn btn-xs btn-success'><i class=\"fa fa-book\"></i>日志</button>";
  106. return butHtml;
  107. }
  108. }
  109. ];
  110. }
  111. /**
  112. * 初始化附件类别表的列
  113. */
  114. TalentAllowanceInfoDlg.initFileTypeColumn = function () {
  115. return [
  116. {field: 'selectItem', checkbox:false,visible:false},
  117. {title: '名称', field: 'name', visible: true, align: 'center', valign: 'middle',width:"30%",'class': 'uitd_showTip',
  118. formatter : function(value,row,index){
  119. if(row.must==1){
  120. return '<i class="fa fa-paste"></i><span style="font-weight:bold;color:red;font-size:14px;font-family:宋体"> * </span> '+ value;
  121. }if(row.must==2){
  122. return '<i class="fa fa-paste"></i>'+value;
  123. }
  124. }
  125. },
  126. {title: '模板', field: 'templateUrl', visible: true, align: 'center', valign: 'middle',width:"8%",
  127. formatter : function(value,row,index){
  128. if(value==null||value==''||value=='null'){
  129. return '无';
  130. }
  131. return "<button type='button' onclick=\"Feng.downloadFile('"+row.id+"',3)\" style='margin-right: 10px' class=\"btn btn-xs btn-primary\">" +
  132. "<i class=\"fa fa-download\"></i>下载" +
  133. "</button>";
  134. }
  135. },
  136. {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle',width:"52%",'class': 'uitd_showTip'},
  137. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle',width:"10%",
  138. formatter : function(value,row,index){
  139. var files = $("#files").val();
  140. var checkState = $("#checkState").val();
  141. if(checkState==1 || (checkState==10 && files.indexOf(row.id)!=-1)){
  142. return "<button type='button' onclick=\"TalentAllowanceInfoDlg.checkFile(this,'"+value+"','"+null+"')\" style='margin-right: 10px' class=\"btn btn-xs btn-info\">" +
  143. "<i class=\"fa fa-upload\"></i>添加" +
  144. "</button>" ;
  145. }else{
  146. return "" ;
  147. }
  148. }
  149. }
  150. ]
  151. };
  152. TalentAllowanceInfoDlg.showLog = function (id) {
  153. layer.open({
  154. type: 1,
  155. title:"日志",
  156. fixed:false,
  157. content: '<table id="'+id+'"></table>',
  158. area: ['80%', '80%'],
  159. maxmin: true,
  160. success :function (layero, index) {
  161. $('#'+id).bootstrapTable({
  162. url: Feng.ctxPath + "/api/talentChecklog/getJbtCheckLog",
  163. method: 'POST',
  164. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  165. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  166. showRefresh: false, // 是否显示刷新按钮
  167. clickToSelect: true, // 是否启用点击选中行
  168. singleSelect: true, // 设置True 将禁止多选
  169. striped: true, // 是否显示行间隔色
  170. pagination: false, // 设置为 true 会在表格底部显示分页条
  171. paginationHAlign: "left",
  172. paginationDetailHAlign: "right",
  173. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  174. showColumns: false,
  175. queryParams: function (params) {
  176. return {"type":CONFIG.project_jbt,"mainId":$("#id").val(),"typeFileId":id,"active":1}
  177. },
  178. columns:
  179. [
  180. {title: '步骤', field: 'stepName', visible: true, align: 'center', valign: 'middle',width:"10%",
  181. formatter : function (value,row,index) {
  182. return ""+value;
  183. }
  184. },
  185. {title: '操作人', field: 'createUser', visible: true, align: 'center', valign: 'middle',width:"15%"},
  186. {title: '操作时间', field: 'createTime', visible: true, align: 'center', valign: 'middle',width:"20%"},
  187. {title: '描述', field: 'description', visible: true, align: 'center', valign: 'middle',width:"45%",
  188. formatter : function (value,row,index) {
  189. return '<span data-toggle="tooltip" title="'+ value +'">"'+value+'"</span>';
  190. }
  191. }
  192. ]
  193. ,
  194. onPostBody: function () {
  195. $('#'+id+"td.uitd_showTip").bind("mouseover", function () {
  196. var htm = $(this).html();
  197. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  198. });
  199. }
  200. });
  201. }
  202. });
  203. }