new_nofile_talentInfo_info.js 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902
  1. /**
  2. * 初始化人才认定申报详情对话框
  3. */
  4. var locked = false;
  5. var TalentInfoInfoDlg = {
  6. talentInfoInfoData: {},
  7. validateFields: {
  8. source_county: {validators: {notEmpty: {message: '入选来源县市区不能为空'}}},
  9. talent_type: {validators: {notEmpty: {message: '人才类型不能为空'}}},
  10. name: {validators: {notEmpty: {message: '姓名不能为空'}}},
  11. card_type: {validators: {notEmpty: {message: '证件类型不能为空'}}},
  12. card_number: {
  13. validators: {
  14. notEmpty: {message: '证件号码不能为空'},
  15. regexp: {
  16. regexp: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
  17. message: "身份证号码格式不正确"
  18. }
  19. }
  20. },
  21. sex: {validators: {notEmpty: {message: '性别不能为空'}}},
  22. birthday: {validators: {notEmpty: {message: '出生日期不能为空'}}},
  23. nationality: {validators: {notEmpty: {message: '国籍/地区不能为空'}}},
  24. province: {validators: {notEmpty: {message: '户籍省份不能为空'}}},
  25. city: {validators: {notEmpty: {message: '户籍市不能为空'}}},
  26. nation: {validators: {notEmpty: {message: '民族不能为空'}}},
  27. politics: {validators: {notEmpty: {message: '政治面貌不能为空'}}},
  28. experience: {validators: {notEmpty: {message: '工作简历不能为空'}}},
  29. education: {validators: {notEmpty: {message: '教育背景不能为空'}}},
  30. apply_year: {validators: {notEmpty: {message: '申报年度不能为空'}}},
  31. import_way: {validators: {notEmpty: {message: '引进方式不能为空'}}},
  32. cur_entry_time: {validators: {notEmpty: {message: '本单位入职时间不能为空'}}},
  33. position: {validators: {notEmpty: {message: '本单位现任职务不能为空'}}},
  34. source: {validators: {notEmpty: {message: '申报来源不能为空'}}},
  35. talent_arrange: {validators: {notEmpty: {message: '人才层次不能为空'}}},
  36. talent_condition: {validators: {notEmpty: {message: '认定条件不能为空'}}},
  37. highest_degree: {validators: {notEmpty: {message: '最高学历不能为空'}}},
  38. graduate_school: {validators: {notEmpty: {message: '毕业院校不能为空'}}},
  39. major: {validators: {notEmpty: {message: '专业不能为空'}}},
  40. bank: {
  41. validators: {
  42. notEmpty: {
  43. message: '开户银行不能为空'
  44. },
  45. regexp: {
  46. regexp: /^[\u4e00-\u9fa5]*银行$/,
  47. message: "开户银行格式不正确"
  48. }
  49. }
  50. },
  51. bank_number: {
  52. validators: {
  53. notEmpty: {
  54. message: '银行行号不能为空'
  55. },
  56. regexp: {
  57. regexp: /^\d+$/,
  58. message: "银行行号格式不正确"
  59. }
  60. }
  61. },
  62. bank_branch_name: {
  63. validators: {
  64. notEmpty: {
  65. message: '开户银行网点不能为空'
  66. },
  67. regexp: {
  68. regexp: /^[\u4e00-\u9fa5]*银行[\u4e00-\u9fa5]*省?[\u4e00-\u9fa5]+市[\u4e00-\u9fa5]*$/,
  69. message: "开户银行格式不正确"
  70. }
  71. }
  72. },
  73. bank_account: {
  74. validators: {
  75. notEmpty: {
  76. message: '银行账号不能为空'
  77. },
  78. regexp: {
  79. regexp: /^\d+$/,
  80. message: "银行账号格式不正确"
  81. }
  82. }
  83. },
  84. phone: {
  85. validators: {
  86. notEmpty: {
  87. message: '手机号码不能为空'
  88. },
  89. regexp: {
  90. regexp: /0?(13|14|15|17|18|19)[0-9]{9}/,
  91. message: "手机号码格式不正确"
  92. }
  93. }
  94. },
  95. email: {
  96. validators: {
  97. notEmpty: {
  98. message: '电子邮箱不能为空'
  99. },
  100. emailAddress: {
  101. message: "电子邮箱格式不正确"
  102. }
  103. }
  104. }
  105. }
  106. };
  107. /**
  108. * 清除数据
  109. */
  110. TalentInfoInfoDlg.clearData = function () {
  111. this.talentInfoInfoData = {};
  112. }
  113. /**
  114. * 设置对话框中的数据
  115. *
  116. * @param key 数据的名称
  117. * @param val 数据的具体值
  118. */
  119. TalentInfoInfoDlg.set = function (key, val) {
  120. var dis = $("#" + key).attr("disabled");
  121. if (dis == "disabled") {
  122. $("#" + key).removeAttr("disabled");
  123. }
  124. this.talentInfoInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val;
  125. if (dis == "disabled") {
  126. $("#" + key).prop("disabled", true);
  127. }
  128. return this;
  129. }
  130. /**
  131. * 设置对话框中的数据
  132. *
  133. * @param key 数据的名称
  134. * @param val 数据的具体值
  135. */
  136. TalentInfoInfoDlg.get = function (key) {
  137. return $("#" + key).val();
  138. }
  139. /**
  140. * 关闭此对话框
  141. */
  142. TalentInfoInfoDlg.close = function () {
  143. parent.layer.close(window.parent.TalentInfo.layerIndex);
  144. }
  145. /**
  146. * 收集数据
  147. */
  148. TalentInfoInfoDlg.collectData = function () {
  149. this
  150. .set('id')
  151. .set('type')
  152. .set('talent_type')
  153. .set('tax_insurance_month')
  154. .set('labor_contract_rangetime')
  155. .set('pre_import_type')
  156. .set('salary_pay_way')
  157. .set('salary_pay_month')
  158. .set('enterprise_id')
  159. .set('name')
  160. .set('photo')
  161. .set('card_type')
  162. .set('card_number')
  163. .set('sex')
  164. .set('birthday')
  165. .set('nationality')
  166. .set('province')
  167. .set('city')
  168. .set('county')
  169. .set('nation')
  170. .set('politics')
  171. .set('talent_arrange')
  172. .set('talent_condition')
  173. .set('highest_degree')
  174. .set('graduate_school')
  175. .set('major')
  176. .set('professional')
  177. .set('bank')
  178. .set('bank_number')
  179. .set('bank_branch_name')
  180. .set('bank_account')
  181. .set('study_abroad')
  182. .set('abroad_school')
  183. .set('abroad_major')
  184. .set('phone')
  185. .set('email')
  186. .set('apply_year')
  187. .set('import_way')
  188. .set('fst_work_time')
  189. .set('cur_entry_time')
  190. .set('position')
  191. .set('source')
  192. .set('fujian_highcert_pubtime')
  193. .set('fujian_highcert_exptime')
  194. .set('quanzhou_highcert_pubtime')
  195. .set('quanzhou_highcert_exptime');
  196. if ($("#province").val() != null && $("#province").val() != '') {
  197. this.talentInfoInfoData["province_name"] = $("#province").find("option:selected").text();
  198. }
  199. if ($("#city").val() != null && $("#city").val() != '') {
  200. this.talentInfoInfoData["city_name"] = $("#city").find("option:selected").text();
  201. }
  202. if ($("#county").val() != null && $("#county").val() != '') {
  203. this.talentInfoInfoData["county_name"] = $("#county").find("option:selected").text();
  204. }
  205. if ($("#source_city").val() != null && $("#source_city").val() != '') {
  206. this.talentInfoInfoData["source_city_name"] = $("#source_city").find("option:selected").text();
  207. }
  208. if ($("#source_county").val() != null && $("#source_county").val() != '') {
  209. this.talentInfoInfoData["source_county_name"] = $("#source_county").find("option:selected").text();
  210. }
  211. }
  212. /**
  213. * 验证数据
  214. */
  215. TalentInfoInfoDlg.validate = function () {
  216. $('#talentInfoForm').data("bootstrapValidator").resetForm();
  217. $('#talentInfoForm').bootstrapValidator('validate');
  218. return $("#talentInfoForm").data('bootstrapValidator').isValid();
  219. }
  220. /**
  221. * 提交添加
  222. */
  223. TalentInfoInfoDlg.addSubmit = function () {
  224. this.clearData();
  225. this.collectData();
  226. /*if (!TalentInfoInfoDlg.validate()) {
  227. return;
  228. }*/
  229. var id = $('#id').val();
  230. if (id != null && id != '') {
  231. if (!TalentInfoInfoDlg.validateIsEdit())
  232. return;
  233. }
  234. $("select").each(function () {
  235. $(this).removeAttr("disabled");
  236. });
  237. if (locked) {
  238. return;
  239. }
  240. locked = true;
  241. $("#talentInfoForm").attr("action", "/enterprise/talent/apply");
  242. $("#talentInfoForm")[0].submit();
  243. }
  244. //回调
  245. TalentInfoInfoDlg.infoCallback = function (data) {
  246. locked = false;
  247. TalentInfoInfoDlg.setNoChangeField();
  248. Feng.info(data.msg);
  249. if (data.code == 200) {
  250. window.parent.TalentInfo.table.refresh();
  251. $("#id").val(data.obj.id);
  252. $("#fileLi").removeAttr("style");
  253. $("#checkState").val(data.obj.checkState);
  254. }
  255. return;
  256. }
  257. TalentInfoInfoDlg.getLayerCatdByLayer = function () {
  258. $("#talent_condition").parents(".table").find(".fileTable").find("tbody").html("");
  259. $("#talent_condition").html("<option>---请选择---</option>");
  260. $("#annual_salary").parents("td").css("display", "none");
  261. $('#talentInfoForm').bootstrapValidator('removeField', "annual_salary");
  262. var level = $("#talent_arrange").val();
  263. Feng.addAjaxSelect({
  264. "id": "talent_arrange_category",
  265. "displayCode": "code",
  266. "displayName": "name",
  267. "type": "GET",
  268. "url": Feng.ctxPath + "/common/api/getLayerCatsByLayer/level/" + level
  269. });
  270. $("#talent_condition").trigger("chosen:updated");
  271. }
  272. /**
  273. * 获取人才认定
  274. */
  275. TalentInfoInfoDlg.getIdentifyCondition = function () {
  276. $("#talent_condition").parents(".table").find(".fileTable").find("tbody").html("");
  277. $("#annual_salary").parents("td").css("display", "none");
  278. $('#talentInfoForm').bootstrapValidator('removeField', "annual_salary");
  279. var level = $("#talent_arrange").val();
  280. var cat = $("#talent_arrange_category").val();
  281. var id = $('#id').val();
  282. Feng.addAjaxSelect({
  283. "id": "talent_condition",
  284. "displayCode": "id",
  285. "displayName": "name",
  286. "type": "GET",
  287. "url": Feng.ctxPath + "/common/api/findIdentifyConditionByLevel/level/" + level + "/cat/" + cat + "/id/" + id
  288. });
  289. $("#talent_condition").trigger('chosen:updated');
  290. }
  291. TalentInfoInfoDlg.getIdentifyNeedsFileTypes = function () {
  292. $("#annual_salary").parents("td").css("display", "none");
  293. $('#talentInfoForm').bootstrapValidator('removeField', "annual_salary");
  294. var source = $("#source").val();
  295. if (source == "" || typeof source == "undefined") {
  296. layer.alert("请先选择申报来源");
  297. $("#talent_condition").val("");
  298. $("#talent_condition").trigger('chosen:updated');
  299. return;
  300. }
  301. TalentInfoInfoDlg.ajaxGetConditionFile(source);
  302. }
  303. TalentInfoInfoDlg.ajaxGetConditionFile = function (source) {
  304. var condition = $("#talent_condition option:selected").val();
  305. if (condition != "") {
  306. var ajax = new $ax("/common/api/getTalentCondtionUploadFile", function (data) {
  307. if (data == null || data.length == 0) {
  308. return;
  309. }
  310. if (typeof data.info != "undefined" && data.info.isSalary == 1) {
  311. $("#annual_salary").parents("td").css("display", "table-cell");
  312. $('#talentInfoForm').bootstrapValidator('addField', "annual_salary", {validators: {
  313. notEmpty: {message: '年薪不能放空'},
  314. callback: {
  315. message: "年薪只能填写数字",
  316. callback: function (value, validator) {
  317. if (!isNaN(value) && isFinite(value)) {
  318. return true;
  319. }
  320. return false;
  321. }
  322. }
  323. }
  324. });
  325. }
  326. if (source != "5") {
  327. return;
  328. }
  329. }, function (data) {
  330. Feng.error("查询失败!" + data.responseJSON.message + "!");
  331. });
  332. var queryData = {};
  333. queryData["mainId"] = $("#id").val();
  334. queryData['project'] = CONFIG.project_rcrd;
  335. queryData["source"] = source;
  336. queryData['type'] = $("#type").val();
  337. queryData["talent_condition"] = condition;
  338. ajax.set(queryData);
  339. ajax.start();
  340. }
  341. }
  342. TalentInfoInfoDlg.bankChange = function () {
  343. var bank = $("#bank").val();
  344. if ($.trim(bank) == '中国工商银行') {
  345. $("#bank_number").val('102391050013');
  346. } else {
  347. $("#bank_number").val('');
  348. }
  349. }
  350. TalentInfoInfoDlg.changeStudyAbroad = function () {
  351. var is_abroad = $("#study_abroad").val();
  352. if (is_abroad == 1) {
  353. $(".abroad_need_this").css("display", "table-row");
  354. $('#talentInfoForm').bootstrapValidator('addField', "abroad_school", {validators: {notEmpty: {message: '留学毕业院校不能为空'}}});
  355. $('#talentInfoForm').bootstrapValidator('addField', "abroad_major", {validators: {notEmpty: {message: '留学专业不能为空'}}});
  356. } else {
  357. $(".abroad_need_this").css("display", "none");
  358. $("#abroad_school").val("");
  359. $("#abroad_major").val("");
  360. $('#talentInfoForm').bootstrapValidator('removeField', "abroad_school");
  361. $('#talentInfoForm').bootstrapValidator('removeField', "abroad_major");
  362. }
  363. }
  364. /**
  365. * 加载市
  366. */
  367. TalentInfoInfoDlg.afterSelectProvince = function () {
  368. var province = $("#province").val();
  369. $("#city").empty();
  370. $("#county").empty();
  371. if (province == null || province == '') {
  372. return;
  373. }
  374. Feng.addAjaxSelect({
  375. "id": "city",
  376. "displayCode": "code",
  377. "displayName": "name",
  378. "type": "GET",
  379. "url": Feng.ctxPath + "/common/tool/findCityByProvinceSelect/code/" + province
  380. });
  381. }
  382. /**
  383. * 加载县
  384. */
  385. TalentInfoInfoDlg.afterSelectCity = function () {
  386. var city = $("#city").val();
  387. $("#county").empty();
  388. if (city == null || city == '') {
  389. return;
  390. }
  391. Feng.addAjaxSelect({
  392. "id": "county",
  393. "displayCode": "code",
  394. "displayName": "name",
  395. "type": "GET",
  396. "url": Feng.ctxPath + "/common/tool/findCountyByCitySelect/code/" + city
  397. });
  398. }
  399. TalentInfoInfoDlg.isAgeChecked = false;
  400. TalentInfoInfoDlg.birthdayChange = function () {
  401. let birthday = parseInt($("#birthday").val().substring(0, 4));
  402. let currentYear = parseInt(new Date().getFullYear());
  403. let age = currentYear - (isNaN(birthday) ? 0 : birthday);
  404. let option = $("[data-rel=birthday]");
  405. let limitAge = option.data("option");
  406. if (age >= limitAge) {
  407. option.css("display", "table-row");
  408. option.next("tr.detail-view").css("display", "table-row");
  409. if (!TalentInfoInfoDlg.isAgeChecked) {
  410. layer.alert("由于您的年龄大于70岁(含),要求提供人社局的允许申报的批文,请线下前往人社局办理。如已办理,请将该批文作为附件上传至对应附件栏中。");
  411. TalentInfoInfoDlg.isAgeChecked = true;
  412. return false;
  413. }
  414. } else {
  415. TalentInfoInfoDlg.isAgeChecked = false;
  416. option.css("display", "none");
  417. option.next("tr.detail-view").css("display", "none");
  418. }
  419. return true;
  420. }
  421. TalentInfoInfoDlg.initBirthday = function () {
  422. let birthday = parseInt($("#birthday").val().substring(0, 4));
  423. let currentYear = parseInt(new Date().getFullYear());
  424. let age = currentYear - (isNaN(birthday) ? 0 : birthday);
  425. let option = $("[data-rel=birthday]");
  426. let isFileExists = option.next("tr.detail-view").find("ul.imgs").find("li").length > 3 ? true : false;
  427. let limitAge = option.data("option");
  428. if (!isNaN(birthday)) {
  429. if (age >= limitAge && isFileExists) {
  430. TalentInfoInfoDlg.isAgeChecked = true;
  431. }
  432. TalentInfoInfoDlg.birthdayChange();
  433. }
  434. }
  435. TalentInfoInfoDlg.talentTypeChange = function () {
  436. var talent_type = $("#talent_type").val();
  437. //$("#tax_insurance_month").val("").parent().css("display", "none");
  438. //$("#labor_contract_rangetime").val("").parent().css("display", "none");
  439. $(".talentType1-2").css("display", "none");
  440. $(".talentType3").css("display", "none");
  441. var text = "";
  442. switch (talent_type) {
  443. case "1":
  444. TalentInfoInfoDlg.talentTypeOneTwo = true;
  445. $("#tipsBlock").css('display', 'block');
  446. $("#typeTips").html("含经晋江市认定且还在晋江市就业创业的人才,或在晋江市就业创业但未曾申报过晋江市现代产业体系人才的人才。");
  447. //$("#desc_talent_type").html("请上传社会保险或个人所得税缴费佐证材料");
  448. $(".talentType1-2").css("display", "table-cell");
  449. $("#talentType_first").css('display', "none");
  450. $('#talentInfoForm').bootstrapValidator('addField', "tax_insurance_month", {
  451. validators: {
  452. notEmpty: {message: '在我市缴交社会保险或个人所得税月份不能为空'}
  453. }
  454. });
  455. $('#talentInfoForm').bootstrapValidator('addField', "labor_contract_rangetime", {validators: {notEmpty: {message: '劳动合同起止时间'}}});
  456. $('#talentInfoForm').bootstrapValidator('addField', "salary_pay_way", {validators: {notEmpty: {message: '请选择工资发放渠道'}}});
  457. $('#talentInfoForm').bootstrapValidator('addField', "salary_pay_month", {validators: {notEmpty: {message: '请选择工资发放月份'}}});
  458. if (TalentInfoInfoDlg.talentTypeFlag) {
  459. TalentInfoInfoDlg.talentTypeFlag = false;
  460. $('#talentInfoForm').bootstrapValidator('removeField', "pre_import_type");
  461. }
  462. text = $("#fst_work_time").length > 0 ? $("#fst_work_time").prev("label").html().replace(/首次/, "近三年") : "";
  463. $("#come_in_jin").length > 0 ? $("#come_in_jin").css('display', 'table-cell') : "";
  464. $("#come_in_jin_str").length > 0 ? $("#come_in_jin_str").css('display', 'table-cell') : "";
  465. break;
  466. case "2":
  467. TalentInfoInfoDlg.talentTypeOneTwo = true;
  468. $("#tipsBlock").css('display', 'block');
  469. $("#typeTips").html("含本办法出台后首次从晋江市以外引进认定的人才,或者流出晋江市满3年后又返回晋江市就业创业(不含企业集团内部人员调动)的人才。")
  470. //$("#desc_talent_type").html("请上传社会保险或个人所得税缴费佐证材料与来我市前工作情况证明,例如原工作单位出具的工作证明、离职证明或原创(领)办企业的营业执照复印件、经市场监管部门备案的公司章程复印件等证明材料");
  471. $(".talentType1-2").css("display", "table-cell");
  472. $("#talentType_first").css('display', "inline");
  473. $('#talentInfoForm').bootstrapValidator('addField', "tax_insurance_month", {
  474. validators: {
  475. notEmpty: {message: '在我市缴交社会保险或个人所得税月份不能为空'}
  476. }
  477. });
  478. $('#talentInfoForm').bootstrapValidator('addField', "labor_contract_rangetime", {validators: {notEmpty: {message: '劳动合同起止时间'}}});
  479. $('#talentInfoForm').bootstrapValidator('addField', "salary_pay_way", {validators: {notEmpty: {message: '请选择工资发放渠道'}}});
  480. $('#talentInfoForm').bootstrapValidator('addField', "salary_pay_month", {validators: {notEmpty: {message: '请选择工资发放月份'}}});
  481. if (TalentInfoInfoDlg.talentTypeFlag) {
  482. TalentInfoInfoDlg.talentTypeFlag = false;
  483. $('#talentInfoForm').bootstrapValidator('removeField', "pre_import_type");
  484. }
  485. text = $("#fst_work_time").length > 0 ? $("#fst_work_time").prev("label").html().replace(/近三年/, "首次") : "";
  486. $("#come_in_jin").length > 0 ? $("#come_in_jin").css('display', 'table-cell') : "";
  487. $("#come_in_jin_str").length > 0 ? $("#come_in_jin_str").css('display', 'none') : "";
  488. break;
  489. case "3":
  490. TalentInfoInfoDlg.talentTypeFlag = true;
  491. $("#tipsBlock").css('display', 'block');
  492. $("#typeTips").html("含已经与晋江市用人单位达成就业意向且签订预引进意向合作协议(合同)的人才,或拟来我市创业且提交企业名称预先核准的人才。")
  493. //$("#desc_talent_type").html("请先提供意向合作协议(合同)或企业名称预先核准材料,落地我市后再补齐上述材料");
  494. $(".talentType3").css("display", "table-cell");
  495. $("#talentType_first").css('display', "none");
  496. $('#talentInfoForm').bootstrapValidator('addField', "pre_import_type", {validators: {notEmpty: {message: '请选择预引进类型'}}});
  497. if (TalentInfoInfoDlg.talentTypeOneTwo) {
  498. TalentInfoInfoDlg.talentTypeOneTwo = false;
  499. $('#talentInfoForm').bootstrapValidator('removeField', "labor_contract_rangetime");
  500. $('#talentInfoForm').bootstrapValidator('removeField', "tax_insurance_month");
  501. $('#talentInfoForm').bootstrapValidator('removeField', "salary_pay_way");
  502. $('#talentInfoForm').bootstrapValidator('removeField', "salary_pay_month");
  503. }
  504. text = $("#fst_work_time").length > 0 ? $("#fst_work_time").prev("label").html().replace(/近三年/, "首次") : "";
  505. $("#come_in_jin").length > 0 ? $("#come_in_jin").css('display', 'none') : "";
  506. $("#come_in_jin_str").length > 0 ? $("#come_in_jin_str").css('display', 'none') : "";
  507. break;
  508. default:
  509. $("#tipsBlock").css('display', 'none');
  510. text = $("#fst_work_time").length > 0 ? $("#fst_work_time").prev("label").html().replace(/近三年/, "首次") : "";
  511. break;
  512. }
  513. $("#fst_work_time").prev("label").html(text);
  514. for (var i = 0; i < $("[data-rel=talent_type]").length; i++) {
  515. let option = $("[data-rel=talent_type]").eq(i);
  516. let options = option.data("option").toString().split(",");
  517. if (options.indexOf(talent_type) > -1) {
  518. option.css("display", "table-row");
  519. option.next("tr.detail-view").css("display", "table-row");
  520. } else {
  521. option.css("display", "none");
  522. option.next("tr.detail-view").css("display", "none");
  523. }
  524. }
  525. }
  526. TalentInfoInfoDlg.sourceChange = function () {
  527. var source = $("#source").val();
  528. $("#source_batch").val("").parents("td").css("display", "none");
  529. $(".fujian_highcert").css("display", "none");
  530. $(".quanzhou_highcert").css("display", "none");
  531. $("#source_city").val("").parents("td").css("display", "none");
  532. $("#source_county").val("").parents("td").css("display", "none");
  533. $('#talentInfoForm').bootstrapValidator('removeField', "source_batch");
  534. $('#talentInfoForm').bootstrapValidator('removeField', "fujian_highcert_pubtime");
  535. $('#talentInfoForm').bootstrapValidator('removeField', "fujian_highcert_exptime");
  536. $('#talentInfoForm').bootstrapValidator('removeField', "quanzhou_highcert_pubtime");
  537. $('#talentInfoForm').bootstrapValidator('removeField', "quanzhou_highcert_exptime");
  538. $('#talentInfoForm').bootstrapValidator('removeField', "source_city");
  539. $('#talentInfoForm').bootstrapValidator('removeField', "source_county");
  540. switch (source) {
  541. case "1":
  542. case "3":
  543. $("#source_batch").parents("td").css("display", "table-cell");
  544. $(".fujian_highcert").css("display", "table-cell");
  545. $('#talentInfoForm').bootstrapValidator('addField', "source_batch", {validators: {notEmpty: {message: '申报来源批次不能为空'}}});
  546. $('#talentInfoForm').bootstrapValidator('addField', "fujian_highcert_pubtime", {validators: {notEmpty: {message: '福建省高层次人才证书发证日期不能为空'}}});
  547. $('#talentInfoForm').bootstrapValidator('addField', "fujian_highcert_exptime", {validators: {notEmpty: {message: '福建省高层次人才证书有效期不能为空'}}});
  548. break;
  549. case "2":
  550. case "4":
  551. $("#source_batch").parents("td").css("display", "table-cell");
  552. $(".quanzhou_highcert").css("display", "table-cell");
  553. $('#talentInfoForm').bootstrapValidator('addField', "source_batch", {validators: {notEmpty: {message: '申报来源批次不能为空'}}});
  554. $('#talentInfoForm').bootstrapValidator('addField', "quanzhou_highcert_pubtime", {validators: {notEmpty: {message: '泉州高层次人才证书发证日期不能为空'}}});
  555. $('#talentInfoForm').bootstrapValidator('addField', "quanzhou_highcert_exptime", {validators: {notEmpty: {message: '泉州高层次人才证书有效期不能为空'}}});
  556. break;
  557. }
  558. if (source == 3) {
  559. //显示入选来源地级市除泉
  560. $("#source_city").parents("td").css("display", "table-cell");
  561. Feng.addAjaxSelect({
  562. "id": "source_city",
  563. "displayCode": "code",
  564. "displayName": "name",
  565. "type": "GET",
  566. "url": "/common/tool/findChildAreaByCode/code/35/no/350500"
  567. });
  568. $('#talentInfoForm').bootstrapValidator('addField', "source_city", {validators: {notEmpty: {message: '入选来源地级市不能为空'}}});
  569. }
  570. if (source == 4) {
  571. //显示入选来源县市区除晋
  572. $("#source_county").parents("td").css("display", "table-cell");
  573. Feng.addAjaxSelect({
  574. "id": "source_county",
  575. "displayCode": "code",
  576. "displayName": "name",
  577. "type": "GET",
  578. "url": "/common/tool/findChildAreaByCode/code/3505/no/350582"
  579. });
  580. $('#talentInfoForm').bootstrapValidator('addField', "source_county", {validators: {notEmpty: {message: '入选来源县市区不能为空'}}});
  581. }
  582. if (source != 5) {
  583. $("#talent_condition").parents(".table").find(".fileTable").find("tbody").html("");
  584. } else {
  585. TalentInfoInfoDlg.ajaxGetConditionFile(source);
  586. }
  587. }
  588. //校验是否保存基础信息
  589. TalentInfoInfoDlg.validId = function () {
  590. var id = $("#id").val();
  591. if (id != null && id != '') {
  592. $("#fileLi").removeAttr("style");
  593. } else {
  594. $("#fileLi").attr("style", "pointer-events: none");
  595. }
  596. }
  597. /**
  598. * 提交审核
  599. */
  600. TalentInfoInfoDlg.submitToCheck = function () {
  601. /*if (!TalentInfoInfoDlg.validate()) {
  602. return;
  603. }*/
  604. var id = $("#id").val();
  605. /*if (id == null || id == "") {
  606. Feng.info("请先填写基础信息并上传附件");
  607. return;
  608. }*/
  609. if (!TalentInfoInfoDlg.validateIsEdit())
  610. return;
  611. var operation = function () {
  612. TalentInfoInfoDlg.clearData();
  613. TalentInfoInfoDlg.collectData();
  614. /*if (!TalentInfoInfoDlg.validate()) {
  615. return;
  616. }*/
  617. var id = $('#id').val();
  618. if (id != null && id != '') {
  619. if (!TalentInfoInfoDlg.validateIsEdit())
  620. return;
  621. }
  622. $("select,input[type=radio]").each(function () {
  623. $(this).removeAttr("disabled");
  624. });
  625. if (locked) {
  626. return;
  627. }
  628. locked = true;
  629. $("#talentInfoForm").attr("action", "/enterprise/talent/submitToCheck");
  630. $("#talentInfoForm")[0].submit();
  631. return;
  632. var ajax = new $ax(Feng.ctxPath + "/enterprise/talent/submit", function (data) {
  633. if (data.code == 200) {
  634. Feng.success(data.msg);
  635. // $("#checkState").val(data.obj);
  636. window.parent.TalentInfo.table.refresh();
  637. TalentInfoInfoDlg.close();
  638. } else {
  639. Feng.error(data.msg);
  640. }
  641. }, function (data) {
  642. Feng.error("提交审核失败!" + data.responseJSON.message + "!");
  643. });
  644. ajax.set("id", id);
  645. ajax.start();
  646. }
  647. Feng.confirm("请确认基础信息已核对无误,相应附件已上传,一旦提交,无法修改", operation);
  648. }
  649. //回调
  650. TalentInfoInfoDlg.submitCallback = function (data) {
  651. locked = false;
  652. TalentInfoInfoDlg.setNoChangeField();
  653. if (data.code == 200) {
  654. Feng.success(data.msg);
  655. // $("#checkState").val(data.obj);
  656. window.parent.TalentInfo.table.refresh();
  657. TalentInfoInfoDlg.close();
  658. } else {
  659. Feng.error(data.msg);
  660. }
  661. }
  662. /**
  663. * 校验是否可以修改/提交审核
  664. */
  665. TalentInfoInfoDlg.validateIsEdit = function () {
  666. var checkState = $("#checkState").val();
  667. if (checkState != 0 && checkState != 8) {
  668. if (checkState == 16 || checkState == -1 || checkState == -2 || checkState == 7) {
  669. Feng.error("您的申报审核不通过,无法再修改");
  670. return false;
  671. } else if (checkState == 28) {
  672. Feng.error("申报已完成");
  673. return false;
  674. } else if (checkState == 14) {
  675. Feng.error("您的申报已审核通过,无法再修改");
  676. return false;
  677. } else if (checkState == 22 || checkState == 25 || checkState == 27) {
  678. Feng.error("该申报已终止");
  679. return false;
  680. } else {
  681. Feng.error("您的申报正在审核中,请耐心等待");
  682. return false;
  683. }
  684. }
  685. return true;
  686. }
  687. TalentInfoInfoDlg.downloadFile = function (id, type) {
  688. window.location.href = Feng.ctxPath + "/api/common/downloadFile?id=" + id + "&type=" + type;
  689. }
  690. //设置不可修改的字段
  691. TalentInfoInfoDlg.setNoChangeField = function () {
  692. var checkState = $("#checkState").val();
  693. var fields = $("#fields").val();
  694. var realState = $("#realState").val();
  695. if (realState == 11) {
  696. $("input,textarea").each(function () {
  697. $(this).attr("readonly", "readonly");
  698. });
  699. $("select,input[type=radio]").each(function () {
  700. $(this).attr("disabled", "disabled");
  701. });
  702. if (fields != null && fields != '') {
  703. var arr = fields.split(",");
  704. for (var key in arr) {
  705. var name = $("#" + arr[key]).prop("tagName");
  706. if (name == 'select' || name == 'SELECT') {
  707. $("#" + arr[key]).removeAttr("disabled");
  708. } else if (name == "input" || name == 'textarea' || name == "INPUT" || name == 'TEXTAREA') {
  709. $("#" + arr[key]).removeAttr("readonly");
  710. } else {
  711. if (name == "undefined") {
  712. $("input[name=" + arr[key] + "]").removeAttr("disabled").removeAttr("readonly");
  713. }
  714. }
  715. }
  716. }
  717. }
  718. }
  719. $("#card_type").change(function () {
  720. async_padding($("#card_number").val().trim(), $(this).val());
  721. })
  722. $("#card_number").blur(function () {
  723. async_padding($(this).val().trim(), $("#card_type").val());
  724. })
  725. function async_padding(card_number, card_type) {
  726. if (card_number != "" && card_number.length == 18 && card_type == "1") {
  727. var year = card_number.substring(6, 10);
  728. var month = card_number.substring(10, 12);
  729. var day = card_number.substring(12, 14);
  730. var birthday = year + "-" + month + "-" + day;
  731. var rule = /\d{4}-\d{2}-\d{2}/;
  732. if (rule.test(birthday))
  733. $("#birthday").val(birthday);
  734. var num = card_number.substring(17, 1);
  735. if (num % 2 == 0) {
  736. $("#sex").val(2);
  737. } else {
  738. $("#sex").val(1);
  739. }
  740. }
  741. }
  742. $(function () {
  743. //Feng.initValidatorTip("talentInfoForm", TalentInfoInfoDlg.validateFields);
  744. var id = $("#id").val();
  745. var checkState = $("#checkState").val();
  746. //批量加载字典表数据
  747. var arr = [
  748. {"name": "nation", "code": "nation"},
  749. {"name": "talent_arrange", "code": "talent_arrange"},
  750. {"name": "nationality", "code": "nationality"},
  751. {"name": "politics", "code": "politics"},
  752. {"name": "highest_degree", "code": "highest_degree"},
  753. {"name": "source", "code": "source"},
  754. {"name": "import_way", "code": "import_way"}];
  755. Feng.findChildDictBatch(JSON.stringify(arr))
  756. //加载省份
  757. Feng.addAjaxSelect({
  758. "id": "province",
  759. "displayCode": "code",
  760. "displayName": "name",
  761. "type": "GET",
  762. "url": "/common/tool/getProvinceSelect"
  763. });
  764. //批量加载时间控件
  765. $(".date").each(function () {
  766. laydate.render({
  767. elem: this
  768. , type: 'date'
  769. , trigger: 'click'
  770. });
  771. });
  772. $(".rangedate").each(function () {
  773. laydate.render({
  774. elem: this,
  775. type: "date",
  776. range: true,
  777. trigger: "click"
  778. })
  779. })
  780. $(".rangemonth").each(function () {
  781. laydate.render({
  782. elem: this,
  783. type: "month",
  784. range: true,
  785. trigger: "click"
  786. })
  787. })
  788. if (id != null && id != '') {
  789. //select初始化
  790. $("select").each(function () {
  791. $(this).val($(this).attr("value")).trigger("change");
  792. });
  793. Feng.getCheckLog("logTable", {"type": CONFIG.project_rcrd, "mainId": id, "typeFileId": "", "active": 1})
  794. }
  795. $("#talent_type").val($("#talent_type").attr("value"));
  796. $("#card_type").val($("#card_type").attr("value"));
  797. $("#sex").val($("#sex").attr("value"));
  798. $("#enterprise_tag").val($("#enterprise_tag").attr("value"));
  799. $("#address").val($("#address").attr("value"));
  800. $("#nation").val($("#nation").attr("value"));
  801. $("#nationality").val($("#nationality").attr("value"));
  802. $("#industry_field").val($("#industry_field").attr("value"));
  803. $("#province").val($("#province").attr("value"));
  804. TalentInfoInfoDlg.afterSelectProvince();
  805. $("#city").val($("#city").attr("value"));
  806. TalentInfoInfoDlg.afterSelectCity();
  807. $("#county").val($("#county").attr("value"));
  808. TalentInfoInfoDlg.getIdentifyCondition();
  809. $("#politics").val($("#politics").attr("value"));
  810. $("#tax_insurance_month").val($("#tax_insurance_month").attr("value"));
  811. $("#labor_contract_rangetime").val($("#labor_contract_rangetime").attr("value"));
  812. $("#source_batch").val($("#source_batch").attr("value"));
  813. $("#source_city").val($("#source_city").attr("value"));
  814. $("#source_county").val($("#source_county").attr("value"));
  815. $("#quanzhou_highcert_pubtime").val($("#quanzhou_highcert_pubtime").attr("value"));
  816. $("#quanzhou_highcert_exptime").val($("#quanzhou_highcert_exptime").attr("value"));
  817. $("#fujian_highcert_pubtime").val($("#fujian_highcert_pubtime").attr("value"));
  818. $("#fujian_highcert_exptime").val($("#fujian_highcert_exptime").attr("value"));
  819. $("#talent_arrange").val($("#talent_arrange").attr("value"));
  820. TalentInfoInfoDlg.getLayerCatdByLayer();
  821. $("#talent_arrange_category").val($("#talent_arrange_category").attr("value"));
  822. TalentInfoInfoDlg.getIdentifyCondition();
  823. TalentInfoInfoDlg.validId();
  824. $("#photo").change(function (e) {
  825. var tag = e.target;
  826. var file = tag.files[0];
  827. var imgSrc;
  828. var reader = new FileReader();
  829. reader.readAsDataURL(file);
  830. reader.onload = function () {
  831. imgSrc = this.result;
  832. $("#photoImg").attr("src", imgSrc);
  833. };
  834. });
  835. TalentInfoInfoDlg.setNoChangeField();
  836. $("#talent_condition").on('chosen:ready', function (e, params) {
  837. $(".chosen-container-single .chosen-single").css("padding", "4px 0px 0px 4px");
  838. });
  839. $("#talent_condition").val($("#talent_condition").attr("value"));
  840. $("#talent_condition").chosen({
  841. search_contains: true,    //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
  842. disable_search: false,
  843. width: "calc(100%)",
  844. enable_split_word_search: true,
  845. rtl: true
  846. });
  847. if ($("#annual_salary").val() != "") {
  848. $("#annual_salary").parents("td").css("display", "table-cell");
  849. $('#talentInfoForm').bootstrapValidator('addField', "annual_salary", {validators: {
  850. notEmpty: {message: '年薪不能放空'},
  851. callback: {
  852. message: "年薪只能填写数字",
  853. callback: function (value, validator) {
  854. if (!isNaN(value) && isFinite(value)) {
  855. return true;
  856. }
  857. return false;
  858. }
  859. }
  860. }
  861. });
  862. }
  863. var is_abroad = $("#study_abroad").val();
  864. if (is_abroad == "1") {
  865. TalentInfoInfoDlg.changeStudyAbroad();
  866. }
  867. TalentInfoInfoDlg.initBirthday();
  868. $(".uitd_showTip").bind("mouseover", function () {
  869. var htm = $(this).html();
  870. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  871. });
  872. });