ProductItem.cshtml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. @using ShwasherSys.Authorization.Permissions
  2. @using ShwasherSys.Models.Layout
  3. @using ShwasherSys.Models.Modal
  4. @{
  5. /**/
  6. ViewBag.ActiveMenu = PermissionNames.PagesProductInspectProductItemInspectMg; //The menu item will be active for this page.
  7. ViewBag.Title = "半成品入库检验";
  8. List<SelectListItem> semiApplyStatus = ViewBag.SemiApplyStatus;
  9. List<SelectListItem> storeHouses = ViewBag.StoreHouses;
  10. var searchForm = new SearchFormViewModal(new List<SearchItem>()
  11. {
  12. new SearchItem("productionOrderNo","排产单号"),
  13. new SearchItem("semiProductName","半成品名称"),
  14. new SearchItem("model","规格"),
  15. new SearchItem("material","材质"),
  16. new SearchItem("surfaceColor","表色"),
  17. new SearchItem("semiProductNo","半成品编码").SetSearchIcon("query_semiProduct_modal"),
  18. new SearchItem("partNo","零件号"),
  19. }, false);
  20. }
  21. <section style="display: none">
  22. @Html.DropDownList("hide-ApplyStatus", semiApplyStatus)
  23. @Html.DropDownList("hide-StoreHouses", storeHouses)
  24. </section>
  25. <div class="table-box mr-4 iwb-bootstrap-table">
  26. @Html.Action("ToolMenu", "Layout", new { pageName = ViewBag.ActiveMenu, searchForm })
  27. <table id="table"
  28. data-url="/api/services/app/ProductInspect/GetSemiEnterStoreCheck"
  29. data-striped="true" data-id-field="id" data-unique-id="id"
  30. data-method="post"
  31. data-side-pagination="server"
  32. data-content-type="application/x-www-form-urlencoded; charset=UTF-8"
  33. data-cache="false"
  34. data-pagination="true" data-page-size="30" data-page-number="1" data-page-list="[30,50,100,200]" data-pagination-detail-h-align="right" data-pagination-h-align="left"
  35. data-query-params="QueryParams"
  36. data-response-handler="ResponseHandler"
  37. data-click-to-select="true"
  38. data-single-select="true">
  39. <thead>
  40. <tr class="row" id="header">
  41. <th data-field="state" data-checkbox="true"></th>
  42. <th data-align="center" data-field="productionOrderNo">排产单编号</th>
  43. <th data-align="center" data-field="semiProductName">名称</th>
  44. <th data-align="center" data-field="model">规格</th>
  45. <th data-align="center" data-field="semiProductNo">半成品编码</th>
  46. <th data-align="center" data-field="quantity">申请入库数量(kg)</th>
  47. <th data-align="center" data-field="actualQuantity" data-formatter="QuantityFormatte">入库数量(kg)</th>
  48. <th data-align="center" data-field="applyStatus" data-formatter="ApplyStatusFormatter">申请状态</th>
  49. <th data-align="center" data-field="storeHouseId" data-formatter="StoreHouseIdFormatte">仓库</th>
  50. <th data-align="center" data-field="applyEnterDate">申请时间</th>
  51. <th data-align="center" data-field="surfaceColor">表色</th>
  52. <th data-align="center" data-field="rigidity">硬度</th>
  53. <th data-align="center" data-field="material">材质</th>
  54. <th data-align="center" data-field="kgWeight">千件重</th>
  55. @*<th data-align="center" data-formatter="ActionFormatter"></th>*@
  56. </tr>
  57. </thead>
  58. </table>
  59. </div>
  60. @section modal{
  61. <section>
  62. <!--Main Modal-->
  63. <div class="modal fade" id="modal" role="dialog" tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true">
  64. <div class="modal-dialog modal-dialog-centered" role="document">
  65. <div class="modal-content">
  66. @Html.Partial("Modals/_ModalHeader", new ModalHeaderViewModel("半成品入库确认", ""))
  67. @{
  68. var inputs = new List<InputViewModel>
  69. {
  70. new InputViewModel("id", hide:true),
  71. new InputViewModel("createSourceType", hide:true),
  72. new InputViewModel("actualQuantity", displayName:"确认入库数量(kg)",@class:"number",other:"min=0.001"),
  73. new InputViewModel("kgWeight", displayName:"千件重)",@class:"number",other:"min=0.001"),
  74. };
  75. //var specials = new List<SpecialInputModel>();
  76. }
  77. @Html.Partial("Modals/_ModalBody", new ModalBodyViewModel(inputs))
  78. @Html.Partial("Modals/_ModalFooter", "0")
  79. </div>
  80. </div>
  81. </div>
  82. </section>
  83. @Html.Partial("Modals/Query/_SemiProduct", "KeyWords-6")
  84. @Html.Partial("Modals/Query/_UnqualifiedProduct", "")
  85. }
  86. @section scripts
  87. {
  88. <script type="text/javascript">
  89. $(function () {
  90. //show完毕前执行
  91. LoadTable();
  92. var funs = window.funs || { none: function () { console.log("No type"); } };
  93. funs["btnCheck"] = function (url) {
  94. var row = config.table.bootstrapTable("getSelections")[0];
  95. if (row) {
  96. abp.message.confirm("确认通过入库检验?", "通过检验", function () {
  97. SaveAjax({ url: url, data: { Id: row.id }, isValidate: false });
  98. });
  99. } else
  100. abp.message.warn(abp.localization.localize("ChooseOneToOp"));
  101. }
  102. funs["btnUnCheck"] = function (url) {
  103. var row = config.table.bootstrapTable("getSelections")[0];
  104. if (row) {
  105. abp.message.confirm("确认入库检验不合格?", "拒绝通过检验", function () {
  106. SaveAjax({ url: url, data: { Id: row.id }, isValidate: false });
  107. });
  108. } else
  109. abp.message.warn(abp.localization.localize("ChooseOneToOp"));
  110. }
  111. funs["btnShowUnqualified"] = function(url) {
  112. ShowModal("query_UnqualifiedProduct_modal");
  113. }
  114. });
  115. function QuantityFormatte(v, r) {
  116. if (r.actualQuantity === 0) {
  117. return '<span class="label label-default">' + v + '</span>';
  118. }
  119. if (r.actualQuantity > r.quantity) {
  120. return '<span class="label label-success">' + v + '</span>';
  121. } else if (r.actualQuantity === r.quantity) {
  122. return '<span class="label label-info">' + v + '</span>';
  123. } else {
  124. return '<span class="label label-danger">' + v + '</span>';
  125. }
  126. }
  127. function StoreHouseIdFormatte(v, r) {
  128. var name = $("#hide-StoreHouses option[value='" + v + "']").text();
  129. return '<span class="label label-primary">' + name + '</span>';
  130. }
  131. function ApplyStatusFormatter(v,r) {
  132. if (r.isClose) {
  133. return '<span class="label label-primary">已结束</span>';
  134. }
  135. var name = $("#hide-ApplyStatus option[value='" + v + "']").text();
  136. if (v === "4") {
  137. return '<span class="label label-info">' + name + '</span>';
  138. }else if (v === "42") {
  139. return '<span class="label label-danger">' + name + '</span>';
  140. }
  141. return '<span class="label label-info">' + name + '</span>';
  142. }
  143. </script>
  144. }