talentInfo_info.js 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074
  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. for (var i = 0; i < $("[data-rel=talent_type]").length; i++) {
  412. let option = $("[data-rel=talent_type]").eq(i);
  413. let options = option.data("option").toString().split(",");
  414. if (options.indexOf(talent_type) > -1) {
  415. option.css("display", "table-row");
  416. option.next("tr.detail-view").css("display", "table-row");
  417. } else {
  418. option.css("display", "none");
  419. option.next("tr.detail-view").css("display", "none");
  420. }
  421. }
  422. }
  423. TalentInfoInfoDlg.sourceChange = function () {
  424. var source = $("#source").val();
  425. $("#source_batch").val("").parent().css("display", "none");
  426. $("#fujian_highcert_pubtime").val("").parent().css("display", "none");
  427. $("#fujian_highcert_exptime").val("").parent().css("display", "none");
  428. $("#quanzhou_highcert_pubtime").val("").parent().css("display", "none");
  429. $("#quanzhou_highcert_exptime").val("").parent().css("display", "none");
  430. $("#source_city").val("").parent().css("display", "none");
  431. $("#source_county").val("").parent().css("display", "none");
  432. $('#talentInfoForm').bootstrapValidator('removeField', "source_batch");
  433. $('#talentInfoForm').bootstrapValidator('removeField', "fujian_highcert_pubtime");
  434. $('#talentInfoForm').bootstrapValidator('removeField', "fujian_highcert_exptime");
  435. $('#talentInfoForm').bootstrapValidator('removeField', "quanzhou_highcert_pubtime");
  436. $('#talentInfoForm').bootstrapValidator('removeField', "quanzhou_highcert_exptime");
  437. $('#talentInfoForm').bootstrapValidator('removeField', "source_city");
  438. $('#talentInfoForm').bootstrapValidator('removeField', "source_county");
  439. switch (source) {
  440. case "1":
  441. case "3":
  442. $("#source_batch").parent().css("display", "block");
  443. $("#fujian_highcert_pubtime").parent().css("display", "block");
  444. $("#fujian_highcert_exptime").parent().css("display", "block");
  445. $('#talentInfoForm').bootstrapValidator('addField', "source_batch", {validators: {notEmpty: {message: '申报来源批次不能为空'}}});
  446. $('#talentInfoForm').bootstrapValidator('addField', "fujian_highcert_pubtime", {validators: {notEmpty: {message: '福建省高层次人才证书发证日期不能为空'}}});
  447. $('#talentInfoForm').bootstrapValidator('addField', "fujian_highcert_exptime", {validators: {notEmpty: {message: '福建省高层次人才证书有效期不能为空'}}});
  448. break;
  449. case "2":
  450. case "4":
  451. $("#source_batch").parent().css("display", "block");
  452. $("#quanzhou_highcert_pubtime").parent().css("display", "block");
  453. $("#quanzhou_highcert_exptime").parent().css("display", "block");
  454. $('#talentInfoForm').bootstrapValidator('addField', "source_batch", {validators: {notEmpty: {message: '申报来源批次不能为空'}}});
  455. $('#talentInfoForm').bootstrapValidator('addField', "quanzhou_highcert_pubtime", {validators: {notEmpty: {message: '泉州高层次人才证书发证日期不能为空'}}});
  456. $('#talentInfoForm').bootstrapValidator('addField', "quanzhou_highcert_exptime", {validators: {notEmpty: {message: '泉州高层次人才证书有效期不能为空'}}});
  457. break;
  458. }
  459. if (source == 3) {
  460. //显示入选来源地级市除泉
  461. $("#source_city").parent().css("display", "block");
  462. Feng.addAjaxSelect({
  463. "id": "source_city",
  464. "displayCode": "code",
  465. "displayName": "name",
  466. "type": "GET",
  467. "url": "/common/tool/findChildAreaByCode/code/35/no/350500"
  468. });
  469. $('#talentInfoForm').bootstrapValidator('addField', "source_city", {validators: {notEmpty: {message: '入选来源地级市不能为空'}}});
  470. }
  471. if (source == 4) {
  472. //显示入选来源县市区除晋
  473. $("#source_county").parent().css("display", "block");
  474. Feng.addAjaxSelect({
  475. "id": "source_county",
  476. "displayCode": "code",
  477. "displayName": "name",
  478. "type": "GET",
  479. "url": "/common/tool/findChildAreaByCode/code/3505/no/350582"
  480. });
  481. $('#talentInfoForm').bootstrapValidator('addField', "source_county", {validators: {notEmpty: {message: '入选来源县市区不能为空'}}});
  482. }
  483. }
  484. /**
  485. * 初始化表格的列
  486. */
  487. TalentInfoInfoDlg._initFileTypeColumn = function () {
  488. return [
  489. {field: 'selectItem', checkbox: false, visible: false},
  490. {title: '名称', field: 'name', visible: true, align: 'left', valign: 'middle', width: "75%", 'class': 'uitd_showTip',
  491. formatter: function (value, row, index) {
  492. let str = '<div class="word-wrap">';
  493. if (row.must == 1) {
  494. str = str + '<i class="fa fa-paste"></i><span style="font-weight:bold;color:red;font-size:14px;font-family:宋体"> * </span> ' + value;
  495. }
  496. if (row.must == 2) {
  497. str = str + '<i class="fa fa-paste"></i>' + value;
  498. }
  499. str = str + '<br /><span id="desc_' + row.rel + '">' + row.description + '</span></div>'
  500. return str;
  501. }
  502. },
  503. {title: '模板', field: 'templateUrl', visible: true, align: 'center', valign: 'middle', width: "8%",
  504. formatter: function (value, row, index) {
  505. if (value == null || value == '' || value == 'null') {
  506. return '无';
  507. }
  508. return "<button type='button' onclick=\"TalentInfoInfoDlg.downloadFile('" + row.id + "',3)\" style='margin-right: 10px' class=\"btn btn-xs btn-primary\">" +
  509. "<i class=\"fa fa-download\"></i>下载" +
  510. "</button>";
  511. }
  512. },
  513. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "17%",
  514. formatter: function (value, row, index) {
  515. return TalentInfoInfoDlg.validUploadButton(1, value, '', row.tableIndex, row.trIndex);
  516. }
  517. }
  518. ]
  519. };
  520. TalentInfoInfoDlg.initFile = function () {
  521. var ajax = new $ax("/common/api/findCommonFileType", function (data) {
  522. if (data == null || data.length == 0) {
  523. return;
  524. }
  525. var datas = new Array();
  526. for (var i = 0; i < $(".fileTable").length; i++) {
  527. datas.push([]);//创建空的多维数组,等下用来存每个附件表的各自的列
  528. }
  529. for (var k in data["rows"]) {
  530. var rel = data["rows"][k].rel;
  531. if ($("#" + rel).length > 0) {
  532. var tableIndex = $("#" + rel).parents(".table").find("table.fileTable").index(".fileTable");
  533. data["rows"][k].rel = rel;
  534. data["rows"][k].tableIndex = tableIndex;
  535. data["rows"][k].trIndex = datas[tableIndex].length;
  536. datas[tableIndex].push(data["rows"][k]);
  537. if (data["rows"][k].option) {
  538. //指定了选项
  539. let selectVal = $("#" + rel).val();
  540. let options = data["rows"][k].option.split(",");
  541. if (options.indexOf(selectVal) == -1) {
  542. data["rows"][k].hidden = true;
  543. }
  544. }
  545. } else {
  546. if (data["rows"][k].isConditionFile) {
  547. var tableIndex = $("#talent_condition").parents(".row").next(".row").find("table.fileTable").index(".fileTable");
  548. data["rows"][k].tableIndex = tableIndex;
  549. data["rows"][k].trIndex = datas[tableIndex].length;
  550. datas[tableIndex].push(data["rows"][k]);//放入人才条件后面的附件表
  551. } else {
  552. var tableIndex = $(".fileTable").length - 1;
  553. data["rows"][k].tableIndex = tableIndex;
  554. data["rows"][k].trIndex = datas[tableIndex].length;
  555. datas[$(".fileTable").length - 1].push(data["rows"][k]);//没有归属,放入最后一个附件表
  556. }
  557. }
  558. }
  559. for (var i = 0; i < $(".fileTable").length; i++) {
  560. var that = $(".fileTable").eq(i);
  561. that.bootstrapTable({
  562. columns: TalentInfoInfoDlg._initFileTypeColumn(),
  563. data: datas[i],
  564. showHeader: false,
  565. rowStyle: function (row, index) {
  566. return {classes: ""};
  567. },
  568. onPostBody: function (data) {
  569. for (var k in data) {
  570. var files = data[k].files;
  571. 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>';
  572. for (var key in files) {
  573. var btn = TalentInfoInfoDlg.validUploadButton(2, data[k].id, files[key].id, i, k);
  574. var sn = files[key].url.lastIndexOf(".");
  575. var suffix = files[key].url.substring(sn + 1, files[key].url.length);
  576. var imgStr = "";
  577. if (suffix == "pdf" || suffix == "PDF") {
  578. 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>";
  579. } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') {
  580. 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>";
  581. } else {
  582. imgStr = '<img class=\"imgUrl\" src=\"' + files[key].url + '\" style=\"width:25px;height:25px;\">';
  583. }
  584. html += '<li data-id="' + files[key].id + '">\n\
  585. <div><input type="hidden" name="uploadFiles[]" value="' + files[key].id + '"></div>\n' +
  586. '<div style="width: 70%;">' + files[key].orignName + '</div>\n' +
  587. '<div style="width: 10%;">' + imgStr + '</div>\n' +
  588. '<div style="width: 20%;">' + btn + '</div>\n\
  589. </li>';
  590. }
  591. html = html + '</ul>';
  592. that.find("tr[data-index='" + k + "']").attr("data-rel", data[k]["rel"]);
  593. that.find("tr[data-index='" + k + "']").attr("data-option", data[k]["option"]);
  594. that.find("tr[data-index='" + k + "']").after('<tr class="detail-view"><td colspan="5">' + html + '</td></tr>');
  595. if (typeof data[k].hidden != "undefined") {
  596. that.find("tr[data-index='" + k + "']").css("display", "none");
  597. that.find("tr[data-index='" + k + "']").next("tr.detail-view").css("display", "none");
  598. }
  599. }
  600. $("td.uitd_showTip").bind("mouseover", function () {
  601. //var htm = $(this).html();
  602. //$(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  603. });
  604. },
  605. });
  606. }
  607. //$(".ibox-content").viewer({fullscreen: false});
  608. }, function (data) {
  609. Feng.error("查询失败!" + data.responseJSON.message + "!");
  610. });
  611. var queryData = {};
  612. queryData["mainId"] = $("#id").val();
  613. queryData['project'] = CONFIG.project_rcrd;
  614. queryData['type'] = $("#type").val();
  615. queryData["talent_condition"] = $("#talent_condition option:selected").val();
  616. queryData['checkState'] = $("#checkState").val();
  617. ajax.set(queryData);
  618. ajax.start();
  619. }
  620. //校验是否保存基础信息
  621. TalentInfoInfoDlg.validId = function () {
  622. var id = $("#id").val();
  623. if (id != null && id != '') {
  624. $("#fileLi").removeAttr("style");
  625. } else {
  626. $("#fileLi").attr("style", "pointer-events: none");
  627. }
  628. }
  629. //选择附件并显示附件名
  630. TalentInfoInfoDlg.checkFile = function (content, fileTypeId, fileId, tableIndex, trIndex) {
  631. if (!TalentInfoInfoDlg.validateIsEdit())
  632. return;
  633. $("#upload_file ").unbind("change");
  634. $("#upload_file ").change(function () {
  635. TalentInfoInfoDlg.upload(fileTypeId, fileId, tableIndex, trIndex);
  636. });
  637. $('#upload_file').val("");
  638. $('#upload_file').click();
  639. }
  640. //上传附件
  641. TalentInfoInfoDlg.upload = function (fileTypeId, fileId, tableIndex, trIndex) {
  642. var id = $("#id").val();
  643. if (!TalentInfoInfoDlg.validateIsEdit())
  644. return;
  645. if (fileId != null && fileId != 'null') {
  646. $("#fileId").val(fileId)
  647. } else {
  648. $("#fileId").val("");
  649. }
  650. $("#mainId").val(id);
  651. $("#fileTypeId").val(fileTypeId);
  652. $("#tableIndex").val(tableIndex);
  653. $("#trIndex").val(trIndex);
  654. var index = layer.load(0, {shade: false, time: 0});
  655. $("#index").val(index);
  656. $("#uploadForm").submit();
  657. }
  658. //删除附件
  659. TalentInfoInfoDlg.deleteFile = function (id, state) {
  660. if (!TalentInfoInfoDlg.validateIsEdit())
  661. return;
  662. var operation = function () {
  663. var ajax = new $ax(Feng.ctxPath + "/common/api/deleteFile", function (data) {
  664. if (data.code = 200) {
  665. Feng.success(data.msg);
  666. $("input[name='uploadFiles[]'][value='" + id + "']").parents("li").remove();
  667. //$("#fileTable").bootstrapTable("refresh", {});
  668. } else {
  669. Feng.error(data.msg);
  670. }
  671. }, function (data) {
  672. Feng.error("删除失败!" + data.responseJSON.message + "!");
  673. });
  674. ajax.set("id", id);
  675. ajax.set("type", 1);
  676. ajax.start();
  677. }
  678. Feng.confirm("删除后无法恢复,确认删除吗?", operation);
  679. }
  680. /**
  681. * 提交审核
  682. */
  683. TalentInfoInfoDlg.submitToCheck = function () {
  684. var id = $("#id").val();
  685. if (id == null || id == "") {
  686. Feng.info("请先填写基础信息并上传附件");
  687. return;
  688. }
  689. if (!TalentInfoInfoDlg.validateIsEdit())
  690. return;
  691. var operation = function () {
  692. var ajax = new $ax(Feng.ctxPath + "/enterprise/base/submit", function (data) {
  693. if (data.code == 200) {
  694. Feng.success(data.msg);
  695. // $("#checkState").val(data.obj);
  696. window.parent.TalentInfo.table.refresh();
  697. TalentInfoInfoDlg.close();
  698. } else {
  699. Feng.error(data.msg);
  700. }
  701. }, function (data) {
  702. Feng.error("提交审核失败!" + data.responseJSON.message + "!");
  703. });
  704. ajax.set("id", id);
  705. ajax.start();
  706. }
  707. Feng.confirm("请确认基础信息已核对无误,相应附件已上传,一旦提交,无法修改", operation);
  708. }
  709. /**
  710. * 校验是否可以修改/提交审核
  711. */
  712. TalentInfoInfoDlg.validateIsEdit = function () {
  713. var checkState = $("#checkState").val();
  714. if (checkState != 0 && checkState != 1 && checkState != 3 && checkState != 5) {
  715. if (checkState == 13) {
  716. Feng.error("您的申报审核不通过,无法再修改");
  717. return false;
  718. } else if (checkState == 11) {
  719. Feng.error("您的申报已审核通过,无法再修改");
  720. return false;
  721. } else {
  722. Feng.error("您的申报正在审核中,请耐心等待");
  723. return false;
  724. }
  725. }
  726. return true;
  727. }
  728. /**
  729. * 校验是否显示按钮
  730. * @param type 类型 1-上传按钮,2-修改删除按钮
  731. * @param row
  732. * @returns {string}
  733. */
  734. TalentInfoInfoDlg.validUploadButton = function (type, fileTypeId, fileId, tableIndex, trIndex) {
  735. var files = $("#files").val();
  736. files = files.split(",");
  737. var checkState = $("#checkState").val();
  738. var realState = $("#realState").val();
  739. if (Feng.isEmptyStr(checkState) || checkState == 0 || (checkState == 1 && realState != 4) || checkState == 3 || checkState == 5 || (realState == 4 && files.indexOf(fileTypeId.toString()) != -1)) {
  740. if ((checkState == 3 || checkState == 5))
  741. return "";
  742. if (type == 1) { //上传
  743. return "<button type='button' onclick=\"TalentInfoInfoDlg.checkFile(this," + fileTypeId + "," + null + "," + tableIndex + "," + trIndex + ")\" style='margin-right: 10px' class=\"btn btn-xs btn-info\">" +
  744. "<i class=\"fa fa-upload\"></i>上传" +
  745. "</button>";
  746. } else {
  747. return "<button type=\'button\' onclick=\"TalentInfoInfoDlg.checkFile(this," + fileTypeId + "," + fileId + "," + tableIndex + "," + trIndex + ")\" style=\'margin-right: 10px\' class=\"btn btn-xs btn-info\">" +
  748. "<i class=\"fa fa-paste\"></i>修改" +
  749. "</button>" +
  750. "<button type='button' onclick=\"TalentInfoInfoDlg.deleteFile(" + fileId + ")\" class=\"btn btn-xs btn-danger\">" +
  751. "<i class=\"fa fa-times\"></i>删除" +
  752. "</button>";
  753. }
  754. } else {
  755. return type == 1 ? "" : "";
  756. }
  757. }
  758. //回调
  759. TalentInfoInfoDlg.callBack = function (data) {
  760. layer.close(data.obj);
  761. Feng.info(data.msg);
  762. if (data.code == 200) {
  763. var tableIndex = $("#tableIndex").val();
  764. var trIndex = $("#trIndex").val();
  765. var sn = data.info.lastIndexOf(".");
  766. var suffix = data.info.substring(sn + 1, data.info.length);
  767. var imgStr = "";
  768. if (suffix == "pdf" || suffix == "PDF") {
  769. 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>";
  770. } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') {
  771. 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>";
  772. } else {
  773. imgStr = '<img class="imgUrl" src="' + data.info + '" style="width:25px;height:25px;">';
  774. }
  775. var li = $("input[name='uploadFiles[]'][value='" + data.id + "'").parents("li");
  776. if (li.length > 0) {
  777. li.find("div").eq(1).html(data.orignName);
  778. li.find("div").eq(2).html(imgStr);
  779. } else {
  780. var html = '<li data-id="' + data.id + '">\n\
  781. <div><input type="hidden" name="uploadFiles[]" value="' + data.id + '"></div>\n\
  782. <div style="width: 70%;">' + data.orignName + '</div>\n\
  783. <div style="width: 10%;">' + imgStr + '</div>\n\
  784. <div style="width: 20%;">\n\
  785. <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\
  786. <button type="button" onclick="TalentInfoInfoDlg.deleteFile(' + data.id + ')" class="btn btn-xs btn-danger"><i class="fa fa-times"></i>删除</button>\n\
  787. </div></li></ul>';
  788. $(".fileTable").eq(tableIndex).find("tr[data-index='" + trIndex + "']").next("tr.detail-view").find(".imgs").append(html);
  789. }
  790. //$(".fileTable").eq(tableIndex).find("tr[data-index='" + trIndex + "']").next("tr.detail-view").find(".imgs").viewer({fullscreen: false});
  791. }
  792. }
  793. TalentInfoInfoDlg.downloadFile = function (id, type) {
  794. window.location.href = Feng.ctxPath + "/api/common/downloadFile?id=" + id + "&type=" + type;
  795. }
  796. //设置不可修改的字段
  797. TalentInfoInfoDlg.setNoChangeField = function () {
  798. var checkState = $("#checkState").val();
  799. var fields = $("#fields").val();
  800. var realState = $("#realState").val();
  801. if (realState == 4) {
  802. $("input,textarea").each(function () {
  803. $(this).attr("readonly", "readonly");
  804. });
  805. $("select").each(function () {
  806. $(this).attr("disabled", "disabled");
  807. });
  808. if (fields != null && fields != '') {
  809. var arr = fields.split(",");
  810. for (var key in arr) {
  811. var name = $("#" + arr[key]).prop("tagName");
  812. if (name == 'select' || name == 'SELECT') {
  813. $("#" + arr[key]).removeAttr("disabled");
  814. }
  815. if (name == "input" || name == 'textarea' || name == "INPUT" || name == 'TEXTAREA') {
  816. $("#" + arr[key]).removeAttr("readonly");
  817. }
  818. }
  819. }
  820. }
  821. }
  822. TalentInfoInfoDlg.__initValidateCondition = function () {
  823. var step = $("#step").val();
  824. if (step == 1) {
  825. $('#talentInfoForm').bootstrapValidator('addField', "source_county", {validators: {notEmpty: {message: '入选来源县市区不能为空'}}});
  826. $('#talentInfoForm').bootstrapValidator('addField', "enterprise_id", {validators: {notEmpty: {message: '所属企业不能为空'}}});
  827. $('#talentInfoForm').bootstrapValidator('addField', "talent_type", {validators: {notEmpty: {message: '人才类型不能为空'}}});
  828. $('#talentInfoForm').bootstrapValidator('addField', "enterprise_tag", {validators: {notEmpty: {message: '单位标签不能为空'}}});
  829. $('#talentInfoForm').bootstrapValidator('addField', "enterprise_name", {validators: {notEmpty: {message: '单位名称不能为空'}}});
  830. $('#talentInfoForm').bootstrapValidator('addField', "address", {validators: {notEmpty: {message: '所属街道不能为空'}}});
  831. $('#talentInfoForm').bootstrapValidator('addField', "industry_field", {validators: {notEmpty: {message: '产业领域不能为空'}}});
  832. $('#talentInfoForm').bootstrapValidator('addField', "name", {validators: {notEmpty: {message: '姓名不能为空'}}});
  833. $('#talentInfoForm').bootstrapValidator('addField', "card_type", {validators: {notEmpty: {message: '证件类型不能为空'}}});
  834. $('#talentInfoForm').bootstrapValidator('addField', "card_number", {validators: {notEmpty: {message: '证件号码不能为空'}}});
  835. $('#talentInfoForm').bootstrapValidator('addField', "sex", {validators: {notEmpty: {message: '性别不能为空'}}});
  836. $('#talentInfoForm').bootstrapValidator('addField', "birthday", {validators: {notEmpty: {message: '出生日期不能为空'}}});
  837. $('#talentInfoForm').bootstrapValidator('addField', "nationality", {validators: {notEmpty: {message: '国籍/地区不能为空'}}});
  838. $('#talentInfoForm').bootstrapValidator('addField', "province", {validators: {notEmpty: {message: '户籍省份不能为空'}}});
  839. $('#talentInfoForm').bootstrapValidator('addField', "city", {validators: {notEmpty: {message: '户籍市不能为空'}}});
  840. $('#talentInfoForm').bootstrapValidator('addField', "nation", {validators: {notEmpty: {message: '民族不能为空'}}});
  841. $('#talentInfoForm').bootstrapValidator('addField', "politics", {validators: {notEmpty: {message: '政治面貌不能为空'}}});
  842. } else {
  843. $('#talentInfoForm').bootstrapValidator('addField', "apply_year", {validators: {notEmpty: {message: '申报年度不能为空'}}});
  844. $('#talentInfoForm').bootstrapValidator('addField', "fst_work_time", {validators: {notEmpty: {message: '首次来晋工作时间不能为空'}}});
  845. $('#talentInfoForm').bootstrapValidator('addField', "import_way", {validators: {notEmpty: {message: '引进方式不能为空'}}});
  846. $('#talentInfoForm').bootstrapValidator('addField', "cur_entry_time", {validators: {notEmpty: {message: '本单位入职时间不能为空'}}});
  847. $('#talentInfoForm').bootstrapValidator('addField', "position", {validators: {notEmpty: {message: '本单位现任职务不能为空'}}});
  848. $('#talentInfoForm').bootstrapValidator('addField', "source", {validators: {notEmpty: {message: '申报来源不能为空'}}});
  849. $('#talentInfoForm').bootstrapValidator('addField', "talent_arrange", {validators: {notEmpty: {message: '人才层次不能为空'}}});
  850. $('#talentInfoForm').bootstrapValidator('addField', "talent_condition", {validators: {notEmpty: {message: '认定条件不能为空'}}});
  851. $('#talentInfoForm').bootstrapValidator('addField', "highest_degree", {validators: {notEmpty: {message: '最高学历不能为空'}}});
  852. $('#talentInfoForm').bootstrapValidator('addField', "graduate_school", {validators: {notEmpty: {message: '毕业院校不能为空'}}});
  853. $('#talentInfoForm').bootstrapValidator('addField', "major", {validators: {notEmpty: {message: '专业不能为空'}}});
  854. $('#talentInfoForm').bootstrapValidator('addField', "bank", {
  855. validators: {
  856. notEmpty: {
  857. message: '开户银行不能为空'
  858. },
  859. regexp: {
  860. regexp: /^[\u4e00-\u9fa5]*银行$/,
  861. message: "开户银行格式不正确"
  862. }
  863. }
  864. });
  865. $('#talentInfoForm').bootstrapValidator('addField', "bank_number", {
  866. validators: {
  867. notEmpty: {
  868. message: '银行行号不能为空'
  869. },
  870. regexp: {
  871. regexp: /^\d+$/,
  872. message: "银行行号格式不正确"
  873. }
  874. }
  875. });
  876. $('#talentInfoForm').bootstrapValidator('addField', "bank_branch_name", {
  877. validators: {
  878. notEmpty: {
  879. message: '开户银行网点不能为空'
  880. },
  881. regexp: {
  882. regexp: /^[\u4e00-\u9fa5]*银行[\u4e00-\u9fa5]*省?[\u4e00-\u9fa5]+市[\u4e00-\u9fa5]*$/,
  883. message: "开户银行格式不正确"
  884. }
  885. }
  886. });
  887. $('#talentInfoForm').bootstrapValidator('addField', "bank_account", {
  888. validators: {
  889. notEmpty: {
  890. message: '银行账号不能为空'
  891. },
  892. regexp: {
  893. regexp: /^\d+$/,
  894. message: "银行账号格式不正确"
  895. }
  896. }
  897. });
  898. $('#talentInfoForm').bootstrapValidator('addField', "phone", {
  899. validators: {
  900. notEmpty: {
  901. message: '手机号码不能为空'
  902. },
  903. regexp: {
  904. regexp: /0?(13|14|15|17|18|19)[0-9]{9}/,
  905. message: "手机号码格式不正确"
  906. }
  907. }
  908. });
  909. $('#talentInfoForm').bootstrapValidator('addField', "email", {
  910. validators: {
  911. notEmpty: {
  912. message: '电子邮箱不能为空'
  913. },
  914. emailAddress: {
  915. message: "电子邮箱格式不正确"
  916. }
  917. }
  918. });
  919. }
  920. }
  921. $("#card_type").change(function () {
  922. async_padding($("#card_number").val().trim(), $(this).val());
  923. })
  924. $("#card_number").blur(function () {
  925. async_padding($(this).val().trim(), $("#card_type").val());
  926. })
  927. function async_padding(card_number, card_type) {
  928. if (card_number != "" && card_number.length == 18 && card_type == "1") {
  929. var year = card_number.substring(6, 10);
  930. var month = card_number.substring(10, 12);
  931. var day = card_number.substring(12, 14);
  932. var birthday = year + "-" + month + "-" + day;
  933. var rule = /\d{4}-\d{2}-\d{2}/;
  934. if (rule.test(birthday))
  935. $("#birthday").val(birthday);
  936. var num = card_number.substring(17, 1);
  937. if (num % 2 == 0) {
  938. $("#sex").val(2);
  939. } else {
  940. $("#sex").val(1);
  941. }
  942. }
  943. }
  944. $(function () {
  945. TalentInfoInfoDlg.talentTypeFlag = false;
  946. TalentInfoInfoDlg.talentTypeOneTwo = true;
  947. Feng.initValidatorTip("talentInfoForm", TalentInfoInfoDlg.validateFields);
  948. var id = $("#id").val();
  949. var checkState = $("#checkState").val();
  950. //批量加载字典表数据
  951. var arr = [
  952. {"name": "enterprise_tag", "code": "enterprise_tag"},
  953. {"name": "nation", "code": "nation"},
  954. {"name": "talent_arrange", "code": "talent_arrange"},
  955. {"name": "nationality", "code": "nationality"},
  956. {"name": "politics", "code": "politics"},
  957. {"name": "highest_degree", "code": "highest_degree"},
  958. {"name": "industry_field", "code": "industry_field"},
  959. {"name": "source", "code": "source"},
  960. {"name": "import_way", "code": "import_way"},
  961. {"name": "address", "code": "street"}];
  962. Feng.findChildDictBatch(JSON.stringify(arr))
  963. //加载省份
  964. Feng.addAjaxSelect({
  965. "id": "province",
  966. "displayCode": "code",
  967. "displayName": "name",
  968. "type": "GET",
  969. "url": "/common/tool/getProvinceSelect"
  970. });
  971. //批量加载时间控件
  972. $(".date").each(function () {
  973. laydate.render({
  974. elem: this
  975. , type: 'date'
  976. , trigger: 'click'
  977. });
  978. });
  979. $(".rangedate").each(function () {
  980. laydate.render({
  981. elem: this,
  982. type: "date",
  983. range: true,
  984. trigger: "click"
  985. })
  986. })
  987. if (id != null && id != '') {
  988. //select初始化
  989. $("select").each(function () {
  990. $(this).val($(this).attr("value")).trigger("change");
  991. });
  992. Feng.getCheckLog("logTable", {"type": CONFIG.project_rcrd, "mainId": id, "typeFileId": "", "active": 1})
  993. }
  994. $("#talent_type").val($("#talent_type").attr("value"));
  995. $("#card_type").val($("#card_type").attr("value"));
  996. $("#sex").val($("#sex").attr("value"));
  997. $("#enterprise_tag").val($("#enterprise_tag").attr("value"));
  998. $("#address").val($("#address").attr("value"));
  999. $("#nation").val($("#nation").attr("value"));
  1000. $("#nationality").val($("#nationality").attr("value"));
  1001. $("#industry_field").val($("#industry_field").attr("value"));
  1002. $("#province").val($("#province").attr("value"));
  1003. TalentInfoInfoDlg.afterSelectProvince();
  1004. $("#city").val($("#city").attr("value"));
  1005. TalentInfoInfoDlg.afterSelectCity();
  1006. $("#county").val($("#county").attr("value"));
  1007. TalentInfoInfoDlg.getIdentifyCondition();
  1008. $("#politics").val($("#politics").attr("value"));
  1009. $("#talent_arrange").val($("#talent_arrange").attr("value"));
  1010. $("#talent_condition").val($("#talent_condition").attr("value"));
  1011. $("#tax_insurance_month").val($("#tax_insurance_month").attr("value"));
  1012. $("#labor_contract_rangetime").val($("#labor_contract_rangetime").attr("value"));
  1013. TalentInfoInfoDlg.validId();
  1014. $("#photo").change(function (e) {
  1015. var tag = e.target;
  1016. var file = tag.files[0];
  1017. var imgSrc;
  1018. var reader = new FileReader();
  1019. reader.readAsDataURL(file);
  1020. reader.onload = function () {
  1021. imgSrc = this.result;
  1022. $("#photoImg").attr("src", imgSrc);
  1023. };
  1024. });
  1025. TalentInfoInfoDlg.setNoChangeField();
  1026. $("#talent_condition").on('chosen:ready', function (e, params) {
  1027. $(".chosen-container-single .chosen-single").css("padding", "4px 0px 0px 4px");
  1028. });
  1029. $("#talent_condition").chosen({
  1030. search_contains: true,    //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
  1031. disable_search: false,
  1032. width: "100%",
  1033. enable_split_word_search: true,
  1034. rtl: true
  1035. });
  1036. TalentInfoInfoDlg.initFile();
  1037. });