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.
 
 
 
 
 
 

429 lines
21 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-09-26 10:47
  5. * 描 述:教学调度
  6. */
  7. var refreshGirdData;
  8. var selectedRow;
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var processId = '';
  12. var page = {
  13. init: function () {
  14. page.initGird();
  15. page.bind();
  16. },
  17. bind: function () {
  18. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  19. page.search(queryJson);
  20. }, 300, 400);
  21. $('#AttemperType').lrDataItemSelect({ code: 'AttemperType' });
  22. $('#AttemperTimeType').lrDataItemSelect({ code: 'AttemperTimeType' });
  23. //$('#F_SchoolId').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' });
  24. $('#AcademicYearNo').lrselect({
  25. allowSearch: true,
  26. url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo',
  27. value: 'value',
  28. text: 'text'
  29. });
  30. $('#Semester').lrselect({
  31. allowSearch: true,
  32. url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetSemesterData',
  33. value: 'value',
  34. text: 'text'
  35. });
  36. $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' });
  37. $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' });
  38. $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' });
  39. $('#TeachClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' });
  40. $('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' });
  41. // 刷新
  42. $('#lr_refresh').on('click', function () {
  43. location.reload();
  44. });
  45. // 新增
  46. $('#lr_add').on('click', function () {
  47. learun.layerForm({
  48. id: 'form',
  49. title: '新增',
  50. url: top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTermAttemper/Form',
  51. width: 1000,
  52. height: 600,
  53. callBack: function (id) {
  54. var res = false;
  55. // 验证数据
  56. res = top[id].validForm();
  57. // 保存数据
  58. if (res) {
  59. //processId = learun.newGuid();
  60. //res = top[id].save(processId, refreshGirdData);
  61. res = top[id].save('', function () {
  62. page.search();
  63. });
  64. }
  65. return res;
  66. }
  67. });
  68. });
  69. // 编辑
  70. $('#lr_edit').on('click', function () {
  71. var keyValue = $('#gridtable').jfGridValue('Id');
  72. selectedRow = $('#gridtable').jfGridGet('rowdata');
  73. if (learun.checkrow(keyValue)) {
  74. if (selectedRow.Status == 1) {//提交
  75. learun.alert.warning("当前课程异动记录已提交!");
  76. return false;
  77. }
  78. learun.layerForm({
  79. id: 'form',
  80. title: '编辑',
  81. url: top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTermAttemper/Form?keyValue=' + keyValue,
  82. width: 1000,
  83. height: 600,
  84. callBack: function (id) {
  85. var res = false;
  86. // 验证数据
  87. res = top[id].validForm();
  88. // 保存数据
  89. if (res) {
  90. res = top[id].save('', function () {
  91. page.search();
  92. });
  93. }
  94. return res;
  95. }
  96. });
  97. }
  98. });
  99. // 删除
  100. $('#lr_delete').on('click', function () {
  101. var keyValue = $('#gridtable').jfGridValue('Id');
  102. selectedRow = $('#gridtable').jfGridGet('rowdata');
  103. if (learun.checkrow(keyValue)) {
  104. if (selectedRow.Status !== 0) {
  105. learun.alert.warning("当前课程异动记录已提交,无法删除!");
  106. return false;
  107. }
  108. learun.layerConfirm('是否确认删除该项!', function (res) {
  109. if (res) {
  110. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTermAttemper/DeleteForm', { keyValue: keyValue }, function () {
  111. //refreshGirdData();
  112. page.search();
  113. });
  114. }
  115. });
  116. }
  117. });
  118. // 提交
  119. $('#lr_submit').on('click', function () {
  120. var keyValue = $('#gridtable').jfGridValue('Id');
  121. selectedRow = $('#gridtable').jfGridGet('rowdata');
  122. if (learun.checkrow(keyValue)) {
  123. if (selectedRow.Status !== 0) {
  124. learun.alert.warning("当前课程异动记录已提交!");
  125. return false;
  126. }
  127. learun.layerConfirm('是否确认提交该项!', function (res) {
  128. if (res) {
  129. processId = learun.newGuid();
  130. learun.postForm(top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTermAttemper/ModifyStatus', { keyValue: keyValue, status: 1, processId: processId }, function (res) {
  131. //selectedRow.ProcessId = processId;
  132. refreshGirdData(res, {});
  133. });
  134. }
  135. });
  136. }
  137. });
  138. // 查看
  139. $('#lr_view').on('click', function () {
  140. var keyValue = $('#gridtable').jfGridValue('Id');
  141. selectedRow = $('#gridtable').jfGridGet('rowdata');
  142. if (learun.checkrow(keyValue)) {
  143. if (selectedRow.Status == 0) {
  144. learun.alert.warning("当前课程异动记录未提交,请提交后再查看!");
  145. return false;
  146. }
  147. learun.layerForm({
  148. id: 'formview',
  149. title: '查看',
  150. url: top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTermAttemper/FormView?keyValue=' + keyValue,
  151. width: 1000,
  152. height: 600,
  153. btn: null
  154. });
  155. }
  156. });
  157. },
  158. // 初始化列表
  159. initGird: function () {
  160. $('#gridtable').lrAuthorizeJfGrid({
  161. url: top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTermAttemper/GetPageList',
  162. headData: [
  163. {
  164. label: "调度类型", name: "AttemperType", width: 100, align: "left",
  165. formatterAsync: function (callback, value, row, op, $cell) {
  166. learun.clientdata.getAsync('dataItem', {
  167. key: value,
  168. code: 'AttemperType',
  169. callback: function (_data) {
  170. callback(_data.text);
  171. }
  172. });
  173. }
  174. },
  175. {
  176. label: "调度时限", name: "AttemperTimeType", width: 100, align: "left",
  177. formatterAsync: function (callback, value, row, op, $cell) {
  178. learun.clientdata.getAsync('dataItem', {
  179. key: value,
  180. code: 'AttemperTimeType',
  181. callback: function (_data) {
  182. callback(_data.text);
  183. }
  184. });
  185. }
  186. },
  187. //{
  188. // label: "校区", name: "F_SchoolId", width: 100, align: "left",
  189. // formatterAsync: function (callback, value, row, op, $cell) {
  190. // learun.clientdata.getAsync('custmerData', {
  191. // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company',
  192. // key: value,
  193. // keyId: 'f_companyid',
  194. // callback: function (_data) {
  195. // callback(_data['f_fullname']);
  196. // }
  197. // });
  198. // }
  199. //},
  200. { label: "学年", name: "AcademicYearNo", width: 100, align: "left" },
  201. { label: "学期", name: "Semester", width: 100, align: "left" },
  202. {
  203. label: "系部", name: "DeptNo", width: 100, align: "left",
  204. formatterAsync: function (callback, value, row, op, $cell) {
  205. learun.clientdata.getAsync('custmerData', {
  206. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  207. key: value,
  208. keyId: 'deptno',
  209. callback: function (_data) {
  210. callback(_data['deptname']);
  211. }
  212. });
  213. }
  214. },
  215. {
  216. label: "专业", name: "MajorNo", width: 100, align: "left",
  217. formatterAsync: function (callback, value, row, op, $cell) {
  218. learun.clientdata.getAsync('custmerData', {
  219. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  220. key: value,
  221. keyId: 'majorno',
  222. callback: function (_data) {
  223. callback(_data['majorname']);
  224. }
  225. });
  226. }
  227. },
  228. {
  229. label: "课程", name: "LessonNo", width: 100, align: "left",
  230. formatterAsync: function (callback, value, row, op, $cell) {
  231. learun.clientdata.getAsync('custmerData', {
  232. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo',
  233. key: value,
  234. keyId: 'lessonno',
  235. callback: function (_data) {
  236. callback(_data['lessonname']);
  237. }
  238. });
  239. }
  240. },
  241. {
  242. label: "班级", name: "TeachClassNo", width: 100, align: "left",
  243. formatterAsync: function (callback, value, row, op, $cell) {
  244. learun.clientdata.getAsync('custmerData', {
  245. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  246. key: value,
  247. keyId: 'classno',
  248. callback: function (_data) {
  249. callback(_data['classname']);
  250. }
  251. });
  252. }
  253. },
  254. {
  255. label: "教师", name: "EmpNo", width: 100, align: "left",
  256. formatterAsync: function (callback, value, row, op, $cell) {
  257. learun.clientdata.getAsync('custmerData', {
  258. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  259. key: value,
  260. keyId: 'empno',
  261. callback: function (_data) {
  262. callback(_data['empname']);
  263. }
  264. });
  265. }
  266. },
  267. {
  268. label: "教室", name: "ClassroomNo", width: 100, align: "left",
  269. formatterAsync: function (callback, value, row, op, $cell) {
  270. learun.clientdata.getAsync('custmerData', {
  271. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ClassRoomInfo',
  272. key: value,
  273. keyId: 'classroomno',
  274. callback: function (_data) {
  275. callback(_data['classroomname']);
  276. }
  277. });
  278. }
  279. },
  280. {
  281. label: "新系部", name: "NewDeptNo", width: 100, align: "left",
  282. formatterAsync: function (callback, value, row, op, $cell) {
  283. learun.clientdata.getAsync('custmerData', {
  284. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  285. key: value,
  286. keyId: 'deptno',
  287. callback: function (_data) {
  288. callback(_data['deptname']);
  289. }
  290. });
  291. }
  292. },
  293. {
  294. label: "新专业", name: "NewMajorNo", width: 100, align: "left",
  295. formatterAsync: function (callback, value, row, op, $cell) {
  296. learun.clientdata.getAsync('custmerData', {
  297. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  298. key: value,
  299. keyId: 'majorno',
  300. callback: function (_data) {
  301. callback(_data['majorname']);
  302. }
  303. });
  304. }
  305. },
  306. {
  307. label: "新课程", name: "NewLessonNo", width: 100, align: "left",
  308. formatterAsync: function (callback, value, row, op, $cell) {
  309. learun.clientdata.getAsync('custmerData', {
  310. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo',
  311. key: value,
  312. keyId: 'lessonno',
  313. callback: function (_data) {
  314. callback(_data['lessonname']);
  315. }
  316. });
  317. }
  318. },
  319. {
  320. label: "新班级", name: "NewTeachClassNo", width: 100, align: "left",
  321. formatterAsync: function (callback, value, row, op, $cell) {
  322. learun.clientdata.getAsync('custmerData', {
  323. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  324. key: value,
  325. keyId: 'classno',
  326. callback: function (_data) {
  327. callback(_data['classname']);
  328. }
  329. });
  330. }
  331. },
  332. {
  333. label: "新教师", name: "NewEmpNo", width: 100, align: "left",
  334. formatterAsync: function (callback, value, row, op, $cell) {
  335. learun.clientdata.getAsync('custmerData', {
  336. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  337. key: value,
  338. keyId: 'empno',
  339. callback: function (_data) {
  340. callback(_data['empname']);
  341. }
  342. });
  343. }
  344. },
  345. {
  346. label: "新教室", name: "NewClassroomNo", width: 100, align: "left",
  347. formatterAsync: function (callback, value, row, op, $cell) {
  348. learun.clientdata.getAsync('custmerData', {
  349. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ClassRoomInfo',
  350. key: value,
  351. keyId: 'classroomno',
  352. callback: function (_data) {
  353. callback(_data['classroomname']);
  354. }
  355. });
  356. }
  357. },
  358. { label: "调度开始时间", name: "AttemperStartTime", width: 100, align: "left" },
  359. { label: "调度结束时间", name: "AttemperEndTime", width: 100, align: "left" },
  360. {
  361. label: "创建用户", name: "CreateUserId", width: 100, align: "left",
  362. formatter: function (cellvalue, row) {
  363. return row.CreateUserName;
  364. }
  365. },
  366. { label: "提交时间", name: "SubmitTime", width: 130, align: "left" },
  367. {
  368. label: "状态", name: "Status", width: 100, align: "left",
  369. formatter: function (cellvalue, row) {
  370. if (cellvalue == 1) {
  371. return '<span class=\"label label-success\" >已提交</span>';
  372. } else {
  373. return '<span class=\"label label-default\" >未提交</span>';
  374. }
  375. }
  376. },
  377. {
  378. label: "审核用户", name: "CheckUserId", width: 100, align: "left",
  379. formatter: function (cellvalue, row) {
  380. return row.CheckUserName;
  381. }
  382. },
  383. { label: "审核时间", name: "CheckTime", width: 130, align: "left" },
  384. {
  385. label: "审核状态", name: "CheckStatus", width: 100, align: "left",
  386. formatter: function (cellvalue, row) {
  387. if (cellvalue == 1) {
  388. return '<span class=\"label label-warning\" >审核中</span>';
  389. } else if (cellvalue == 2) {
  390. return '<span class=\"label label-success\" >审核通过</span>';
  391. } else {
  392. return '<span class=\"label label-default\" >草稿</span>';
  393. }
  394. }
  395. },
  396. ],
  397. mainId: 'Id',
  398. isPage: true,
  399. sord: 'desc',
  400. sidx: 'CreateTime'
  401. });
  402. page.search();
  403. },
  404. search: function (param) {
  405. param = param || {};
  406. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  407. }
  408. };
  409. refreshGirdData = function (res, postData) {
  410. if (res.code == 200) {
  411. // 发起流程
  412. learun.workflowapi.create({
  413. isNew: true,
  414. schemeCode: 'ArrangeLessonTermAttemper',// 填写流程对应模板编号
  415. processId: processId,
  416. processName: '课程异动申请',// 对应流程名称
  417. processLevel: '1',
  418. description: '',
  419. formData: JSON.stringify(postData),
  420. callback: function (res, data) {
  421. }
  422. });
  423. page.search();
  424. }
  425. };
  426. page.init();
  427. }