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.

TeachIndex.js 9.7 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2022-07-18 17:52
  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. }, 220, 400);
  19. //$('#VaccineType').lrDataItemSelect({ code: 'VaccineType' });
  20. $('#DepartmentId').lrselect({
  21. type: 'tree',
  22. allowSearch: true,
  23. url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree',
  24. param: {}
  25. });
  26. $('#DeptNo').lrselect({
  27. value: "deptno",
  28. text: "deptname",
  29. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo',
  30. select: function (item) {
  31. if (item) {
  32. $('#MajorNo').lrselectRefresh({
  33. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
  34. param: { code: "CdMajorInfo", strWhere: "DeptNo='" + item.deptno + "'" }
  35. });
  36. }
  37. else {
  38. $('#MajorNo').lrselectRefresh({
  39. url: "",
  40. data: []
  41. });
  42. }
  43. $('#ClassNo').lrselectRefresh({
  44. url: "",
  45. data: []
  46. });
  47. }
  48. });
  49. $('#MajorNo').lrselect({
  50. value: "majorno",
  51. text: "majorname",
  52. select: function (item) {
  53. if (item) {
  54. $('#ClassNo').lrselectRefresh({
  55. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
  56. param: { code: "bjsj", strWhere: "DeptNo='" + item.deptno + "' and majorno='" + item.majorno + "'" }
  57. });
  58. }
  59. }
  60. });
  61. $('#MajorNo').on("click",
  62. function () {
  63. var data = $('#DeptNo').lrselectGet();
  64. if (!data) {
  65. learun.alert.error('请先选择系');
  66. }
  67. });
  68. $('#ClassNo').on("click",
  69. function () {
  70. var data1 = $('#DeptNo').lrselectGet();
  71. var data2 = $('#MajorNo').lrselectGet();
  72. if (!data1 || !data2) {
  73. learun.alert.error('请先选择系和专业');
  74. }
  75. });
  76. $('#ClassNo').lrselect({
  77. value: "classno",
  78. text: "classname"
  79. });
  80. // 刷新
  81. $('#lr_refresh').on('click', function () {
  82. location.reload();
  83. });
  84. //// 新增
  85. //$('#lr_add').on('click', function () {
  86. // learun.layerForm({
  87. // id: 'form',
  88. // title: '新增',
  89. // url: top.$.rootUrl + '/EducationalAdministration/VaccinationInfo/Form',
  90. // width: 600,
  91. // height: 400,
  92. // callBack: function (id) {
  93. // return top[id].acceptClick(refreshGirdData);
  94. // }
  95. // });
  96. //});
  97. // 编辑
  98. $('#lr_edit').on('click', function () {
  99. var keyValue = $('#gridtable').jfGridValue('Id');
  100. if (learun.checkrow(keyValue)) {
  101. learun.layerForm({
  102. id: 'form',
  103. title: '编辑',
  104. url: top.$.rootUrl + '/EducationalAdministration/VaccinationInfo/TeachForm?keyValue=' + keyValue,
  105. width: 600,
  106. height: 430,
  107. callBack: function (id) {
  108. return top[id].acceptClick(refreshGirdData);
  109. }
  110. });
  111. }
  112. });
  113. // 删除
  114. $('#lr_delete').on('click', function () {
  115. var keyValue = $('#gridtable').jfGridValue('Id');
  116. if (learun.checkrow(keyValue)) {
  117. learun.layerConfirm('是否确认删除该项!', function (res) {
  118. if (res) {
  119. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/VaccinationInfo/DeleteForm', { keyValue: keyValue }, function () {
  120. refreshGirdData();
  121. });
  122. }
  123. });
  124. }
  125. });
  126. // 一键生成
  127. $('#lr_create').on('click', function () {
  128. var userId = learun.clientdata.get(['userinfo']).userId;
  129. learun.layerConfirm('是否确认一键生成!', function (res) {
  130. if (res) {
  131. learun.postForm(top.$.rootUrl + '/EducationalAdministration/VaccinationInfo/CreateFrom', { userId: userId, Description: 1 }, function () {
  132. refreshGirdData();
  133. });
  134. }
  135. });
  136. });
  137. },
  138. // 初始化列表
  139. initGird: function () {
  140. $('#gridtable').jfGrid({
  141. url: top.$.rootUrl + '/EducationalAdministration/VaccinationInfo/GetPageListForTeacher',
  142. headData: [
  143. { label: "职工编号", name: "EmpNo", width: 100, align: "left" },
  144. { label: "姓名", name: "EmpName", width: 150, align: "left" },
  145. {
  146. label: "员工状态", name: "IsInActiveStatus", width: 100, align: "left",
  147. formatterAsync: function (callback, value, row, op, $cell) {
  148. learun.clientdata.getAsync('dataItem', {
  149. key: value,
  150. code: 'JobStatus',
  151. callback: function (_data) {
  152. callback(_data.text);
  153. }
  154. });
  155. }
  156. },
  157. { label: "身份证", name: "CardId", width: 160, align: "left" },
  158. {
  159. label: "部门", name: "DepartmentId", width: 200, align: "left",
  160. formatterAsync: function (callback, value, row, op, $cell) {
  161. learun.clientdata.getAsync('custmerData', {
  162. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata',
  163. key: value,
  164. keyId: 'id',
  165. callback: function (_data) {
  166. callback(_data['name']);
  167. }
  168. });
  169. }
  170. },
  171. { label: "电话号码", name: "Mobile", width: 120, align: "left" },
  172. {
  173. label: "疫苗类型", name: "VaccineType", width: 100, align: "left",
  174. //formatterAsync: function (callback, value, row, op, $cell) {
  175. // learun.clientdata.getAsync('dataItem', {
  176. // key: value,
  177. // code: 'VaccineType',
  178. // callback: function (_data) {
  179. // callback(_data.text);
  180. // }
  181. // });
  182. //}
  183. },
  184. { label: "接种地", name: "VaccineAddress", width: 100, align: "left" },
  185. {
  186. label: "第一针时间", name: "FirstNeedle", width: 100, align: "left",
  187. formatter: function (cellvalue) {
  188. return learun.formatDate(cellvalue, 'yyyy-MM-dd');
  189. }
  190. },
  191. {
  192. label: "第二针时间", name: "SecondNeedle", width: 100, align: "left",
  193. formatter: function (cellvalue) {
  194. return learun.formatDate(cellvalue, 'yyyy-MM-dd');
  195. }
  196. },
  197. {
  198. label: "第三针时间", name: "ThirdNeedle", width: 100, align: "left",
  199. formatter: function (cellvalue) {
  200. return learun.formatDate(cellvalue, 'yyyy-MM-dd');
  201. }
  202. },
  203. { label: "未接种原因", name: "NotReason", width: 200, align: "left" },
  204. { label: "备注", name: "Remark", width: 300, align: "left" },
  205. ],
  206. mainId: 'Id',
  207. sidx: 'CreateTime desc',
  208. isPage: true
  209. });
  210. page.search();
  211. },
  212. search: function (param) {
  213. param = param || {};
  214. param.StuOrTeach = 1;
  215. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  216. }
  217. };
  218. refreshGirdData = function () {
  219. $('#gridtable').jfGridSet('reload');
  220. };
  221. page.init();
  222. }