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.
 
 
 
 
 
 

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