talentInfo_info.js 46 KB

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