IntegralLog.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. /**
  2. * 积分记录
  3. */
  4. var IntegralVerify = {
  5. id: "IntegralLogTable", //表格id
  6. seItem: null, //选中的条目
  7. table: null,
  8. layerIndex: -1
  9. };
  10. IntegralVerify.formParams = function () {
  11. var queryData = {};
  12. queryData['card_type'] = $("#card_type").val();
  13. queryData['card_number'] = $("#card_number").val();
  14. queryData['apply_year'] = $("#apply_year").val();
  15. queryData['enterprise_id'] = $("#enterprise_id").val();
  16. queryData['shareholder'] = $("#shareholder").val();
  17. return queryData;
  18. }
  19. /**
  20. * 初始化表格的列
  21. */
  22. IntegralVerify.initColumn = function () {
  23. var type = $("#type").val();
  24. return [
  25. {field: 'selectItem', radio: true},
  26. {title: '积分来源', field: 'mainType', visible: true, align: 'center', valign: 'middle', width: '80px',
  27. formatter: function (value, row, index) {
  28. switch (value) {
  29. case "integral":
  30. return "积分申报";
  31. case "talent":
  32. return "人才申报";
  33. case "talentTypeChange":
  34. return "人才层次变更";
  35. default:
  36. return "未分类";
  37. }
  38. }
  39. },
  40. {title: '申报年度', field: 'apply_year', visible: true, align: 'center', valign: 'middle', width: '80px'},
  41. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: "100px",
  42. formatter: function (value, row, index) {
  43. if (row.sex == 1) {
  44. return value + '<span style="color:#6495ED">【男】</span>';
  45. } else if (row.sex == 2) {
  46. return value + '<span style="color:#FF82AB">【女】</span>';
  47. } else {
  48. return value;
  49. }
  50. }
  51. },
  52. {title: '证件号码', field: 'card_number', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
  53. {title: '所属单位', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle', width: "100px"},
  54. {title: '是否股东', field: 'shareholder', visible: true, align: 'center', valign: 'middle', width: "100px",
  55. formatter: function (value, row, index) {
  56. if (value == 1) {
  57. return '是';
  58. }
  59. if (value == 2) {
  60. return '否';
  61. }
  62. }
  63. },
  64. {title: '申报标准', field: 'details', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
  65. {title: '上次积分', field: 'lastPoints', visible: true, align: 'center', valign: 'middle', width: "100px",
  66. formatter: function (value, row, index) {
  67. return value;
  68. }
  69. },
  70. {title: '增加积分', field: 'gainPoints', visible: true, align: 'center', valign: 'middle', width: "100px",
  71. formatter: function (value, row, index) {
  72. return value;
  73. }
  74. },
  75. {title: '当前积分', field: 'nowPoints', visible: true, align: 'center', valign: 'middle', width: "100px",
  76. formatter: function (value, row, index) {
  77. return value;
  78. }
  79. },
  80. {title: '首次提交时间', field: 'first_submit_time', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  81. {title: '积分获得时间', field: 'createTime', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  82. {title: '操作', field: 'mainId', visible: true, align: 'center', valign: 'middle', width: "80px",
  83. formatter: function (value, row, index) {
  84. var type = row.mainType == "integral" ? CONFIG.project_integral_apply : CONFIG.project_rcrd;
  85. return "<span class='label label-success' onclick=\"IntegralVerify.showLog('" + value + "'," + "'" + type + "')\" >" +
  86. "<i class=\"fa fa-book\"></i>日志" +
  87. "</span>";
  88. }
  89. }
  90. ];
  91. };
  92. /**
  93. * 检查是否选中
  94. */
  95. IntegralVerify.check = function () {
  96. var selected = $('#' + this.id).bootstrapTable('getSelections');
  97. if (selected.length != 1) {
  98. Feng.info("请先选中表格中的某一记录!");
  99. return false;
  100. } else {
  101. IntegralVerify.seItem = selected[0];
  102. return true;
  103. }
  104. };
  105. /**
  106. * 查询人才认定申报列表
  107. */
  108. IntegralVerify.search = function () {
  109. IntegralVerify.table.refresh({query: IntegralVerify.formParams()});
  110. };
  111. /**
  112. * 重置
  113. */
  114. IntegralVerify.reset = function () {
  115. $("#name").val("");
  116. $("#card_number").val("");
  117. $("#phone").val("");
  118. $("#email").val("");
  119. $("#checkState").val("");
  120. $("#apply_year").val("");
  121. $("#enterprise_id").val("").trigger("chosen:updated");
  122. $("#shareholder").val("");
  123. }
  124. /**
  125. * 显示导出模态框
  126. */
  127. IntegralVerify.showExportModal = function () {
  128. $("#exportForm")[0].reset();
  129. $("#commonExportModal").modal("show");
  130. }
  131. /**
  132. * 导出提交
  133. */
  134. IntegralVerify.export = function (process) {
  135. var names = '';
  136. var values = '';
  137. var commonExport = "";
  138. $("#field_info li input").each(function (index) {
  139. if ($(this).is(":checked")) {
  140. values = values + $(this).val() + ",";
  141. names = names + $(this).next().text() + ",";
  142. }
  143. });
  144. var queryData = IntegralVerify.formParams();
  145. commonExport = "integralLogListExport";
  146. $("#commonExportModal").modal('hide');
  147. var params = $("#exportForm").serialize();
  148. var url = "/admin/integralVerify/" + commonExport + "?" + params;
  149. window.location.href = url;
  150. }
  151. /**
  152. * 下载
  153. */
  154. IntegralVerify.download = function () {
  155. if (this.check()) {
  156. if (IntegralVerify.seItem.mainType == "talent") {
  157. layer.alert("不能下载非积分申报的附件");
  158. return;
  159. }
  160. window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/common/api/downloadZip?type=20&id=" + IntegralVerify.seItem.mainId));
  161. }
  162. }
  163. IntegralVerify.openCheckIntegralVerify = function () {
  164. if (this.check()) {
  165. if (IntegralVerify.seItem.mainType == "talent") {
  166. layer.alert("不能查看非积分申报的内容");
  167. return;
  168. }
  169. var index = layer.open({
  170. type: 2,
  171. title: '积分申报记录',
  172. area: ['800px', '420px'], //宽高
  173. fix: false, //不固定
  174. maxmin: true,
  175. content: '/admin/integralVerify/detail/id/' + IntegralVerify.seItem.mainId + '/1',
  176. btn: ['<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  177. btnAlign: 'c'
  178. });
  179. layer.full(index);
  180. IntegralVerify.layerIndex = index;
  181. }
  182. }
  183. /**
  184. * 显示审核日志
  185. */
  186. IntegralVerify.showLog = function (id, type) {
  187. layer.open({
  188. type: 1,
  189. title: "日志",
  190. fixed: false,
  191. content: '<table id="' + id + '"></table>',
  192. area: ['80%', '80%'],
  193. maxmin: true,
  194. success: function (layero, index) {
  195. Feng.getCheckLog(id, {"type": type, "mainId": id, "typeFileId": "", "active": 1})
  196. }
  197. });
  198. }
  199. IntegralVerify.creatFieldCheckModal = function () {
  200. return '<form id="firstCheckForm">\n' +
  201. ' <div class="form-group" style="margin: 10px;">\n' +
  202. ' <div >\n' +
  203. ' <label for="checkMsg" class="control-label">可修改字段</label>\n' +
  204. ' <div id="field_info">\n' +
  205. ' <ul>\n' +
  206. ' </ul>\n' +
  207. ' </div>\n' +
  208. ' <label for="checkMsg" class="control-label">可修改附件</label>\n' +
  209. ' <div id="field_file">\n' +
  210. ' </div>\n' +
  211. ' <div class="form-group" style="text-align: center">\n' +
  212. ' <button type="button" class="btn btn-primary" onclick="IntegralVerify.checkAll()">全选</button>\n' +
  213. ' <button type="button" class="btn btn-success" onclick="IntegralVerify.unCheckAll()">反选</button>\n' +
  214. ' </div>\n' +
  215. ' </div>\n' +
  216. ' </div>\n' +
  217. ' </form>';
  218. }
  219. /**
  220. * 全选
  221. */
  222. IntegralVerify.checkAll = function () {
  223. $("#field_info input").each(function () {
  224. this.checked = true;
  225. })
  226. }
  227. /**
  228. * 反选
  229. */
  230. IntegralVerify.unCheckAll = function () {
  231. $("#field_info input").each(function () {
  232. if (this.checked) {
  233. this.checked = false;
  234. } else {
  235. this.checked = true;
  236. }
  237. })
  238. }
  239. $(function () {
  240. var defaultColunms = IntegralVerify.initColumn();
  241. var process = $("#process").val();
  242. var card_type = $("#card_type").val();
  243. var card_number = $("#card_number").val();
  244. var table = new BSTable(IntegralVerify.id, "/admin/integralVerify/list/process/" + process + "/card_type/" + card_type + "/card_number/" + card_number, defaultColunms);
  245. table.setPaginationType("server");
  246. table.setSingleSelect(false);
  247. table.setOnDblClickRow(function () {
  248. IntegralVerify.openCheckIntegralVerify();
  249. });
  250. IntegralVerify.table = table.init();
  251. $("#enterprise_id").on('chosen:ready', function (e, params) {
  252. $(".chosen-container-single .chosen-single").css("padding", "4px 0px 0px 4px");
  253. });
  254. $("#enterprise_id").val("");
  255. $("#enterprise_id").trigger('chosen:updated');
  256. $("#enterprise_id").chosen({
  257. search_contains: true,    //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
  258. disable_search: false,
  259. width: "100%",
  260. enable_split_word_search: true
  261. });
  262. });