FinshedEnterStoreApplyMg.cshtml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. @using ShwasherSys.Authorization.Permissions
  2. @using ShwasherSys.Models.Layout
  3. @using ShwasherSys.Models.Modal
  4. @{
  5. /**/
  6. ViewBag.ActiveMenu = PermissionNames.PagesFinshedStoreInfoFinshedEnterStoreApplyMg; //The menu item will be active for this page.
  7. ViewBag.Title = "成品入库申请审核";
  8. List<SelectListItem> applyStatus = ViewBag.FinshedApplyStatus;
  9. List<SelectListItem> storeHouse = ViewBag.StoreHouse;
  10. List<SelectListItem> createSourceType = ViewBag.CreateSourceType;
  11. var searchForm = new SearchFormViewModal(new List<SearchItem>()
  12. {
  13. new SearchItem("productionOrderNo","排产单号"),
  14. new SearchItem("productName","产品名称"),
  15. new SearchItem("model","规格"),
  16. new SearchItem("material","材质"),
  17. new SearchItem("rigidity","硬度"),
  18. new SearchItem("surfaceColor","表色"),
  19. new SearchItem("productNo","产品编码").SetSearchIcon("query_Product_modal"),
  20. new SearchItem("applyStatus","申请状态",FiledType.I,ExpType.Equal )
  21. .SetSearchItem(applyStatus),
  22. }, false);
  23. }
  24. <section style="display: none">
  25. @Html.DropDownList("hide-ApplyStatus", applyStatus)
  26. @Html.DropDownList("hide-StoreHouse", storeHouse)
  27. @Html.DropDownList("hide-CreateSourceType", createSourceType)
  28. </section>
  29. <div class="table-box mr-4 iwb-bootstrap-table">
  30. @Html.Action("ToolMenu", "Layout", new { pageName = ViewBag.ActiveMenu, searchForm })
  31. <table id="table"
  32. data-url="/api/services/app/FinshedEnterStore/GetViewAll"
  33. data-striped="true" data-id-field="id" data-unique-id="id"
  34. data-method="post"
  35. data-side-pagination="server"
  36. data-content-type="application/x-www-form-urlencoded; charset=UTF-8"
  37. data-cache="false"
  38. 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"
  39. data-query-params="QueryParams"
  40. data-response-handler="ResponseHandler"
  41. data-click-to-select="true"
  42. data-single-select="true">
  43. <thead>
  44. <tr class="row" id="header">
  45. <th data-field="state" data-checkbox="true"></th>
  46. <th data-align="center" data-field="productionOrderNo">排产单编号</th>
  47. <th data-align="center" data-field="productNo">产品编号</th>
  48. @*<th data-align="center" data-field="packageProductNo">产品编码</th>*@
  49. <th data-align="center" data-field="packageEnterNum">包装入库号</th>
  50. <th data-align="center" data-field="quantity">申请数量</th>
  51. <th data-align="center" data-field="packageSpecification">包装规格(千件/包)</th>
  52. <th data-align="center" data-field="packageCount">申请数量(包)</th>
  53. <th data-align="center" data-field="actualPackageCount" data-formatter="QuantityFormatte">入库数量(包)</th>
  54. <th data-align="center" data-field="applyStatus" data-formatter="ApplyStatusFormatter">申请状态</th>
  55. <th data-align="center" data-field="productName">产品名称</th>
  56. <th data-align="center" data-field="surfaceColor">表色</th>
  57. <th data-align="center" data-field="model">规格</th>
  58. <th data-align="center" data-field="rigidity">硬度</th>
  59. <th data-align="center" data-field="material">材质</th>
  60. <th data-align="center" data-field="partNo">零件号</th>
  61. <th data-align="center" data-field="remark">备注</th>
  62. <th data-align="center" data-field="storeHouseId" data-formatter="StoreHouseIdFormatter">仓库</th>
  63. <th data-align="center" data-field="storeLocationNo">库位编号</th>
  64. <th data-align="center" data-field="createSourceType" data-formatter="CreateSourceTypeFormatter">申请类型</th>
  65. <th data-align="center" data-field="sourceStoreHouseId" data-formatter="StoreHouseIdFormatter">来源仓库</th>
  66. <th data-align="center" data-field="applyEnterDate">申请时间</th>
  67. @*<th data-align="center" data-formatter="ActionFormatter"></th>*@
  68. </tr>
  69. </thead>
  70. </table>
  71. </div>
  72. @section modal{
  73. <section>
  74. <!--Main Modal-->
  75. <div class="modal fade" id="modal" role="dialog" tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true">
  76. <div class="modal-dialog modal-dialog-centered" role="document">
  77. <div class="modal-content">
  78. @Html.Partial("Modals/_ModalHeader", new ModalHeaderViewModel("成品入库数量确认", ""))
  79. @{
  80. var inputs = new List<InputViewModel>
  81. {
  82. new InputViewModel("id", hide:true),
  83. new InputViewModel("createSourceType", hide:true),
  84. new InputViewModel("actualPackageCount", displayName:"入库包数(包)",@class:"number",other:"min=0.001"),
  85. new InputViewModel("packageSpecification", displayName:"包装规格(千件/包)",@class:"number",other:"min=0.001"),
  86. new InputViewModel("storeHouseId",InputTypes.List,displayName: "仓库").SetSelectOptions(storeHouse),
  87. new InputViewModel("storeLocationNo", displayName:"库位编号").SetSearchIcon("query_storeHouseLocation_modal"),
  88. };
  89. //var specials = new List<SpecialInputModel>();
  90. }
  91. @Html.Partial("Modals/_ModalBody", new ModalBodyViewModel(inputs))
  92. @Html.Partial("Modals/_ModalFooter", "0")
  93. </div>
  94. </div>
  95. </div>
  96. </section>
  97. @Html.Partial("Modals/Query/_Product", "KeyWords-7")
  98. @Html.Partial("Modals/Query/_StoreHouseLocation", "storeHouseId,storeLocationNo")
  99. }
  100. @section scripts
  101. {
  102. <script type="text/javascript">
  103. $(function () {
  104. $("#KeyWords-8").val("1").select2();//默认先未审核的
  105. //show完毕前执行
  106. LoadTable();
  107. var funs = window.funs || { none: function () { console.log("No type"); } };
  108. funs["btnUpdate"] = function () {
  109. var rows = config.table.bootstrapTable("getSelections");
  110. if (rows.length === 1) {
  111. if (rows[0].applyStatus === "5") {
  112. abp.message.warn("申请已审核入库,不能再操作!");
  113. return;
  114. }
  115. queryParams.storeHouseId = rows[0].storeHouseId;
  116. $("#modal #storeHouseId").off('change');
  117. BtnUpdate({ disabled: "storeHouseId,packageSpecification", readonly: "storeLocationNo", data: { id: rows[0].id, packageSpecification: rows[0].packageSpecification, actualPackageCount: rows[0].packageCount, storeHouseId: rows[0].storeHouseId, storeLocationNo: rows[0].storeLocationNo, createSourceType: rows[0].createSourceType } });
  118. $("#modal #storeHouseId").on('change', function () {
  119. queryParams.storeHouseId = $(this).val();
  120. $("#modal #storeLocationNo").val('');
  121. });
  122. }
  123. };
  124. funs["btnDelete"] = function () {
  125. var rows = config.table.bootstrapTable("getSelections");
  126. if (rows.length === 1) {
  127. //console.log('申请--' + rows[0].applyStatus)
  128. if (rows[0].applyStatus === 2 || rows[0].applyStatus === 5) {
  129. abp.message.warn("申请已审核通过,不能操作!");
  130. return;
  131. }
  132. //console.log('退货/返工返镀/降级'+rows[0].createSourceType)
  133. if (rows[0].createSourceType === 3 || rows[0].createSourceType === 4 || rows[0].createSourceType === 5) {
  134. abp.message.warn("退货/返工返镀/降级,不能拒绝入库操作!");
  135. return;
  136. }
  137. var url = config.tableTool.find('.btn[data-type=btnDelete]').data('url');
  138. abp.message.confirm("确认拒绝入库申请?", "拒绝申请", function () {
  139. SaveAjax({ url: url, data: { Id: rows[0].id }, isValidate: false });
  140. });
  141. } else
  142. abp.message.warn(abp.localization.localize("ChooseOneToOp"));
  143. }
  144. });
  145. function QuantityFormatte(v, r) {
  146. if (r.actualQuantity === 0) {
  147. return '<span class="label label-default">' + v + '</span>';
  148. }
  149. if (r.actualQuantity > r.quantity) {
  150. return '<span class="label label-success">' + v + '</span>';
  151. } else if (r.actualQuantity === r.quantity) {
  152. return '<span class="label label-info">' + v + '</span>';
  153. } else {
  154. return '<span class="label label-danger">' + v + '</span>';
  155. }
  156. }
  157. function StoreHouseIdFormatter(v, r) {
  158. var name = $("#hide-StoreHouse option[value='" + v + "']").text();
  159. return name;
  160. }
  161. function ApplyStatusFormatter(v, r) {
  162. if (r.isClose) {
  163. return '<span class="label label-primary">已结束</span>';
  164. }
  165. var name = $("#hide-ApplyStatus option[value='" + v + "']").text();
  166. if (v === 1) {
  167. return '<span class="label label-info">' + name + '</span>';
  168. } else if (v === 2) {
  169. return '<span class="label label-success">' + name + '</span>';
  170. } else if (v === 3) {
  171. return '<span class="label label-warning">' + name + '</span>';
  172. } else if (v === 4) {
  173. return '<span class="label label-danger">' + name + '</span>';
  174. }
  175. return '<span class="label label-info">' + name + '</span>';
  176. }
  177. function CreateSourceTypeFormatter(v, r) {
  178. var name = $("#hide-CreateSourceType option[value='" + v + "']").text();
  179. return '<span class="label label-info">' + name + '</span>';
  180. }
  181. function ActionFormatter(v, r) {
  182. var str = '';
  183. if (r.applyStatus === 2 && r.createSourceType === 2) {
  184. str = '<span class="table-action" onclick="BtnConfirmEnter(\'' +
  185. r.id +
  186. '\')"><i class="iconfont icon-right"></i>确认入库</span>';
  187. }
  188. return str;
  189. }
  190. function BtnConfirmEnter(id) {
  191. abp.message.confirm("确认产品入库数量正确吗?",
  192. "确认入库数量",
  193. function () {
  194. SaveAjax({
  195. url: window.appUrl + 'FinshedEnterStore/ConfirmEnterStoreQuantity',
  196. data: { Id: id },
  197. isValidate: false
  198. });
  199. });
  200. }
  201. </script>
  202. }