OutsourcingReport.cshtml 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  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.PagesStatisticMgOutsourcingReportMg; //The menu item will be active for this page.
  9. ViewBag.ActiveMenu = activeMenu;
  10. }
  11. @section css{
  12. <link href="~/Content/Css/statistic.css" rel="stylesheet" />
  13. <style>
  14. #table1 th.td:not(.index) {
  15. min-width: 120px;
  16. max-width: 300px;
  17. }
  18. </style>
  19. }
  20. <div class="box-tool">
  21. <div class="tool-form">
  22. <form id="tool-form">
  23. <div style="float: left">
  24. <select id="year" name="year" class="form-control" autocomplete="off" style="width: 120px;">
  25. <option value="">请选择年份</option>
  26. @for (int i = DateTime.Now.Year; i >= 2019; i--)
  27. {
  28. <option value="@(i)">@(i)年</option>
  29. }
  30. </select>
  31. <select id="month" name="month" class="form-control" autocomplete="off" style="width: 180px;">
  32. <option value="">请选择月份/季度/年度</option>
  33. <optgroup label="月份">
  34. @for (int j = 1; j <= 12; j++)
  35. {
  36. <option value="@(j)">@(j)月</option>
  37. }
  38. </optgroup>
  39. <optgroup label="季度">
  40. @for (int j = 1; j <= 4; j++)
  41. {
  42. <option value="@(j+12)">第 @(j) 季度</option>
  43. }
  44. </optgroup>
  45. <optgroup label="年度">
  46. <option value="19">整年度</option>
  47. <option value="17">上半年</option>
  48. <option value="18">下半年</option>
  49. </optgroup>
  50. </select>
  51. @*<input id="query-date1" class="form-control iwb-date" type="text" value="" placeholder="请输入查询开始日期..." style="width: 250px;"/>
  52. <input id="query-date2" class="form-control iwb-date" type="text" value="" placeholder="请输入查询结束日期..." style="width: 250px;"/>*@
  53. </div>
  54. @*<div style="width: 250px; float: left;margin-left: 10px;">
  55. <div class="input-group form-group-sm " style="width: 100%;">
  56. <input id="employeeId" name="employeeId" class="form-control" type="hidden" autocomplete="off" placeholder="" style="width: 250px;" />
  57. <input class="form-control" id="query-man" name="query-man" type="text" autocomplete="off" required="" placeholder="请输入查询员工..." readonly="">
  58. <div class="input-group-addon" onclick="ShowQueryModal('query_employee_modal', '.tool-form');">
  59. <i class="iconfont icon-search"></i>
  60. </div>
  61. <div class="input-group-addon" title="清除员工信息" onclick="ClearQueryValue(this);">
  62. <i class="iconfont icon-close"></i>
  63. </div>
  64. </div>
  65. </div>*@
  66. </form>
  67. </div>
  68. <div class="tool-btn">
  69. @if (IsGranted(PermissionNames.PagesStatisticMgOutsourcingReportMgQuery))
  70. {
  71. <button class="btn btn-info btn-sm" onclick="Query()">查询</button>
  72. }
  73. @if (IsGranted(PermissionNames.PagesStatisticMgOutsourcingReportMgExport))
  74. {
  75. <button class="btn btn-success btn-sm" onclick="Export()">导出</button>
  76. }
  77. </div>
  78. </div>
  79. <div class="box-data">
  80. <div class="box-body">
  81. <table id="table" style="display: none">
  82. <thead>
  83. <tr class="title">
  84. <td class="td" colspan="20">上海上垫垫圈有限公司采购统计表</td>
  85. </tr>
  86. <tr class="title-sm">
  87. <th class="td department" colspan="3">部门:采购部</th>
  88. <th class="td " colspan="6"></th>
  89. <th class="td date" colspan="2">日期:<span class="date"></span></th>
  90. </tr>
  91. <tr>
  92. <th class="td index">序号</th>
  93. <th class="td">流转单号</th>
  94. <th class="td">半成品名称</th>
  95. <th class="td">零件号</th>
  96. <th class="td">规格</th>
  97. <th class="td">千件</th>
  98. <th class="td">千件重</th>
  99. <th class="td">重量(kg)</th>
  100. <th class="td">日期</th>
  101. <th class="td">材质</th>
  102. <th class="td">表色</th>
  103. </tr>
  104. </thead>
  105. <tbody class="tbody"></tbody>
  106. <tfoot>
  107. <tr>
  108. <td class="td" colspan="1"></td>
  109. <td class="td detail" colspan="2">
  110. 总重量:<strong class="kg"></strong> kg
  111. </td>
  112. <td class="td detail" colspan="2">
  113. 总件数: <strong class="pcs"></strong> 千件
  114. </td>
  115. <td class="td" colspan="10"></td>
  116. @*<th class="td" colspan="1">本月总计</th>
  117. <td class="td detail" colspan="3">
  118. <p>总重量:<strong id="kg">44</strong> kg</p>
  119. <p>总件数:<strong id="pcs">55</strong> 千件</p>
  120. </td>*@
  121. </tr>
  122. </tfoot>
  123. </table>
  124. </div>
  125. </div>
  126. @section modal{
  127. @Html.Partial("Modals/Query/_Employee", "1:query-man,employeeId")
  128. }
  129. @section scripts
  130. {
  131. <script type="text/javascript">
  132. var $table = $('#table');
  133. $(function () {
  134. $('#year').val(@(DateTime.Now.Year)).select2();
  135. $('#month').val(@(DateTime.Now.Month)).select2();
  136. Query();
  137. });
  138. function Query() {
  139. var date = $('#year').val();
  140. if (date) {
  141. $.iwbAjax4({
  142. url: window.appUrl + 'ProductionOrders/QueryOutsourcingReport' ,
  143. form:'tool-form',
  144. success: function (res) {
  145. $table.find('.date').html(res.dayDate || "");
  146. //$table.find('.eNo').html(res.employeeNo || "");
  147. //$table.find('.eName').html(res.employeeName || "");
  148. $table.find('.kg').html(res.kgTotal || "");
  149. $table.find('.pcs').html(res.pcsTotal || "");
  150. if (res) {
  151. var str = ItemFormatter(res.items);
  152. $table.find('.tbody').html(str);
  153. $table.fadeIn();
  154. } else {
  155. $table.hide();
  156. abp.message.warn("未查询到数据。");
  157. }
  158. }
  159. });
  160. } else {
  161. abp.message.warn("请选择年份。");
  162. }
  163. }
  164. function ItemFormatter(data) {
  165. var str = "";
  166. if (data && data.length > 0) {
  167. for (var i = 0; i < data.length; i++) {
  168. var item = data[i];
  169. str += '<tr>';
  170. str += '<td class="td">{0}</td>'.format(i+1);
  171. str += '<td class="td">{0}</td>'.format(item.productionOrderNo || "");
  172. str += '<td class="td">{0}</td>'.format(item.productName || "");
  173. str += '<td class="td">{0}</td>'.format(item.partNo || "");
  174. str += '<td class="td">{0}</td>'.format(item.model || "");
  175. str += '<td class="td">{0}</td>'.format(item.pcsQuantity || "");
  176. str += '<td class="td">{0}</td>'.format(item.kgWeight || "0");
  177. str += '<td class="td">{0}</td>'.format(item.kgQuantity || "");
  178. str += '<td class="td">{0}</td>'.format(new Date(item.productDate).format('yyyy-MM-dd'));
  179. str += '<td class="td">{0}</td>'.format(item.material || "");
  180. str += '<td class="td">{0}</td>'.format(item.surfaceColor || "");
  181. str += '</tr>';
  182. }
  183. } else {
  184. str += '<tr>';
  185. str += '<td class="td" colspan="20" style="color:red;padding:10px;">未查询到生产明细</td>';
  186. str += '</tr>';
  187. }
  188. return str;
  189. }
  190. function Export() {
  191. var date = $('#year').val();
  192. if (date) {
  193. $.iwbAjax4({
  194. url: window.appUrl + 'ProductionOrders/ExportOutsourcingReport' ,
  195. form:'tool-form',
  196. success: function (res) {
  197. if (res) {
  198. window.location.href = res;
  199. }
  200. }
  201. });
  202. } else {
  203. abp.message.warn("请选择年份。");
  204. }
  205. }
  206. function ClearQueryValue(that) {
  207. var $that = $(that).closest('.input-group');
  208. $that.find('input').val("");
  209. }
  210. </script>
  211. }
  212. <section style="display: none">
  213. <select id="hid-type">
  214. <option value=""></option>
  215. </select>
  216. @*@Html.DropDownList("hid-type", type)*@
  217. </section>