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.
 
 
 
 
 
 

454 lines
22 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. if (data.code == "200") {
  273. if (data.data.ID) {
  274. learun.layerForm({
  275. id: 'form',
  276. title: '设置',
  277. url: top.$.rootUrl + '/EducationalAdministration/TeachSwitch/Form?keyValue=' + data.data.ID,
  278. width: 600,
  279. height: 400,
  280. callBack: function (id) {
  281. return top[id].acceptClick();
  282. }
  283. });
  284. } else {
  285. learun.alert.warning("请在控制注册表中添加一条数据");
  286. }
  287. }
  288. }, "json")
  289. });
  290. //打印
  291. $('#lr_print').on('click', function () {
  292. var keyValue = $('#gridtable').jfGridValue('EmpId');
  293. if (learun.checkrow(keyValue)) {
  294. if (keyValue.indexOf(',') != -1) {
  295. learun.alert.warning("只能选择一条记录进行查看!");
  296. return;
  297. }
  298. learun.layerForm({
  299. id: 'print',
  300. title: '教职工基本信息登记表',
  301. url: top.$.rootUrl + '/EducationalAdministration/EmpInfo/Print?keyValue=' + keyValue,
  302. width: 1100,
  303. height: 800,
  304. btn: null
  305. });
  306. }
  307. });
  308. },
  309. // 初始化列表
  310. initGird: function () {
  311. $('#gridtable').lrAuthorizeJfGrid({
  312. url: top.$.rootUrl + '/EducationalAdministration/EmpInfo/GetPageList',
  313. headData: [
  314. {
  315. label: "审核标志", name: "CheckMark", width: 80, align: "center",
  316. formatter: function (cellvalue) {
  317. //return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  318. return cellvalue == true ? "<span class=\"label label-success\">已审核</span>" : "<span class=\"label label-danger\">未审核</span>";
  319. }
  320. },
  321. { label: "职工编号", name: "EmpNo", width: 100, align: "left" },
  322. { label: "姓名", name: "EmpName", width: 100, align: "left" },
  323. {
  324. label: "民族", name: "NationalityNo", width: 100, align: "left",
  325. formatterAsync: function (callback, value, row, op, $cell) {
  326. learun.clientdata.getAsync('dataItem', {
  327. key: value,
  328. code: 'National',
  329. callback: function (_data) {
  330. callback(_data.text);
  331. }
  332. });
  333. }
  334. },
  335. {
  336. label: "性别", name: "GenderNo", width: 80, align: "left",
  337. formatter: function (cellvalue) {
  338. return cellvalue == true ? "男" : "女";
  339. }
  340. },
  341. {
  342. label: "政治面貌", name: "PartyFaceNo", width: 100, align: "left",
  343. formatterAsync: function (callback, value, row, op, $cell) {
  344. learun.clientdata.getAsync('dataItem', {
  345. key: value,
  346. code: 'BCdPartyFace',
  347. callback: function (_data) {
  348. callback(_data.text);
  349. }
  350. });
  351. }
  352. },
  353. { label: "入党时间", name: "JoinPartyTime", width: 100, align: "left" },
  354. { label: "出生年月", name: "Birthday", width: 100, align: "left" },
  355. { label: "是否授课", name: "IsHasLesson", width: 100, align: "left", formatter: function (cellvalue) { return cellvalue == true ? "是" : "否" } },
  356. {
  357. label: "所在科室", name: "F_DepartmentId", width: 100, align: "left",
  358. formatterAsync: function (callback, value, row, op, $cell) {
  359. learun.clientdata.getAsync('custmerData', {
  360. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata',
  361. key: value,
  362. keyId: 'id',
  363. callback: function (_data) {
  364. callback(_data['name']);
  365. }
  366. });
  367. }
  368. },
  369. {
  370. label: "原始学历", name: "CultureDegreeNo", width: 100, align: "left",
  371. formatterAsync: function (callback, value, row, op, $cell) {
  372. learun.clientdata.getAsync('custmerData', {
  373. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdCultureDegree',
  374. key: value,
  375. keyId: 'culturedegreeno',
  376. callback: function (_data) {
  377. callback(_data['culturedegree']);
  378. }
  379. });
  380. }
  381. },
  382. { label: "原始学历毕业院校", name: "GraduateSchoolName", width: 120, align: "left" },
  383. { label: "原始学历专业", name: "Major1", width: 120, align: "left" },
  384. { label: "原始学历毕业时间", name: "GraduateDate1", width: 120, align: "left" },
  385. {
  386. label: "最高学历", name: "HighestRecord", width: 100, align: "left",
  387. formatterAsync: function (callback, value, row, op, $cell) {
  388. learun.clientdata.getAsync('custmerData', {
  389. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdCultureDegree',
  390. key: value,
  391. keyId: 'culturedegreeno',
  392. callback: function (_data) {
  393. callback(_data['culturedegree']);
  394. }
  395. });
  396. }
  397. },
  398. { label: "最高学历毕业院校", name: "GraduateSchoolName2", width: 120, align: "left" },
  399. { label: "最高学历专业", name: "Major2", width: 120, align: "left" },
  400. { label: "最高学历毕业时间", name: "GraduateDate2", width: 120, align: "left" },
  401. { label: "参加工作时间", name: "AddWorkDate", width: 100, align: "left" },
  402. { label: "进入本单位时间", name: "SchoolDate", width: 100, align: "left" },
  403. { label: "任现职时间", name: "InSchoolDate", width: 100, align: "left" },
  404. { label: "任同职级职务时间", name: "InRankDate", width: 120, align: "left" },
  405. { label: "籍贯", name: "LocusOfArchives", width: 100, align: "left" },
  406. { label: "户籍所在地", name: "LocusOfResidence", width: 100, align: "left" },
  407. { label: "家庭住址", name: "Homeaddress", width: 100, align: "left" },
  408. { label: "联系电话", name: "mobile", width: 100, align: "left" },
  409. { label: "身份证号", name: "IdentityCardNo", width: 150, align: "left" },
  410. { label: "职称", name: "TitleOfTechPostNo", width: 100, align: "left" },
  411. {
  412. label: "职级", name: "PostRank", width: 100, align: "left",
  413. formatterAsync: function (callback, value, row, op, $cell) {
  414. learun.clientdata.getAsync('dataItem', {
  415. key: value,
  416. code: 'BCdTitleOfTechPost',
  417. callback: function (_data) {
  418. callback(_data.text);
  419. }
  420. });
  421. }
  422. },
  423. { label: "评审通过日期", name: "ReviewDate", width: 100, align: "left" },
  424. { label: "改评通过日期", name: "ReviewDate2", width: 100, align: "left" },
  425. { label: "教师资格证名称", name: "TeacherCertificateName", width: 100, align: "left" },
  426. { label: "教师资格证号", name: "TeacherCertificateNo", width: 100, align: "left" },
  427. { label: "评审单位", name: "ReviewUnit", width: 100, align: "left" },
  428. { label: "护照/港澳台通行证", name: "PassPort", width: 120, align: "left" },
  429. ],
  430. mainId: 'EmpId',
  431. isPage: true,
  432. isMultiselect: true
  433. });
  434. page.search();
  435. },
  436. search: function (param) {
  437. param = param || {};
  438. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  439. }
  440. };
  441. refreshGirdData = function () {
  442. page.search();
  443. };
  444. page.init();
  445. }