EnterOutStoreHouseQueryMg.cshtml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. @using Microsoft.Ajax.Utilities
  2. @using ShwasherSys.Authorization.Permissions
  3. @using ShwasherSys.Models.Layout
  4. @using ShwasherSys.Models.Modal
  5. @{
  6. /**/
  7. ViewBag.ActiveMenu = PermissionNames.PagesFinshedStoreInfoEnterOutStoreHouseQueryMg; //The menu item will be active for this page.
  8. ViewBag.Title = "进出库数量查询";
  9. List<SelectListItem> storeHouseList = ViewBag.StoreHouseList;
  10. var searchForm = new SearchFormViewModal(new List<SearchItem>()
  11. {
  12. new SearchItem("productName","产品名称"),
  13. new SearchItem("model","规格"),
  14. new SearchItem("surfaceColor","表色"),
  15. new SearchItem("material","材质"),
  16. new SearchItem("rigidity","硬度"),
  17. new SearchItem("dateTiem","记录时间",FiledType.Dnull,ExpType.GreaterOrEqual),
  18. new SearchItem("dateTiem","至",FiledType.Dnull,ExpType.LessOrEqual),
  19. new SearchItem("productNo","成品编号").SetSearchIcon("query_Product_modal"),
  20. new SearchItem("productionOrderNo","批次号"),
  21. }, false);
  22. }
  23. @section css{
  24. <link href="~/Content/Plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" />
  25. }
  26. <div id="exportCss">
  27. <style>
  28. /*.trProduct td {
  29. height: 30px;
  30. padding: 5px 0 1px !important;
  31. text-align: left !important;
  32. background: #f8e8eb;
  33. font-size: 1.5rem !important;
  34. color: red;
  35. border-left: none;
  36. }
  37. .trProduct td span {
  38. color: #632d32;
  39. margin: 0 3px;
  40. font-weight: 500;
  41. }
  42. .trProduct td span.left{
  43. margin-left: 15px;
  44. }
  45. #table td {
  46. text-align: center;
  47. }*/
  48. .tool-radio {
  49. display: inline-block;
  50. margin-left: 10px;
  51. }
  52. [type="radio"]:not(:checked) + label, [type="radio"]:checked + label {
  53. padding-left: 25px;
  54. font-size: 1.5rem;
  55. color: #dad9db;
  56. }
  57. [type="radio"]:not(:checked) + label::before, [type="radio"]:not(:checked) + label::after {
  58. border: 2px solid #fff;
  59. }
  60. </style>
  61. </div>
  62. <div class="table-box mr-4 iwb-bootstrap-table">
  63. @Html.Action("ToolMenu", "Layout", new { pageName = ViewBag.ActiveMenu, searchForm })
  64. <table id="table" data-url="/api/services/app/StoreStatistics/QueryEnterOutRecord"
  65. data-striped="true" data-id-field="id" data-unique-id="id"
  66. data-method="post"
  67. data-side-pagination="server"
  68. data-content-type="application/x-www-form-urlencoded; charset=UTF-8"
  69. data-cache="false"
  70. 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"
  71. data-query-params="QueryParams"
  72. data-response-handler="ResponseHandler"
  73. data-click-to-select="true"
  74. data-single-select="true">
  75. <thead>
  76. <tr class="row">
  77. <th data-align="center" data-field="productionOrderNo">批次号</th>
  78. <th data-align="center" data-field="productName">名称</th>
  79. <th data-align="center" data-field="model">规格</th>
  80. <th data-align="center" data-field="rigidity">硬度</th>
  81. <th data-align="center" data-field="material">材质</th>
  82. <th data-align="center" data-field="surfaceColor">表色</th>
  83. <th data-align="center" data-field="enterOutFlag" data-formatter="FlagFormatter">标志</th>
  84. <th data-align="center" data-field="quantity">数量(千件)</th>
  85. <th data-align="center" data-field="storeHouseId" data-formatter="StoreHouseIdFormatte">仓库</th>
  86. <th data-align="center" data-field="dateTiem">日期</th>
  87. <th data-align="center" data-field="customerId">客户编号</th>
  88. <th data-align="center" data-field="customerName">客户名称</th>
  89. <th data-align="center" data-field="productNo">编号</th>
  90. </tr>
  91. </thead>
  92. </table>
  93. </div>
  94. @section modal{
  95. @Html.Partial("Modals/Query/_Product", "KeyWords-8")
  96. }
  97. <section style="display: none">
  98. <select id="hid-type">
  99. <option value=""></option>
  100. </select>
  101. @Html.DropDownList("hid-storeHouse", storeHouseList)
  102. </section>
  103. @section scripts
  104. {
  105. <script src="~/Content/Scripts/MyScript/ExportExcel.js"></script>
  106. <script src="~/Content/Plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
  107. <script src="~/Content/Plugins/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
  108. <script type="text/javascript">
  109. var datePickerOpt = {
  110. language: 'zh-CN',
  111. format: "yyyy-mm-dd",
  112. todayBtn: true,
  113. autoclose: true,
  114. startView: 2,
  115. minView: 2,
  116. maxView: 4,
  117. //showSecond: true,
  118. //showHours: true,
  119. //minuteStep: 10
  120. };
  121. $(function () {
  122. $("#tableTool").css("min-height", "40px");
  123. $("#KeyWords-6").datetimepicker(datePickerOpt);
  124. $("#KeyWords-7").datetimepicker(datePickerOpt);
  125. var nowDate = new Date();
  126. $("#KeyWords-6").val(new Date(nowDate.getTime() - 30 * 24 * 60 * 60 * 1000).Format("yyyy-MM-dd"));
  127. LoadTable();
  128. //BtnSearch();
  129. funs["btnExportExcel"] = function (url) {
  130. BtnExportExcel(url);
  131. }
  132. $("#Tool1").append(
  133. '<div class="tool-radio"><input name="proType" type="radio" id="allFlag" checked value="" /><label for="allFlag">全部</label></div>' +
  134. '<div class="tool-radio"><input name="proType" type="radio" id="enterFlag" value="-1" /><label for="enterFlag">出库</label></div>' +
  135. '<div class="tool-radio"><input name="proType" type="radio" id="outFlag" value="1" /><label for="outFlag">入库</label></div>');
  136. $(".tool-radio input[type='radio']").on('click',
  137. function (e) {
  138. GetSearchList();
  139. RefreshTable();
  140. });
  141. });
  142. //function BtnSearch() {
  143. // GetSearchList();
  144. // console.log(JSON.stringify(_searchList));
  145. // SaveAjax({
  146. // url: window.appUrl + "StoreStatistics/QueryEnterOutRecord",
  147. // data: JSON.stringify(_searchList),
  148. // contentType:"application/json",
  149. // isValidate: false,
  150. // isAlert: false,
  151. // success: function (res) {
  152. // $("#table tbody").empty();
  153. // if (res && res.length > 0) {
  154. // var curProductNo = "";
  155. // var index = 1;
  156. // res.forEach(function(r) {
  157. // var tr = "";
  158. // if (r.productNo !== curProductNo) {
  159. // index = 1;
  160. // curProductNo = r.productNo;
  161. // tr += '<tr class="trProduct"><td >';
  162. // tr += '<span class="left">编号:[ </span> ' + r.productNo + '<span> ]</span></td><td>';
  163. // tr += '<span class="left">名称:[ </span> ' + r.productName + '<span> ]</span></td><td>';
  164. // tr += '<span class="left">表色:[ </span> ' + r.surfaceColor + '<span> ]</span></td><td>';
  165. // tr += '<span class="left">规格:[ </span> ' + r.model + '<span> ]</span></td><td>';
  166. // tr += '<span class="left">材质:[ </span> ' + r.material + '<span> ]</span></td><td>';
  167. // tr += '<span class="left">硬度:[ </span> ' + r.rigidity + '<span> ]</span></td><td>';
  168. // //tr += '</td></tr>';
  169. // //tr += '<tr class="trProduct"><td colspan="5">';
  170. // tr += '<span class="left">当前库存:</span>' + r.allQuantity + '<span> 千件</span></td><td>';
  171. // tr += '<span class="left">冻结库存:</span>' + r.allFreezeQuantity + '<span> 千件</span>';
  172. // tr += '</td></tr>';
  173. // }
  174. // tr += '<tr>' +
  175. // '<td>' + index +'</td>' +
  176. // '<td>' + (r.enterOutFlag===1?'入库':'出库')+'</td>' +
  177. // '<td colspan="3">' + r.quantity +'</td>' +
  178. // '<td colspan="2">' + r.dateTiem +'</td>' +
  179. // '<td>' + r.userIDLastMod+'</td>' +
  180. // '</tr>';
  181. // index++;
  182. // $("#table tbody").append(tr);
  183. // });
  184. // }
  185. // }
  186. // });
  187. //}
  188. function BtnExportExcel(url) {
  189. //ExportExcel('table', '库存出入库记录', 'exportCss');
  190. SaveAjax({
  191. url: window.appUrl + 'StoreStatistics/ExportExcel',
  192. data: JSON.stringify(_searchList),
  193. contentType: "application/json",
  194. isValidate: false,
  195. isAlert: false,
  196. success: function(res) {
  197. window.location.href = "/" + res;
  198. }
  199. });
  200. }
  201. function GetSearchList() {
  202. var count = $("#SearchForm").find(".KeyWords").length;
  203. window._searchList = [];
  204. var outType = $('input[name="proType"]:checked').val();
  205. if (outType) {
  206. window._searchList.push({
  207. KeyWords: outType,
  208. KeyField: "EnterOutFlag",
  209. FieldType: "1",
  210. ExpType: "0"
  211. });
  212. }
  213. for (var i = 1; i <= count; i++) {
  214. var keyWords = $("#KeyWords-" + i).val();
  215. if (keyWords) {
  216. var keyField = $("#KeyField-" + i).val();
  217. var fieldType = $("#FieldType-" + i).val();
  218. var expType = $("#ExpType-" + i).val();
  219. if (keyField === 'dateTiem' && expType === "5") {
  220. var endDate = new Date(keyWords);
  221. keyWords = new Date(endDate.getTime() + 24 * 60 * 59 * 1000).Format("yyyy-MM-dd");
  222. }
  223. _searchList.push({
  224. KeyWords: keyWords,
  225. KeyField: keyField,
  226. FieldType: fieldType,
  227. ExpType: expType
  228. });
  229. }
  230. }
  231. }
  232. function StoreHouseIdFormatte(v, r) {
  233. return '<span class="table-action">' + $("#hid-storeHouse option[value=" + v + "]").html() + '</span>';
  234. }
  235. function FlagFormatter(v, r) {
  236. if (v === 1) {
  237. return '<span class="label label-info">入库</span>';
  238. } else {
  239. return '<span class="label label-danger">出库</span>';
  240. }
  241. }
  242. </script>
  243. }