IntegralLog.js 9.8 KB

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