livingAllowanceInfo_info.js 22 KB

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