enterprise_list.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. var Enterprise = {
  2. id: "table", //表格id
  3. seItem: null, //选中的条目
  4. table: null,
  5. layerIndex: -1
  6. };
  7. Enterprise.initColumn = function () {
  8. var type = $("#type").val();
  9. var isShow = true;
  10. if (type == 2) {
  11. isShow = false;
  12. }
  13. ;
  14. return [
  15. {field: 'selectItem', radio: true},
  16. {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'},
  17. {title: '账号', field: 'username', visible: true, align: 'center', width: 120, valign: 'middle', 'class': 'uitd_showTip'},
  18. {title: '机构名称', field: 'name', visible: true, align: 'center', width: 120, valign: 'middle', 'class': 'uitd_showTip'},
  19. {title: '统一社会信用代码', field: 'idCard', visible: true, align: 'center', width: 120, valign: 'middle', 'class': 'uitd_showTip'},
  20. {title: '产业领域', field: 'industryFieldNewName', visible: isShow, align: 'center', width: 120, valign: 'middle', 'class': 'uitd_showTip'},
  21. {title: '机构类型', field: 'type', align: 'center', width: 120, valign: 'middle', 'class': 'uitd_showTip',
  22. formatter: function (value, row, index) {
  23. if (value == 1) {
  24. return "晋江市现代产业体系人才";
  25. }
  26. if (value == 2) {
  27. return "集成电路优秀人才";
  28. }
  29. }
  30. },
  31. {title: '单位标签', field: 'enterpriseTagName', visible: isShow, align: 'center', width: 120, valign: 'middle', 'class': 'uitd_showTip'},
  32. {title: '法人代表', field: 'legal', align: 'center', width: 120, valign: 'middle', 'class': 'uitd_showTip'},
  33. {title: '单位电话', field: 'ephone', align: 'center', width: 120, valign: 'middle', 'class': 'uitd_showTip'},
  34. {title: '人才联络员', field: 'agentName', align: 'center', width: 120, valign: 'middle', 'class': 'uitd_showTip'},
  35. {title: '人才联络员电话', field: 'agentPhone', align: 'center', width: 120, valign: 'middle', 'class': 'uitd_showTip'},
  36. {title: '审核状态', field: 'checkState', align: 'center', width: 120, valign: 'middle', 'class': 'uitd_showTip',
  37. formatter: function (value, row, index) {
  38. if (value == null || value == '') {
  39. return "";
  40. } else if (value == 1) {
  41. return "未审核";
  42. } else if (value == 2) {
  43. return "审核驳回";
  44. } else if (value == 3) {
  45. return "审核通过";
  46. } else if (value == 4) {
  47. return "重新提交";
  48. }
  49. },
  50. cellStyle: function (value, row, index) {
  51. if (value == null || value === '') {
  52. return {css: {}};
  53. } else if (value === 1) {
  54. return {css: {"background-color": "LightGrey"}};
  55. } else if (value === 3) {
  56. return {css: {'background-color': 'LightGreen'}};
  57. } else if (value === 2) {
  58. return {css: {"background-color": "Orange"}};
  59. } else {
  60. return {css: {}};
  61. }
  62. }
  63. },
  64. {title: '账号状态', field: 'active', align: 'center', width: 120, valign: 'middle', 'class': 'uitd_showTip',
  65. formatter: function (value, row, index) {
  66. if (value == null || value == '') {
  67. return "";
  68. } else if (value == 1) {
  69. return "账号有效";
  70. } else if (value == 2) {
  71. return "拉黑/冻结";
  72. }
  73. },
  74. cellStyle: function (value, row, index) {
  75. if (value == null || value === '') {
  76. return {css: {}};
  77. } else if (value === 1) {
  78. return {css: {'background-color': 'LightGreen'}};
  79. } else if (value === 2) {
  80. return {css: {"background-color": "Orange"}};
  81. } else {
  82. return {css: {}};
  83. }
  84. }
  85. },
  86. {title: '注册时间', field: 'createTime', align: 'center', width: 120, valign: 'middle', 'class': 'uitd_showTip'},
  87. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "80px",
  88. formatter: function (value, row, index) {
  89. return "<span class='label label-success' onclick=\"Enterprise.showLog('" + value + "')\" >" +
  90. "<i class=\"fa fa-book\"></i>日志" +
  91. "</span>";
  92. }
  93. }
  94. ];
  95. };
  96. Enterprise.formParam = function () {
  97. var queryData = {};
  98. queryData['name'] = $("#name").val();
  99. queryData['idCard'] = $("#idCard").val();
  100. queryData['legal'] = $("#legal").val();
  101. queryData['ephone'] = $("#ephone").val();
  102. queryData['agentName'] = $("#agentName").val();
  103. queryData['agentPhone'] = $("#agentPhone").val();
  104. queryData['checkState'] = $("#checkState").val();
  105. queryData['active'] = $("#active").val();
  106. queryData['street'] = $("#street").val();
  107. queryData['enterpriseTag'] = $("#enterpriseTag").val();
  108. queryData['industryFieldNew'] = $("#industryFieldNew").val();
  109. return queryData;
  110. }
  111. Enterprise.search = function () {
  112. Enterprise.table.refresh({"query": Enterprise.formParam()});
  113. };
  114. Enterprise.reset = function () {
  115. $("#name").val("");
  116. $("#idCard").val("");
  117. $("#legal").val("");
  118. $("#ephone").val("");
  119. $("#agentName").val("");
  120. $("#agentPhone").val("");
  121. $("#checkState").val("");
  122. $("#active").val("");
  123. $("#street").val("");
  124. $("#talentType").val("");
  125. $("#industryField").val("");
  126. };
  127. Enterprise.gotoEnterpriseDetailPage = function () {
  128. if (!Enterprise.check()) {
  129. return;
  130. }
  131. var index = layer.open({
  132. type: 2,
  133. title: '查看详情',
  134. area: ['830px', '450px'], //宽高
  135. fix: false, //不固定
  136. maxmin: true,
  137. content: Feng.ctxPath + '/admin/enterprise/gotoEnterpriseDetailPage?id=' + Enterprise.seItem.id,
  138. btn: ['<i class="fa fa-check"></i>&nbsp;&nbsp;审核', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  139. btnAlign: 'c',
  140. yes: function (index, layero) {
  141. Enterprise.doExamine();
  142. }
  143. });
  144. layer.full(index);
  145. Enterprise.layerIndex = index;
  146. };
  147. Enterprise.setActive = function () {
  148. if (!Enterprise.check()) {
  149. return;
  150. }
  151. var index = layer.open({
  152. type: 2,
  153. title: '设置冻结',
  154. area: ['830px', '500px'], //宽高
  155. fix: false, //不固定
  156. maxmin: true,
  157. content: Feng.ctxPath + '/admin/enterprise/gotoActivePage?id=' + Enterprise.seItem.id,
  158. btn: ['<i class="fa fa-check"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
  159. btnAlign: 'c',
  160. yes: function (index, layero) {
  161. //按钮【按钮一】的回调
  162. var iframeWin = window[layero.find('iframe')[0]['name']];
  163. iframeWin.EpActive.addSubmit();
  164. }
  165. });
  166. // layer.full(index);
  167. Enterprise.layerIndex = index;
  168. };
  169. Enterprise.doExamine = function () {
  170. if (!Enterprise.check()) {
  171. return;
  172. }
  173. var index = layer.open({
  174. type: 2,
  175. title: '审核',
  176. area: ['830px', '500px'], //宽高
  177. fix: false, //不固定
  178. maxmin: true,
  179. content: Feng.ctxPath + '/admin/enterprise/gotoExaminePage?id=' + Enterprise.seItem.id,
  180. btn: ['<i class="fa fa-check"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
  181. btnAlign: 'c',
  182. yes: function (index, layero) {
  183. //按钮【按钮一】的回调
  184. var iframeWin = window[layero.find('iframe')[0]['name']];
  185. iframeWin.EpExam.addSubmit();
  186. }
  187. });
  188. // layer.full(index);
  189. };
  190. Enterprise.delEnterprise = function () {
  191. if (!Enterprise.check()) {
  192. return;
  193. }
  194. if (!Enterprise.check()) {
  195. return;
  196. }
  197. Feng.confirm(
  198. "确定删除吗?",
  199. function () {
  200. var ajax = new $ax(Feng.ctxPath + "/enterprise/delEnterprise?id=" + Enterprise.seItem.id, function (data) {
  201. Feng.info(data.msg);
  202. if (data.code == 200) {
  203. Enterprise.table.refresh();
  204. }
  205. }, function (data) {
  206. Feng.error("操作失败!");
  207. });
  208. ajax.set(null);
  209. ajax.start();
  210. }
  211. );
  212. };
  213. Enterprise.resetPassword = function () {
  214. if (!Enterprise.check()) {
  215. return;
  216. }
  217. Feng.confirm(
  218. "确定要重置密码吗?",
  219. function () {
  220. var ajax = new $ax(Feng.ctxPath + "/admin/enterprise/resetPassword?id=" + Enterprise.seItem.id, function (data) {
  221. Feng.info(data.msg);
  222. // if(data.code == 200){
  223. // Enterprise.table.refresh();
  224. // }
  225. }, function (data) {
  226. Feng.error("操作失败!");
  227. });
  228. ajax.set(null);
  229. ajax.start();
  230. }
  231. );
  232. };
  233. Enterprise.doExport = function () {
  234. var name = $("#name").val();
  235. var idCard = $("#idCard").val();
  236. var legal = $("#legal").val();
  237. var ephone = $("#ephone").val();
  238. var agentName = $("#agentName").val();
  239. var agentPhone = $("#agentPhone").val();
  240. var checkState = $("#checkState").val();
  241. var active = $("#active").val();
  242. var street = $("#street").val();
  243. var talentType = $("#talentType").val();
  244. var industryField = $("#industryField").val();
  245. var arr = {"name": name, "idCard": idCard, "legal": legal, "ephone": ephone, "agentName": agentName,
  246. "agentPhone": agentPhone, "checkState": checkState, "active": active, "street": street, "talentType": talentType, "industryField": industryField};
  247. window.location.href = Feng.setUrlParam(Feng.ctxPath + "/admin/enterprise/export", arr);
  248. }
  249. /**
  250. * 批量获取人才联络员手机号码
  251. */
  252. Enterprise.getPhones = function () {
  253. var ajax = new $ax(Feng.ctxPath + "/enterprise/getPhones", function (data) {
  254. if (data.code == 200) {
  255. layer.open({
  256. type: 1,
  257. title: "手机号码",
  258. area: ['830px', '500px'], //宽高
  259. fix: false, //不固定
  260. maxmin: true,
  261. content: "<span style='word-break:break-all'>" + data.obj + "</span>"
  262. });
  263. } else {
  264. Feng.info(data.msg);
  265. }
  266. }, function (data) {
  267. Feng.error("操作失败!");
  268. });
  269. ajax.setData(Enterprise.formParam());
  270. ajax.start();
  271. }
  272. Enterprise.check = function () {
  273. var selected = $('#' + Enterprise.id).bootstrapTable('getSelections');
  274. if (selected.length == 0) {
  275. Feng.info("请先选中表格中的某一记录!");
  276. return false;
  277. } else {
  278. Enterprise.seItem = selected[0];
  279. return true;
  280. }
  281. };
  282. Enterprise.showLog = function (id) {
  283. layer.open({
  284. type: 1,
  285. title: "日志",
  286. fixed: false,
  287. content: '<table id="' + id + '"></table>',
  288. area: ['80%', '80%'],
  289. maxmin: true,
  290. success: function (layero, index) {
  291. Feng.getCheckLog(id, {"type": 10, "enterpriseId": id, "typeFileId": "", "active": 1})
  292. }
  293. });
  294. }
  295. $(function () {
  296. var defaultColunms = Enterprise.initColumn();
  297. var table = new BSTable(Enterprise.id, "/admin/enterprise/findEnterpriseByPage", defaultColunms);
  298. table.setPaginationType("server");
  299. Enterprise.table = table.init();
  300. var arr = [
  301. {"name": "street", "code": "street"},
  302. {"name": "enterpriseTag", "code": "enterprise_tag"},
  303. {"name": "industryFieldNew", "code": "industry_field"},
  304. {"name": "enterpriseType", "code": "enterprise_type"}];
  305. Feng.findChildDictBatch(JSON.stringify(arr));
  306. // Feng.addAjaxSelect({
  307. // "id": "street",
  308. // "displayCode": "code",
  309. // "displayName": "name",
  310. // "type": "GET",
  311. // "url": Feng.ctxPath + "/dict/findChildDictByCode?code=un_street"
  312. // });
  313. });