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.
 
 
 
 
 
 

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