PackageApplyInfo.cshtml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. @using ShwasherSys.Authorization.Permissions
  2. @using ShwasherSys.Models.Layout
  3. @using ShwasherSys.Models.Modal
  4. @{
  5. /**/
  6. ViewBag.ActiveMenu = PermissionNames.PagesPackInfoPackageApplyInfo; //The menu item will be active for this page.
  7. ViewBag.Title = "包装申请信息";
  8. List<SelectListItem> applyStatus = ViewBag.ApplyStatus;
  9. List<SelectListItem> closeStatus = new List<SelectListItem>()
  10. {
  11. new SelectListItem(){Text = @"未关闭",Value = "false",Selected = true},
  12. new SelectListItem(){Text = @"已关闭",Value = "true"}
  13. };
  14. var searchForm = new SearchFormViewModal(new List<SearchItem>()
  15. {
  16. new SearchItem("productionOrderNo","排产单号"),
  17. new SearchItem("productName","产品名称"),
  18. new SearchItem("model","规格"),
  19. new SearchItem("material","材质"),
  20. new SearchItem("applyDate", "申请日期",FiledType.Dnull,ExpType.GreaterOrEqual),
  21. new SearchItem("applyDate", "到",FiledType.Dnull,ExpType.LessOrEqual),
  22. new SearchItem("semiProductNo","半成品编码").SetSearchIcon("query_semiProduct_modal"),
  23. new SearchItem("applyStatus","申请状态" )
  24. .SetSearchItem(applyStatus),
  25. new SearchItem("isClose","关闭状态" ,FiledType.B,ExpType.Equal)
  26. .SetSearchItem(closeStatus),
  27. }, false);
  28. }
  29. @section css{
  30. <link href="~/Content/Plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" />
  31. }
  32. <style>
  33. .tool-radio {
  34. display: inline-block;
  35. margin-left: 10px;
  36. }
  37. [type="radio"]:not(:checked) + label, [type="radio"]:checked + label {
  38. padding-left: 25px;
  39. font-size: 1.5rem;
  40. color: #dad9db;
  41. }
  42. </style>
  43. <section style="display: none">
  44. @Html.DropDownList("hide-ApplyStatus", applyStatus)
  45. </section>
  46. <div class="table-box iwb-bootstrap-table">
  47. @Html.Action("ToolMenu", "Layout", new { pageName = ViewBag.ActiveMenu, searchForm })
  48. <table id="table"
  49. data-url="/api/services/app/PackInfoApply/GetAll" data-id-field="id" data-unique-id="id"
  50. data-striped="true" data-click-to-select="true" data-single-select="true"
  51. data-method="post" data-side-pagination="server" data-content-type="application/x-www-form-urlencoded; charset=UTF-8"
  52. data-cache="false" data-pagination="true" data-page-size="30" data-page-number="1" data-page-list="[30,50,100,200]"
  53. data-pagination-h-align="left" data-pagination-detail-h-align="right"
  54. data-query-params="QueryParams" data-response-handler="ResponseHandler">
  55. <thead>
  56. <tr class="row" id="header">
  57. <th data-field="state" data-checkbox="true"></th>
  58. <th data-align="center" data-field="processingNum" data-formatter="ProcessingNumFormatter">待处理明细</th>
  59. <th data-align="center" data-field="productionOrderNo">流转单编号</th>
  60. <th data-align="center" data-field="" data-formatter="PackageProductNoFormatter">包装前产品编码</th>
  61. @*<th data-align="center" data-field="semiProductNo">半成品编码</th>*@
  62. <th data-align="center" data-field="applyQuantity">申请包装数量</th>
  63. <th data-align="center" data-field="surfaceColor">表色</th>
  64. <th data-align="center" data-field="productName">产品名称</th>
  65. <th data-align="center" data-field="model">规格</th>
  66. <th data-align="center" data-field="rigidity">硬度</th>
  67. <th data-align="center" data-field="partNo">零件号</th>
  68. <th data-align="center" data-field="remark">备注</th>
  69. <th data-align="center" data-field="applyStatus" data-formatter="ApplyStatusFormatter">申请状态</th>
  70. <th data-align="center" data-field="applyDate" data-formatter="DateFormatter">申请时间</th>
  71. </tr>
  72. </thead>
  73. </table>
  74. </div>
  75. @section modal{
  76. <!--Main Modal-->
  77. <section>
  78. <div class="modal fade" id="modal" role="dialog" tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true">
  79. <div class="modal-dialog modal-dialog-centered" role="document">
  80. <div class="modal-content">
  81. @Html.Partial("Modals/_ModalHeader", new ModalHeaderViewModel("包装产品"))
  82. @{
  83. var inputs = new List<InputViewModel>
  84. {
  85. new InputViewModel("id", hide: true),
  86. new InputViewModel("packageApplyNo",displayName:"申请流水号").SetNotRequired(),
  87. new InputViewModel("currentSemiStoreHouseNo",displayName:"半成品仓库库存信息编号").SetNotRequired(),
  88. new InputViewModel("productionOrderNo",displayName:"流转单编号"),
  89. new InputViewModel("semiProductNo",displayName:"半成品编码").SetNotRequired(),
  90. new InputViewModel("applyQuantity",displayName:"申请包装数量").SetNotRequired(),
  91. new InputViewModel("actualQuantity",displayName:"实际包装的千件数").SetNotRequired(),
  92. new InputViewModel("applyStatus",displayName:"").SetNotRequired(),
  93. new InputViewModel("applyDate",displayName:"发起申请时间").SetNotRequired(),
  94. new InputViewModel("remark",displayName:"").SetNotRequired(),
  95. new InputViewModel("timeCreated",displayName:"").SetNotRequired(),
  96. new InputViewModel("timeLastMod",displayName:"").SetNotRequired(),
  97. new InputViewModel("creatorUserId",displayName:"").SetNotRequired(),
  98. new InputViewModel("userIDLastMod",displayName:"").SetNotRequired(),
  99. };
  100. //var specials = new List<SpecialInputModel>();
  101. }
  102. @Html.Partial("Modals/_ModalBody", new ModalBodyViewModel(inputs))
  103. @Html.Partial("Modals/_ModalFooter", "0")
  104. </div>
  105. </div>
  106. </div>
  107. </section>
  108. @Html.Partial("Modals/Query/_SemiProduct", "KeyWords-7")
  109. }
  110. @section scripts
  111. {
  112. <script src="~/Content/Plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
  113. <script src="~/Content/Plugins/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
  114. <script type="text/javascript">
  115. var datePickerOpt = {
  116. language: 'zh-CN',
  117. format: "yyyy-mm-dd",
  118. todayBtn: true,
  119. autoclose: true,
  120. startView: 2,
  121. minView: 2,
  122. maxView: 4
  123. //showSecond: true,
  124. //showHours: true,
  125. //minuteStep: 10
  126. };
  127. $(function () {
  128. $("#tableTool").css("min-height", "40px");
  129. $("#KeyWords-9").val("false").select2();
  130. $("#Tool1").append(
  131. //'<div class="tool-radio"><input name="proType" type="radio" id="allProduction" checked value=""/><label for="allProduction">全部</label></div>' +
  132. '<div class="tool-radio"><input name="packType" type="radio" id="sProduct" checked value="1"/><label for="sProduct">半成品包装</label></div>' +
  133. '<div class="tool-radio"><input name="packType" type="radio" id="fProduct" value="2"/><label for="fProduct">成品包装</label></div>');
  134. $(".tool-radio input[type='radio']").on('click', function (e) {
  135. document.getElementById("SearchForm").reset();
  136. GetSearchList();
  137. RefreshTable();
  138. });
  139. LoadTable();
  140. $("#KeyWords-5").datetimepicker(datePickerOpt);
  141. $("#KeyWords-6").datetimepicker(datePickerOpt);
  142. });
  143. function GetSearchList() {
  144. var count = $("#SearchForm").find(".KeyWords").length;
  145. window._searchList = [];
  146. var packType = $('input[name="packType"]:checked').val();
  147. if (packType) {
  148. window._searchList.push({ KeyWords: packType, KeyField: "PackType", FieldType: "1", ExpType: "0" });
  149. }
  150. for (var i = 1; i <= count; i++) {
  151. var keyWords = $("#KeyWords-" + i).val();
  152. if (keyWords) {
  153. var keyField = $("#KeyField-" + i).val();
  154. var fieldType = $("#FieldType-" + i).val();
  155. var expType = $("#ExpType-" + i).val();
  156. _searchList.push({
  157. KeyWords: keyWords,
  158. KeyField: keyField,
  159. FieldType: fieldType,
  160. ExpType: expType
  161. });
  162. }
  163. }
  164. }
  165. </script>
  166. <script>
  167. function ProcessingNumFormatter(v, r) {
  168. if (v === 0) {
  169. //return '<span class="label label-info">' + v+ '</span>';
  170. return '';
  171. } else {
  172. return '<span class="label label-danger">待处理:' + v + '</span>';
  173. }
  174. }
  175. function PackageProductNoFormatter(v, r) {
  176. var packType = $('input[name="packType"]:checked').val();
  177. if (packType === "1") {
  178. return '<span class="label label-info">' + r.semiProductNo + '</span>';
  179. } else {
  180. return '<span class="label label-danger">' + r.productNo + '</span>';
  181. }
  182. }
  183. function ApplyStatusFormatter(v, r) {
  184. if (r.isClose) {
  185. return '<span class="label label-primary">已结束</span>';
  186. }
  187. var name = $("#hide-ApplyStatus option[value='" + v + "']").text();
  188. if (v === "1") {
  189. return '<span class="label label-info">' + name + '</span>';
  190. } else if (v === "2") {
  191. return '<span class="label label-success">' + name + '</span>';
  192. } else if (v === "3") {
  193. return '<span class="label label-danger">' + name + '</span>';
  194. }
  195. return '<span class="label label-info">' + name + '</span>';
  196. }
  197. </script>
  198. }