PackageDaily.cshtml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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.PagesStatisticMgPackageDailyMg; //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. }
  14. <div class="box-tool">
  15. <div class="tool-form" >
  16. <input id="query-date" class="form-control iwb-date" type="text" value="" placeholder="请输入查询日期" style="width: 250px;"/>
  17. </div>
  18. <div class="tool-btn">
  19. @if (IsGranted(PermissionNames.PagesStatisticMgPackageDailyMgQuery))
  20. {
  21. <button class="btn btn-info btn-sm" onclick="Query()">查询</button>
  22. }
  23. @* <button class="btn btn-success" onclick="Export()">导出</button>*@
  24. </div>
  25. </div>
  26. <div class="box-data">
  27. <div class="box-body">
  28. <table id="table" style="display: none">
  29. <thead>
  30. <tr class="title">
  31. <td class="td" colspan="20">上海上垫垫圈有限公司包装车间生产日报表</td>
  32. </tr>
  33. <tr class="title-sm">
  34. <th class="td department" colspan="10">部门:包装车间</th>
  35. <th class="td date" colspan="6">日期:<span id="date">2020-01-20</span></th>
  36. </tr>
  37. <tr>
  38. <th class="td">序号</th>
  39. <th class="td">包装日期</th>
  40. <th class="td">零件号</th>
  41. <th class="td">规格</th>
  42. <th class="td">产品名称</th>
  43. <th class="td">材质</th>
  44. <th class="td">表色</th>
  45. <th class="td">重量</th>
  46. <th class="td">千件</th>
  47. <th class="td">千件重</th>
  48. <th class="td">包数</th>
  49. <th class="td">流转单号</th>
  50. <th class="td">订单号</th>
  51. <th class="td">包装分类</th>
  52. <th class="td">核件人</th>
  53. <th class="td">包装人</th>
  54. </tr>
  55. </thead>
  56. <tbody id="tbody"></tbody>
  57. <tfoot>
  58. <tr>
  59. <td class="td" colspan="1"></td>
  60. <th class="td">总重量</th>
  61. <td class="td detail" colspan="3">
  62. <p>生产包装:<strong id="kg1">22</strong> kg</p>
  63. <p>改包装:<strong id="kg2">33</strong> kg</p>
  64. </td>
  65. <th class="td">总件数</th>
  66. <td class="td detail" colspan="4">
  67. <p>生产包装:<strong id="pcs1">44</strong> 千件</p>
  68. <p>改包装:<strong id="pcs2">55</strong> 千件</p>
  69. </td>
  70. <td class="td" colspan="2"></td>
  71. <th class="td" colspan="1">本月总计</th>
  72. <td class="td detail" colspan="3">
  73. <p>总重量:<strong id="kg">44</strong> kg</p>
  74. <p>总件数:<strong id="pcs">55</strong> 千件</p>
  75. </td>
  76. </tr>
  77. </tfoot>
  78. </table>
  79. </div>
  80. </div>
  81. @section modal{
  82. }
  83. @section scripts
  84. {
  85. <script type="text/javascript">
  86. var $table = $('#table');
  87. $(function() {
  88. $('#query-date').val(new Date().format('yyyy-MM-dd'));
  89. Query();
  90. });
  91. function Query() {
  92. var date = $('#query-date').val();
  93. if (date) {
  94. $.iwbAjax4({
  95. url: window.appUrl + 'PackInfoApply/QueryPackageDaily?date=' + date,
  96. success: function(res) {
  97. if (res) {
  98. $('#date').html(new Date(res.dayDate).format('yyyy-MM-dd'));
  99. $('#kg1').html(res.kgQuantity1);
  100. $('#pcs1').html(res.pcsQuantity1);
  101. $('#kg2').html(res.kgQuantity2);
  102. $('#pcs2').html(res.pcsQuantity2);
  103. $('#kg').html(res.kgTotal);
  104. $('#pcs').html(res.pcsTotal);
  105. var str = ItemFormatter(res.packageItems);
  106. $('#tbody').html(str);
  107. $table.fadeIn();
  108. } else {
  109. $table.hide();
  110. abp.message.warn("未查询到数据。");
  111. }
  112. }
  113. });
  114. } else {
  115. abp.message.warn("请填写查询日期。");
  116. }
  117. }
  118. function ItemFormatter(data) {
  119. var str = "";
  120. if (data && data.length > 0) {
  121. for (var i = 0; i < data.length; i++) {
  122. var item = data[i];
  123. str += '<tr>';
  124. str += '<td class="td">{0}</td>'.format(item.index);
  125. str += '<td class="td">{0}</td>'.format(new Date(item.packageDate).format('yyyy-MM-dd'));
  126. str += '<td class="td">{0}</td>'.format(item.partNo || "");
  127. str += '<td class="td">{0}</td>'.format(item.model || "");
  128. str += '<td class="td">{0}</td>'.format(item.productName || "");
  129. str += '<td class="td">{0}</td>'.format(item.material || "");
  130. str += '<td class="td">{0}</td>'.format(item.surfaceColor || "");
  131. str += '<td class="td">{0}</td>'.format(item.kgQuantity || "");
  132. str += '<td class="td">{0}</td>'.format(item.pcsQuantity || "");
  133. str += '<td class="td">{0}</td>'.format(item.kgWeight || "");
  134. str += '<td class="td">{0}</td>'.format(item.packageDetail || "");
  135. str += '<td class="td">{0}</td>'.format(item.productionOrderNo || "");
  136. str += '<td class="td">{0}</td>'.format(item.packageEnterNum || "");
  137. str += '<td class="td">{0}</td>'.format(item.packageType || "");
  138. str += '<td class="td">{0}</td>'.format(item.verifyUser || "");
  139. str += '<td class="td">{0}</td>'.format(item.packageUser || "");
  140. str += '</tr>';
  141. }
  142. } else
  143. {
  144. str += '<tr>';
  145. str += '<td class="td" colspan="20" style="color:red;padding:10px;">未查询到包装明细</td>';
  146. str += '</tr>';
  147. }
  148. return str;
  149. }
  150. function Export() {
  151. }
  152. </script>
  153. }
  154. <section style="display: none">
  155. <select id="hid-type">
  156. <option value=""></option>
  157. </select>
  158. @*@Html.DropDownList("hid-type", type)*@
  159. </section>