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.
 
 
 
 
 
 

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