livingAllowanceInfo_info.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  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|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('industryField')
  199. .set('title')
  200. .set('professionalQualifications')
  201. .set('studyAbroad')
  202. // .set('studyAbroadCountry')
  203. .set('studyAbroadTime')
  204. .set('backJJBusinessTime')
  205. .set('introductionMethod')
  206. .set('firstSocialSecurityTime')
  207. // .set('introductionMode')
  208. // .set('letterTime')
  209. // .set('applyCount')
  210. ;
  211. if ($("#provinceCode").val() != null && $("#provinceCode").val() != '') {
  212. this.livingAllowanceInfoInfoData["provinceName"] = $("#provinceCode").find("option:selected").text();
  213. }
  214. if ($("#cityCode").val() != null && $("#cityCode").val() != '') {
  215. this.livingAllowanceInfoInfoData["cityName"] = $("#cityCode").find("option:selected").text();
  216. }
  217. if ($("#countyCode").val() != null && $("#countyCode").val() != '') {
  218. this.livingAllowanceInfoInfoData["countyName"] = $("#countyCode").find("option:selected").text();
  219. }
  220. var personalTaxVal = LivingAllowanceInfoInfoDlg.tax.getValue();
  221. var socialSecurityVal = LivingAllowanceInfoInfoDlg.socialSecurity.getValue();
  222. // if(personalTaxVal == null || personalTaxVal.length <= 0){
  223. // Feng.info("")
  224. // }
  225. var personalTax = personalTaxVal.map(function (item) {
  226. return item.value;
  227. }).sort().join(",");
  228. var socialSecurity = socialSecurityVal.map(function (item) {
  229. return item.value;
  230. }).sort().join(",");
  231. LivingAllowanceInfoInfoDlg.livingAllowanceInfoInfoData["personalTax"] = personalTax;
  232. LivingAllowanceInfoInfoDlg.livingAllowanceInfoInfoData["socialSecurity"] = socialSecurity;
  233. }
  234. /**
  235. * 数据校验
  236. * @returns {*|Window.jQuery}
  237. */
  238. LivingAllowanceInfoInfoDlg.validate = function () {
  239. $('#talentInfoForm').data("bootstrapValidator").resetForm();
  240. $('#talentInfoForm').bootstrapValidator('validate');
  241. return $("#talentInfoForm").data('bootstrapValidator').isValid();
  242. }
  243. LivingAllowanceInfoInfoDlg.upsertValidate = function () {
  244. this.clearData();
  245. this.collectData();
  246. if (!LivingAllowanceInfoInfoDlg.validate()) {
  247. return;
  248. }
  249. if (Feng.isEmptyStr(LivingAllowanceInfoInfoDlg.livingAllowanceInfoInfoData.socialSecurity)) {
  250. Feng.info("社保缴交情况不能为空!");
  251. return;
  252. }
  253. if (LivingAllowanceInfoInfoDlg.livingAllowanceInfoInfoData.introductionMethod == 1) {
  254. if (Feng.isEmptyStr(LivingAllowanceInfoInfoDlg.livingAllowanceInfoInfoData.firstInJJTime)) {
  255. Feng.info("首次来晋时间不能为空!");
  256. return;
  257. }
  258. var dateArr = new Array(LivingAllowanceInfoInfoDlg.livingAllowanceInfoInfoData.firstSocialSecurityTime,
  259. LivingAllowanceInfoInfoDlg.livingAllowanceInfoInfoData.entryTime,
  260. LivingAllowanceInfoInfoDlg.livingAllowanceInfoInfoData.startTime);
  261. dateArr.sort(function (a, b) {
  262. return a > b ? 1 : -1
  263. });
  264. if (new Date(dateArr[0]).getTime() < new Date("2021-11-16").getTime()) {
  265. Feng.info("不符合2021年11月16日起新引进的人才条件,无法申报");
  266. return;
  267. }
  268. }
  269. if (LivingAllowanceInfoInfoDlg.livingAllowanceInfoInfoData.introductionMethod == 2) {
  270. if (Feng.isEmptyStr(LivingAllowanceInfoInfoDlg.livingAllowanceInfoInfoData.backJJBusinessTime)) {
  271. Feng.info("返晋创业时间不能为空!");
  272. return;
  273. }
  274. if (new Date("2021-11-16").getTime() > new Date(LivingAllowanceInfoInfoDlg.livingAllowanceInfoInfoData.backJJBusinessTime).getTime()) {
  275. Feng.info("引进方式为其他的必须满足:返晋创业时间在2021-11-16至2022-11-15之间!");
  276. return;
  277. }
  278. if (new Date("2022-11-15").getTime() < new Date(LivingAllowanceInfoInfoDlg.livingAllowanceInfoInfoData.backJJBusinessTime).getTime()) {
  279. Feng.info("引进方式为其他的必须满足:返晋创业时间在2021-11-16至2022-11-15之间!");
  280. return;
  281. }
  282. }
  283. if (Feng.isEmptyStr(LivingAllowanceInfoInfoDlg.livingAllowanceInfoInfoData.id) && Feng.isEmptyStr($("#photo").val())) {
  284. Feng.info("头像不能为空!");
  285. return;
  286. }
  287. var formData = new FormData();
  288. Object.keys(this.livingAllowanceInfoInfoData).forEach((key) => {
  289. formData.append(key, this.livingAllowanceInfoInfoData[key]);
  290. });
  291. formData.append('file', $('#photo')[0].files[0]);
  292. return formData;
  293. }
  294. /**
  295. * 提交添加
  296. */
  297. LivingAllowanceInfoInfoDlg.addSubmit = function () {
  298. var formData = LivingAllowanceInfoInfoDlg.upsertValidate();
  299. if (formData == null) {
  300. return;
  301. }
  302. if (LivingAllowanceInfoInfoDlg.locked) {
  303. return;
  304. }
  305. LivingAllowanceInfoInfoDlg.locked = true;
  306. $.ajax({
  307. url: Feng.ctxPath + "/enterprise/living_allowance/apply",
  308. type: "POST",
  309. processData: false,
  310. contentType: false,
  311. data: formData,
  312. success: function (data) {
  313. LivingAllowanceInfoInfoDlg.setNoChangeField();
  314. LivingAllowanceInfoInfoDlg.locked = false;
  315. if (data.code == 200) {
  316. Feng.success(data.msg);
  317. window.parent.LivingAllowanceInfo.table.refresh();
  318. $("#id").val(data.obj.id);
  319. $("#fileLi").removeAttr("style");
  320. $("#checkState").val(data.obj.checkState);
  321. } else {
  322. Feng.info(data.msg);
  323. }
  324. }, error: function (data) {
  325. LivingAllowanceInfoInfoDlg.locked = false;
  326. Feng.error("保存失败!" + data.responseJSON.message + "!");
  327. }
  328. });
  329. }
  330. /**
  331. * 提交审核
  332. */
  333. LivingAllowanceInfoInfoDlg.submitToCheck = function () {
  334. var id = $("#id").val();
  335. if (Feng.isEmptyStr(id)) {
  336. Feng.info("请先填写基础信息并上传附件");
  337. return;
  338. }
  339. if (!validateIsEdit())
  340. return;
  341. var formData = LivingAllowanceInfoInfoDlg.upsertValidate();
  342. if (formData == null) {
  343. return;
  344. }
  345. $.ajax({
  346. url: Feng.ctxPath + "/enterprise/living_allowance/apply",
  347. type: "POST",
  348. processData: false,
  349. contentType: false,
  350. data: formData,
  351. async: true,
  352. success: function (data) {
  353. if (data.code == 200) {
  354. LivingAllowanceInfoInfoDlg.submitFun();
  355. } else {
  356. Feng.info(data.msg);
  357. }
  358. }, error: function (data) {
  359. LivingAllowanceInfoInfoDlg.locked = false;
  360. Feng.error("提交失败!" + data.responseJSON.message + "!");
  361. }
  362. });
  363. }
  364. LivingAllowanceInfoInfoDlg.submitFun = function () {
  365. var operation = function () {
  366. var ajax = new $ax(Feng.ctxPath + "/enterprise/living_allowance/submitToCheck", function (data) {
  367. if (data.code == 200) {
  368. Feng.success(data.msg);
  369. // $("#checkState").val(data.obj);
  370. window.parent.LivingAllowanceInfo.table.refresh();
  371. LivingAllowanceInfoInfoDlg.close();
  372. } else if (data.code == 600) {
  373. layer.confirm(data.msg, {
  374. btn: ['我已知晓'] //按钮
  375. }, function () {
  376. window.parent.LivingAllowanceInfo.table.refresh();
  377. LivingAllowanceInfoInfoDlg.close();
  378. });
  379. } else {
  380. Feng.error(data.msg);
  381. }
  382. }, function (data) {
  383. Feng.error("提交审核失败!" + data.responseJSON.message + "!");
  384. });
  385. ajax.set("id", $("#id").val());
  386. ajax.start();
  387. }
  388. Feng.confirm("请确认基础信息已核对无误,相应附件已上传,一旦提交,无法修改", operation);
  389. }
  390. /**
  391. * 设置不可修改的字段
  392. */
  393. LivingAllowanceInfoInfoDlg.setNoChangeField = function () {
  394. var checkState = $("#checkState").val();
  395. var fields = $("#fields").val();
  396. if (checkState == 10) {
  397. // $("input,textarea").each(function () {
  398. // $(this).attr("readonly", "readonly");
  399. // });
  400. $("select,input,textarea").not(":file,:hidden").each(function () {
  401. $(this).attr("disabled", "disabled");
  402. });
  403. if (Feng.isNotEmptyStr(fields)) {
  404. var arr = fields.split(",");
  405. for (var key in arr) {
  406. var name = $("#" + arr[key]).prop("tagName");
  407. if (name == 'select' || name == 'SELECT') {
  408. $("#" + arr[key]).removeAttr("disabled");
  409. }
  410. if (name == "input" || name == 'textarea' || name == "INPUT" || name == 'TEXTAREA') {
  411. $("#" + arr[key]).removeAttr("disabled");
  412. }
  413. }
  414. LivingAllowanceInfoInfoDlg.tax.update({disabled: fields.indexOf("personalTax") == -1});
  415. LivingAllowanceInfoInfoDlg.socialSecurity.update({disabled: fields.indexOf("socialSecurity") == -1});
  416. }
  417. }
  418. }
  419. /**
  420. * 数据加载
  421. * */
  422. /**
  423. * 加载市
  424. */
  425. LivingAllowanceInfoInfoDlg.afterSelectProvince = function () {
  426. var province = $("#provinceCode").val();
  427. $("#cityCode").empty();
  428. $("#countyCode").empty();
  429. if (province == null || province == '') {
  430. return;
  431. }
  432. Feng.addAjaxSelect({
  433. "id": "cityCode",
  434. "displayCode": "code",
  435. "displayName": "name",
  436. "type": "GET",
  437. "url": Feng.ctxPath + "/common/tool/findCityByProvinceSelect/code/" + province
  438. });
  439. }
  440. LivingAllowanceInfoInfoDlg.introductionMethodChange = function () {
  441. var introductionMethod = $("#introductionMethod").val();
  442. if (Feng.isEmptyStr(introductionMethod)) {
  443. $("#backJJBusinessTime,#firstInJJTime").val("");
  444. $("#backJJBusinessTimeDiv,#firstInJJTimeDiv").css("display", "none");
  445. return;
  446. }
  447. if (introductionMethod == 1) {
  448. $("#backJJBusinessTime").val("");
  449. $("#backJJBusinessTimeDiv").css("display", "none");
  450. $("#firstInJJTimeDiv").css("display", "block");
  451. return;
  452. }
  453. $("#firstInJJTime").val("");
  454. $("#firstInJJTimeDiv").css("display", "none");
  455. $("#backJJBusinessTimeDiv").css("display", "block");
  456. }
  457. /**
  458. * 加载县
  459. */
  460. LivingAllowanceInfoInfoDlg.afterSelectCity = function () {
  461. var city = $("#cityCode").val();
  462. $("#countyCode").empty();
  463. if (city == null || city == '') {
  464. return;
  465. }
  466. Feng.addAjaxSelect({
  467. "id": "countyCode",
  468. "displayCode": "code",
  469. "displayName": "name",
  470. "type": "GET",
  471. "url": Feng.ctxPath + "/common/tool/findCountyByCitySelect/code/" + city
  472. });
  473. }
  474. //校验是否保存基础信息
  475. LivingAllowanceInfoInfoDlg.validId = function () {
  476. var id = $("#id").val();
  477. if (id != null && id != '') {
  478. $("#fileLi").removeAttr("style");
  479. } else {
  480. $("#fileLi").attr("style", "pointer-events: none");
  481. }
  482. }
  483. LivingAllowanceInfoInfoDlg.initTaxAndSocialSecurity = function () {
  484. var year = $("#year").val().substr(0, 4);
  485. var nowYear = new Date().getFullYear();
  486. var nowMonth = new Date().getMonth() + 1;
  487. let maxMonth = 12;
  488. if (year == nowYear) {
  489. maxMonth = nowMonth;
  490. }
  491. var data = new Array();
  492. for (var i = 1; i <= maxMonth; i++) {
  493. var month = year + "-" + (i < 10 ? "0" + i : i);
  494. data.push({name: month, value: month, selected: false, disabled: false});
  495. }
  496. LivingAllowanceInfoInfoDlg.tax = xmSelect.render({
  497. el: '#personalTax',
  498. data: data
  499. })
  500. LivingAllowanceInfoInfoDlg.socialSecurity = xmSelect.render({
  501. el: '#socialSecurity',
  502. data: data
  503. })
  504. }
  505. function validUploadButton(type, row, fileId) {
  506. var files = $("#files").val();
  507. var checkState = $("#checkState").val();
  508. if ((Feng.isEmptyStr(checkState) || checkState == 1 || (checkState == 10 && files.indexOf(row.id) != -1)) && $("#hand").val() != "select") {
  509. return type == 1 ?
  510. "<button type='button' onclick=\"checkFile(this,'" + row.id + "','" + null + "')\" style='margin-right: 10px' class=\"btn btn-xs btn-info\">" +
  511. "<i class=\"fa fa-upload\"></i>上传" +
  512. "</button>"
  513. :
  514. // "<button type=\'button\' onclick=\"checkFile(this,'" + row.id + "','" + fileId + "')\" style=\'margin-right: 10px\' class=\"btn btn-xs btn-info\">" +
  515. // "<i class=\"fa fa-paste\"></i>修改" +
  516. // "</button>" +
  517. "<button type='button' onclick=\"deleteFile('" + fileId + "','" + CONFIG.project_master_living_allowance + "')\" class=\"btn btn-xs btn-danger\">" +
  518. "<i class=\"fa fa-times\"></i>删除" +
  519. "</button>";
  520. } else {
  521. return "";
  522. }
  523. }
  524. /**
  525. * 校验是否可以操作
  526. */
  527. function validateIsEdit() {
  528. var checkState = $("#checkState").val();
  529. if (checkState != 1 && checkState != 5 && checkState != 10) {
  530. if (checkState == -1) {
  531. Feng.error("您的申报审核不通过,无法再修改");
  532. return false;
  533. } else if (checkState >= 35) {
  534. Feng.error("您的申报已审核通过,无法再修改");
  535. return false;
  536. } else {
  537. Feng.error("您的申报正在审核中,请耐心等待");
  538. return false;
  539. }
  540. }
  541. return true;
  542. }
  543. $(function () {
  544. Feng.initValidatorTip("talentInfoForm", LivingAllowanceInfoInfoDlg.validateFields);
  545. var id = $("#id").val();
  546. var industry_field_type = $("#industry_field_type").val();
  547. if ($("#industryFieldNew").attr("value") != "") {
  548. industry_field_type = "un_industryField";//兼容查看旧申报时候,没有产业信息,就显示旧的行业领域信息
  549. }
  550. //批量加载字典表数据
  551. var arr = [
  552. {"name": "nation", "code": "nation"},
  553. {"name": "nationality", "code": "nationality"},
  554. {"name": "politics", "code": "politics"},
  555. {"name": "declareType", "code": "un_master_education"},
  556. {"name": "highEducation", "code": "highest_degree"},
  557. {"name": "introductionMode", "code": "un_introduction_mode"},
  558. {"name": "industryFieldNew", "code": "industry_field"},
  559. {"name": "industryField", "code": industry_field_type},
  560. {"name": "address", "code": "street"}];
  561. Feng.findChildDictBatch(JSON.stringify(arr))
  562. //加载省份
  563. Feng.addAjaxSelect({
  564. "id": "provinceCode",
  565. "displayCode": "code",
  566. "displayName": "name",
  567. "type": "GET",
  568. "url": Feng.ctxPath + "/common/tool/getProvinceSelect"
  569. });
  570. LivingAllowanceInfoInfoDlg.initTaxAndSocialSecurity();
  571. LivingAllowanceInfoInfoDlg.setNoChangeField();
  572. //批量加载时间控件
  573. $(".date").each(function () {
  574. laydate.render({
  575. elem: this
  576. , type: 'date'
  577. , trigger: 'click'
  578. });
  579. });
  580. if (id != null && id != '') {
  581. //select初始化
  582. $("select").each(function () {
  583. $(this).val($(this).attr("value")).trigger("change");
  584. });
  585. if (Feng.isNotEmptyStr($("#personalTax").attr("value"))) {
  586. LivingAllowanceInfoInfoDlg.tax.setValue($("#personalTax").attr("value").split(","));
  587. }
  588. if (Feng.isNotEmptyStr($("#socialSecurity").attr("value"))) {
  589. LivingAllowanceInfoInfoDlg.socialSecurity.setValue($("#socialSecurity").attr("value").split(","));
  590. }
  591. Feng.getCheckLog("logTable", {
  592. "type": CONFIG.project_master_living_allowance,
  593. "mainId": id,
  594. "typeFileId": "",
  595. "active": 1
  596. })
  597. }
  598. $("#address").val($("#address").attr("value"));
  599. $("#industryFieldNew").val($("#industryFieldNew").attr("value"))
  600. $("#industryField").val($("#industryField").attr("value"));
  601. ;
  602. $("#provinceCode").val($("#provinceCode").attr("value"));
  603. LivingAllowanceInfoInfoDlg.afterSelectProvince();
  604. $("#cityCode").val($("#cityCode").attr("value"));
  605. LivingAllowanceInfoInfoDlg.afterSelectCity();
  606. $("#countyCode").val($("#countyCode").attr("value"));
  607. LivingAllowanceInfoInfoDlg.validId();
  608. $("#photo").change(function (e) {
  609. var tag = e.target;
  610. var file = tag.files[0];
  611. var imgSrc;
  612. var reader = new FileReader();
  613. reader.readAsDataURL(file);
  614. reader.onload = function () {
  615. imgSrc = this.result;
  616. $("#photoImg").attr("src", imgSrc);
  617. };
  618. });
  619. });