talentInfo_info.js 45 KB

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