TeacherRetail.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/TeacherRetail/Edit";
  2. //var ViewUrl = CMS_SystemConfig.VirtualDirectoryPath + "/TeacherRetail/TeacherRetailDetailList";
  3. var ViewUrl = CMS_SystemConfig.VirtualDirectoryPath + "/StockOut/StockOutDetailList"; //考虑到页面重用
  4. var mnu = "";
  5. //加载
  6. $(function () {
  7. mnu = $.SystemGeneral.getUrlParam("MNU");
  8. })
  9. function reload() {
  10. $("#dgTeacherRetailList").cmsXDataTable("load", $.getDataGridParams("dgTeacherRetailList"));
  11. }
  12. //获取选中的数据
  13. function validChoose() {
  14. var d = [];
  15. $.each($("#dgTeacherRetailList").cmsXDataTable("getSelections"), function (index) {
  16. d.push(this.StockOutID);
  17. });
  18. return d;
  19. }
  20. //修改
  21. function TeacherRetail_Update() {
  22. var d = validChoose();
  23. if (d.length == 0) {
  24. $.messager.alert("系统提示", "请选择您要修改的信息。");
  25. return;
  26. }
  27. if (d.length > 1) {
  28. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  29. return;
  30. }
  31. var redirectTo = url + '?stockOutID=' + d + '&MNU=' + mnu;
  32. $.popupTopWindow('教材零售信息', redirectTo, 800, 550, null, null);
  33. }
  34. //保存数据
  35. function TeacherRetail_Save() {
  36. $(document.forms[0]).submit();//提交表单
  37. }
  38. //导出
  39. function TeacherRetail_Export() {
  40. $("#formQuery").submit();
  41. }
  42. //删除
  43. function TeacherRetail_Delete() {
  44. var d = validChoose().join(',');
  45. if (d == "") {
  46. $.messager.alert("系统提示", "请选择您要删除的信息。");
  47. return;
  48. }
  49. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  50. if (r) {
  51. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/TeacherRetail/Delete', { stockOutIDs: d }, function (data) {
  52. if (data == "删除成功。") {
  53. $.messager.alert("系统提示", data);
  54. $("#dgTeacherRetailList").cmsXDataTable('load');
  55. } else {
  56. $.messager.alert("系统提示", data);
  57. }
  58. });
  59. }
  60. });
  61. }
  62. //教材零售(新增)
  63. function TeacherRetail_Add() {
  64. var redirectTo = url + '?MNU=' + mnu+ '&stockOutType=1';
  65. $.popupTopWindow('教材零售', redirectTo, 800, 550, null, null);
  66. }
  67. //教材零售信息明细
  68. function TeacherRetailDetailView(rowindex, rowdata) {
  69. var redirectTo = ViewUrl + '?stockOutID=' + rowdata.StockOutID + '&MNU=' + mnu;
  70. $.popupTopWindow('教材零售明细', redirectTo, 850, 550, null, null);
  71. }
  72. //提交数据、更新状态值
  73. function TeacherRetail_Submit() {
  74. var d = validChoose().join(',');
  75. if (d == "") {
  76. $.messager.alert("系统提示", "请选择您要提交的信息。");
  77. return;
  78. }
  79. $.messager.confirm("系统提示", "您确定要提交选择的信息?", function (r) {
  80. if (r) {
  81. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/TeacherRetail/Submit?hid_ActionsType=Submit', { stockOutIDs: d }, function (data) {
  82. if (data == "提交出库成功。") {
  83. $.messager.alert("系统提示", data);
  84. $("#dgTeacherRetailList").cmsXDataTable('load');
  85. } else {
  86. $.messager.alert("系统提示", data);
  87. }
  88. });
  89. }
  90. });
  91. }
  92. function QueryCourseDropdownList() {
  93. reload();
  94. }
  95. function QuerySchoolYearDropdownList() {
  96. reload();
  97. }
  98. function QueryLibraryDropdownList() {
  99. reload();
  100. }
  101. function QueryPublishDropdownList() {
  102. reload();
  103. }
  104. function QueryEndStockInTimeList() {
  105. $("#EndStockInTime").val($dp.cal.getNewDateStr())
  106. reload();
  107. }
  108. function QueryStartStockInTimeList() {
  109. $("#StartStockInTime").val($dp.cal.getNewDateStr())
  110. reload();
  111. }