InventoryCheckReport.cshtml 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. @using ShwasherSys
  2. @using ShwasherSys.Authorization.Permissions
  3. @using ShwasherSys.Models.Layout
  4. @using ShwasherSys.Views.Shared.New.Modals
  5. @using ShwasherSys.Views.Shared.New.Table
  6. @{
  7. ViewBag.Title = "库存盘点任务统计";
  8. string activeMenu = PermissionNames.PagesStatisticMgInventoryCheckReportMg; //The menu item will be active for this page.
  9. ViewBag.ActiveMenu = activeMenu;
  10. var CheckStateListStr = ViewBag.CheckStateListStr;
  11. }
  12. @section css{
  13. <link href="~/Content/Css/statistic.css" rel="stylesheet" />
  14. <style>
  15. #table1 th.td:not(.index) {
  16. min-width: 120px;
  17. max-width: 300px;
  18. }
  19. </style>
  20. }
  21. <div class="box-tool">
  22. <div class="tool-form">
  23. <form id="tool-form">
  24. <div style="float: left">
  25. <select id="year" name="year" class="form-control" autocomplete="off" style="width: 120px;">
  26. <option value="">请选择年份</option>
  27. @for (int i = DateTime.Now.Year; i >= 2019; i--)
  28. {
  29. <option value="@(i)">@(i)年</option>
  30. }
  31. </select>
  32. <select id="month" name="month" class="form-control" autocomplete="off" style="width: 180px;">
  33. <option value="">请选择月份/季度/年度</option>
  34. <optgroup label="月份">
  35. @for (int j = 1; j <= 12; j++)
  36. {
  37. <option value="@(j)">@(j)月</option>
  38. }
  39. </optgroup>
  40. <optgroup label="季度">
  41. @for (int j = 1; j <= 4; j++)
  42. {
  43. <option value="@(j+12)">第 @(j) 季度</option>
  44. }
  45. </optgroup>
  46. <optgroup label="年度">
  47. <option value="19">整年度</option>
  48. <option value="17">上半年</option>
  49. <option value="18">下半年</option>
  50. </optgroup>
  51. </select>
  52. @*<input id="query-date1" class="form-control iwb-date" type="text" value="" placeholder="请输入查询开始日期..." style="width: 250px;"/>
  53. <input id="query-date2" class="form-control iwb-date" type="text" value="" placeholder="请输入查询结束日期..." style="width: 250px;"/>*@
  54. </div>
  55. <div style="width: 180px; float: left; margin-left: 10px;">
  56. <select id="HouseType" name="HouseType" class="form-control" autocomplete="off" style="width: 160px;">
  57. <option value="">请选择成品/半成品</option>
  58. <option value="1">成品</option>
  59. <option value="2">半成品</option>
  60. </select>
  61. </div>
  62. <div style="width: 180px; float: left; margin-left: 10px;">
  63. <select id="CheckState" name="CheckState" class="form-control" autocomplete="off" style="width: 150px;">
  64. <option value="">请选择盘点状态</option>
  65. @Html.Raw(CheckStateListStr)
  66. </select>
  67. </div>
  68. <div style="width: 250px; float: left;margin-left: 10px;">
  69. <div class="input-group form-group-sm " style="width: 100%;">
  70. <input id="employeeId" name="employeeId" class="form-control" type="hidden" autocomplete="off" placeholder="" style="width: 250px;" />
  71. <input class="form-control" id="query-man" name="query-man" type="text" autocomplete="off" required="" placeholder="请输入盘点的员工..." readonly="">
  72. <div class="input-group-addon" onclick="ShowQueryModal('query_employee_modal', '.tool-form');">
  73. <i class="iconfont icon-search"></i>
  74. </div>
  75. <div class="input-group-addon" title="清除员工信息" onclick="ClearQueryValue(this);">
  76. <i class="iconfont icon-close"></i>
  77. </div>
  78. </div>
  79. </div>
  80. </form>
  81. </div>
  82. <div class="tool-btn">
  83. @if (IsGranted(PermissionNames.PagesStatisticMgInventoryCheckReportMgQuery))
  84. {
  85. <button class="btn btn-info btn-sm" onclick="Query()">查询</button>
  86. }
  87. @* <button class="btn btn-success btn-sm" onclick="Export()">导出</button>*@
  88. </div>
  89. </div>
  90. <div class="box-data">
  91. <div class="box-body">
  92. <table id="table1" >
  93. <thead>
  94. <tr class="title">
  95. <td class="td" colspan="20">上海上垫垫圈有限公司库存盘点任务表</td>
  96. </tr>
  97. <tr>
  98. <th class="td index">序号</th>
  99. <th class="td">盘点编号</th>
  100. <th class="td">仓库</th>
  101. <th class="td">库区</th>
  102. <th class="td">货架</th>
  103. <th class="td">层次</th>
  104. <th class="td">序列</th>
  105. <th class="td">盘点状态</th>
  106. <th class="td">盘点计划日期</th>
  107. <th class="td">盘点人员</th>
  108. </tr>
  109. </thead>
  110. <tbody class="tbody"></tbody>
  111. </table>
  112. </div>
  113. </div>
  114. @section modal{
  115. @Html.Partial("Modals/Query/_Employee", "employeeId,1:query-man")
  116. }
  117. @section scripts
  118. {
  119. <script type="text/javascript">
  120. var $table = $('#table1');
  121. $(function () {
  122. $('#year').val(@(DateTime.Now.Year)).select2();
  123. $('#month').val(@(DateTime.Now.Month)).select2();
  124. Query();
  125. });
  126. function Query() {
  127. var date = $('#year').val();
  128. if (date) {
  129. $.iwbAjax4({
  130. url: window.appUrl + 'InventoryCheck/QueryStaticsInventoryItems' ,
  131. form:'tool-form',
  132. success: function (res) {
  133. var str = ItemFormatter(res);
  134. $table.find('.tbody').html(str);
  135. }
  136. });
  137. } else {
  138. abp.message.warn("请选择年份。");
  139. }
  140. }
  141. function ItemFormatter(data) {
  142. var str = "";
  143. if (data && data.length > 0) {
  144. for (var i = 0; i < data.length; i++) {
  145. var item = data[i];
  146. str += '<tr>';
  147. str += '<td class="td">{0}</td>'.format(i+1);
  148. str += '<td class="td">{0}</td>'.format(item.checkNo || "");
  149. str += '<td class="td">{0}</td>'.format(item.storeHouseName || "");
  150. str += '<td class="td">{0}</td>'.format(item.storeAreaCode || "");
  151. str += '<td class="td">{0}</td>'.format(item.shelfNumber || "");
  152. str += '<td class="td">{0}</td>'.format(item.shelfLevel || "");
  153. //str += '<td class="td">{0}</td>'.format(new Date(item.productDate).format('yyyy-MM-dd'));
  154. str += '<td class="td">{0}</td>'.format(item.sequenceNo || "");
  155. str += '<td class="td">{0}</td>'.format(CheckStateFormatter(item.checkState) || "");
  156. str += '<td class="td">{0}</td>'.format(new Date(item.planStartDate).format('yyyy-MM-dd'));
  157. str += '<td class="td">{0}</td>'.format(item.checkUserName || "");
  158. str += '</tr>';
  159. }
  160. } else {
  161. str += '<tr>';
  162. str += '<td class="td" colspan="20" style="color:red;padding:10px;">未查询到生产明细</td>';
  163. str += '</tr>';
  164. }
  165. return str;
  166. }
  167. function Export() {
  168. }
  169. function ClearQueryValue(that) {
  170. var $that = $(that).closest('.input-group');
  171. $that.find('input').val("");
  172. }
  173. function CheckStateFormatter(v) {
  174. var name = $("#CheckState option[value='" + v + "']").text();
  175. if (v === 1) {
  176. return '<span class="label label-info">' + name + '</span>';
  177. } else if (v === 2) {
  178. return '<span class="label label-success">' + name + '</span>';
  179. } else if (v === 3) {
  180. return '<span class="label label-warning">' + name + '</span>';
  181. }
  182. return '<span class="label label-info">' + name + '</span>';
  183. }
  184. </script>
  185. }
  186. <section style="display: none">
  187. <select id="hid-type">
  188. <option value=""></option>
  189. </select>
  190. @*@Html.DropDownList("hid-type", type)*@
  191. </section>