Refund.js 3.4 KB

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