IntegralLog.js 9.7 KB

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