StockOut.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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_Save()
  35. {
  36. $(document.forms[0]).submit();//提交表单
  37. }
  38. //导出
  39. function StockOut_Export() {
  40. $("#formQuery").submit();
  41. }
  42. //删除
  43. function StockOut_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 + '/StockOut/Delete', { stockOutIDs: d }, function (data) {
  52. if (data == "删除成功。") {
  53. $.messager.alert("系统提示", data);
  54. $("#dgStockOutList").cmsXDataTable('load');
  55. } else {
  56. $.messager.alert("系统提示", data);
  57. }
  58. });
  59. }
  60. });
  61. }
  62. //学生领书
  63. function StockOut_SD_Add() {
  64. var redirectTo = url + '?MNU=' + mnu + '&stockOutType=' + studentTypeID.toString();
  65. $.popupTopWindow('学生领书', redirectTo, 800, 550, null, null);
  66. }
  67. //教师领书
  68. function StockOut_TM_Add() {
  69. var redirectTo = url + '?MNU=' + mnu + '&stockOutType=' + teacherTypeID.toString();
  70. $.popupTopWindow('教师领书', redirectTo, 800, 550, null, null);
  71. }
  72. //个人领书明细
  73. function StockOutDetailView(rowindex, rowdata) {
  74. var redirectTo = ViewUrl + '?stockOutID=' + rowdata.StockOutID + '&MNU=' + mnu;
  75. $.popupTopWindow('个人领书明细', redirectTo, 800, 550, null, null);
  76. }
  77. //提交
  78. function StockOut_Submit() {
  79. var d = validChoose().join(',');
  80. if (d == "") {
  81. $.messager.alert("系统提示", "请选择您要提交的信息。");
  82. return;
  83. }
  84. $.messager.confirm("系统提示", "您确定要提交选择的信息?", function (r) {
  85. if (r) {
  86. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/StockOut/Submit?hid_ActionsType=Submit', { stockOutIDs: d }, function (data) {
  87. if (data == "提交出库成功。") {
  88. $.messager.alert("系统提示", data);
  89. $("#dgStockOutList").cmsXDataTable('load');
  90. } else {
  91. $.messager.alert("系统提示", data);
  92. }
  93. });
  94. }
  95. });
  96. }
  97. function QueryCourseDropdownList() {
  98. reload();
  99. }
  100. function QuerySchoolYearDropdownList() {
  101. reload();
  102. }
  103. function QueryLibraryDropdownList() {
  104. reload();
  105. }
  106. function QueryPublishDropdownList() {
  107. reload();
  108. }
  109. function QueryEndStockInTimeList() {
  110. $("#EndStockInTime").val($dp.cal.getNewDateStr())
  111. reload();
  112. }
  113. function QueryStartStockInTimeList() {
  114. $("#StartStockInTime").val($dp.cal.getNewDateStr())
  115. reload();
  116. }