talentAllowanceInfo_select.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  1. /**
  2. * 初始化人才认定申报详情对话框
  3. */
  4. var TalentAllowanceInfoDlg = {
  5. talentAllowanceData : {},
  6. validateFields: {
  7. talentId: {validators: {notEmpty: {message: '申报对象不能为空' }}}
  8. }
  9. };
  10. //初始化附件类别表单
  11. TalentAllowanceInfoDlg.initFileTable = function (){
  12. TalentAllowanceInfoDlg.initContract();
  13. var queryData = {};
  14. queryData['project'] = CONFIG.project_jbt;
  15. queryData['type'] = $("#type").val();
  16. queryData['allowanceType'] = $("#allowanceType").val();
  17. $("#fileTable").bootstrapTable({
  18. url: Feng.ctxPath + "/common/api/findCommonFileType",
  19. method: 'POST',
  20. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  21. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  22. showRefresh: false, // 是否显示刷新按钮
  23. clickToSelect: true, // 是否启用点击选中行
  24. singleSelect: true, // 设置True 将禁止多选
  25. striped: true, // 是否显示行间隔色
  26. escape: true,
  27. pagination: false, // 设置为 true 会在表格底部显示分页条
  28. paginationHAlign: "left",
  29. paginationDetailHAlign: "right",
  30. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  31. showColumns: false,
  32. detailView: true, //是否显示父子表
  33. pageList: [10, 30, 50],
  34. queryParams: function (params) {
  35. return $.extend(queryData,params)
  36. },
  37. rowStyle: function (row, index) {
  38. return {classes:"info"};
  39. },
  40. columns: TalentAllowanceInfoDlg.initFileTypeColumn(),
  41. onPostBody: function () {
  42. $("td.uitd_showTip").bind("mouseover", function () {
  43. var htm = $(this).html();
  44. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  45. });
  46. },
  47. onLoadSuccess: function (data) {
  48. $("#fileTable").bootstrapTable('expandAllRows');
  49. },
  50. onExpandRow: function (index, row, $detail) {
  51. var ajax = new $ax(Feng.ctxPath + "/common/api/listTalentFile", function (data) {
  52. if(data==null||data.length==0){
  53. return;
  54. }
  55. var html = '<ul class="imgs"><li style="width: 80%;font-weight: bold;padding-top: 5px;">附件原名</li><li style="width: 10%;font-weight: bold;padding-top: 5px;">预览</li>';
  56. for(var key in data){
  57. var sn = data[key].url.lastIndexOf(".");
  58. var suffix = data[key].url.substring(sn+1,data[key].url.length);
  59. var imgStr = "";
  60. if(suffix=="pdf"||suffix=="PDF"){
  61. 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>";
  62. }else if(suffix == "xlsx" || suffix=="XLSX" || suffix == 'xls' || suffix == 'XLS'){
  63. 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>";
  64. }else{
  65. imgStr = '<img class=\"imgUrl\" src=\"'+data[key].url+'\" style=\"width:25px;height:25px;\">';
  66. }
  67. html = html + '<li style="display: none">'+data[key].id+'</li>\n'+
  68. '<li style="width: 80%;padding-top: 5px;">'+data[key].orignName+'</li>\n'+
  69. '<li style="width: 10%;">'+imgStr+'</li>\n';
  70. }
  71. html = html + '</ul>';
  72. $detail.html(html);
  73. $(".imgs").viewer({
  74. fullscreen:false
  75. });
  76. }, function (data) {
  77. Feng.error("查询失败!" + data.responseJSON.message + "!");
  78. });
  79. var queryData = {};
  80. queryData["mainId"] = $("#id").val();
  81. queryData["fileTypeId"] = row.id;
  82. ajax.set(queryData);
  83. ajax.start();
  84. }
  85. });
  86. TalentAllowanceInfoDlg.initCommonFileTable();
  87. }
  88. //初始化通用附件
  89. TalentAllowanceInfoDlg.initCommonFileTable = function () {
  90. var queryData = {};
  91. queryData.id = $("#id").val();
  92. $("#commonFileTable").bootstrapTable({
  93. url: Feng.ctxPath + "/common/api/listTalentAllowanceCommonFile",
  94. method: 'POST',
  95. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  96. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  97. showRefresh: false, // 是否显示刷新按钮
  98. clickToSelect: true, // 是否启用点击选中行
  99. singleSelect: true, // 设置True 将禁止多选
  100. striped: true, // 是否显示行间隔色
  101. pagination: false, // 设置为 true 会在表格底部显示分页条
  102. paginationHAlign: "left",
  103. paginationDetailHAlign: "right",
  104. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  105. showColumns: false,
  106. queryParams: function (params) {
  107. return $.extend(queryData, params)
  108. },
  109. rowStyle: function (row, index) {
  110. return {css: {"word-break": "break-word", "white-space": "inherit"}}
  111. },
  112. columns: [
  113. {title: '附件原名', field: 'originalName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: '70%', formatter: function (value, row, index) {
  114. return value;
  115. }},
  116. {title: '预览', field: 'url', visible: true, align: 'center', valign: 'middle',width: "20%",
  117. formatter: function (value, row, index) {
  118. var sn = value.lastIndexOf(".");
  119. var suffix = value.substring(sn + 1, value.length);
  120. var imgStr = "";
  121. if (suffix == "pdf" || suffix == "PDF") {
  122. imgStr = "<button type='button' onclick=\"Feng.showPdf('" + value + "','" + row.id + "','" + row.originalName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i></button>";
  123. } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') {
  124. imgStr = "<button type='button' onclick=\"Feng.showExcel('" + value + "','" + row.id + "','" + row.originalName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
  125. } else {
  126. imgStr = '<img class=\"cImgUrl\" src=\"' + value + '\" style=\"width:25px;height:25px;\">';
  127. }
  128. return imgStr;
  129. }
  130. },
  131. {title: '操作', field: 'url', visible: true, align: 'center', valign: 'middle', width: '10%',
  132. formatter: function (value, row, index) {
  133. return "";
  134. }
  135. }
  136. ],
  137. onPostBody: function () {
  138. $("td.uitd_showTip").bind("mouseover", function () {
  139. var htm = $(this).html();
  140. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  141. });
  142. $(".cImgUrl").viewer({fullscreen: false});
  143. }
  144. });
  145. }
  146. /**
  147. * 初始化工作单位及核查项目情况表
  148. */
  149. TalentAllowanceInfoDlg.initContract = function(){
  150. $("#projectTable").bootstrapTable("destroy",{});
  151. $("#projectTable").bootstrapTable({
  152. url: Feng.ctxPath + "/enterprise/talentAllowance/findAllowanceContractDetail",
  153. method: 'POST',
  154. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  155. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  156. showRefresh: false, // 是否显示刷新按钮
  157. clickToSelect: true, // 是否启用点击选中行
  158. singleSelect: true, // 设置True 将禁止多选
  159. striped: true, // 是否显示行间隔色
  160. escape: true,
  161. pagination: false, // 设置为 true 会在表格底部显示分页条
  162. paginationHAlign: "left",
  163. paginationDetailHAlign: "right",
  164. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  165. showColumns: false,
  166. detailView: true,//父子表
  167. queryParams: function (params) {
  168. return $.extend({"mainId":$("#id").val()},params)
  169. },
  170. columns: TalentAllowanceInfoDlg.initContractColumns(),
  171. onPostBody: function () {
  172. $("td.uitd_showTip").bind("mouseover", function () {
  173. var htm = $(this).html();
  174. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  175. });
  176. },
  177. onLoadSuccess: function (data) {
  178. $("#projectTable").bootstrapTable('expandAllRows');
  179. },
  180. onExpandRow: function (index, row, $detail) {
  181. var enterpriseId = row.enterpriseId;
  182. var cur_table = $detail.html('<table id="'+enterpriseId+'" class="mytable-hover"></table>').find('table');
  183. $(cur_table).bootstrapTable("destroy",{});
  184. $(cur_table).bootstrapTable({
  185. url: Feng.ctxPath + "/enterprise/talentAllowance/findAllowanceProject",
  186. method: 'POST',
  187. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  188. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  189. showRefresh: false, // 是否显示刷新按钮
  190. clickToSelect: true, // 是否启用点击选中行
  191. singleSelect: true, // 设置True 将禁止多选
  192. escape: true,
  193. pagination: false, // 设置为 true 会在表格底部显示分页条
  194. paginationHAlign: "left",
  195. paginationDetailHAlign: "right",
  196. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  197. showColumns: false,
  198. queryParams: function (params) {
  199. return $.extend({"mainId":$("#id").val(),"baseId":row.id},params)
  200. },
  201. columns: TalentAllowanceInfoDlg.initProjectColumns(),
  202. });
  203. }
  204. });
  205. }
  206. //初始化工作单位表的列
  207. TalentAllowanceInfoDlg.initContractColumns = function(){
  208. var type = $("#type").val();
  209. if(type==1){
  210. return [
  211. {field: 'selectItem', checkbox:false,visible:false},
  212. {title: '企业名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  213. {title: '合同起始时间', field: 'startTime', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  214. {title: '合同截止时间', field: 'endTime', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  215. {title: '入职时间', field: 'entryTime', visible: true, align: 'center', valign: 'middle',width:"100px"},
  216. {title: '离职时间', field: 'quitTime', visible: true, align: 'center', valign: 'middle',width:"100px"},
  217. {title: '人才标签', field: 'talentTypeName', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'},
  218. {title: '首次来晋行政介绍信时间', field: 'letterTime', visible: true, align: 'center', valign: 'middle',width:"120px"},
  219. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle',width:"120px",
  220. formatter : function(value,row,index){
  221. return "<button type='button' onclick='TalentAllowanceInfoDlg.showLog(\""+row.id+"\")' style='margin-right: 10px' class='btn btn-xs btn-success'>" +
  222. "<i class=\"fa fa-book\"></i>日志" +
  223. "</button>";
  224. }
  225. }
  226. ];
  227. }
  228. if(type==2){
  229. return [
  230. {field: 'selectItem', checkbox:false,visible:false},
  231. {title: '企业名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  232. {title: '合同起始时间', field: 'startTime', visible: true, align: 'center', valign: 'middle',width:"120px"},
  233. {title: '合同截止时间', field: 'endTime', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  234. {title: '入职时间', field: 'entryTime', visible: true, align: 'center', valign: 'middle',width:"100px"},
  235. {title: '离职时间', field: 'quitTime', visible: true, align: 'center', valign: 'middle',width:"100px"},
  236. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle',width:"120px",
  237. formatter : function(value,row,index){
  238. return "<button type='button' onclick='TalentAllowanceInfoDlg.showLog(\""+row.id+"\")' style='margin-right: 10px' class='btn btn-xs btn-success'>" +
  239. "<i class=\"fa fa-book\"></i>日志" +
  240. "</button>"
  241. }
  242. }
  243. ];
  244. }
  245. }
  246. //初始化项目表的列
  247. TalentAllowanceInfoDlg.initProjectColumns = function () {
  248. return [
  249. {field: 'selectItem', checkbox:false,visible:false},
  250. {title: '核查项目名称', field: 'projectName', visible: true, align: 'center', valign: 'middle',width:"15%",'class': 'uitd_showTip'},
  251. {title: '详情', field: 'months', visible: true, align: 'center', valign: 'middle',width:"35%",
  252. formatter : function(value,row,index){
  253. if(value!=null && value!=''){
  254. return value;
  255. }else if(row.days!=null && row.days!=''){
  256. return row.days + "天";
  257. }else{
  258. return "";
  259. }
  260. }
  261. },
  262. {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle',width:"35%",'class': 'uitd_showTip'},
  263. {title: '操作', field: 'project', visible: true, align: 'center', valign: 'middle',width:"15%",
  264. formatter : function(value,row,index){
  265. return "<button type='button' onclick='TalentAllowanceInfoDlg.showLog(\""+row.id+"\")' style='margin-right: 10px' class='btn btn-xs btn-success'><i class=\"fa fa-book\"></i>日志</button>";
  266. }
  267. }
  268. ];
  269. }
  270. /**
  271. * 初始化附件类别表的列
  272. */
  273. TalentAllowanceInfoDlg.initFileTypeColumn = function () {
  274. return [
  275. {field: 'selectItem', checkbox:false,visible:false},
  276. {title: '名称', field: 'name', visible: true, align: 'center', valign: 'middle',width:"30%",'class': 'uitd_showTip',
  277. formatter : function(value,row,index){
  278. if(row.must==1){
  279. return '<i class="fa fa-paste"></i><span style="font-weight:bold;color:red;font-size:14px;font-family:宋体"> * </span> '+ value;
  280. }if(row.must==2){
  281. return '<i class="fa fa-paste"></i>'+value;
  282. }
  283. }
  284. },
  285. {title: '模板', field: 'templateUrl', visible: true, align: 'center', valign: 'middle',width:"8%",
  286. formatter : function(value,row,index){
  287. if(value==null||value==''||value=='null'){
  288. return '无';
  289. }
  290. return "<button type='button' onclick=\"Feng.downloadFile('"+row.id+"',3)\" style='margin-right: 10px' class=\"btn btn-xs btn-primary\">" +
  291. "<i class=\"fa fa-download\"></i>下载" +
  292. "</button>";
  293. }
  294. },
  295. {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle',width:"52%",'class': 'uitd_showTip'},
  296. ]
  297. };
  298. TalentAllowanceInfoDlg.showLog = function (id) {
  299. layer.open({
  300. type: 1,
  301. title:"日志",
  302. fixed:false,
  303. content: '<table id="'+id+'"></table>',
  304. area: ['80%', '80%'],
  305. maxmin: true,
  306. success :function (layero, index) {
  307. $('#'+id).bootstrapTable({
  308. url: Feng.ctxPath + "/common/api/getJbtCheckLog",
  309. method: 'POST',
  310. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  311. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  312. showRefresh: false, // 是否显示刷新按钮
  313. clickToSelect: true, // 是否启用点击选中行
  314. singleSelect: true, // 设置True 将禁止多选
  315. striped: true, // 是否显示行间隔色
  316. pagination: false, // 设置为 true 会在表格底部显示分页条
  317. paginationHAlign: "left",
  318. paginationDetailHAlign: "right",
  319. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  320. showColumns: false,
  321. queryParams: function (params) {
  322. return {"type":CONFIG.project_jbt,"mainId":$("#id").val(),"typeFileId":id,"active":1}
  323. },
  324. columns:
  325. [
  326. {title: '步骤', field: 'stepName', visible: true, align: 'center', valign: 'middle',width:"10%",
  327. formatter : function (value,row,index) {
  328. return ""+value;
  329. }
  330. },
  331. {title: '操作人', field: 'createUser', visible: true, align: 'center', valign: 'middle',width:"15%"},
  332. {title: '操作时间', field: 'createTime', visible: true, align: 'center', valign: 'middle',width:"20%"},
  333. {title: '描述', field: 'description', visible: true, align: 'center', valign: 'middle',width:"45%",
  334. formatter : function (value,row,index) {
  335. return '<span data-toggle="tooltip" title="'+ value +'">"'+value+'"</span>';
  336. }
  337. }
  338. ]
  339. ,
  340. onPostBody: function () {
  341. $('#'+id+"td.uitd_showTip").bind("mouseover", function () {
  342. var htm = $(this).html();
  343. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  344. });
  345. }
  346. });
  347. }
  348. });
  349. }
  350. //回调
  351. TalentAllowanceInfoDlg.callBack = function (data){
  352. layer.close(data.obj);
  353. Feng.info(data.msg);
  354. if (data.code == 200) {
  355. var ajax = new $ax(Feng.ctxPath + "/enterprise/talentAllowance/updateSuppleState", function(data){
  356. if(data.code == 200){
  357. }else{
  358. }
  359. },function(data){
  360. Feng.error("修改失败!" + data.responseJSON.message + "!");
  361. });
  362. ajax.set("id",$("#id").val());
  363. ajax.start();
  364. $("#fileTable").bootstrapTable("refresh", {});
  365. }
  366. }
  367. TalentAllowanceInfoDlg.showAllLog = function(){
  368. var id = $("#id").val();
  369. if(Feng.isNotEmptyStr(id)){
  370. Feng.getCheckLog("logTable",{"type":CONFIG.project_jbt,"mainId":id,"typeFileId":"","active":1})
  371. }
  372. }
  373. $(function() {
  374. Feng.initValidatorTip("talentAllowanceForm",TalentAllowanceInfoDlg.validateFields);
  375. Feng.addAjaxSelect({
  376. "id": 'name',
  377. "displayCode": "id",
  378. "displayName": "name",
  379. "type": "GET",
  380. "url": Feng.ctxPath + "/enterprise/talent/findTalentByEnterpriseInLibrary?type=1&year="+$("#year").val()
  381. });
  382. if($("#type").val()==2){
  383. $("#bankNumberSpan,#talentTypeSpan,#introductionModeSpan,#firstInJJTimeSpan").attr("style","display:none");
  384. }
  385. if ($("#allowanceType").val() == 1) {
  386. //$("#wageDiv").css("display", "block");
  387. }
  388. //批量加载时间控件
  389. $(".date").each(function(){
  390. laydate.render({elem: "#"+$(this).attr("id"),type: 'date',trigger: 'click'});
  391. });
  392. $("select").each(function () {
  393. $(this).val($(this).attr("value"));
  394. });
  395. TalentAllowanceInfoDlg.showAllLog();
  396. });