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.
 
 
 
 
 
 

233 lines
10 KiB

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