選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 
 

251 行
11 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2020-05-19 11:37
  5. * 描 述:心理预约管理
  6. */
  7. var refreshGirdData;
  8. var bootstrap = function ($, learun) {
  9. "use strict";
  10. var startTime;
  11. var endTime;
  12. var page = {
  13. init: function () {
  14. page.initGird();
  15. page.bind();
  16. },
  17. bind: function () {
  18. // 时间搜索框
  19. $('#datesearch').lrdate({
  20. dfdata: [
  21. { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  22. { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  23. { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  24. { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }
  25. ],
  26. // 月
  27. mShow: false,
  28. premShow: false,
  29. // 季度
  30. jShow: false,
  31. prejShow: false,
  32. // 年
  33. ysShow: false,
  34. yxShow: false,
  35. preyShow: false,
  36. yShow: false,
  37. // 默认
  38. dfvalue: '1',
  39. selectfn: function (begin, end) {
  40. startTime = begin;
  41. endTime = end;
  42. page.search();
  43. }
  44. });
  45. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  46. page.search(queryJson);
  47. }, 250, 400);
  48. $('#PDeptNo').lrDataSourceSelect({
  49. code: 'CdDeptInfo', value: 'deptno', text: 'deptname', select: function (val) {
  50. var deptno = "";
  51. if (val) {
  52. deptno = val.deptno;
  53. }
  54. $('#PMajorNo').lrselectRefresh({
  55. url: top.$.rootUrl + '/EducationalAdministration/CdMajor/GetListByDeptNo?DeptNo=' + deptno,
  56. text: "MajorName",
  57. value: "MajorNo"
  58. })
  59. }
  60. });
  61. $('#PMajorNo').lrDataSourceSelect({
  62. code: 'CdMajorInfo', value: 'majorno', text: 'majorname', select:
  63. function (val) {
  64. var majorNo = '';
  65. if (val) {
  66. majorNo = val.MajorNo;
  67. }
  68. $('#PClassNo').lrselectRefresh({
  69. url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GetClassByMajorNo?majorNo=' + majorNo,
  70. text: "ClassName",
  71. value: "ClassNo"
  72. })
  73. }
  74. });
  75. $('#PClassNo').lrDataSourceSelect({
  76. code: 'bjsj', value: 'classno', text: 'classname', select: function (val) {
  77. var classNo = '';
  78. if (val) {
  79. classNo = val.ClassNo;
  80. }
  81. $('#PStuNo').lrselectRefresh({
  82. url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetStuInfoByClassNo?classNo=' + classNo,
  83. text: "StuName",
  84. value: "StuNo"
  85. })
  86. }
  87. });
  88. $('#PEmpNo').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_userid', text: 'f_realname' });
  89. $('#PStuNo').lrDataSourceSelect({ code: 'StuInfoBasic', value: 'stuno', text: 'stuname' });
  90. // 刷新
  91. $('#lr_refresh').on('click', function () {
  92. location.reload();
  93. });
  94. // 新增
  95. $('#lr_add').on('click', function () {
  96. learun.layerForm({
  97. id: 'form',
  98. title: '新增',
  99. url: top.$.rootUrl + '/LogisticsManagement/APAppointmentPsychologist/Form',
  100. width: 600,
  101. height: 400,
  102. callBack: function (id) {
  103. return top[id].acceptClick(refreshGirdData);
  104. }
  105. });
  106. });
  107. // 编辑
  108. $('#lr_edit').on('click', function () {
  109. var keyValue = $('#gridtable').jfGridValue('PID');
  110. if (learun.checkrow(keyValue)) {
  111. learun.layerForm({
  112. id: 'form',
  113. title: '编辑',
  114. url: top.$.rootUrl + '/LogisticsManagement/APAppointmentPsychologist/Form?keyValue=' + keyValue,
  115. width: 600,
  116. height: 400,
  117. callBack: function (id) {
  118. return top[id].acceptClick(refreshGirdData);
  119. }
  120. });
  121. }
  122. });
  123. // 删除
  124. $('#lr_delete').on('click', function () {
  125. var keyValue = $('#gridtable').jfGridValue('PID');
  126. if (learun.checkrow(keyValue)) {
  127. learun.layerConfirm('是否确认删除该项!', function (res) {
  128. if (res) {
  129. learun.deleteForm(top.$.rootUrl + '/LogisticsManagement/APAppointmentPsychologist/DeleteForm', { keyValue: keyValue }, function () {
  130. refreshGirdData();
  131. });
  132. }
  133. });
  134. }
  135. });
  136. //预约通过
  137. $('#lr_success').on('click',
  138. function () {
  139. var keyValue = $('#gridtable').jfGridValue('PID');
  140. if (learun.checkrow(keyValue)) {
  141. learun.layerConfirm('是否确认通过预约!',
  142. function (res) {
  143. if (res) {
  144. learun.getForm(top.$.rootUrl + '/LogisticsManagement/APAppointmentPsychologist/SuccessAppointment?keyValue=' + keyValue,
  145. function () {
  146. refreshGirdData();
  147. });
  148. }
  149. });
  150. }
  151. });
  152. },
  153. // 初始化列表
  154. initGird: function () {
  155. $('#gridtable').lrAuthorizeJfGrid({
  156. url: top.$.rootUrl + '/LogisticsManagement/APAppointmentPsychologist/GetPageList',
  157. headData: [
  158. {
  159. label: "申请人", name: "PStuNo", width: 100, align: "left",
  160. formatterAsync: function (callback, value, row, op, $cell) {
  161. learun.clientdata.getAsync('custmerData', {
  162. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic',
  163. key: value,
  164. keyId: 'stuno',
  165. callback: function (_data) {
  166. callback(_data['stuname']);
  167. }
  168. });
  169. }
  170. },
  171. {
  172. label: "系", name: "PDeptNo", width: 100, align: "left",
  173. formatterAsync: function (callback, value, row, op, $cell) {
  174. learun.clientdata.getAsync('custmerData', {
  175. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  176. key: value,
  177. keyId: 'deptno',
  178. callback: function (_data) {
  179. callback(_data['deptname']);
  180. }
  181. });
  182. }
  183. },
  184. {
  185. label: "专业", name: "PMajorNo", width: 100, align: "left",
  186. formatterAsync: function (callback, value, row, op, $cell) {
  187. learun.clientdata.getAsync('custmerData', {
  188. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  189. key: value,
  190. keyId: 'majorno',
  191. callback: function (_data) {
  192. callback(_data['majorname']);
  193. }
  194. });
  195. }
  196. },
  197. {
  198. label: "班级", name: "PClassNo", width: 100, align: "left",
  199. formatterAsync: function (callback, value, row, op, $cell) {
  200. learun.clientdata.getAsync('custmerData', {
  201. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  202. key: value,
  203. keyId: 'classno',
  204. callback: function (_data) {
  205. callback(_data['classname']);
  206. }
  207. });
  208. }
  209. },
  210. { label: "预约时间", name: "PTime", width: 100, align: "left" },
  211. {
  212. label: "预约老师", name: "PEmpNo", width: 100, align: "left",
  213. formatterAsync: function (callback, value, row, op, $cell) {
  214. learun.clientdata.getAsync('custmerData', {
  215. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Psychology',
  216. key: value,
  217. keyId: 'f_account',
  218. callback: function (_data) {
  219. callback(_data['f_realname']);
  220. }
  221. });
  222. }
  223. },
  224. {
  225. label: "预约成功", name: "PAgreee", width: 100, align: "left",
  226. formatter(val) {
  227. if (val === 'true') {
  228. return '成功';
  229. } else {
  230. return '待处理';
  231. }
  232. } },
  233. { label: "备注", name: "Remark", width: 100, align: "left" },
  234. ],
  235. mainId: 'PID',
  236. isPage: true
  237. });
  238. },
  239. search: function (param) {
  240. param = param || {};
  241. param.StartTime = startTime;
  242. param.EndTime = endTime;
  243. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  244. }
  245. };
  246. refreshGirdData = function () {
  247. page.search();
  248. };
  249. page.init();
  250. }