OutProductionOrderMg.cshtml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. @using Abp.Authorization
  2. @using ShwasherSys.Authorization.Permissions
  3. @using ShwasherSys.BasicInfo
  4. @using ShwasherSys.Models.Layout
  5. @using ShwasherSys.Models.Modal
  6. @{
  7. /**/
  8. ViewBag.ActiveMenu = PermissionNames.PagesProductionInfoOutProductionOrderMg; //The menu item will be active for this page.
  9. ViewBag.Title = "外协生产维护";
  10. List<SelectListItem> productionOrderStatus = ViewBag.ProductionOrderStatus;
  11. List<SelectListItem> storeHouses = ViewBag.StoreHouses;
  12. List<SelectListItem> applyStatus = ViewBag.ApplyStatus;
  13. List<SelectListItem> employee = ViewBag.Employee;
  14. var searchForm = new SearchFormViewModal(new List<SearchItem>()
  15. {
  16. new SearchItem("productionOrderNo","排产单号"),
  17. new SearchItem("partNo","零件号"),
  18. new SearchItem("semiProductName","半成品名称"),
  19. new SearchItem("model","规格"),
  20. new SearchItem("material","材质"),
  21. new SearchItem("remark","备注" ),
  22. new SearchItem("planProduceDate","计划完成时间",FiledType.Dnull,ExpType.GreaterOrEqual),
  23. new SearchItem("planProduceDate","至",FiledType.Dnull,ExpType.LessOrEqual),
  24. new SearchItem("semiProductNo","半成品编码").SetSearchIcon("query_semiProduct_modal"),
  25. new SearchItem("productionOrderStatus","排产状态" ,FiledType.I)
  26. .SetSearchItem(productionOrderStatus),
  27. new SearchItem("surfaceColor","表色" ),
  28. //new SearchItem("outsourcingFactoryName","外协厂商" ).SetSearchIcon("query_outFactory_modal"),
  29. }, false);
  30. }
  31. @section css{
  32. <link href="~/Content/Plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" />
  33. }
  34. <div class="table-box mr-4 iwb-bootstrap-table">
  35. @Html.Action("ToolMenu", "Layout", new { pageName = ViewBag.ActiveMenu, searchForm })
  36. <table id="table"
  37. data-url="/api/services/app/ProductionOrders/GetAll"
  38. data-striped="true" data-id-field="id" data-unique-id="id"
  39. data-method="post"
  40. data-side-pagination="server"
  41. data-content-type="application/x-www-form-urlencoded; charset=UTF-8"
  42. data-cache="false"
  43. 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"
  44. data-query-params="QueryParams"
  45. data-response-handler="ResponseHandler"
  46. data-click-to-select="true"
  47. data-single-select="false">
  48. <thead>
  49. <tr class="row" id="header">
  50. <th data-field="state" data-checkbox="true"></th>
  51. <th data-align="center" data-field="productionOrderNo">排产单号</th>
  52. <th data-align="center" data-field="partNo">零件号</th>
  53. <th data-align="center" data-field="semiProductName">名称</th>
  54. <th data-align="center" data-field="model">规格</th>
  55. @*<th data-align="center" data-field="outsourcingFactory">外协厂商</th>*@
  56. <th data-align="center" data-field="outsourcingFactoryName">外协厂商</th>
  57. <th data-align="center" data-field="quantity">排产数量</th>
  58. <th data-align="center" data-field="processingType" data-formatter="ProcessingTypeFormatter">加工类型</th>
  59. <th data-align="center" data-field="remark">备注</th>
  60. <th data-align="center" data-field="planProduceDate" data-formatter="PlanDateFormatter">计划完成时间</th>
  61. @*<th data-align="center" data-field="stoveNo">炉号</th>
  62. <th data-align="center" data-field="carNo">车号</th>*@
  63. <th data-align="center" data-field="surfaceColor">表色</th>
  64. <th data-align="center" data-field="rigidity">硬度</th>
  65. <th data-align="center" data-field="material">材质</th>
  66. <th data-align="center" data-field="productionOrderStatus" data-formatter="ProductionOrderStatusFormatter">状态</th>
  67. <th data-align="center" data-field="kgWeight">千件重</th>
  68. <th data-align="center" data-field="enterDate" data-formatter="DateFormatter">入库时间</th>
  69. <th data-align="center" data-field="semiProductNo">半成品编码</th>
  70. <th data-align="center" data-formatter="ActionFormatter">操作</th>
  71. </tr>
  72. </thead>
  73. </table>
  74. </div>
  75. @section modal{
  76. <section>
  77. <!--Main Modal-->
  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("productionOrderNo",displayName:"流转单编号").SetDisabled().SetOuterBefore("<div class=\"type2\">"),
  87. new InputViewModel("semiProductNo", displayName: "半成品编码").SetSearchIcon("query_semiProductEx_modal","modal"),
  88. new InputViewModel("quantity", displayName:"生产数量",@class:"number",other:"min=0.001").SetNotRequired(),
  89. new InputViewModel("maxQuantity", displayName:"最大生产数量",@class:"number",other:"min=0.001").SetNotRequired(),
  90. new InputViewModel("planProduceDate", displayName:"计划完成时间",@class:"iwb-date"),
  91. new InputViewModel("semiProductName", displayName: "半成品名称").SetNotRequired(),
  92. new InputViewModel("model", displayName: "规格").SetNotRequired(),
  93. new InputViewModel("material", displayName: "材质").SetNotRequired(),
  94. new InputViewModel("rigidity", displayName: "硬度").SetNotRequired(),
  95. new InputViewModel("surfaceColor", displayName: "表色").SetNotRequired().SetOuterAfter("</div>"),
  96. new InputViewModel("remark",InputTypes.Textarea,displayName:"备注").SetNotRequired(),
  97. new InputViewModel("productionOrderStatus",hide:true),
  98. new InputViewModel("processingType",hide:true),
  99. new InputViewModel("processingLevel",hide:true),
  100. };
  101. //var specials = new List<SpecialInputModel>();
  102. }
  103. @Html.Partial("Modals/_ModalBody", new ModalBodyViewModel(inputs))
  104. @Html.Partial("Modals/_ModalFooter", "0")
  105. </div>
  106. </div>
  107. </div>
  108. </section>
  109. @Html.Partial("Modals/Query/_OutFactory", "outsourcingFactory-tool,outsourcingFactory-toolName")
  110. @{
  111. List<SelectListItem>[] arr = new List<SelectListItem>[4] { employee, storeHouses, applyStatus, productionOrderStatus };
  112. }
  113. @Html.Partial("_EnterStoreShare", arr)
  114. @Html.Partial("Modals/Query/_SemiProductEx", "semiProductNo")
  115. @Html.Partial("Modals/Query/_SemiProduct", "KeyWords-9")
  116. }
  117. @section scripts
  118. {
  119. <script src="~/Content/Plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
  120. <script src="~/Content/Plugins/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
  121. <script src="~/Content/Plugins/PrintPreView/print-preView.js"></script>
  122. <script type="text/javascript">
  123. var datePickerOpt = {
  124. language: 'zh-CN',
  125. format: "yyyy-mm-dd",
  126. todayBtn: true,
  127. autoclose: true,
  128. startView: 2,
  129. minView: 2,
  130. maxView: 4
  131. //showSecond: true,
  132. //showHours: true,
  133. //minuteStep: 10
  134. };
  135. var page
  136. $(function () {
  137. //$("#planProduceDate").datetimepicker(datePickerOpt).on('show',
  138. // function (event) {
  139. // event.preventDefault();
  140. // event.stopPropagation();
  141. // }).on('hide',
  142. // function (event) {
  143. // event.preventDefault();
  144. // event.stopPropagation();
  145. // });
  146. //$("#KeyWords-7").datetimepicker(datePickerOpt);
  147. //$("#KeyWords-8").datetimepicker(datePickerOpt);
  148. //show完毕前执行
  149. LoadTable();
  150. //$("#print").printPreview({
  151. // printBody: "#modal"
  152. //});
  153. var funs = window.funs || { none: function () { console.log("No type"); } };
  154. funs["btnUpdate"] = function () {
  155. var rows = config.table.bootstrapTable("getSelections");
  156. if (rows.length === 1) {
  157. if (rows[0].productionOrderStatus > 2 && rows[0].productionOrderStatus !== 7) {
  158. abp.message.warn("排产单已审核或者生产入库,不可进行更改!");
  159. return;
  160. }
  161. if (rows[0].productionOrderStatus === 2) {
  162. $(".type2").css("display", "none");
  163. } else {
  164. $(".type2").css("display", "block");
  165. }
  166. queryParams.model = rows[0].model;
  167. queryParams.material = rows[0].material;
  168. queryParams.semiProductName = rows[0].semiProductName;
  169. BtnUpdate({ readonly: "id,productionOrderNo,quantity,semiProductName,model,material,rigidity,surfaceColor", data: rows[0] });
  170. }
  171. };
  172. funs["btnDelete"] = function (url) {
  173. var rows = config.table.bootstrapTable("getSelections");
  174. if (rows.length === 1) {
  175. if (rows[0].productionOrderStatus >= 2 && rows[0].productionOrderStatus !== 7) {
  176. abp.message.warn("排产单已生产,不可进行删除!");
  177. return;
  178. }
  179. BtnDelete(url);
  180. }
  181. };
  182. funs["btnExportOut"] = function (url) {
  183. var rows = config.table.bootstrapTable("getSelections");
  184. if (rows.length >= 1) {
  185. var ids = "";
  186. rows.forEach(function (v, i) {
  187. ids += v.id + ",";
  188. });
  189. ids = ids.substr(0, ids.length - 1);
  190. SaveAjax({
  191. url: url,
  192. data: { id: ids },
  193. isValidate: false,
  194. isAlert: false,
  195. success: function (res) {
  196. //console.log(res);
  197. RefreshTable();
  198. window.location.href = res;
  199. }
  200. });
  201. }
  202. }
  203. $("#tableToolExt").append(
  204. '<div class="tool-input" style="float:left;margin-left:10px;max-width: 200px;"><div class="input-group input-group-sm text-non" style="position: relative; width: 100%;"><input id="outsourcingFactory-tool" name="outsourcingFactory-tool" type="hidden"/><input id="outsourcingFactory-toolName" name="outsourcingFactory-toolName" class="form-control" placeholder="请输入外协产商" autocomplete="off" value="" readonly style="width:200px;color:#000"><div class="input-group-addon" style="border-radius: 0 3px 3px 0" onclick="ShowQueryModal(\'query_outFactory_modal\',\'#tableToolExt\');"><i class="iconfont icon-search"></i></div><div class="input-group-addon" style="border-radius: 0 3px 3px 0" onclick="$(this).closest(\'.input-group\').find(\'input\').val(\'\')"><i class="iconfont icon-delete"></i></div></div></div>');
  205. $(".tool-input input").on('change', function (e) {
  206. //var outType = $(this).val();
  207. document.getElementById("SearchForm").reset();
  208. GetSearchList();
  209. RefreshTable();
  210. });
  211. });
  212. function GetSearchList() {
  213. var count = $("#SearchForm").find(".KeyWords").length;
  214. window._searchList = [];
  215. window._searchList.push({ KeyWords: "2", KeyField: "ProcessingLevel", FieldType: "0", ExpType: "0" });
  216. if ($('#outsourcingFactory-tool').val()) {
  217. window._searchList.push({ KeyWords: $('#outsourcingFactory-tool').val(), KeyField: "outsourcingFactory", FieldType: "0", ExpType: "6" });
  218. }
  219. for (var i = 1; i <= count; i++) {
  220. var keyWords = $("#KeyWords-" + i).val();
  221. if (keyWords) {
  222. var keyField = $("#KeyField-" + i).val();
  223. var fieldType = $("#FieldType-" + i).val();
  224. var expType = $("#ExpType-" + i).val();
  225. _searchList.push({
  226. KeyWords: keyWords,
  227. KeyField: keyField,
  228. FieldType: fieldType,
  229. ExpType: expType
  230. });
  231. }
  232. }
  233. }
  234. </script>
  235. <script id="formatter">
  236. function ProcessingTypeFormatter(v, r) {
  237. if (v === "2") {
  238. return '<span class="label label-info">表面处理</span>';
  239. } else if (v === "3") {
  240. return '<span class="label label-danger">热处理</span>';
  241. }
  242. return "";
  243. }
  244. </script>
  245. }