livingAllowanceInfo_info.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. /**
  2. * 初始化硕博人才生活补贴申报详情对话框
  3. */
  4. var LivingAllowanceInfoInfoDlg = {
  5. livingAllowanceInfoInfoData: {},
  6. locked: false,
  7. validateFields: {
  8. enterpriseId: {validators: {notEmpty: {message: '所属企业不能为空'}}},
  9. enterpriseName: {validators: {notEmpty: {message: '所属企业不能为空'}}},
  10. declareType: {validators: {notEmpty: {message: '申报类型不能为空'}}},
  11. type: {validators: {notEmpty: {message: '人才类别不能为空'}}},
  12. name: {validators: {notEmpty: {message: '姓名不能为空'}}},
  13. nation: {validators: {notEmpty: {message: '民族不能为空'}}},
  14. provinceCode: {validators: {notEmpty: {message: '户籍省份不能为空'}}},
  15. cityCode: {validators: {notEmpty: {message: '户籍市不能为空'}}},
  16. address: {validators: {notEmpty: {message: '现居地址不能为空'}}},
  17. highEducation: {validators: {notEmpty: {message: '最高学历不能为空'}}},
  18. graduateSchool: {validators: {notEmpty: {message: '毕业院校不能为空'}}},
  19. major: {validators: {notEmpty: {message: '专业不能为空'}}},
  20. phone: {
  21. validators: {
  22. notEmpty: {
  23. message: '手机号码不能为空'
  24. },
  25. regexp: {
  26. regexp: /0?(13|14|15|16|17|18|19)[0-9]{9}/,
  27. message: "手机号码格式不正确"
  28. }
  29. }
  30. },
  31. bank: {
  32. validators: {
  33. notEmpty: {
  34. message: '开户银行不能为空'
  35. },
  36. regexp: {
  37. regexp: /^[\u4e00-\u9fa5]*银行$/,
  38. message: "开户银行格式不正确"
  39. }
  40. }
  41. },
  42. bankAccount: {
  43. validators: {
  44. notEmpty: {
  45. message: '银行账号不能为空'
  46. },
  47. regexp: {
  48. regexp: /^\d+$/,
  49. message: "银行账号格式不正确"
  50. }
  51. }
  52. },
  53. entryTime: {validators: {notEmpty: {message: '入职时间不能为空'}}},
  54. endTime: {validators: {notEmpty: {message: '工作合同结束时间不能为空'}}},
  55. type: {validators: {notEmpty: {message: '人才类别不能为空'}}},
  56. cardType: {validators: {notEmpty: {message: '证件类型不能为空'}}},
  57. idCard: {validators: {notEmpty: {message: '证件号码不能为空'}}},
  58. sex: {validators: {notEmpty: {message: '性别不能为空'}}},
  59. nationality: {validators: {notEmpty: {message: '国籍/地区不能为空'}}},
  60. birthday: {validators: {notEmpty: {message: '出生日期不能为空'}}},
  61. //firstSocialSecurityTime: {validators: {notEmpty: {message: '首次社保缴纳时间不能为空'}}},
  62. politics: {validators: {notEmpty: {message: '政治面貌不能为空'}}},
  63. post: {validators: {
  64. notEmpty: {message: '职务不能为空'},
  65. regexp: {
  66. regexp: /^[\u4e00-\u9fa5]{0,}$/,
  67. message: "职务必须为汉字"
  68. }
  69. }},
  70. email: {
  71. validators: {
  72. notEmpty: {
  73. message: '电子邮箱不能为空'
  74. },
  75. emailAddress: {
  76. message: "电子邮箱格式不正确"
  77. }
  78. }
  79. },
  80. bankNetwork: {
  81. validators: {
  82. notEmpty: {
  83. message: '开户银行网点不能为空'
  84. },
  85. regexp: {
  86. regexp: /^[\u4e00-\u9fa5]*银行[\u4e00-\u9fa5]*省?[\u4e00-\u9fa5]+市[\u4e00-\u9fa5]*$/,
  87. message: "开户银行格式不正确"
  88. }
  89. }
  90. },
  91. bankNumber: {
  92. validators: {
  93. notEmpty: {
  94. message: '银行行号不能为空'
  95. },
  96. regexp: {
  97. regexp: /^\d{12}$/,
  98. message: "银行行号格式不正确"
  99. }
  100. }
  101. },
  102. introductionMethod: {
  103. validators: {
  104. notEmpty: {
  105. message: '引进方式不能为空'
  106. }
  107. }
  108. },
  109. startTime: {validators: {notEmpty: {message: '工作合同开始时间不能为空'}}},
  110. mainHonours: {validators: {notEmpty: {message: '主要业绩及取得的荣誉不能为空'}}},
  111. educationAndResume: {validators: {notEmpty: {message: '教育背景及工作简历不能为空'}}},
  112. // firstInJJTime: {validators: {notEmpty: {message: '首次来晋工作时间不能为空'}}},
  113. industryField: {validators: {notEmpty: {message: '行业领域不能为空'}}}
  114. },
  115. tax: null,
  116. socialSecurity: null,
  117. getBirthdayByIdCard() {
  118. var cardType = $("#cardType").val();
  119. if (cardType == 1) {
  120. var idCard = $("#idCard").val();
  121. $("#birthday").val(idCard.substring(6, 10) + "-" + idCard.substring(10, 12) + "-" + idCard.substring(12, 14));
  122. }
  123. }
  124. };
  125. /**
  126. * 清除数据
  127. */
  128. LivingAllowanceInfoInfoDlg.clearData = function () {
  129. this.livingAllowanceInfoInfoData = {};
  130. }
  131. /**
  132. * 设置对话框中的数据
  133. *
  134. * @param key 数据的名称
  135. * @param val 数据的具体值
  136. */
  137. LivingAllowanceInfoInfoDlg.set = function (key, val) {
  138. this.livingAllowanceInfoInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val;
  139. return this;
  140. }
  141. /**
  142. * 设置对话框中的数据
  143. *
  144. * @param key 数据的名称
  145. * @param val 数据的具体值
  146. */
  147. LivingAllowanceInfoInfoDlg.get = function (key) {
  148. return $("#" + key).val();
  149. }
  150. /**
  151. * 关闭此对话框
  152. */
  153. LivingAllowanceInfoInfoDlg.close = function () {
  154. parent.layer.close(window.parent.LivingAllowanceInfo.layerIndex);
  155. }
  156. /**
  157. * 收集数据
  158. */
  159. LivingAllowanceInfoInfoDlg.collectData = function () {
  160. this
  161. .set('id')
  162. .set('year')
  163. .set('enterpriseId')
  164. .set('enterpriseName')
  165. .set('type')
  166. .set('declareType')
  167. .set('cardType')
  168. .set('idCard')
  169. .set('name')
  170. .set('photo')
  171. .set('sex')
  172. .set('nation')
  173. .set('nationality')
  174. .set('provinceCode')
  175. .set('cityCode')
  176. .set('countyCode')
  177. .set('birthday')
  178. .set('address')
  179. .set('politics')
  180. .set('highEducation')
  181. .set('graduateSchool')
  182. .set('major')
  183. .set('post')
  184. .set('phone')
  185. .set('email')
  186. .set('bank')
  187. .set('bankNetwork')
  188. .set('bankAccount')
  189. .set('bankNumber')
  190. .set('entryTime')
  191. // .set('quitTime')
  192. .set('startTime')
  193. .set('endTime')
  194. .set('educationAndResume')
  195. .set('mainHonours')
  196. .set('firstInJJTime')
  197. // .set('isIntroduction')
  198. .set('industryFieldNew')
  199. .set('industryField')
  200. .set('title')
  201. .set('professionalQualifications')
  202. .set('studyAbroad')
  203. // .set('studyAbroadCountry')
  204. .set('studyAbroadTime')
  205. .set('backJJBusinessTime')
  206. .set('introductionMethod')
  207. .set('firstSocialSecurityTime')
  208. // .set('introductionMode')
  209. // .set('letterTime')
  210. // .set('applyCount')
  211. ;
  212. if ($("#provinceCode").val() != null && $("#provinceCode").val() != '') {
  213. this.livingAllowanceInfoInfoData["provinceName"] = $("#provinceCode").find("option:selected").text();
  214. }
  215. if ($("#cityCode").val() != null && $("#cityCode").val() != '') {
  216. this.livingAllowanceInfoInfoData["cityName"] = $("#cityCode").find("option:selected").text();
  217. }
  218. if ($("#countyCode").val() != null && $("#countyCode").val() != '') {
  219. this.livingAllowanceInfoInfoData["countyName"] = $("#countyCode").find("option:selected").text();
  220. }
  221. var personalTaxVal = LivingAllowanceInfoInfoDlg.tax.getValue();
  222. var socialSecurityVal = LivingAllowanceInfoInfoDlg.socialSecurity.getValue();
  223. // if(personalTaxVal == null || personalTaxVal.length <= 0){
  224. // Feng.info("")
  225. // }
  226. var personalTax = personalTaxVal.map(function (item) {
  227. return item.value;
  228. }).sort().join(",");
  229. var socialSecurity = socialSecurityVal.map(function (item) {
  230. return item.value;
  231. }).sort().join(",");
  232. LivingAllowanceInfoInfoDlg.livingAllowanceInfoInfoData["personalTax"] = personalTax;
  233. LivingAllowanceInfoInfoDlg.livingAllowanceInfoInfoData["socialSecurity"] = socialSecurity;
  234. }
  235. /**
  236. * 数据校验
  237. * @returns {*|Window.jQuery}
  238. */
  239. LivingAllowanceInfoInfoDlg.validate = function () {
  240. $('#talentInfoForm').data("bootstrapValidator").resetForm();
  241. $('#talentInfoForm').bootstrapValidator('validate');
  242. return $("#talentInfoForm").data('bootstrapValidator').isValid();
  243. }
  244. LivingAllowanceInfoInfoDlg.upsertValidate = function () {
  245. this.clearData();
  246. this.collectData();
  247. if (!LivingAllowanceInfoInfoDlg.validate()) {
  248. return;
  249. }
  250. // if (Feng.isEmptyStr(LivingAllowanceInfoInfoDlg.livingAllowanceInfoInfoData.socialSecurity)) {
  251. // Feng.info("社保缴交情况不能为空!");
  252. // return;
  253. // }
  254. if (LivingAllowanceInfoInfoDlg.livingAllowanceInfoInfoData.introductionMethod == 1) {
  255. if (Feng.isEmptyStr(LivingAllowanceInfoInfoDlg.livingAllowanceInfoInfoData.firstInJJTime)) {
  256. Feng.info("首次来晋时间不能为空!");
  257. return;
  258. }
  259. var dateArr = new Array(LivingAllowanceInfoInfoDlg.livingAllowanceInfoInfoData.firstSocialSecurityTime,
  260. LivingAllowanceInfoInfoDlg.livingAllowanceInfoInfoData.entryTime,
  261. LivingAllowanceInfoInfoDlg.livingAllowanceInfoInfoData.startTime);
  262. dateArr.sort(function (a, b) {
  263. return a > b ? 1 : -1
  264. });
  265. if (new Date(dateArr[0]).getTime() < new Date("2021-11-16").getTime()) {
  266. Feng.info("不符合2021年11月16日起新引进的人才条件,无法申报");
  267. return;
  268. }
  269. }
  270. if (LivingAllowanceInfoInfoDlg.livingAllowanceInfoInfoData.introductionMethod == 2) {
  271. if (Feng.isEmptyStr(LivingAllowanceInfoInfoDlg.livingAllowanceInfoInfoData.backJJBusinessTime)) {
  272. Feng.info("返晋创业时间不能为空!");
  273. return;
  274. }
  275. if (new Date("2021-11-16").getTime() > new Date(LivingAllowanceInfoInfoDlg.livingAllowanceInfoInfoData.backJJBusinessTime).getTime()) {
  276. Feng.info("引进方式为其他的必须满足:返晋创业时间在2021-11-16至2022-11-15之间!");
  277. return;
  278. }
  279. if (new Date("2022-11-15").getTime() < new Date(LivingAllowanceInfoInfoDlg.livingAllowanceInfoInfoData.backJJBusinessTime).getTime()) {
  280. Feng.info("引进方式为其他的必须满足:返晋创业时间在2021-11-16至2022-11-15之间!");
  281. return;
  282. }
  283. }
  284. if (Feng.isEmptyStr(LivingAllowanceInfoInfoDlg.livingAllowanceInfoInfoData.id) && Feng.isEmptyStr($("#photo").val())) {
  285. Feng.info("头像不能为空!");
  286. return;
  287. }
  288. var formData = new FormData();
  289. Object.keys(this.livingAllowanceInfoInfoData).forEach((key) => {
  290. formData.append(key, this.livingAllowanceInfoInfoData[key]);
  291. });
  292. formData.append('file', $('#photo')[0].files[0]);
  293. return formData;
  294. }
  295. /**
  296. * 提交添加
  297. */
  298. LivingAllowanceInfoInfoDlg.addSubmit = function () {
  299. var formData = LivingAllowanceInfoInfoDlg.upsertValidate();
  300. if (formData == null) {
  301. return;
  302. }
  303. if (LivingAllowanceInfoInfoDlg.locked) {
  304. return;
  305. }
  306. LivingAllowanceInfoInfoDlg.locked = true;
  307. $.ajax({
  308. url: Feng.ctxPath + "/enterprise/living_allowance/apply",
  309. type: "POST",
  310. processData: false,
  311. contentType: false,
  312. data: formData,
  313. success: function (data) {
  314. LivingAllowanceInfoInfoDlg.setNoChangeField();
  315. LivingAllowanceInfoInfoDlg.locked = false;
  316. if (data.code == 200) {
  317. Feng.success(data.msg);
  318. window.parent.LivingAllowanceInfo.table.refresh();
  319. $("#id").val(data.obj.id);
  320. $("#fileLi").removeAttr("style");
  321. $("#checkState").val(data.obj.checkState);
  322. } else {
  323. Feng.info(data.msg);
  324. }
  325. }, error: function (data) {
  326. LivingAllowanceInfoInfoDlg.locked = false;
  327. Feng.error("保存失败!" + data.responseJSON.message + "!");
  328. }
  329. });
  330. }
  331. /**
  332. * 提交审核
  333. */
  334. LivingAllowanceInfoInfoDlg.submitToCheck = function () {
  335. var id = $("#id").val();
  336. if (Feng.isEmptyStr(id)) {
  337. Feng.info("请先填写基础信息并上传附件");
  338. return;
  339. }
  340. if (!validateIsEdit())
  341. return;
  342. var formData = LivingAllowanceInfoInfoDlg.upsertValidate();
  343. if (formData == null) {
  344. return;
  345. }
  346. $.ajax({
  347. url: Feng.ctxPath + "/enterprise/living_allowance/apply",
  348. type: "POST",
  349. processData: false,
  350. contentType: false,
  351. data: formData,
  352. async: true,
  353. success: function (data) {
  354. if (data.code == 200) {
  355. LivingAllowanceInfoInfoDlg.submitFun();
  356. } else {
  357. Feng.info(data.msg);
  358. }
  359. }, error: function (data) {
  360. LivingAllowanceInfoInfoDlg.locked = false;
  361. Feng.error("提交失败!" + data.responseJSON.message + "!");
  362. }
  363. });
  364. }
  365. LivingAllowanceInfoInfoDlg.submitFun = function () {
  366. var operation = function () {
  367. var ajax = new $ax(Feng.ctxPath + "/enterprise/living_allowance/submitToCheck", function (data) {
  368. if (data.code == 200) {
  369. Feng.success(data.msg);
  370. // $("#checkState").val(data.obj);
  371. window.parent.LivingAllowanceInfo.table.refresh();
  372. LivingAllowanceInfoInfoDlg.close();
  373. } else if (data.code == 600) {
  374. layer.confirm(data.msg, {
  375. btn: ['我已知晓'] //按钮
  376. }, function () {
  377. window.parent.LivingAllowanceInfo.table.refresh();
  378. LivingAllowanceInfoInfoDlg.close();
  379. });
  380. } else {
  381. Feng.error(data.msg);
  382. }
  383. }, function (data) {
  384. Feng.error("提交审核失败!" + data.responseJSON.message + "!");
  385. });
  386. ajax.set("id", $("#id").val());
  387. ajax.start();
  388. }
  389. Feng.confirm("请确认基础信息已核对无误,相应附件已上传,一旦提交,无法修改", operation);
  390. }
  391. /**
  392. * 设置不可修改的字段
  393. */
  394. LivingAllowanceInfoInfoDlg.setNoChangeField = function () {
  395. var checkState = $("#checkState").val();
  396. var fields = $("#fields").val();
  397. if (checkState == 10) {
  398. // $("input,textarea").each(function () {
  399. // $(this).attr("readonly", "readonly");
  400. // });
  401. $("select,input,textarea").not(":file,:hidden").each(function () {
  402. $(this).attr("disabled", "disabled");
  403. });
  404. if (Feng.isNotEmptyStr(fields)) {
  405. var arr = fields.split(",");
  406. for (var key in arr) {
  407. var name = $("#" + arr[key]).prop("tagName");
  408. if (name == 'select' || name == 'SELECT') {
  409. $("#" + arr[key]).removeAttr("disabled");
  410. }
  411. if (name == "input" || name == 'textarea' || name == "INPUT" || name == 'TEXTAREA') {
  412. $("#" + arr[key]).removeAttr("disabled");
  413. }
  414. }
  415. LivingAllowanceInfoInfoDlg.tax.update({disabled: fields.indexOf("personalTax") == -1});
  416. LivingAllowanceInfoInfoDlg.socialSecurity.update({disabled: fields.indexOf("socialSecurity") == -1});
  417. }
  418. }
  419. }
  420. /**
  421. * 数据加载
  422. * */
  423. /**
  424. * 加载市
  425. */
  426. LivingAllowanceInfoInfoDlg.afterSelectProvince = function () {
  427. var province = $("#provinceCode").val();
  428. $("#cityCode").empty();
  429. $("#countyCode").empty();
  430. if (province == null || province == '') {
  431. return;
  432. }
  433. Feng.addAjaxSelect({
  434. "id": "cityCode",
  435. "displayCode": "code",
  436. "displayName": "name",
  437. "type": "GET",
  438. "url": Feng.ctxPath + "/common/tool/findCityByProvinceSelect/code/" + province
  439. });
  440. }
  441. LivingAllowanceInfoInfoDlg.introductionMethodChange = function () {
  442. var introductionMethod = $("#introductionMethod").val();
  443. if (Feng.isEmptyStr(introductionMethod)) {
  444. $("#backJJBusinessTime,#firstInJJTime").val("");
  445. $("#backJJBusinessTimeDiv,#firstInJJTimeDiv").css("display", "none");
  446. return;
  447. }
  448. if (introductionMethod == 1) {
  449. $("#backJJBusinessTime").val("");
  450. $("#backJJBusinessTimeDiv").css("display", "none");
  451. $("#firstInJJTimeDiv").css("display", "block");
  452. return;
  453. }
  454. $("#firstInJJTime").val("");
  455. $("#firstInJJTimeDiv").css("display", "none");
  456. $("#backJJBusinessTimeDiv").css("display", "block");
  457. }
  458. /**
  459. * 加载县
  460. */
  461. LivingAllowanceInfoInfoDlg.afterSelectCity = function () {
  462. var city = $("#cityCode").val();
  463. $("#countyCode").empty();
  464. if (city == null || city == '') {
  465. return;
  466. }
  467. Feng.addAjaxSelect({
  468. "id": "countyCode",
  469. "displayCode": "code",
  470. "displayName": "name",
  471. "type": "GET",
  472. "url": Feng.ctxPath + "/common/tool/findCountyByCitySelect/code/" + city
  473. });
  474. }
  475. //校验是否保存基础信息
  476. LivingAllowanceInfoInfoDlg.validId = function () {
  477. var id = $("#id").val();
  478. if (id != null && id != '') {
  479. $("#fileLi").removeAttr("style");
  480. } else {
  481. $("#fileLi").attr("style", "pointer-events: none");
  482. }
  483. }
  484. LivingAllowanceInfoInfoDlg.initTaxAndSocialSecurity = function () {
  485. var year = $("#year").val().substr(0, 4);
  486. var nowYear = new Date().getFullYear();
  487. var nowMonth = new Date().getMonth() + 1;
  488. let maxMonth = 12;
  489. if (year == nowYear) {
  490. maxMonth = nowMonth;
  491. }
  492. var startYear = year-1;
  493. var data = new Array();
  494. for (var j = 1;j<= 12; j++){
  495. var month = startYear + "-" + (i < 10 ? "0" + i : i);
  496. data.push({name: month, value: month, selected: false, disabled: false});
  497. }
  498. for (var i = 1; i <= maxMonth; i++) {
  499. var month = year + "-" + (i < 10 ? "0" + i : i);
  500. data.push({name: month, value: month, selected: false, disabled: false});
  501. }
  502. LivingAllowanceInfoInfoDlg.tax = xmSelect.render({
  503. el: '#personalTax',
  504. data: data
  505. })
  506. LivingAllowanceInfoInfoDlg.socialSecurity = xmSelect.render({
  507. el: '#socialSecurity',
  508. data: data
  509. })
  510. }
  511. function validUploadButton(type, row, fileId) {
  512. var files = $("#files").val();
  513. var checkState = $("#checkState").val();
  514. if ((Feng.isEmptyStr(checkState) || checkState == 1 || (checkState == 10 && files.indexOf(row.id) != -1)) && $("#hand").val() != "select") {
  515. return type == 1 ?
  516. "<button type='button' onclick=\"checkFile(this,'" + row.id + "','" + null + "')\" style='margin-right: 10px' class=\"btn btn-xs btn-info\">" +
  517. "<i class=\"fa fa-upload\"></i>上传" +
  518. "</button>"
  519. :
  520. // "<button type=\'button\' onclick=\"checkFile(this,'" + row.id + "','" + fileId + "')\" style=\'margin-right: 10px\' class=\"btn btn-xs btn-info\">" +
  521. // "<i class=\"fa fa-paste\"></i>修改" +
  522. // "</button>" +
  523. "<button type='button' onclick=\"deleteFile('" + fileId + "','" + CONFIG.project_master_living_allowance + "')\" class=\"btn btn-xs btn-danger\">" +
  524. "<i class=\"fa fa-times\"></i>删除" +
  525. "</button>";
  526. } else {
  527. return "";
  528. }
  529. }
  530. /**
  531. * 校验是否可以操作
  532. */
  533. function validateIsEdit() {
  534. var checkState = $("#checkState").val();
  535. if (checkState != 1 && checkState != 5 && checkState != 10) {
  536. if (checkState == -1) {
  537. Feng.error("您的申报审核不通过,无法再修改");
  538. return false;
  539. } else if (checkState >= 35) {
  540. Feng.error("您的申报已审核通过,无法再修改");
  541. return false;
  542. } else {
  543. Feng.error("您的申报正在审核中,请耐心等待");
  544. return false;
  545. }
  546. }
  547. return true;
  548. }
  549. $(function () {
  550. Feng.initValidatorTip("talentInfoForm", LivingAllowanceInfoInfoDlg.validateFields);
  551. var id = $("#id").val();
  552. var industry_field_type = $("#industry_field_type").val();
  553. if ($("#industryFieldNew").attr("value") == "") {
  554. industry_field_type = "un_industryField";//兼容查看旧申报时候,没有产业信息,就显示旧的行业领域信息
  555. }
  556. //批量加载字典表数据
  557. var arr = [
  558. {"name": "nation", "code": "nation"},
  559. {"name": "nationality", "code": "nationality"},
  560. {"name": "politics", "code": "politics"},
  561. {"name": "declareType", "code": "un_master_education"},
  562. {"name": "highEducation", "code": "highest_degree"},
  563. {"name": "introductionMode", "code": "un_introduction_mode"},
  564. {"name": "industryFieldNew", "code": "industry_field"},
  565. {"name": "industryField", "code": industry_field_type},
  566. {"name": "address", "code": "street"}];
  567. Feng.findChildDictBatch(JSON.stringify(arr))
  568. //加载省份
  569. Feng.addAjaxSelect({
  570. "id": "provinceCode",
  571. "displayCode": "code",
  572. "displayName": "name",
  573. "type": "GET",
  574. "url": Feng.ctxPath + "/common/tool/getProvinceSelect"
  575. });
  576. LivingAllowanceInfoInfoDlg.initTaxAndSocialSecurity();
  577. LivingAllowanceInfoInfoDlg.setNoChangeField();
  578. //批量加载时间控件
  579. $(".date").each(function () {
  580. laydate.render({
  581. elem: this
  582. , type: 'date'
  583. , trigger: 'click'
  584. });
  585. });
  586. if (id != null && id != '') {
  587. //select初始化
  588. $("select").each(function () {
  589. $(this).val($(this).attr("value")).trigger("change");
  590. });
  591. if (Feng.isNotEmptyStr($("#personalTax").attr("value"))) {
  592. LivingAllowanceInfoInfoDlg.tax.setValue($("#personalTax").attr("value").split(","));
  593. }
  594. if (Feng.isNotEmptyStr($("#socialSecurity").attr("value"))) {
  595. LivingAllowanceInfoInfoDlg.socialSecurity.setValue($("#socialSecurity").attr("value").split(","));
  596. }
  597. Feng.getCheckLog("logTable", {
  598. "type": CONFIG.project_master_living_allowance,
  599. "mainId": id,
  600. "typeFileId": "",
  601. "active": 1
  602. })
  603. }
  604. $("#address").val($("#address").attr("value"));
  605. $("#industryFieldNew").val($("#industryFieldNew").attr("value"))
  606. $("#industryField").val($("#industryField").attr("value"));
  607. ;
  608. $("#provinceCode").val($("#provinceCode").attr("value"));
  609. LivingAllowanceInfoInfoDlg.afterSelectProvince();
  610. $("#cityCode").val($("#cityCode").attr("value"));
  611. LivingAllowanceInfoInfoDlg.afterSelectCity();
  612. $("#countyCode").val($("#countyCode").attr("value"));
  613. LivingAllowanceInfoInfoDlg.validId();
  614. $("#photo").change(function (e) {
  615. var tag = e.target;
  616. var file = tag.files[0];
  617. var imgSrc;
  618. var reader = new FileReader();
  619. reader.readAsDataURL(file);
  620. reader.onload = function () {
  621. imgSrc = this.result;
  622. $("#photoImg").attr("src", imgSrc);
  623. };
  624. });
  625. });