OutProductionOrderMg.cshtml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  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="timeCreated">创建时间</th>
  59. <th data-align="center" data-field="processingType" data-formatter="ProcessingTypeFormatter">加工类型</th>
  60. <th data-align="center" data-field="remark">备注</th>
  61. <th data-align="center" data-field="planProduceDate" data-formatter="PlanDateFormatter">计划完成时间</th>
  62. @*<th data-align="center" data-field="stoveNo">炉号</th>
  63. <th data-align="center" data-field="carNo">车号</th>*@
  64. <th data-align="center" data-field="surfaceColor">表色</th>
  65. <th data-align="center" data-field="rigidity">硬度</th>
  66. <th data-align="center" data-field="material">材质</th>
  67. <th data-align="center" data-field="productionOrderStatus" data-formatter="ProductionOrderStatusFormatter">状态</th>
  68. <th data-align="center" data-field="kgWeight" data-formatter="KgWeightFormatter">千件重</th>
  69. <th data-align="center" data-field="enterDate" data-formatter="DateFormatter">入库时间</th>
  70. <th data-align="center" data-field="semiProductNo">半成品编码</th>
  71. <th data-align="center" data-formatter="ActionFormatter">操作</th>
  72. </tr>
  73. </thead>
  74. </table>
  75. </div>
  76. @section modal{
  77. <section>
  78. <!--Main Modal-->
  79. <div class="modal fade" id="modal" role="dialog" tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true">
  80. <div class="modal-dialog modal-dialog-centered" role="document">
  81. <div class="modal-content">
  82. @Html.Partial("Modals/_ModalHeader", new ModalHeaderViewModel("排产单"))
  83. @{
  84. var inputs = new List<InputViewModel>
  85. {
  86. new InputViewModel("id", hide:true),
  87. new InputViewModel("productionOrderNo",displayName:"流转单编号").SetDisabled().SetOuterBefore("<div class=\"type2\">"),
  88. new InputViewModel("semiProductNo", displayName: "半成品编码").SetSearchIcon("query_semiProductEx_modal","modal"),
  89. new InputViewModel("quantity", displayName:"生产数量",@class:"number",other:"min=0.001").SetNotRequired(),
  90. new InputViewModel("maxQuantity", displayName:"最大生产数量",@class:"number",other:"min=0.001").SetNotRequired(),
  91. new InputViewModel("planProduceDate", displayName:"计划完成时间",@class:"iwb-date"),
  92. new InputViewModel("semiProductName", displayName: "半成品名称").SetNotRequired(),
  93. new InputViewModel("model", displayName: "规格").SetNotRequired(),
  94. new InputViewModel("material", displayName: "材质").SetNotRequired(),
  95. new InputViewModel("rigidity", displayName: "硬度").SetNotRequired(),
  96. new InputViewModel("surfaceColor", displayName: "表色").SetNotRequired().SetOuterAfter("</div>"),
  97. new InputViewModel("remark",InputTypes.Textarea,displayName:"备注").SetNotRequired(),
  98. new InputViewModel("productionOrderStatus",hide:true),
  99. new InputViewModel("processingType",hide:true),
  100. new InputViewModel("processingLevel",hide:true),
  101. };
  102. //var specials = new List<SpecialInputModel>();
  103. }
  104. @Html.Partial("Modals/_ModalBody", new ModalBodyViewModel(inputs))
  105. @Html.Partial("Modals/_ModalFooter", "0")
  106. </div>
  107. </div>
  108. </div>
  109. </section>
  110. @Html.Partial("Modals/Query/_OutFactory", "outsourcingFactory-tool,outsourcingFactory-toolName")
  111. @{
  112. List<SelectListItem>[] arr = new List<SelectListItem>[4] { employee, storeHouses, applyStatus, productionOrderStatus };
  113. }
  114. @Html.Partial("_EnterStoreShare", arr)
  115. @Html.Partial("Modals/Query/_SemiProductEx", "semiProductNo")
  116. @Html.Partial("Modals/Query/_SemiProduct", "KeyWords-9")
  117. @Html.Partial("_ProductionOrderEx")
  118. }
  119. @section scripts
  120. {
  121. <script src="~/Content/Plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
  122. <script src="~/Content/Plugins/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
  123. <script src="~/Content/Plugins/PrintPreView/print-preView.js"></script>
  124. <script type="text/javascript">
  125. var datePickerOpt = {
  126. language: 'zh-CN',
  127. format: "yyyy-mm-dd",
  128. todayBtn: true,
  129. autoclose: true,
  130. startView: 2,
  131. minView: 2,
  132. maxView: 4
  133. //showSecond: true,
  134. //showHours: true,
  135. //minuteStep: 10
  136. };
  137. var page
  138. $(function () {
  139. //$("#planProduceDate").datetimepicker(datePickerOpt).on('show',
  140. // function (event) {
  141. // event.preventDefault();
  142. // event.stopPropagation();
  143. // }).on('hide',
  144. // function (event) {
  145. // event.preventDefault();
  146. // event.stopPropagation();
  147. // });
  148. //$("#KeyWords-7").datetimepicker(datePickerOpt);
  149. //$("#KeyWords-8").datetimepicker(datePickerOpt);
  150. //show完毕前执行
  151. LoadTable();
  152. //$("#print").printPreview({
  153. // printBody: "#modal"
  154. //});
  155. var funs = window.funs || { none: function () { console.log("No type"); } };
  156. funs["btnUpdate"] = function () {
  157. var rows = config.table.bootstrapTable("getSelections");
  158. if (rows.length === 1) {
  159. if (rows[0].productionOrderStatus > 2 && rows[0].productionOrderStatus !== 7) {
  160. abp.message.warn("排产单已审核或者生产入库,不可进行更改!");
  161. return;
  162. }
  163. if (rows[0].productionOrderStatus === 2) {
  164. $(".type2").css("display", "none");
  165. } else {
  166. $(".type2").css("display", "block");
  167. }
  168. queryParams.model = rows[0].model;
  169. queryParams.material = rows[0].material;
  170. queryParams.semiProductName = rows[0].semiProductName;
  171. BtnUpdate({ readonly: "id,productionOrderNo,quantity,semiProductName,model,material,rigidity,surfaceColor", data: rows[0] });
  172. }
  173. };
  174. funs["btnDelete"] = function (url) {
  175. var rows = config.table.bootstrapTable("getSelections");
  176. if (rows.length === 1) {
  177. if (rows[0].productionOrderStatus >= 2 && rows[0].productionOrderStatus !== 7) {
  178. abp.message.warn("排产单已生产,不可进行删除!");
  179. return;
  180. }
  181. BtnDelete(url);
  182. }
  183. };
  184. funs["btnExportOut"] = function (url) {
  185. var rows = config.table.bootstrapTable("getSelections");
  186. if (rows.length >= 1) {
  187. var ids = "";
  188. rows.forEach(function (v, i) {
  189. ids += v.id + ",";
  190. });
  191. ids = ids.substr(0, ids.length - 1);
  192. SaveAjax({
  193. url: url,
  194. data: { id: ids },
  195. isValidate: false,
  196. isAlert: false,
  197. success: function (res) {
  198. //console.log(res);
  199. RefreshTable();
  200. window.location.href = res;
  201. }
  202. });
  203. }
  204. }
  205. $("#tableToolExt").append(
  206. '<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>');
  207. $(".tool-input input").on('change', function (e) {
  208. //var outType = $(this).val();
  209. document.getElementById("SearchForm").reset();
  210. GetSearchList();
  211. RefreshTable();
  212. });
  213. });
  214. function GetSearchList() {
  215. var count = $("#SearchForm").find(".KeyWords").length;
  216. window._searchList = [];
  217. window._searchList.push({ KeyWords: "2", KeyField: "ProcessingLevel", FieldType: "0", ExpType: "0" });
  218. if ($('#outsourcingFactory-tool').val()) {
  219. window._searchList.push({ KeyWords: $('#outsourcingFactory-tool').val(), KeyField: "outsourcingFactory", FieldType: "0", ExpType: "6" });
  220. }
  221. for (var i = 1; i <= count; i++) {
  222. var keyWords = $("#KeyWords-" + i).val();
  223. if (keyWords) {
  224. var keyField = $("#KeyField-" + i).val();
  225. var fieldType = $("#FieldType-" + i).val();
  226. var expType = $("#ExpType-" + i).val();
  227. _searchList.push({
  228. KeyWords: keyWords,
  229. KeyField: keyField,
  230. FieldType: fieldType,
  231. ExpType: expType
  232. });
  233. }
  234. }
  235. }
  236. </script>
  237. <script id="formatter">
  238. function ProcessingTypeFormatter(v, r) {
  239. if (v === "2") {
  240. return '<span class="label label-info">表面处理</span>';
  241. } else if (v === "3") {
  242. return '<span class="label label-danger">热处理</span>';
  243. }
  244. return "";
  245. }
  246. </script>
  247. }