You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

585 lines
28 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-01-29 17:31
  5. * 描 述:教师信息管理
  6. */
  7. var refreshGirdData;
  8. var bootstrap = function ($, learun) {
  9. "use strict";
  10. var page = {
  11. init: function () {
  12. page.initGird();
  13. page.bind();
  14. },
  15. bind: function () {
  16. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  17. page.search(queryJson);
  18. }, 250, 400);
  19. $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' });
  20. $('#ProvinceNo').lrDataSourceSelect({
  21. code: 'DIC_PROVINCE', value: 'pcode', text: 'pname',
  22. select: function (item) {
  23. if (!!item) {
  24. $('#CityNo').lrselectRefresh({
  25. url: "/DIC_CITY/GetListByProvinceCode",
  26. param: { ProvinceCode: item.pcode },
  27. value: 'CCODE',
  28. text: 'CNAME'
  29. });
  30. $('#RegionNo').lrselectRefresh({
  31. url: "",
  32. data: []
  33. });
  34. }
  35. }
  36. });
  37. $('#CityNo').lrselect({
  38. select: function (item) {
  39. if (!!item) {
  40. $('#RegionNo').lrselectRefresh({
  41. url: top.$.rootUrl + "/DIC_AREA/GetAreasListByCityCode",
  42. param: { cityCode: item.CCODE },
  43. value: 'ACODE',
  44. text: 'ANAME'
  45. });
  46. }
  47. }
  48. });
  49. $('#RegionNo').lrselect();
  50. //校区
  51. $('#F_CompanyId').lrDataSourceSelect({
  52. code: 'company', value: 'f_companyid', text: 'f_fullname',
  53. select: function (item) {
  54. if (!!item) {
  55. // 部门
  56. $('#F_DepartmentId').lrselectRefresh({
  57. type: 'tree',
  58. // 是否允许搜索
  59. allowSearch: true,
  60. // 访问数据接口地址
  61. url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree',
  62. // 访问数据接口参数
  63. param: { companyId: item.f_companyid, parentId: '0' }
  64. });
  65. }
  66. }
  67. });
  68. // 部门选择
  69. $('#F_DepartmentId').lrselect();
  70. // 刷新
  71. $('#lr_refresh').on('click', function () {
  72. location.reload();
  73. });
  74. // 新增
  75. $('#lr_add').on('click', function () {
  76. learun.layerForm({
  77. id: 'form',
  78. title: '新增',
  79. url: top.$.rootUrl + '/EducationalAdministration/EmpInfo/Form',
  80. width: 1000,
  81. height: 800,
  82. callBack: function (id) {
  83. return top[id].acceptClick(refreshGirdData);
  84. }
  85. });
  86. });
  87. // 编辑
  88. $('#lr_edit').on('click', function () {
  89. var keyValue = $('#gridtable').jfGridValue('EmpId');
  90. if (learun.checkrow(keyValue)) {
  91. if (keyValue.indexOf(',') != -1) {
  92. learun.alert.warning("只能选择一条记录进行编辑!");
  93. return;
  94. }
  95. var CheckMark = $('#gridtable').jfGridValue('CheckMark');
  96. if (CheckMark === "true") {
  97. learun.alert.warning("当前项目已审核不能编辑!");
  98. return;
  99. }
  100. learun.layerForm({
  101. id: 'form',
  102. title: '编辑',
  103. url: top.$.rootUrl + '/EducationalAdministration/EmpInfo/Form?keyValue=' + keyValue,
  104. width: 1000,
  105. height: 800,
  106. callBack: function (id) {
  107. return top[id].acceptClick(refreshGirdData);
  108. }
  109. });
  110. }
  111. });
  112. //查看
  113. $('#lr_view').on('click', function () {
  114. var keyValue = $('#gridtable').jfGridValue('EmpId');
  115. if (learun.checkrow(keyValue)) {
  116. if (keyValue.indexOf(',') != -1) {
  117. learun.alert.warning("只能选择一条记录进行查看!");
  118. return;
  119. }
  120. learun.layerForm({
  121. id: 'formView',
  122. title: '查看',
  123. url: top.$.rootUrl + '/EducationalAdministration/EmpInfo/FormView?keyValue=' + keyValue,
  124. width: 1162,
  125. height: 600,
  126. btn: null
  127. });
  128. }
  129. });
  130. // 修改部门、系部
  131. $('#lr_editDept').on('click', function () {
  132. var keyValue = $('#gridtable').jfGridValue('EmpId');
  133. if (learun.checkrow(keyValue)) {
  134. var CheckMark = $('#gridtable').jfGridValue('CheckMark');
  135. if (CheckMark.indexOf('true') != -1) {
  136. learun.alert.warning("选中记录中包含已启用项目!");
  137. return;
  138. }
  139. learun.layerForm({
  140. id: 'formEdit',
  141. title: '修改部门、系部',
  142. url: top.$.rootUrl + '/EducationalAdministration/EmpInfo/FormEdit?keyValue=' + keyValue,
  143. width: 600,
  144. height: 400,
  145. callBack: function (id) {
  146. return top[id].acceptClick(refreshGirdData);
  147. }
  148. });
  149. }
  150. });
  151. // 删除
  152. $('#lr_delete').on('click', function () {
  153. var keyValue = $('#gridtable').jfGridValue('EmpId');
  154. if (learun.checkrow(keyValue)) {
  155. var CheckMark = $('#gridtable').jfGridValue('CheckMark');
  156. if (CheckMark.indexOf('true') != -1) {
  157. learun.alert.warning("选中记录中包含已启用项目,已启用不能删除!");
  158. return;
  159. }
  160. //if (CheckMark === true) {
  161. // learun.alert.warning("当前项目已审核不能删除!");
  162. // return;
  163. //}
  164. learun.layerConfirm('是否确认删除该项!', function (res) {
  165. if (res) {
  166. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/DeleteForm', { keyValue: keyValue }, function () {
  167. refreshGirdData();
  168. });
  169. }
  170. });
  171. }
  172. });
  173. //审核
  174. $('#lr_lock').on('click', function () {
  175. var keyValue = $('#gridtable').jfGridValue('EmpId');
  176. if (learun.checkrow(keyValue)) {
  177. var CheckMark = $('#gridtable').jfGridValue('CheckMark');
  178. if (CheckMark.indexOf('true') != -1) {
  179. learun.alert.warning("选中记录中包含已启用项目!");
  180. return;
  181. }
  182. //if (CheckMark === true) {
  183. // learun.alert.warning("当前项目已审核无需再审!");
  184. // return;
  185. //}
  186. learun.layerConfirm('是否确认审核该项!', function (res) {
  187. if (res) {
  188. learun.postForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/Lock', { keyValue: keyValue }, function () {
  189. refreshGirdData();
  190. });
  191. }
  192. });
  193. }
  194. });
  195. //去审核
  196. $('#lr_unlock').on('click', function () {
  197. var keyValue = $('#gridtable').jfGridValue('EmpId');
  198. if (learun.checkrow(keyValue)) {
  199. var CheckMark = $('#gridtable').jfGridValue('CheckMark');
  200. if (CheckMark.indexOf('false') != -1) {
  201. learun.alert.warning("选中记录中包含已停用项目!");
  202. return;
  203. }
  204. //if (CheckMark === false) {
  205. // learun.alert.warning("当前项目还未审核不需要去审核!");
  206. // return;
  207. //}
  208. learun.layerConfirm('是否确认去审核该项!', function (res) {
  209. if (res) {
  210. learun.postForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/UnLock', { keyValue: keyValue }, function () {
  211. refreshGirdData();
  212. });
  213. }
  214. });
  215. }
  216. });
  217. $('#checkall').on('click', function () {
  218. learun.layerConfirm('是否确认全部审核?', function (res) {
  219. if (res) {
  220. learun.postForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/CheckAll', {}, function () {
  221. refreshGirdData();
  222. });
  223. }
  224. });
  225. });
  226. //简历
  227. $('#lr_resume').on('click', function () {
  228. var keyValue = $('#gridtable').jfGridValue('EmpId');
  229. if (learun.checkrow(keyValue)) {
  230. if (keyValue.indexOf(',') != -1) {
  231. learun.alert.warning("只能选择一条记录!");
  232. return;
  233. }
  234. var CheckMark = $('#gridtable').jfGridValue('CheckMark');
  235. if (CheckMark === "true") {
  236. learun.alert.warning("当前项目已审核不能编辑!");
  237. return;
  238. }
  239. learun.layerForm({
  240. id: 'form',
  241. title: '编辑',
  242. url: top.$.rootUrl + '/EducationalAdministration/EmpInfo/Form?keyValue=' + keyValue,
  243. width: 800,
  244. height: 600,
  245. callBack: function (id) {
  246. return top[id].acceptClick(refreshGirdData);
  247. }
  248. });
  249. }
  250. });
  251. //生成帐号
  252. $('#lr_generate').on('click', function () {
  253. learun.layerConfirm('是否确认生成帐号!', function (res) {
  254. if (res) {
  255. learun.postForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/Generate', {}, function () {
  256. refreshGirdData();
  257. });
  258. }
  259. });
  260. });
  261. $("#lr_update").on("click", function () {
  262. learun.layerConfirm('是否确认更新帐号!', function (res) {
  263. if (res) {
  264. learun.postForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/UpdateAccount', {}, function () {
  265. refreshGirdData();
  266. })
  267. }
  268. })
  269. });
  270. $("#lr_switch").on("click", function () {
  271. $.get("/EducationalAdministration/TeachSwitch/GetFirstEntity", function (data) {
  272. console.log(data);
  273. if (data.code == "200") {
  274. if (data.data.ID) {
  275. learun.layerForm({
  276. id: 'form',
  277. title: '设置',
  278. url: top.$.rootUrl + '/EducationalAdministration/TeachSwitch/Form?keyValue=' + data.data.ID,
  279. width: 600,
  280. height: 400,
  281. callBack: function (id) {
  282. return top[id].acceptClick();
  283. }
  284. });
  285. } else {
  286. learun.alert.warning("请在控制注册表中添加一条数据");
  287. }
  288. }
  289. }, "json")
  290. });
  291. //打印
  292. $('#lr_print').on('click', function () {
  293. var keyValue = $('#gridtable').jfGridValue('EmpId');
  294. if (learun.checkrow(keyValue)) {
  295. if (keyValue.indexOf(',') != -1) {
  296. learun.alert.warning("只能选择一条记录进行查看!");
  297. return;
  298. }
  299. learun.layerForm({
  300. id: 'print',
  301. title: '教职工基本信息登记表',
  302. url: top.$.rootUrl + '/EducationalAdministration/EmpInfo/Print?keyValue=' + keyValue,
  303. width: 1100,
  304. height: 800,
  305. btn: null
  306. });
  307. }
  308. });
  309. },
  310. // 初始化列表
  311. initGird: function () {
  312. $('#gridtable').lrAuthorizeJfGrid({
  313. url: top.$.rootUrl + '/EducationalAdministration/EmpInfo/GetPageList',
  314. headData: [
  315. {
  316. label: "审核标志", name: "CheckMark", width: 80, align: "center",
  317. formatter: function (cellvalue) {
  318. //return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  319. return cellvalue == true ? "<span class=\"label label-success\">已审核</span>" : "<span class=\"label label-danger\">未审核</span>";
  320. }
  321. },
  322. { label: "职工编号", name: "EmpNo", width: 100, align: "left" },
  323. { label: "姓名", name: "EmpName", width: 100, align: "left" },
  324. {
  325. label: "校区", name: "F_CompanyId", width: 100, align: "left",
  326. formatterAsync: function (callback, value, row, op, $cell) {
  327. learun.clientdata.getAsync('custmerData', {
  328. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company',
  329. key: value,
  330. keyId: 'f_companyid',
  331. callback: function (_data) {
  332. callback(_data['f_fullname']);
  333. }
  334. });
  335. }
  336. },
  337. {
  338. label: "部门", name: "F_DepartmentId", width: 100, align: "left",
  339. formatterAsync: function (callback, value, row, op, $cell) {
  340. learun.clientdata.getAsync('custmerData', {
  341. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata',
  342. key: value,
  343. keyId: 'f_departmentid',
  344. callback: function (_data) {
  345. callback(_data['f_fullname']);
  346. }
  347. });
  348. }
  349. },
  350. {
  351. label: "系部", name: "DeptNo", width: 100, align: "left",
  352. formatterAsync: function (callback, value, row, op, $cell) {
  353. learun.clientdata.getAsync('custmerData', {
  354. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  355. key: value,
  356. keyId: 'deptno',
  357. callback: function (_data) {
  358. callback(_data['deptname']);
  359. }
  360. });
  361. }
  362. },
  363. {
  364. label: "性别", name: "GenderNo", width: 80, align: "left",
  365. formatter: function (cellvalue) {
  366. return cellvalue == true ? "男" : "女";
  367. }
  368. },
  369. { label: "是否授课", name: "IsHasLesson", width: 100, align: "left", formatter: function (cellvalue) { return cellvalue == true ? "是" : "否" } },
  370. { label: "出生日期", name: "Birthday", width: 100, align: "left" },
  371. {
  372. label: "民族", name: "NationalityNo", width: 100, align: "left",
  373. formatterAsync: function (callback, value, row, op, $cell) {
  374. learun.clientdata.getAsync('custmerData', {
  375. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdNationality',
  376. key: value,
  377. keyId: 'nationalityno',
  378. callback: function (_data) {
  379. callback(_data['nationality']);
  380. }
  381. });
  382. }
  383. },
  384. {
  385. label: "政治面貌", name: "PartyFaceNo", width: 100, align: "left",
  386. formatterAsync: function (callback, value, row, op, $cell) {
  387. learun.clientdata.getAsync('custmerData', {
  388. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdPartyFace',
  389. key: value,
  390. keyId: 'partyfaceno',
  391. callback: function (_data) {
  392. callback(_data['partyface']);
  393. }
  394. });
  395. }
  396. },
  397. { label: "身份证号", name: "IdentityCardNo", width: 150, align: "left" },
  398. {
  399. label: "文化程度", name: "CultureDegreeNo", width: 100, align: "left",
  400. formatterAsync: function (callback, value, row, op, $cell) {
  401. learun.clientdata.getAsync('custmerData', {
  402. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdCultureDegree',
  403. key: value,
  404. keyId: 'culturedegreeno',
  405. callback: function (_data) {
  406. callback(_data['culturedegree']);
  407. }
  408. });
  409. }
  410. },
  411. {
  412. label: "最高学位", name: "DegreeNo", width: 100, align: "left",
  413. formatterAsync: function (callback, value, row, op, $cell) {
  414. learun.clientdata.getAsync('custmerData', {
  415. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdDegree',
  416. key: value,
  417. keyId: 'degreeno',
  418. callback: function (_data) {
  419. callback(_data['degreename']);
  420. }
  421. });
  422. }
  423. },
  424. { label: "联系电话", name: "mobile", width: 100, align: "left" },
  425. { label: "电子邮箱", name: "EMail", width: 100, align: "left" },
  426. {
  427. label: "户籍省份", name: "ProvinceNo", width: 100, align: "left",
  428. formatterAsync: function (callback, value, row, op, $cell) {
  429. learun.clientdata.getAsync('custmerData', {
  430. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_PROVINCE',
  431. key: value,
  432. keyId: 'pcode',
  433. callback: function (_data) {
  434. callback(_data['pname']);
  435. }
  436. });
  437. }
  438. },
  439. {
  440. label: "户籍县区", name: "RegionNo", width: 100, align: "left",
  441. formatterAsync: function (callback, value, row, op, $cell) {
  442. learun.clientdata.getAsync('custmerData', {
  443. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_AREA',
  444. key: value,
  445. keyId: 'acode',
  446. callback: function (_data) {
  447. callback(_data['aname']);
  448. }
  449. });
  450. }
  451. },
  452. {
  453. label: "港澳台侨", name: "OverseasChineseNo", width: 100, align: "left",
  454. formatterAsync: function (callback, value, row, op, $cell) {
  455. learun.clientdata.getAsync('custmerData', {
  456. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdOverseasChinese',
  457. key: value,
  458. keyId: 'overseaschineseno',
  459. callback: function (_data) {
  460. callback(_data['overseaschinesename']);
  461. }
  462. });
  463. }
  464. },
  465. {
  466. label: "健康状况", name: "HealthStatusNo", width: 100, align: "left",
  467. formatterAsync: function (callback, value, row, op, $cell) {
  468. learun.clientdata.getAsync('custmerData', {
  469. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdHealthStatus',
  470. key: value,
  471. keyId: 'healthstatusno',
  472. callback: function (_data) {
  473. callback(_data['healthstatus']);
  474. }
  475. });
  476. }
  477. },
  478. {
  479. label: "家庭出身", name: "FamilyOriginNo", width: 100, align: "left",
  480. formatterAsync: function (callback, value, row, op, $cell) {
  481. learun.clientdata.getAsync('custmerData', {
  482. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdFamilyOrigin',
  483. key: value,
  484. keyId: 'familyoriginno',
  485. callback: function (_data) {
  486. callback(_data['familyorigin']);
  487. }
  488. });
  489. }
  490. },
  491. { label: "毕业学校", name: "GraduateSchoolName", width: 100, align: "left" },
  492. {
  493. label: "学科门类", name: "SubjectSpeciesNo", width: 100, align: "left",
  494. formatterAsync: function (callback, value, row, op, $cell) {
  495. learun.clientdata.getAsync('custmerData', {
  496. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdSubjectSpecies',
  497. key: value,
  498. keyId: 'subjectspeciesno',
  499. callback: function (_data) {
  500. callback(_data['subjectspecies']);
  501. }
  502. });
  503. }
  504. },
  505. {
  506. label: "岗位类别", name: "EmpSortNo", width: 100, align: "left",
  507. formatterAsync: function (callback, value, row, op, $cell) {
  508. learun.clientdata.getAsync('dataItem', {
  509. key: value,
  510. code: 'jsgw',
  511. callback: function (_data) {
  512. callback(_data.text);
  513. }
  514. });
  515. }
  516. },
  517. {
  518. label: "专职兼职", name: "EmpFullTimeNo", width: 100, align: "left",
  519. formatterAsync: function (callback, value, row, op, $cell) {
  520. learun.clientdata.getAsync('dataItem', {
  521. key: value,
  522. code: 'EmpFullTime',
  523. callback: function (_data) {
  524. callback(_data.text);
  525. }
  526. });
  527. }
  528. },
  529. {
  530. label: "聘任职称", name: "TitleOfTechPostNo", width: 100, align: "left",
  531. formatterAsync: function (callback, value, row, op, $cell) {
  532. learun.clientdata.getAsync('custmerData', {
  533. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdTitleOfTechPost',
  534. key: value,
  535. keyId: 'titleoftechpostno',
  536. callback: function (_data) {
  537. callback(_data['titleoftechpost']);
  538. }
  539. });
  540. }
  541. },
  542. {
  543. label: "编制类别", name: "CompilationCategory", width: 100, align: "left",
  544. formatterAsync: function (callback, value, row, op, $cell) {
  545. learun.clientdata.getAsync('dataItem', {
  546. key: value,
  547. code: 'CompilationCategory',
  548. callback: function (_data) {
  549. callback(_data.text);
  550. }
  551. });
  552. }
  553. },
  554. { label: "来校时间", name: "InSchoolDate", width: 100, align: "left" },
  555. { label: "紧急联系人", name: "Linkman", width: 100, align: "left" },
  556. { label: "联系人关系", name: "RelationOfLinkman", width: 100, align: "left" },
  557. { label: "联系人电话", name: "PhoneOfLinkman", width: 100, align: "left" },
  558. ],
  559. mainId: 'EmpId',
  560. isPage: true,
  561. isMultiselect: true
  562. });
  563. page.search();
  564. },
  565. search: function (param) {
  566. param = param || {};
  567. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  568. }
  569. };
  570. refreshGirdData = function () {
  571. page.search();
  572. };
  573. page.init();
  574. }