enterprise_change_edit.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  1. var locked = false;
  2. var EpChangeEdit = {
  3. epChangeEditData: {},
  4. validateFields1: {
  5. newName: {validators: {notEmpty: {message: '企业名称不能为空'}, regexp: {regexp: /^([\u4E00-\u9FA5]|\(|\)|\(|\)){1,100}$/, message: "单位名称只允许中文"}}},
  6. newIdCard: {validators: {notEmpty: {message: '统一社会信用代码不能为空'}}},
  7. newEnterpriseTag: {validators: {notEmpty: {message: '企业标签不能为空'}}},
  8. newEnterpriseType: {validators: {notEmpty: {message: '企业类型不能为空'}}},
  9. newLegal: {validators: {notEmpty: {message: '法人代表不能为空'}, regexp: {regexp: /^[\u4e00-\u9fa5]{1,50}$/, message: "法人代表只允许中文"}}},
  10. newAddress: {validators: {notEmpty: {message: '企业地址不能为空'}}},
  11. newStreet: {validators: {notEmpty: {message: '所属街道不能为空'}}},
  12. newAgentName: {validators: {notEmpty: {message: '人才联络员不能为空'}}},
  13. newEphone: {
  14. validators: {
  15. notEmpty: {
  16. message: '企业电话不能为空'
  17. },
  18. regexp: {
  19. regexp: /((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)/,
  20. message: "企业电话格式不正确"
  21. }
  22. }
  23. },
  24. newAgentPhone: {
  25. validators: {
  26. notEmpty: {
  27. message: '人才联络员电话不能为空'
  28. },
  29. regexp: {
  30. regexp: /((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)/,
  31. message: "人才联络员电话格式不正确"
  32. }
  33. }
  34. },
  35. newAgentEmail: {
  36. validators: {
  37. notEmpty: {
  38. message: '电子邮箱不能为空'
  39. },
  40. emailAddress: {
  41. message: "电子邮箱格式不正确"
  42. }
  43. }
  44. },
  45. newBankCard: {
  46. validators: {
  47. notEmpty: {
  48. message: '企业银行账号不能为空'
  49. }
  50. }
  51. },
  52. newBank: {
  53. validators: {
  54. notEmpty: {
  55. message: '企业开户银行不能为空'
  56. }
  57. }, regexp: {regexp: /^([\u4E00-\u9FA5]|\(|\)|\(|\)){1,100}$/, message: "开户银行只允许中文"}
  58. },
  59. newBankNetwork: {
  60. validators: {notEmpty: {message: '开户银行网点不能为空'},
  61. regexp: {
  62. regexp: /^[\u4e00-\u9fa5]*银行[\u4e00-\u9fa5]*$/,
  63. message: "开户银行网点格式不正确"
  64. }}
  65. }
  66. },
  67. validateFields2: {
  68. newName: {validators: {notEmpty: {message: '单位名称不能为空'}, regexp: {regexp: /^[\u4e00-\u9fa5]{1,100}$/, message: "单位名称只允许中文"}}},
  69. newAddress: {validators: {notEmpty: {message: '单位地址不能为空'}}},
  70. newStreet: {validators: {notEmpty: {message: '所属街道不能为空'}}},
  71. newAgentName: {validators: {notEmpty: {message: '人才联络员不能为空'}}},
  72. newEphone: {
  73. validators: {
  74. notEmpty: {
  75. message: '单位电话不能为空'
  76. },
  77. regexp: {
  78. regexp: /((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)/,
  79. message: "单位电话格式不正确"
  80. }
  81. }
  82. },
  83. newAgentPhone: {
  84. validators: {
  85. notEmpty: {
  86. message: '人才联络员电话不能为空'
  87. },
  88. regexp: {
  89. regexp: /((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)/,
  90. message: "人才联络员电话格式不正确"
  91. }
  92. }
  93. },
  94. newAgentEmail: {
  95. validators: {
  96. notEmpty: {
  97. message: '电子邮箱不能为空'
  98. },
  99. emailAddress: {
  100. message: "电子邮箱格式不正确"
  101. }
  102. }
  103. }
  104. }
  105. };
  106. /**
  107. * 清除数据
  108. */
  109. EpChangeEdit.clearData = function () {
  110. this.epChangeEditData = {};
  111. }
  112. /**
  113. * 设置对话框中的数据
  114. *
  115. * @param key 数据的名称
  116. * @param val 数据的具体值
  117. */
  118. EpChangeEdit.set = function (key, val) {
  119. this.epChangeEditData[key] = (typeof val == "undefined") ? $("#" + key).val() : val;
  120. return this;
  121. }
  122. /**
  123. * 设置对话框中的数据
  124. *
  125. * @param key 数据的名称
  126. * @param val 数据的具体值
  127. */
  128. EpChangeEdit.get = function (key) {
  129. return $("#" + key).val();
  130. }
  131. /**
  132. * 关闭此对话框
  133. */
  134. EpChangeEdit.close = function () {
  135. parent.layer.close(window.parent.EnterpriseCenter.layerIndex);
  136. }
  137. /**
  138. * 收集数据
  139. */
  140. EpChangeEdit.collectData = function () {
  141. this
  142. .set('id')
  143. .set('type')
  144. .set('newName')
  145. .set('newIdCard')
  146. .set('newEnterpriseTag')
  147. .set('newEnterpriseType')
  148. .set('newLegal')
  149. .set('newStreet')
  150. .set('newAddress')
  151. .set('newEphone')
  152. .set('newAgentName')
  153. .set('newAgentPhone')
  154. .set('newAgentEmail')
  155. .set('newIndustryFieldNew')
  156. .set('newIndustryFieldOld')
  157. .set('newBankCard')
  158. .set('newBank')
  159. .set('newBankNetwork')
  160. .set('enterprise_id');
  161. }
  162. /**
  163. * 验证数据
  164. */
  165. EpChangeEdit.validate = function () {
  166. $('#ecr_form').data("bootstrapValidator").resetForm();
  167. $('#ecr_form').bootstrapValidator('validate');
  168. return $("#ecr_form").data('bootstrapValidator').isValid();
  169. }
  170. EpChangeEdit.initFileTable = function () {
  171. $("#fileTable").bootstrapTable({
  172. url: Feng.ctxPath + "/common/api/listCurrencyFileType",
  173. method: 'POST',
  174. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  175. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  176. showRefresh: false, // 是否显示刷新按钮
  177. clickToSelect: true, // 是否启用点击选中行
  178. singleSelect: true, // 设置True 将禁止多选
  179. striped: true, // 是否显示行间隔色
  180. escape: true,
  181. pagination: false, // 设置为 true 会在表格底部显示分页条
  182. paginationHAlign: "left",
  183. paginationDetailHAlign: "right",
  184. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  185. showColumns: false,
  186. detailView: true, //是否显示父子表
  187. pageList: [10, 30, 50],
  188. queryParams: function (params) {
  189. return $.extend({"type": "enterpriseChange"}, params)
  190. },
  191. rowStyle: function (row, index) {
  192. return {classes: "info"};
  193. },
  194. columns: EpChangeEdit.initFileTypeColumn(),
  195. onPostBody: function () {
  196. $("td.uitd_showTip").bind("mouseover", function () {
  197. var htm = $(this).html();
  198. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  199. });
  200. },
  201. onLoadSuccess: function (data) {
  202. $("#fileTable").bootstrapTable('expandAllRows');
  203. },
  204. onExpandRow: function (index, row, $detail) {
  205. var ajax = new $ax(Feng.ctxPath + "/common/api/listTalentCommonFile", function (data) {
  206. if (data == null || data.length == 0) {
  207. return;
  208. }
  209. var checkState = $("#checkState").length > 0 ? $("#checkState").val() : 1;
  210. var files = "";
  211. if (checkState != 1) {
  212. files = $("#files").val().split(",");
  213. }
  214. 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>';
  215. for (var key in data) {
  216. var sn = data[key].url.lastIndexOf(".");
  217. var suffix = data[key].ext;//data[key].url.substring(sn+1,data[key].url.length);
  218. var imgStr = "";
  219. if (suffix == "pdf" || suffix == "PDF") {
  220. 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>";
  221. } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS' || suffix == 'docx' || suffix == 'doc' || suffix == 'DOCX' || suffix == 'DOC') {
  222. 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>";
  223. } else {
  224. imgStr = '<img class=\"imgUrl\" src=\"' + data[key].url + '\" style=\"width:25px;height:25px;\">';
  225. }
  226. var btn = "<button type=\'button\' onclick=\"EpChangeEdit.checkFile('" + row.id + "','" + data[key].id + "')\" style=\'margin-right: 10px\' class=\"btn btn-xs btn-info\"><i class=\"fa fa-paste\"></i>修改</button>" +
  227. "<button type='button' onclick=\"EpChangeEdit.deleteFile('" + data[key].id + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-times\"></i>删除</button>";
  228. html = html + '<li style="display: none">' + data[key].id + '</li>\n' +
  229. '<li style="width: 80%;padding-top: 5px;">' + data[key].orignName + '</li>\n' +
  230. '<li style="width: 10%;">' + imgStr + '</li>\n' +
  231. '<li style="width: 10%;padding-top: 2px;">' + (checkState == 1 ? btn : (files.indexOf(data[key].typeId.toString()) > -1 ? btn : "")) + '</li>';
  232. }
  233. html = html + '</ul>';
  234. $detail.html(html);
  235. $(".imgs").viewer({
  236. // toolbar:false,
  237. fullscreen: false
  238. });
  239. }, function (data) {
  240. Feng.error("查询失败!" + data.responseJSON.message + "!");
  241. });
  242. var queryData = {};
  243. queryData["mainId"] = $("#id").val();
  244. queryData["typeId"] = row.id;
  245. ajax.set(queryData);
  246. ajax.start();
  247. }
  248. });
  249. }
  250. EpChangeEdit.initFileTypeColumn = function () {
  251. return [
  252. {field: 'selectItem', checkbox: false, visible: false},
  253. {title: '名称', field: 'name', visible: true, align: 'center', valign: 'middle', width: "30%", 'class': 'uitd_showTip',
  254. formatter: function (value, row, index) {
  255. if (row.must == 1) {
  256. return '<i class="fa fa-paste"></i><span style="font-weight:bold;color:red;font-size:14px;font-family:宋体"> * </span> ' + value;
  257. }
  258. if (row.must == 2) {
  259. return '<i class="fa fa-paste"></i>' + value;
  260. }
  261. }
  262. },
  263. {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle', width: "50%", 'class': 'uitd_showTip',
  264. formatter: function (value, row, index) {
  265. return '<span style="color: red">' + value + '</span>';
  266. }
  267. },
  268. {title: '模板', field: 'templateUrl', visible: true, align: 'center', valign: 'middle', width: "10%",
  269. formatter: function (value, row, index) {
  270. if (value == null || value == '' || value == 'null') {
  271. return '无';
  272. }
  273. return "<button type='button' onclick=\"Feng.downloadFile('" + row.id + "',3)\" style='margin-right: 10px' class=\"btn btn-xs btn-primary\">" +
  274. "<i class=\"fa fa-download\"></i>下载" +
  275. "</button>";
  276. }
  277. },
  278. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "10%",
  279. formatter: function (value, row, index) {
  280. var checkState = $("#checkState").length > 0 ? $("#checkState").val() : 1;
  281. if (checkState == 1) {
  282. return "<button type='button' onclick=\"EpChangeEdit.checkFile('" + value + "','" + null + "')\" style='margin-right: 10px' class=\"btn btn-xs btn-info\">" +
  283. "<i class=\"fa fa-upload\"></i>上传" +
  284. "</button>";
  285. } else {
  286. var files = $("#files").val().split(",");
  287. if (files.indexOf(value.toString()) != -1) {
  288. return "<button type='button' onclick=\"EpChangeEdit.checkFile('" + value + "','" + null + "')\" style='margin-right: 10px' class=\"btn btn-xs btn-info\">" +
  289. "<i class=\"fa fa-upload\"></i>上传" +
  290. "</button>";
  291. } else {
  292. return "";
  293. }
  294. }
  295. }
  296. }
  297. ]
  298. }
  299. //选择附件并显示附件名
  300. EpChangeEdit.checkFile = function (fileTypeId, fileId) {
  301. var checkState = $("#checkState").val();
  302. if (checkState == 2) {
  303. Feng.error("正在审核中,无法修改");
  304. return;
  305. }
  306. if (checkState == 4) {
  307. Feng.error("审核通过,无法修改");
  308. return;
  309. }
  310. $("#upload_file").unbind("change");
  311. $("#upload_file").change(function () {
  312. if (!Feng.chkFileInvalid(this.files[0], 10, 10, ["image/jpeg", "image/gif", "image/png", "image/jpg", "application/pdf"], "只允许上传PDF或图片"))
  313. return;
  314. EpChangeEdit.upload(fileTypeId, fileId);
  315. });
  316. $('#upload_file').val("");
  317. $('#upload_file').click()
  318. }
  319. //上传附件
  320. EpChangeEdit.upload = function (fileTypeId, fileId) {
  321. if (fileId != null && fileId != 'null') {
  322. $("#fileId").val(fileId)
  323. } else {
  324. $("#fileId").val("");
  325. }
  326. $("#mainId").val($("#id").val());
  327. $("#typeId").val(fileTypeId);
  328. var index = layer.load(0, {shade: false, time: 0});
  329. $("#index").val(index);
  330. $("#uploadForm").submit();
  331. }
  332. //删除附件
  333. EpChangeEdit.deleteFile = function (id) {
  334. var checkState = $("#checkState").val();
  335. if (checkState == 2) {
  336. Feng.error("正在审核中,无法修改");
  337. return;
  338. }
  339. if (checkState == 4) {
  340. Feng.error("审核通过,无法删除");
  341. return;
  342. }
  343. var operation = function () {
  344. var ajax = new $ax("/common/api/deleteTalentCommonFile", function (data) {
  345. if (data.code = 200) {
  346. Feng.success(data.msg);
  347. $("#fileTable").bootstrapTable("refresh", {});
  348. } else {
  349. Feng.error(data.msg);
  350. }
  351. }, function (data) {
  352. Feng.error("删除失败!" + data.responseJSON.message + "!");
  353. });
  354. ajax.set("id", id);
  355. ajax.start();
  356. }
  357. Feng.confirm("删除后无法恢复,确认删除吗?", operation);
  358. }
  359. EpChangeEdit.addSubmit = function () {
  360. this.clearData();
  361. this.collectData();
  362. if (!this.validate()) {
  363. return;
  364. }
  365. var checkState = $("#checkState").val();
  366. if (checkState == 2 || checkState == 5) {
  367. Feng.info("正在审核中,无法修改")
  368. return;
  369. }
  370. if (checkState == 4) {
  371. Feng.info("已审核通过,无法修改")
  372. return;
  373. }
  374. // $(".layui-layer-btn0",parent.document).css("pointer-events","none");
  375. if (locked) {
  376. Feng.info("保存进行中,请耐心等候")
  377. return;
  378. }
  379. locked = true;
  380. layer.load(0, {shade: false, time: 0});
  381. /*var ajax = new $ax(Feng.ctxPath + "/enterprise/api/upsert", function (data) {
  382. if (data.code == "200") {
  383. Feng.success(data.msg);
  384. $("#fileLi").removeAttr("style");
  385. $("#id").val(data.obj.id);
  386. $("#checkState").val(data.obj.checkState);
  387. window.parent.EnterpriseCenter.table.refresh();
  388. } else {
  389. Feng.info(data.msg);
  390. }
  391. // $(".layui-layer-btn0",parent.document).css("pointer-events","block");
  392. locked = false;
  393. }, function (data) {
  394. Feng.error("添加失败!" + data.responseJSON.msg + "!");
  395. locked = false;
  396. });
  397. ajax.set(this.epChangeEditData);
  398. ajax.start();*/
  399. $("#ecr_form :input").removeAttr("disabled");
  400. $("#ecr_form").attr("action", "/enterprise/api/upsert");
  401. $("#ecr_form")[0].submit();
  402. };
  403. /**
  404. * 提交审核
  405. */
  406. EpChangeEdit.submitToCheck = function () {
  407. if (locked) {
  408. Feng.info("保存进行中,请耐心等候")
  409. return;
  410. }
  411. var id = $("#id").val();
  412. if (id == null || id == "") {
  413. Feng.info("请先填写基础信息并上传附件");
  414. return;
  415. }
  416. var checkState = $("#checkState").val();
  417. if (checkState == 2 || checkState == 5) {
  418. Feng.error("正在审核中,无法修改");
  419. return;
  420. }
  421. if (checkState == 4) {
  422. Feng.error("审核通过,无法修改");
  423. return;
  424. }
  425. $(".layui-layer-btn1", parent.document).css("pointer-events", "none");
  426. var operation = function () {
  427. var ajax = new $ax(Feng.ctxPath + "/enterprise/api/submitToCheck", function (data) {
  428. if (data.code == 200) {
  429. Feng.success(data.msg);
  430. window.parent.EnterpriseCenter.table.refresh();
  431. EpChangeEdit.close();
  432. } else {
  433. Feng.error(data.msg);
  434. }
  435. $(".layui-layer-btn1", parent.document).css("pointer-events", "block");
  436. }, function (data) {
  437. Feng.error("提交审核失败!" + data.responseJSON.message + "!");
  438. $(".layui-layer-btn1", parent.document).css("pointer-events", "block");
  439. });
  440. ajax.set("id", id);
  441. ajax.start();
  442. }
  443. Feng.confirm("请确认基础信息已核对无误,相应附件已上传,一旦提交,无法修改", operation);
  444. }
  445. EpChangeEdit.setFieldDisabled = function () {
  446. var checkState = $("#checkState").length > 0 ? $("#checkState").val() : 1;
  447. if (checkState != 1) {
  448. $("#ecr_form :input").prop("disabled", true);
  449. $("#ecr_form :button").css("display", "none");
  450. var fields = $("#fields").val().split(",");
  451. for (var i in fields) {
  452. $("#" + fields[i]).removeAttr("disabled");
  453. }
  454. var files = $("#files").val().split(",");
  455. for (var i in files) {
  456. switch (files[i]) {
  457. case "newImgurl":
  458. $("#imgurl").removeAttr("disabled");
  459. $("#imgurl").parent().find("button").removeAttr("disabled").css("display", "block");
  460. break;
  461. case "newBankImg":
  462. $("#bankImg").removeAttr("disabled");
  463. $("#bankImg").parent().find("button").removeAttr("disabled").css("display", "block");
  464. break;
  465. case "newDomainImg":
  466. $("#domainImg").removeAttr("disabled");
  467. $("#domainImg").parent().find("button").removeAttr("disabled").css("display", "block");
  468. break;
  469. case "newBeian":
  470. $("#beian").removeAttr("disabled");
  471. $("#beian").parent().find("button").removeAttr("disabled").css("display", "block");
  472. break;
  473. }
  474. }
  475. }
  476. }
  477. EpChangeEdit.callBack = function (data) {
  478. layer.closeAll();
  479. EpChangeEdit.setFieldDisabled();
  480. locked = false;
  481. Feng.info(data.msg);
  482. if (data.code == 200) {
  483. $("#id").val(data.id);
  484. $("input[type=file]").val("");
  485. window.parent.EnterpriseCenter.table.refresh();
  486. }
  487. };
  488. EpChangeEdit.downloadFile = function (id) {
  489. window.location.href = Feng.ctxPath + '/enterprisechangeRecord/downloadFile?id=' + id;
  490. };
  491. EpChangeEdit.industryChange = function () {
  492. var industryNew = $("#newIndustryFieldNew").val();
  493. var arr = [{"name": "newIndustryFieldOld", "code": industryNew + "_field"}];
  494. Feng.findChildDictBatch(JSON.stringify(arr));
  495. }
  496. $("#imgurl,#bankImg,#beian,#domainImg").change(function (e) {
  497. var that = this;
  498. if (!Feng.chkFileInvalid(that.files[0], 10, 10, ["image/jpeg", "image/gif", "image/png", "image/jpg", "application/pdf"], "只允许上传PDF或图片")) {
  499. return;
  500. }
  501. var file = that.files[0];
  502. var imgSrc;
  503. var reader = new FileReader();
  504. reader.readAsDataURL(file);
  505. reader.onload = function () {
  506. if (Feng.isImg(file.type)) {
  507. imgSrc = this.result;
  508. $(that).prev("img").attr("src", imgSrc);
  509. } else {
  510. $(that).prev("img").attr("src", Feng.ctxPath + "/static/img/Pdf.png");
  511. }
  512. };
  513. });
  514. $(function () {
  515. EpChangeEdit.setFieldDisabled();
  516. var special = parseInt($("#special").val());
  517. $('#ecr_form').bootstrapValidator({
  518. feedbackIcons: {
  519. valid: 'glyphicon glyphicon-ok',
  520. invalid: 'glyphicon glyphicon-remove',
  521. validating: 'glyphicon glyphicon-refresh'
  522. },
  523. group: '.rowGroup',
  524. fields: special == 1 ? EpChangeEdit.validateFields2 : EpChangeEdit.validateFields1,
  525. live: 'enabled',
  526. message: '该字段不能为空'
  527. });
  528. //Feng.initValidator("ecr_form", EpChangeEdit.validateFields);
  529. var industryNew = $("#newIndustryFieldNew").attr("value");
  530. var arr = [
  531. {"name": "newStreet", "code": "street"},
  532. {"name": "newEnterpriseTag", "code": "enterprise_tag"},
  533. {"name": "newEnterpriseType", "code": "enterprise_type"},
  534. {"name": "newIndustryFieldNew", "code": "industry_field"},
  535. {"name": "newIndustryFieldOld", "code": industryNew + "_field"}];
  536. Feng.findChildDictBatch(JSON.stringify(arr));
  537. $("select").each(function () {
  538. $(this).val($(this).attr("value"));
  539. })
  540. if ($("#type").val() == 1) {
  541. $("#newEnterpriseTag,#newIndustryFieldNew,#newIndustryFieldOld,#newEnterpriseType").parent().parent().attr("style", "display:cell");
  542. $("#newEnterpriseTag").val($("#newEnterpriseTag").attr("value"));
  543. $("#newIndustryFieldNew").val($("#newIndustryFieldNew").attr("value"));
  544. $("#newIndustryFieldOld").val($("#newIndustryFieldOld").attr("value"));
  545. } else {
  546. $("#newEnterpriseTag,#newIndustryFieldNew,#newIndustryFieldOld,#newEnterpriseType").parent().parent().attr("style", "display:none");
  547. $("#newEnterpriseTag").val("");
  548. $("#newIndustryFieldNew").val("");
  549. }
  550. var id = $("#id").val();
  551. if (id != null && id != '') {
  552. $("#fileLi").removeAttr("style");
  553. } else {
  554. $("#fileLi").attr("style", "pointer-events: none");
  555. }
  556. });