talentAllowanceInfo_info_supple.js 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527
  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 process = $("#process").val();
  29. var companyCode = $("#companyCode").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: "100px", 'class': 'uitd_showTip'},
  34. {title: '合同起始时间', field: 'startTime', visible: true, align: 'center', valign: 'middle', width: "90px", 'class': 'uitd_showTip'},
  35. {title: '合同截止时间', field: 'endTime', visible: true, align: 'center', valign: 'middle', width: "90px", 'class': 'uitd_showTip'},
  36. {title: '入职时间', field: 'entryTime', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
  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", 'class': 'uitd_showTip'},
  40. {title: '认定条件证书取得时间', field: 'identifyGetTime', visible: true, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'},
  41. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "150px",
  42. formatter: function (value, row, index) {
  43. var html = "";
  44. if (process == 1 && companyCode == CONFIG.COM_RSJ) {
  45. html = html + "<button type='button' onclick='TalentAllowanceInfoDlg.showEditContractModel(\"" + value + "\")' style='margin-right: 10px' class='btn btn-xs btn-info'>" +
  46. "<i class=\"fa fa-edit\"></i>修改" +
  47. "</button>";
  48. }
  49. html = html + "<button type='button' onclick='TalentAllowanceInfoDlg.showLog(\"" + value + "\")' style='margin-right: 10px' class='btn btn-xs btn-success'>" +
  50. "<i class=\"fa fa-book\"></i>日志" +
  51. "</button>";
  52. return html;
  53. }
  54. }
  55. ];
  56. } else {
  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", 'class': 'uitd_showTip'},
  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: "80px"},
  63. {title: '离职时间', field: 'quitTime', visible: true, align: 'center', valign: 'middle', width: "80px"},
  64. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "150px",
  65. formatter: function (value, row, index) {
  66. var html = "";
  67. if (process == 1) {
  68. html = html + "<button type='button' onclick='TalentAllowanceInfoDlg.showEditContractModel(\"" + value + "\")' style='margin-right: 10px' class='btn btn-xs btn-info'>" +
  69. "<i class=\"fa fa-edit\"></i>修改" +
  70. "</button>";
  71. }
  72. html = html + "<button type='button' onclick='TalentAllowanceInfoDlg.showLog(\"" + value + "\")' style='margin-right: 10px' 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 (enterpriseId) {
  83. var process = $("#process").val();
  84. return [
  85. {field: 'selectItem', checkbox: false, visible: false},
  86. {title: '核查项目名称', field: 'projectName', visible: true, align: 'center', valign: 'middle', width: "15%", 'class': 'uitd_showTip'},
  87. {title: '详情', field: 'months', visible: true, align: 'center', valign: 'middle', width: "40%", 'class': 'uitd_showTip',
  88. formatter: function (value, row, index) {
  89. var allowanceType = $("#allowanceType").val();
  90. var tmp = [];
  91. if (row.project == 4 && allowanceType == 2) {
  92. var dayArr = value ? value.split(",") : [];
  93. var totalDays = 0;
  94. for (var d = 0; d < dayArr.length; d++) {
  95. var kv = dayArr[d].split("=");
  96. if (kv[0] && kv[1]) {
  97. totalDays += parseInt(kv[1]);
  98. tmp.push(kv[0] + "月(" + kv[1] + "天)");
  99. }
  100. }
  101. tmp.push("共计" + totalDays + "天");
  102. } else {
  103. var monthArr = value ? value.split(",") : [];
  104. for (var d = 0; d < monthArr.length; d++) {
  105. if (monthArr[d]) {
  106. tmp.push(monthArr[d] + "月");
  107. }
  108. }
  109. }
  110. return tmp.join(",");
  111. }
  112. },
  113. {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle', width: "25%", 'class': 'uitd_showTip'},
  114. {title: '操作', field: 'project', visible: true, align: 'left', valign: 'middle', width: "20%",
  115. formatter: function (value, row, index) {
  116. var html = "";
  117. if (process == 1) {
  118. var companyCode = $("#companyCode").val();
  119. if (companyCode == CONFIG.COM_RSJ || companyCode == CONFIG.COM_IC) {
  120. if (value == 1) {
  121. html = html + "<button type='button' data-value='" + row.description + "' onclick=\"TalentAllowanceInfoDlg.showEditProjectModal('" + row.project + "','" + row.id + "','" + enterpriseId + "','" + row.months + "','" + row.days + "',this)\" style='margin-left: 5px;' class=\"btn btn-xs btn-danger\">" +
  122. "<i class=\"fa fa-edit\"></i>修改" +
  123. "</button>";
  124. }
  125. }
  126. if ((companyCode == CONFIG.COM_SWJ || companyCode == CONFIG.COM_RSJ) && value == 2) {
  127. html = html + "<button type='button' data-value='" + row.description + "' onclick=\"TalentAllowanceInfoDlg.showEditProjectModal('" + row.project + "','" + row.id + "','" + enterpriseId + "','" + row.months + "','" + row.days + "',this)\" style='margin-left: 5px;' class=\"btn btn-xs btn-danger\">" +
  128. "<i class=\"fa fa-edit\"></i>修改" +
  129. "</button>";
  130. }
  131. }
  132. if (process == 2 && (value == 3 || value == 4 || value == 5 || value == 6 || value == 7)) {
  133. html = html + "<button type='button' data-value='" + row.description + "' onclick=\"TalentAllowanceInfoDlg.showEditProjectModal('" + row.project + "','" + row.id + "','" + enterpriseId + "','" + row.months + "','" + row.days + "',this)\" style='margin-left: 5px;' class=\"btn btn-xs btn-danger\">" +
  134. "<i class=\"fa fa-edit\"></i>修改" +
  135. "</button>";
  136. }
  137. /*if (value == 1 || value == 2) {
  138. html = html + "<button type='button' onclick=\"TalentAllowanceInfoDlg.showFileTable('" + row.project + "')\" style='margin-left: 5px;' class=\"btn btn-xs btn-default\"><i class=\"fa fa-book\"></i>查看附件</button>";
  139. }*/
  140. if (Feng.isNotEmptyStr(row.fileUrl)) {
  141. html = html + "<button type='button' onclick=\"TalentAllowanceInfoDlg.downloadFileByUrl('" + row.fileUrl + "')\" style='margin-left: 5px;' class=\"btn btn-xs btn-success\"><i class=\"fa fa-download\"></i>下载</button>";
  142. }
  143. html = html +
  144. "<button type='button' onclick='TalentAllowanceInfoDlg.showLog(\"" + row.id + "\")' class='btn btn-xs btn-success' style='margin-left: 5px;'>" +
  145. "<i class=\"fa fa-book\"></i>日志" +
  146. "</button>";
  147. return html;
  148. }
  149. }
  150. ];
  151. }
  152. TalentAllowanceInfoDlg.showFileTable = function (project) {
  153. var api = (project == 1) ? CONFIG.jbt_concat : CONFIG.jbt_tax;
  154. var index = layer.open({
  155. type: 1,
  156. title: "附件材料",
  157. shade: 0,
  158. fixed: false,
  159. content: '<ul class="showImgs" style="padding: 0px 5px 0px 5px;"><li style="width: 80%;font-weight: bold;padding-top: 5px;">附件原名</li><li style="width: 10%;font-weight: bold;padding-top: 5px;">预览</li><li style="width: 10%;font-weight: bold;padding-top: 5px;">操作</li></ul>',
  160. area: ['50%', '50%'],
  161. maxmin: true,
  162. btn: ['<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  163. success: function (layero, index) {
  164. var ajax = new $ax(Feng.ctxPath + "/commmon/api/getTalentFileByApi?api=" + api + "&mainId=" + $("#id").val(), function (data) {
  165. if (data.code == 500) {
  166. Feng.error(data.msg);
  167. return;
  168. }
  169. var html = "";
  170. var files = data.obj;
  171. for (var key in files) {
  172. var sn = files[key].url.lastIndexOf(".");
  173. var suffix = files[key].url.substring(sn + 1, files[key].url.length);
  174. var imgStr = "";
  175. if (suffix == "pdf" || suffix == "PDF") {
  176. imgStr = "<button type='button' onclick=\"Feng.showPdf('" + files[key].url + "','" + files[key].id + "','" + files[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i></button>";
  177. } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') {
  178. imgStr = "<button type='button' onclick=\"Feng.showExcel('" + files[key].url + "','" + files[key].id + "','" + files[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
  179. } else {
  180. imgStr = '<img class=\"imgUrl\" src=\"' + files[key].url + '\" style=\"width:25px;height:25px;\">';
  181. }
  182. html = html + '<li style="display: none">' + files[key].id + '</li>\n' +
  183. '<li style="width: 80%;padding-top: 5px;">' + files[key].orignName + '</li>\n' +
  184. '<li style="width: 10%;">' + imgStr + '</li>\n' +
  185. "<li style='width: 10%;padding-top: 2px;'><button type='button' onclick=\"Feng.downloadFile('" + files[key].id + "',1)\" class=\"btn btn-xs btn-success\"><i class=\"fa fa-download\" aria-hidden=\"true\"></i>下载</button></li>";
  186. }
  187. $(".showImgs").append(html);
  188. $(".showImgs").viewer({
  189. fullscreen: false
  190. });
  191. });
  192. ajax.start();
  193. }
  194. });
  195. }
  196. /**
  197. * 初始化附件类别表的列
  198. */
  199. TalentAllowanceInfoDlg.initFileTypeColumn = function () {
  200. return [
  201. {field: 'selectItem', checkbox: false, visible: false},
  202. {title: '名称', field: 'name', visible: true, align: 'center', valign: 'middle', width: "52%", 'class': 'uitd_showTip',
  203. formatter: function (value, row, index) {
  204. if (row.must == 1) {
  205. return '<i class="fa fa-paste"></i><span style="font-weight:bold;color:red;font-size:14px;font-family:宋体"> * </span> ' + value;
  206. }
  207. if (row.must == 2) {
  208. return '<i class="fa fa-paste"></i>' + value;
  209. }
  210. }
  211. },
  212. {title: '模板', field: 'templateUrl', visible: true, align: 'center', valign: 'middle', width: "8%",
  213. formatter: function (value, row, index) {
  214. if (value == null || value == '' || value == 'null') {
  215. return '无';
  216. }
  217. return "<button type='button' onclick=\"Feng.downloadFile('" + value + "',3)\" style='margin-right: 10px' class=\"btn btn-xs btn-primary\">" +
  218. "<i class=\"fa fa-download\"></i>下载" +
  219. "</button>";
  220. }
  221. },
  222. {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle', width: "40%", 'class': 'uitd_showTip'},
  223. ]
  224. };
  225. TalentAllowanceInfoDlg.initArrangeColumn = function () {
  226. return [
  227. {field: 'selectItem', checkbox: false, visible: false},
  228. {title: '人才层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle', width: "100px"},
  229. {title: '认定条件', field: 'identifyConditionText', visible: true, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'},
  230. {title: '人才证书发证日期', field: 'startTime', visible: true, align: 'center', valign: 'middle', width: "100px"},
  231. {title: '人才证书有效期', field: 'endTime', visible: true, align: 'center', valign: 'middle', width: "100px"},
  232. {title: '忽略其他条件可享受月份', field: 'prepareMonths', visible: true, align: 'center', valign: 'middle', width: "150px", 'class': 'uitd_showTip'},
  233. {title: '综合可享受月份', field: 'months', visible: true, align: 'center', valign: 'middle', width: "150px", 'class': 'uitd_showTip'},
  234. {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle', width: "150px", 'class': 'uitd_showTip'},
  235. ]
  236. }
  237. TalentAllowanceInfoDlg.downloadFileByUrl = function (url) {
  238. window.location.href = Feng.ctxPath + "/common/api/downloadByUrl?url=" + url;
  239. }
  240. TalentAllowanceInfoDlg.showLog = function (id) {
  241. layer.open({
  242. type: 1,
  243. title: "日志",
  244. fixed: false,
  245. content: '<table id="' + id + '"></table>',
  246. area: ['80%', '80%'],
  247. maxmin: true,
  248. success: function (layero, index) {
  249. $('#' + id).bootstrapTable({
  250. url: Feng.ctxPath + "/common/api/getJbtCheckLog",
  251. method: 'POST',
  252. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  253. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  254. showRefresh: false, // 是否显示刷新按钮
  255. clickToSelect: true, // 是否启用点击选中行
  256. singleSelect: true, // 设置True 将禁止多选
  257. striped: true, // 是否显示行间隔色
  258. pagination: false, // 设置为 true 会在表格底部显示分页条
  259. paginationHAlign: "left",
  260. paginationDetailHAlign: "right",
  261. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  262. showColumns: false,
  263. queryParams: function (params) {
  264. return {"type": CONFIG.project_jbt, "mainId": $("#id").val(), "typeFileId": id, "active": 1}
  265. },
  266. columns:
  267. [
  268. {title: '步骤', field: 'stepName', visible: true, align: 'center', valign: 'middle', width: "10%",
  269. formatter: function (value, row, index) {
  270. return "" + value;
  271. }
  272. },
  273. {title: '操作人', field: 'createUser', visible: true, align: 'center', valign: 'middle', width: "15%"},
  274. {title: '操作时间', field: 'createTime', visible: true, align: 'center', valign: 'middle', width: "20%"},
  275. {title: '描述', field: 'description', visible: true, align: 'center', valign: 'middle', width: "45%",
  276. formatter: function (value, row, index) {
  277. return '<span data-toggle="tooltip" title="' + value + '">"' + value + '"</span>';
  278. }
  279. }
  280. ]
  281. ,
  282. onPostBody: function () {
  283. $('#' + id + "td.uitd_showTip").bind("mouseover", function () {
  284. var htm = $(this).html();
  285. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  286. });
  287. }
  288. });
  289. }
  290. });
  291. }
  292. //初始化附件类别表单
  293. TalentAllowanceInfoDlg.initFileTable = function () {
  294. TalentAllowanceInfoDlg.initContract();
  295. // Feng.showMiniFileModal(CONFIG.project_jbt,$("#type").val(),$("#id").val());
  296. var queryData = {};
  297. queryData['project'] = CONFIG.project_jbt;
  298. queryData['type'] = $("#type").val();
  299. queryData['allowanceType'] = $("#allowanceType").val();
  300. $("#fileTable").bootstrapTable({
  301. url: Feng.ctxPath + "/common/api/findCommonFileType",
  302. method: 'POST',
  303. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  304. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  305. showRefresh: false, // 是否显示刷新按钮
  306. clickToSelect: true, // 是否启用点击选中行
  307. singleSelect: true, // 设置True 将禁止多选
  308. striped: true, // 是否显示行间隔色
  309. escape: true,
  310. pagination: false, // 设置为 true 会在表格底部显示分页条
  311. paginationHAlign: "left",
  312. paginationDetailHAlign: "right",
  313. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  314. showColumns: false,
  315. detailView: true, //是否显示父子表
  316. pageList: [10, 30, 50],
  317. queryParams: function (params) {
  318. return $.extend(queryData, params)
  319. },
  320. rowStyle: function (row, index) {
  321. return {classes: "info"};
  322. },
  323. columns: TalentAllowanceInfoDlg.initFileTypeColumn(),
  324. onPostBody: function () {
  325. $("td.uitd_showTip").bind("mouseover", function () {
  326. var htm = $(this).html();
  327. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  328. });
  329. },
  330. onLoadSuccess: function (data) {
  331. $("#fileTable").bootstrapTable('expandAllRows');
  332. },
  333. onExpandRow: function (index, row, $detail) {
  334. var ajax = new $ax(Feng.ctxPath + "/common/api/listTalentFile", function (data) {
  335. if (data == null || data.length == 0) {
  336. return;
  337. }
  338. 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><li style="width: 10%;font-weight: bold;padding-top: 5px;">操作</li>';
  339. for (var key in data) {
  340. var sn = data[key].url.lastIndexOf(".");
  341. var suffix = data[key].url.substring(sn + 1, data[key].url.length);
  342. var imgStr = "";
  343. if (suffix == "pdf" || suffix == "PDF") {
  344. 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>";
  345. } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') {
  346. 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>";
  347. } else {
  348. imgStr = '<img class=\"imgUrl\" src=\"' + data[key].url + '\" style=\"width:25px;height:25px;\">';
  349. }
  350. html = html + '<li style="display: none">' + data[key].id + '</li>\n' +
  351. '<li style="width: 80%;padding-top: 5px;">' + data[key].orignName + '</li>\n' +
  352. '<li style="width: 10%;">' + imgStr + '</li>\n' +
  353. "<li style='width: 10%;padding-top: 2px;'><button type='button' onclick=\"Feng.downloadFile('" + data[key].id + "',1)\" class=\"btn btn-xs btn-success\"><i class=\"fa fa-download\" aria-hidden=\"true\"></i>下载</button></li>";
  354. }
  355. html = html + '</ul>';
  356. $detail.html(html);
  357. $(".imgs").viewer({
  358. // toolbar:false,
  359. fullscreen: false
  360. });
  361. }, function (data) {
  362. Feng.error("查询失败!" + data.responseJSON.message + "!");
  363. });
  364. var queryData = {};
  365. queryData["mainId"] = $("#id").val();
  366. queryData["fileTypeId"] = row.id;
  367. ajax.set(queryData);
  368. ajax.start();
  369. }
  370. });
  371. }
  372. //初始化通用附件
  373. TalentAllowanceInfoDlg.initCommonFileTable = function () {
  374. var queryData = {};
  375. queryData.id = $("#id").val();
  376. $("#commonFileTable").bootstrapTable({
  377. url: Feng.ctxPath + "/common/api/listTalentAllowanceCommonFile",
  378. method: 'POST',
  379. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  380. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  381. showRefresh: false, // 是否显示刷新按钮
  382. clickToSelect: true, // 是否启用点击选中行
  383. singleSelect: true, // 设置True 将禁止多选
  384. striped: true, // 是否显示行间隔色
  385. pagination: false, // 设置为 true 会在表格底部显示分页条
  386. paginationHAlign: "left",
  387. paginationDetailHAlign: "right",
  388. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  389. showColumns: false,
  390. queryParams: function (params) {
  391. return $.extend(queryData, params)
  392. },
  393. rowStyle: function (row, index) {
  394. return {css: {"word-break": "break-word", "white-space": "inherit"}}
  395. },
  396. columns: [
  397. {title: '附件原名', field: 'originalName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: '70%', formatter: function (value, row, index) {
  398. return value;
  399. }},
  400. {title: '预览', field: 'url', visible: true, align: 'center', valign: 'middle', width: "20%",
  401. formatter: function (value, row, index) {
  402. var sn = value.lastIndexOf(".");
  403. var suffix = value.substring(sn + 1, value.length);
  404. var imgStr = "";
  405. if (suffix == "pdf" || suffix == "PDF") {
  406. 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>";
  407. } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') {
  408. 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>";
  409. } else {
  410. imgStr = '<img class=\"cImgUrl\" src=\"' + value + '\" style=\"width:25px;height:25px;\">';
  411. }
  412. return imgStr;
  413. }
  414. },
  415. {title: '操作', field: 'url', visible: true, align: 'center', valign: 'middle', width: '10%',
  416. formatter: function (value, row, index) {
  417. return "";
  418. }
  419. }
  420. ],
  421. onPostBody: function () {
  422. $("td.uitd_showTip").bind("mouseover", function () {
  423. var htm = $(this).html();
  424. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  425. });
  426. $(".cImgUrl").viewer({fullscreen: false});
  427. }
  428. });
  429. }
  430. /**
  431. *
  432. */
  433. TalentAllowanceInfoDlg.createCheckHtml = function () {
  434. var process = $("#process").val();
  435. var companyCode = $("#companyCode").val();
  436. var html = "";
  437. switch (process) {
  438. case '1':
  439. html =
  440. '<form id="checkForm">\n' +
  441. '<div class="form-group" style="margin: 10px;">\n' +
  442. '<label for="checkState" class="control-label">审核状态</label>\n' +
  443. '<select class="form-control" id="checkStateModal" onchange="TalentAllowanceInfoDlg.toggleField()">\n' +
  444. '<option value=""></option>\n' +
  445. '<option value="3">审核通过</option>\n' +
  446. '<option value="2">审核驳回</option>\n' +
  447. '<option value="-1">审核不通过</option>\n' +
  448. '</select>\n' +
  449. '</div>\n' +
  450. '<div class="form-group" style="margin: 10px;">\n' +
  451. '<label for="checkMsg" class="control-label">审核意见</label>\n' +
  452. '<textarea class="form-control" id="checkMsg" rows="5"></textarea>\n' +
  453. '</div>\n' +
  454. '<div class="form-group" id="field" style="display: none;margin: 10px">\n';
  455. //if(companyCode == CONFIG.COM_RSJ || companyCode == CONFIG.COM_IC){
  456. html = html +
  457. '<label for="field_concat" class="control-label">可修改合同时间</label>\n' +
  458. '<div id="field_concat">\n' +
  459. '</div>\n' +
  460. '<label for="field_project" class="control-label">可修改字段</label>\n' +
  461. '<div id="field_field">\n' +
  462. '<ul><li style="width: 100%"><input type="checkbox" value="allowanceType"><span>津补贴类型</span></li></ul>\n' +
  463. '<!--<li style="width: 100%"><input type="checkbox" value="wage"><span>上一年度年薪(元)</span></li>--></ul>\n' +
  464. '</div>\n';
  465. //}
  466. html = html +
  467. '<label for="field_project" class="control-label">可修改项目</label>\n' +
  468. '<div id="field_project">\n' +
  469. '</div>\n' +
  470. '<label for="field_file" class="control-label">可修改附件</label>\n' +
  471. '<div id="field_file">\n' +
  472. '</div>\n' +
  473. '<div class="form-group" style="text-align: center">\n' +
  474. '<button type="button" class="btn btn-primary" onclick="TalentAllowanceInfoDlg.checkAll(\'field\')">全选</button>\n' +
  475. '<button type="button" class="btn btn-success" onclick="TalentAllowanceInfoDlg.unCheckAll(\'field\')">反选</button>\n' +
  476. '</div>\n' +
  477. '</div>\n' +
  478. '</form>';
  479. break;
  480. case '3':
  481. html =
  482. '<form id="checkForm">\n' +
  483. '<div class="form-group" style="margin: 10px;">\n' +
  484. '<label for="checkState" class="control-label">审核状态</label>\n' +
  485. '<select class="form-control" id="checkStateModal" onchange="TalentAllowanceInfoDlg.toggleField()">\n' +
  486. '<option value=""></option>\n' +
  487. '<option value="3">审核通过</option>\n' +
  488. '<option value="2">审核驳回</option>\n' +
  489. '<option value="-1">审核不通过</option>\n' +
  490. '</select>\n' +
  491. '</div>\n' +
  492. '<div class="form-group" style="margin: 10px;">\n' +
  493. '<label for="checkMsg" class="control-label">审核意见</label>\n' +
  494. '<textarea class="form-control" id="checkMsg" rows="5"></textarea>\n' +
  495. '</div>\n' +
  496. '</form>';
  497. break;
  498. }
  499. return html;
  500. }
  501. TalentAllowanceInfoDlg.processChange = function (content) {
  502. var process = $(content).val();
  503. var checkStateModal = $("#checkStateModal").val();
  504. if (process == 1 && checkStateModal == 2) {
  505. $("#toDepDiv").css("display", "block");
  506. $('#toDep').chosen({width: '100%', placeholder_text_multiple: '请选择驳回单位'});
  507. } else {
  508. $("#toDepDiv").css("display", "none");
  509. }
  510. }