ReturnStockIn.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/StockIn/Edit";
  2. var ViewUrl = CMS_SystemConfig.VirtualDirectoryPath + "/StockIn/StockInDetailList";
  3. var AutoUrl = CMS_SystemConfig.VirtualDirectoryPath + "/StockIn/AutoNewStockIn";
  4. var mnu = "";
  5. //加载
  6. $(function () {
  7. mnu = $.SystemGeneral.getUrlParam("MNU");
  8. })
  9. function reload() {
  10. $("#dgStockInList").cmsXDataTable("load", $.getDataGridParams("dgStockInList"));
  11. }
  12. //获取选中的数据
  13. function validChoose() {
  14. var d = [];
  15. $.each($("#dgStockInList").cmsXDataTable("getSelections"), function (index) {
  16. d.push(this.StockInID);
  17. });
  18. return d;
  19. }
  20. //修改
  21. function StockIn_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 + "?stockInID=" + d + "&MNU=" + mnu;
  32. $.popupTopWindow("教材入库信息", redirectTo, 800, 550, null, null);
  33. }
  34. //导出
  35. function StockIn_Export() {
  36. $("#formQuery").submit();
  37. }
  38. //删除
  39. function StockIn_Delete() {
  40. var d = validChoose().join(',');
  41. if (d == "") {
  42. $.messager.alert("系统提示", "请选择您要删除的信息。");
  43. return;
  44. }
  45. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  46. if (r) {
  47. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/StockIn/Delete', { stockInIDs: d }, function (data) {
  48. if (data == "删除成功。") {
  49. $.messager.alert("系统提示", data);
  50. $("#dgStockInList").cmsXDataTable('load');
  51. } else {
  52. $.messager.alert("系统提示", data);
  53. }
  54. });
  55. }
  56. });
  57. }
  58. //教材入库(新增)
  59. function StockIn_Add() {
  60. var redirectTo = url + '?MNU=' + mnu + '&stockInType=' + returnStockInType;
  61. $.popupTopWindow('教材入库', redirectTo, 800, 550, null, null);
  62. }
  63. //教材入库明细
  64. function StockInDetailView(rowindex, rowdata) {
  65. var redirectTo = ViewUrl + "?stockInID=" + rowdata.StockInID + "&MNU=" + mnu;
  66. $.popupTopWindow("教材入库明细", redirectTo, 800, 550, null, null);
  67. }
  68. //提交数据、更新状态值
  69. function Submit() {
  70. var d = validChoose().join(',');
  71. if (d == "") {
  72. $.messager.alert("系统提示", "请选择您要提交的信息。");
  73. return;
  74. }
  75. $.messager.confirm("系统提示", "您确定要提交选择的信息?", function (r) {
  76. if (r) {
  77. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/StockIn/Submit', { stockInIDs: d }, function (data) {
  78. if (data == "提交入库成功。") {
  79. $.messager.alert("系统提示", data);
  80. $("#dgStockInList").cmsXDataTable('load');
  81. } else {
  82. $.messager.alert("系统提示", data);
  83. }
  84. });
  85. }
  86. });
  87. }
  88. function QueryCourseDropdownList() {
  89. reload();
  90. }
  91. function QuerySchoolYearDropdownList() {
  92. reload();
  93. }
  94. function QueryCollegeDropdownList() {
  95. reload();
  96. }
  97. function QueryPublishDropdownList() {
  98. reload();
  99. }
  100. function QueryEndStockInTimeList() {
  101. $("#EndStockInTime").val($dp.cal.getNewDateStr())
  102. reload();
  103. }
  104. function QueryStartStockInTimeList() {
  105. $("#StartStockInTime").val($dp.cal.getNewDateStr())
  106. reload();
  107. }
  108. function QueryLateDropdownList() {
  109. reload();
  110. }