StatementBillReport.cshtml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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.PagesStatisticMgStatementBillReportMg; //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: 180px; float: left; margin-left: 10px;">
  55. <select id="HouseType" name="HouseType" class="form-control" autocomplete="off" style="width: 160px;">
  56. <option value="">请选择成品/半成品</option>
  57. <option value="1">成品</option>
  58. <option value="2">半成品</option>
  59. </select>
  60. </div>*@
  61. @*<div style="width: 180px; float: left; margin-left: 10px;">
  62. <select id="CheckState" name="CheckState" class="form-control" autocomplete="off" style="width: 150px;">
  63. <option value="">请选择盘点状态</option>
  64. @Html.Raw(CheckStateListStr)
  65. </select>
  66. </div>*@
  67. <div style="width: 250px; float: left;margin-left: 10px;">
  68. <div class="input-group form-group-sm " style="width: 100%;">
  69. <input class="form-control" id="customerId" name="customerId" type="text" autocomplete="off" required="" placeholder="请输入客户编码..." readonly="">
  70. <div class="input-group-addon" onclick="ShowQueryModal('query_customer_modal', '.tool-form');">
  71. <i class="iconfont icon-search"></i>
  72. </div>
  73. <div class="input-group-addon" title="清除员工信息" onclick="ClearQueryValue(this);">
  74. <i class="iconfont icon-close"></i>
  75. </div>
  76. </div>
  77. </div>
  78. </form>
  79. </div>
  80. <div class="tool-btn">
  81. @if (IsGranted(PermissionNames.PagesStatisticMgStatementBillReportMgQuery))
  82. {
  83. <button class="btn btn-info btn-sm" onclick="Query()">查询</button>
  84. }
  85. @* <button class="btn btn-success btn-sm" onclick="Export()">导出</button>*@
  86. </div>
  87. </div>
  88. <div class="box-data">
  89. <div class="box-body">
  90. <table id="table1" >
  91. <thead>
  92. <tr class="title">
  93. <td class="td" colspan="20">上海上垫垫圈有限公司对账单表</td>
  94. </tr>
  95. <tr>
  96. <th class="td index">序号</th>
  97. <th class="td">编号</th>
  98. <th class="td">客户编号</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. </tr>
  107. </thead>
  108. <tbody class="tbody"></tbody>
  109. <tfoot>
  110. <tr>
  111. <td class="td" colspan="7"></td>
  112. <td class="td detail">
  113. 含税总金额:<strong class="allPrice"></strong>
  114. </td>
  115. <td class="td detail" colspan="2">
  116. 不含税总金额: <strong class="afterAllPrice"></strong>
  117. </td>
  118. </tr>
  119. </tfoot>
  120. </table>
  121. </div>
  122. </div>
  123. @section modal{
  124. @Html.Partial("Modals/Query/_Customer", "customerId")
  125. }
  126. @section scripts
  127. {
  128. <script type="text/javascript">
  129. var $table = $('#table1');
  130. $(function () {
  131. $('#year').val(@(DateTime.Now.Year)).select2();
  132. $('#month').val(@(DateTime.Now.Month)).select2();
  133. Query();
  134. });
  135. function Query() {
  136. var date = $('#year').val();
  137. if (date) {
  138. $.iwbAjax4({
  139. url: window.appUrl + 'StatementBill/QueryStatisticStatementBillItems' ,
  140. form:'tool-form',
  141. success: function (res) {
  142. var str = ItemFormatter(res);
  143. $table.find('.tbody').html(str);
  144. }
  145. });
  146. } else {
  147. abp.message.warn("请选择年份。");
  148. }
  149. }
  150. function ItemFormatter(data) {
  151. var str = "";
  152. var allPrice = 0, cnyAllPrice = 0, usdAllPrice = 0;
  153. var afterAllPrice = 0,cnyAfterAllPrice = 0,usdAfterAllPrice = 0;
  154. if (data && data.length > 0) {
  155. for (var i = 0; i < data.length; i++) {
  156. var item = data[i];
  157. str += '<tr>';
  158. str += '<td class="td">{0}</td>'.format(i+1);
  159. str += '<td class="td">{0}</td>'.format(item.statementBillNo || "");
  160. str += '<td class="td">{0}</td>'.format(item.customerId || "");
  161. str += '<td class="td">{0}</td>'.format(item.customerName || "");
  162. str += '<td class="td">{0}</td>'.format(item.billMan || "");
  163. str += '<td class="td">{0}</td>'.format(new Date(item.creationTime).format('yyyy-MM-dd'));
  164. //str += '<td class="td">{0}</td>'.format(new Date(item.productDate).format('yyyy-MM-dd'));
  165. str += '<td class="td">{0}</td>'.format(item.orderStickBillNo || "");
  166. str += '<td class="td">{0}</td>'.format(item.totalPrice || "");
  167. if (item.totalPrice) {
  168. allPrice += item.totalPrice;
  169. if (item.currencyId === "CNY") {
  170. cnyAllPrice += item.totalPrice;
  171. } else if (item.currencyId === "USD") {
  172. usdAllPrice += item.totalPrice;
  173. }
  174. }
  175. str += '<td class="td">{0}</td>'.format(item.afterTaxTotalPrice || "");
  176. if (item.afterTaxTotalPrice) {
  177. afterAllPrice += item.afterTaxTotalPrice;
  178. if (item.currencyId === "CNY") {
  179. cnyAfterAllPrice += item.afterTaxTotalPrice;
  180. } else if (item.currencyId === "USD") {
  181. usdAfterAllPrice += item.afterTaxTotalPrice;
  182. }
  183. }
  184. str += '<td class="td">{0}</td>'.format(item.currencyId || "");
  185. str += '</tr>';
  186. }
  187. } else {
  188. str += '<tr>';
  189. str += '<td class="td" colspan="20" style="color:red;padding:10px;">未查询到明细</td>';
  190. str += '</tr>';
  191. }
  192. $table.find('.allPrice').html((Number(cnyAllPrice).toFixed(3) || "") + 'CNY | ' + (Number(usdAllPrice).toFixed(3) || "")+'USD');
  193. $table.find('.afterAllPrice').html((Number(cnyAfterAllPrice).toFixed(3) || "") + 'CNY | ' + (Number(usdAfterAllPrice).toFixed(3) || "") + 'USD');
  194. return str;
  195. }
  196. function Export() {
  197. }
  198. function ClearQueryValue(that) {
  199. var $that = $(that).closest('.input-group');
  200. $that.find('input').val("");
  201. }
  202. function CheckStateFormatter(v) {
  203. var name = $("#CheckState option[value='" + v + "']").text();
  204. if (v === 1) {
  205. return '<span class="label label-info">' + name + '</span>';
  206. } else if (v === 2) {
  207. return '<span class="label label-success">' + name + '</span>';
  208. } else if (v === 3) {
  209. return '<span class="label label-warning">' + name + '</span>';
  210. }
  211. return '<span class="label label-info">' + name + '</span>';
  212. }
  213. </script>
  214. }
  215. <section style="display: none">
  216. <select id="hid-type">
  217. <option value=""></option>
  218. </select>
  219. @*@Html.DropDownList("hid-type", type)*@
  220. </section>