ScrapStoreEnterMg.cshtml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. @using ShwasherSys.Authorization.Permissions
  2. @using ShwasherSys.BasicInfo
  3. @using ShwasherSys.Models.Layout
  4. @using ShwasherSys.Models.Modal
  5. @using ShwasherSys.Views.Shared.New.Modals
  6. @using ShwasherSys.Views.Shared.New.Table
  7. @using InputTypes = ShwasherSys.Views.Shared.New.Modals.InputTypes
  8. @using ModalBodyViewModel = ShwasherSys.Views.Shared.New.Modals.ModalBodyViewModel
  9. @using ModalHeaderViewModel = ShwasherSys.Models.Modal.ModalHeaderViewModel
  10. @using SpecialInputModel = ShwasherSys.Views.Shared.New.Modals.SpecialInputModel
  11. @{
  12. ViewBag.Title = "废品入库信息维护";
  13. string activeMenu = PermissionNames.PagesScrapStoreScrapStoreEnterMg; //The menu item will be active for this page.
  14. ViewBag.ActiveMenu = activeMenu;
  15. List<SelectListItem> productType = ViewBag.ProductType;
  16. List<SelectListItem> scrapSource = ViewBag.ScrapSource;
  17. var searchForm = new SearchFormViewModal(new List<SearchItem>()
  18. {
  19. new SearchItem("productNo","产品编码"),
  20. new SearchItem("productName","名称"),
  21. new SearchItem("model","规格"),
  22. new SearchItem("applyEnterDate","申请时间",FiledType.Dnull,ExpType.GreaterOrEqual),
  23. new SearchItem("applyEnterDate","至",FiledType.Dnull,ExpType.LessOrEqual),
  24. //new SearchItem("applyStatus","申请状态",FiledType.I,ExpType.Equal).SetSearchItem(applyStatus)
  25. });
  26. var table = new TableViewModel("/api/services/app/ScrapEnterStore/GetViewAll", activeMenu, searchForm)
  27. .SetFields(new List<FieldItem>()
  28. {
  29. new FieldItem("productType", "产品类别",formatter:"productTypeFormatter"),
  30. new FieldItem("productNo", "产品编码"),
  31. new FieldItem("productName", "名称"),
  32. new FieldItem("productionOrderNo", "流转单号"),
  33. new FieldItem("material", "材质"),
  34. new FieldItem("model", "规格"),
  35. new FieldItem("applyQuantity","申请数量"),
  36. new FieldItem("applyEnterDate","申请入库时间","DateFormatter"),
  37. new FieldItem("quantity","入库数量"),
  38. new FieldItem("storeLocationNo", "库区"),
  39. new FieldItem("scrapSource", "报废来源",formatter:"scrapSourceFormatter"),
  40. //new FieldItem("auditDate","审核时间","DateFormatter"),
  41. //new FieldItem("applyStatus","状态","ApplyStatusFormatter"),
  42. });
  43. }
  44. @section css{
  45. }
  46. @Html.Partial("New/Table/_Table", table)
  47. @section scripts
  48. {
  49. <script type="text/javascript">
  50. var $table = $('#table');
  51. $(function() {
  52. LoadTable();
  53. var funs = window.funs || { none: function() { console.log("No type"); } };
  54. });
  55. </script>
  56. <!--格式化-->
  57. <script id="formatter-script" type="text/javascript">
  58. function productTypeFormatter(v, r) {
  59. var name = $("#hid-productType option[value='" + v + "']").text();
  60. if (v === 1) {
  61. return '<span class="label label-info">' + name + '</span>';
  62. } else if (v === 2) {
  63. return '<span class="label label-success">' + name + '</span>';
  64. } else if (v === 3) {
  65. return '<span class="label label-warning">' + name + '</span>';
  66. }
  67. return '<span class="label label-info">' + name + '</span>';
  68. }
  69. function scrapSourceFormatter(v, r) {
  70. var name = $("#hid-scrapSource option[value='" + v + "']").text();
  71. if (v === 1) {
  72. return '<span class="label label-info">' + name + '</span>';
  73. } else if (v === 2) {
  74. return '<span class="label label-success">' + name + '</span>';
  75. } else if (v === 3) {
  76. return '<span class="label label-warning">' + name + '</span>';
  77. }
  78. return '<span class="label label-info">' + name + '</span>';
  79. }
  80. </script>
  81. }
  82. <section style="display: none">
  83. <select id="hid-type">
  84. <option value=""></option>
  85. </select>
  86. @Html.DropDownList("hid-productType", productType)
  87. @Html.DropDownList("hid-scrapSource", scrapSource)
  88. @*@Html.DropDownList("hid-du", duty)
  89. @Html.DropDownList("hid-de", depart)
  90. @Html.DropDownList("hid-gender", gender)*@
  91. </section>