StockIn.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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 ET06_05_01_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 ET06_05_01_StockIn_Import() {
  36. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/StockIn/Import?MNU=' + mnu;
  37. $.popupTopWindow('教材入库导入', redirectTo, 400, 300, null, null);
  38. }
  39. //导出
  40. function ET06_05_01_StockIn_Export() {
  41. $("#formQuery").submit();
  42. }
  43. //删除
  44. function ET06_05_01_StockIn_Delete()
  45. {
  46. var d = validChoose().join(',');
  47. if (d == "") {
  48. $.messager.alert("系统提示", "请选择您要删除的信息。");
  49. return;
  50. }
  51. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  52. if (r) {
  53. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/StockIn/Delete', { stockInIDs: d }, function (data) {
  54. if (data == "删除成功。") {
  55. $.messager.alert("系统提示", data);
  56. $("#dgStockInList").cmsXDataTable('load');
  57. } else {
  58. $.messager.alert("系统提示", data);
  59. }
  60. });
  61. }
  62. });
  63. }
  64. //教材入库(新增)
  65. function ET06_05_01_StockIn_Add()
  66. {
  67. var redirectTo = url + '?MNU=' + mnu + '&stockInType=1';
  68. $.popupTopWindow('教材入库', redirectTo, 800, 550, null, null);
  69. }
  70. //自动入库(根据采购计划自动入库)
  71. function ET06_05_01_StockIn_AutoAdd() {
  72. var redirectTo = AutoUrl + '?MNU=' + mnu;
  73. $.popupTopWindow('自动入库', redirectTo, 450, 300, null, null);
  74. }
  75. //自动入库确定
  76. function ET06_05_01_StockIn_AutoAdd_New(){
  77. var schoolyearIDStr = $("#SchoolyearDropdown").combobox("getValue");
  78. if (schoolyearIDStr == "-1") {
  79. $.messager.alert("系统提示", "请选择要自动入库的学年学期。");
  80. return;
  81. }
  82. $.messager.confirm("系统提示", "您确定要对选择的学年学期的教材自动入库?", function (r) {
  83. if (r) {
  84. $(document.forms[0]).submit(); //提交表单
  85. }
  86. });
  87. }
  88. //教材入库明细
  89. function StockInDetailView(rowindex, rowdata) {
  90. var redirectTo = ViewUrl + "?stockInID=" + rowdata.StockInID + "&MNU=" + mnu;
  91. $.popupTopWindow("教材入库明细", redirectTo, 850, 480, null, null);
  92. }
  93. //提交数据、更新状态值
  94. function ET06_05_01_Submit() {
  95. var d = validChoose().join(',');
  96. if (d == "") {
  97. $.messager.alert("系统提示", "请选择您要提交的信息。");
  98. return;
  99. }
  100. $.messager.confirm("系统提示", "您确定要提交选择的信息?", function (r) {
  101. if (r) {
  102. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/StockIn/Submit', { stockInIDs: d }, function (data) {
  103. if (data == "提交入库成功。") {
  104. $.messager.alert("系统提示", data);
  105. $("#dgStockInList").cmsXDataTable('load');
  106. } else {
  107. $.messager.alert("系统提示", data);
  108. }
  109. });
  110. }
  111. });
  112. }
  113. function QueryCourseDropdownList()
  114. {
  115. reload();
  116. }
  117. function QuerySchoolYearDropdownList() {
  118. reload();
  119. }
  120. function QueryCollegeDropdownList() {
  121. reload();
  122. }
  123. function QueryPublishDropdownList()
  124. {
  125. reload();
  126. }
  127. function QueryEndStockInTimeList()
  128. {
  129. $("#EndStockInTime").val($dp.cal.getNewDateStr())
  130. reload();
  131. }
  132. function QueryStartStockInTimeList() {
  133. $("#StartStockInTime").val($dp.cal.getNewDateStr())
  134. reload();
  135. }
  136. function QueryLateDropdownList()
  137. {
  138. reload();
  139. }