talentAllowanceInfo_select.js 20 KB

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