StatementBillDetail.cshtml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  1. @using Abp.Authorization
  2. @using IwbZero.Setting
  3. @using NPOI.SS.Formula.Functions
  4. @using ShwasherSys.Authorization.Permissions
  5. @using ShwasherSys.CustomerInfo
  6. @using ShwasherSys.Invoice
  7. @using ShwasherSys.OrderSendInfo
  8. @using ShwasherSys.OrderSendInfo.Dto
  9. @{
  10. Layout = null;
  11. ViewBag.Title = "InvoiceBillDetail";
  12. Customer customerInfo = ViewBag.CustomerInfo;
  13. OrderSendBillDto sendBill = ViewBag.SendBill;
  14. string sendStickBillNo = ViewBag.SendStickBillNo;
  15. List<ViewOrderSendStickBill> orderSends = ViewBag.OrderSends;
  16. /*string sendTitle = SettingManager.GetSettingValue("SysUserCop") + SettingManager.GetSettingValue("SENDBILLTITLE");
  17. string sendAddress = SettingManager.GetSettingValue("SENDADDRESS");
  18. string sendTel = SettingManager.GetSettingValue("SENDTELEPHONE");*/
  19. string tddate = "日期: " + DateTime.Now.Year + " 年 " + DateTime.Now.Month + " 月 " + DateTime.Now.Day + " 日 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
  20. bool isCanViewPrice = PermissionChecker.IsGranted(PermissionNames.PagesOrderInfoOrderMgQueryOrderPrice);
  21. }
  22. <html>
  23. <head>
  24. <title>对账单详情</title>
  25. <link href="~/Content/Css/PrintPage.css" rel="stylesheet" media="all" />
  26. <link href="~/Content/Plugins/PrintPreView/print-preview.css" rel="stylesheet" />
  27. @*<link href="~/Content/Plugins/jquery-print-preview/src/css/print-preview.css" rel="stylesheet" media="screen" />
  28. <script src="https://cdn.bootcss.com/jquery-tools/1.2.7/jquery.tools.min.js"></script>
  29. <script src="~/Content/Plugins/jquery-print-preview/src/jquery.print-preview.js"></script>*@
  30. @*<script src="~/Content/Plugins/PrintPreView/print-preView.js"></script>*@
  31. <style>
  32. </style>
  33. </head>
  34. <body>
  35. <div id="exportCss">
  36. <style>
  37. .table-body {
  38. width: 800px;
  39. border-collapse: collapse;
  40. font-size: 12px;
  41. border-width: thin;
  42. table-layout: fixed;
  43. WORD-BREAK: break-all;
  44. WORD-WRAP: break-word;
  45. }
  46. .table-body tr {
  47. height: 18px;
  48. border-top: 1px solid #888383
  49. }
  50. .table-body tr:last-of-type td {
  51. border-bottom: 1px solid #000
  52. }
  53. .table-body tr td {
  54. height: 18px;
  55. padding: 3px 2px;
  56. text-align: center;
  57. border-left: 1px solid #888383
  58. }
  59. .table-body tr td:last-of-type {
  60. height: 18px;
  61. border-right: 1px solid #000;
  62. }
  63. .trColor:nth-child(even) {
  64. background: #efe7e7
  65. }
  66. .trColor:nth-child(odd) {
  67. background: #FFF
  68. }
  69. </style>
  70. </div>
  71. <header style="height: 40px;">
  72. <div style="position: absolute;left: calc(50% - 100px)">
  73. <input type="button" value="打印" class="btn" id="printBtn" />
  74. <input type="button" value="导出Excel" class="btn" id="exportReport" />
  75. </div>
  76. <hr class="hr01" />
  77. </header>
  78. <div id="printContent" style="">
  79. @{
  80. var colspan = isCanViewPrice ? 17 : 11;
  81. var col3 = colspan/5;
  82. var col4 = colspan/4+1;
  83. var col5 = colspan/5;
  84. var col6 = colspan/3;
  85. var col7 = colspan/2+1;
  86. var col8 = colspan / 7;
  87. }
  88. <table style="width: 900px; margin: 0 auto" id="tableHeader">
  89. <tr style="height: auto">
  90. <td colspan="@col8"></td>
  91. @{
  92. var col2 = colspan - 2;
  93. }
  94. <td style="height: auto; text-align: left; padding: 10px 0px 10px 50px" colspan="@col2">
  95. <img src="~/Content/Images/excle/report.png" style="width: 650px; height: 100px;" />
  96. </td>
  97. </tr>
  98. <tr style="height: auto">
  99. <td style="height: auto; text-align: center; padding: 5px; font-size: 25px;" colspan="@colspan">
  100. <strong><span>开票前对账(对账单)</span></strong>
  101. </td>
  102. </tr>
  103. <tr style="height: auto">
  104. @{
  105. }
  106. <td style="width: 15%; text-align: right;" colspan="@col3">
  107. <strong><span>客户:</span></strong>
  108. </td>
  109. <td style="width: 25%; font-size: 13px; font-family: 黑体;" id="tdcustormer" colspan="@col4">
  110. @customerInfo.CustomerName
  111. </td>
  112. <td style="width: 20%; text-align: right;" colspan="@col5">
  113. <strong><span>地址:</span></strong>
  114. </td>
  115. <td style="width: 60%; font-size: 13px; font-family: 黑体;" id="tdsendaddr" colspan="@col6">
  116. @if (sendBill != null)
  117. {
  118. @sendBill.SendAddress
  119. }
  120. </td>
  121. </tr>
  122. <tr style="height: auto">
  123. <td style="width: 15%; text-align: right;" colspan="@col3">
  124. <strong><span>联系电话:</span></strong>
  125. </td>
  126. <td style="width: 25%; font-size: 13px; font-family: 黑体;" id="tdtel" colspan="@col4">
  127. @if (sendBill != null)
  128. {
  129. @sendBill.ContactTels
  130. }
  131. </td>
  132. <td style="width: 20%; text-align: right;" colspan="@col5">
  133. <strong><span>联系人:</span></strong>
  134. </td>
  135. <td style="width: auto; font-size: 13px; font-family: 黑体;" id="tdlinkman" colspan="@col6">
  136. @if (sendBill != null)
  137. {
  138. @sendBill.ContactMan
  139. }
  140. </td>
  141. </tr>
  142. <tr style="height: auto;">
  143. <td align=right colspan="@col5">
  144. <strong>单号:</strong>
  145. </td>
  146. <td id="tddanhao" colspan="@col4" style="font-size: 13px; font-family: 黑体;">
  147. @sendStickBillNo
  148. </td>
  149. <td style="width: auto; text-align: right; font-family: 黑体;" id="tddate" colspan="@col7">
  150. @Html.Raw(tddate)
  151. </td>
  152. </tr>
  153. <tr>
  154. <td colspan="@colspan">
  155. <table style="width: 1050px; table-layout: auto;" class="table-body">
  156. <tr>
  157. <td style="width: 35px; text-align: center;">
  158. <strong>序号</strong>
  159. </td>
  160. <td style="text-align: center; font-size: 14px;">
  161. <strong>
  162. 客户订单号
  163. </strong>
  164. </td>
  165. <td style="text-align: center; font-size: 14px;">
  166. <strong>
  167. 送货单号
  168. </strong>
  169. </td>
  170. <td style="text-align: center; font-size: 14px;">
  171. <strong>
  172. 送货日期
  173. </strong>
  174. </td>
  175. <td style="text-align: center; font-size: 14px;">
  176. <strong>
  177. 零件号
  178. </strong>
  179. </td>
  180. <td style="text-align: center; font-size: 14px;">
  181. <strong>
  182. 规格
  183. </strong>
  184. </td>
  185. <td style="text-align: center; font-size: 14px;">
  186. <strong>
  187. 材质
  188. </strong>
  189. </td>
  190. <td style="text-align: center; font-size: 14px;">
  191. <strong>
  192. 产品名
  193. </strong>
  194. </td>
  195. <td style="text-align: center; font-size: 14px;">
  196. <strong>
  197. 硬度
  198. </strong>
  199. </td>
  200. <td style="text-align: center; font-size: 14px;">
  201. <strong>
  202. 表色
  203. </strong>
  204. </td>
  205. <td style="text-align: center; font-size: 14px;">
  206. <strong>
  207. 数量
  208. </strong>
  209. </td>
  210. <td style="text-align: center; font-size: 14px;">
  211. <strong>
  212. 单位
  213. </strong>
  214. </td>
  215. @if (isCanViewPrice)
  216. {
  217. <td style="text-align: center; font-size: 14px;">
  218. <strong>
  219. 含税单价
  220. </strong>
  221. </td>
  222. <td style="text-align: center; font-size: 14px;">
  223. <strong>
  224. 不含税单价
  225. </strong>
  226. </td>
  227. <td style="text-align: center; font-size: 14px;">
  228. <strong>
  229. 模具费
  230. </strong>
  231. </td>
  232. <td style="text-align: center; font-size: 14px;">
  233. <strong>
  234. 运费
  235. </strong>
  236. </td>
  237. <td style="text-align: center; font-size: 14px;">
  238. <strong>
  239. 含税总价
  240. </strong>
  241. </td>
  242. <td style="text-align: center; border-right: 1px solid #888383;">
  243. <strong>
  244. 不含税总价
  245. </strong>
  246. </td>
  247. }
  248. </tr>
  249. @{
  250. int index = 1;
  251. decimal ldAccontTotal = 0;
  252. decimal ldNoTaxTotal = 0;
  253. string currencyId = "CNY";
  254. foreach (var orderSend in orderSends)
  255. {
  256. var sendQuantity = string.Format("{0:N3}", orderSend.SendQuantity ?? 0);
  257. var price = string.Format("{0:N3}", orderSend.Price);
  258. var logisticsFee = string.Format("{0:N3}", orderSend.LogisticsFee);
  259. var moldFee = string.Format("{0:N3}", orderSend.MoldFee);
  260. var noTaxprice = string.Format("{0:N3}", orderSend.AfterTaxPrice);
  261. var totalprice = string.Format("{0:N3}", orderSend.totalprice);
  262. var totalNoTaxprice = string.Format("{0:N3}", (orderSend.SendQuantity ?? 0) * orderSend.AfterTaxPrice);
  263. var sendDate = string.Format("{0:yyyy-MM-dd}", orderSend.SendDate);
  264. currencyId = orderSend.CurrencyId;
  265. string tmp = "";
  266. <tr class="trColor">
  267. @if (index == orderSends.Count)
  268. {
  269. tmp = "border-bottom: 1px solid #888383;";
  270. }
  271. <td style="@tmp">@index</td>
  272. @if (string.IsNullOrEmpty(orderSend.StockNo))
  273. {
  274. <td style="font-family: 黑体; font-size: 13px; @tmp">@orderSend.OrderNo</td>
  275. }
  276. else
  277. {
  278. <td style="font-family: 黑体; font-size: 13px; @tmp">@orderSend.StockNo</td>
  279. }
  280. <td style="font-family: 黑体; font-size: 13px; @tmp">@orderSend.OrderSendBillNo</td>
  281. <td style="font-family: 黑体; font-size: 13px; @tmp">@sendDate</td>
  282. <td style="font-family: 黑体; font-size: 13px; @tmp">@orderSend.PartNo</td>
  283. <td style="font-family: 黑体; font-size: 13px; @tmp">@orderSend.Model</td>
  284. <td style="font-family: 黑体; font-size: 13px; @tmp">@orderSend.Material</td>
  285. <td style="font-family: 黑体; font-size: 13px; @tmp">@orderSend.ProductName</td>
  286. <td style="font-family: 黑体; font-size: 13px; @tmp">@orderSend.Rigidity</td>
  287. <td style="font-family: 黑体; font-size: 13px; @tmp">@orderSend.SurfaceColor</td>
  288. <td style="font-family: 黑体; font-size: 13px; @tmp">@sendQuantity</td>
  289. <td style="font-family: 黑体; font-size: 13px; @tmp">@orderSend.OrderUnitName</td>
  290. @if (isCanViewPrice)
  291. {
  292. <td style="font-family: 黑体; font-size: 13px; @tmp">@price</td>
  293. <td style="font-family: 黑体; font-size: 13px; @tmp">@noTaxprice</td>
  294. <td style="font-family: 黑体; font-size: 13px; @tmp">@moldFee</td>
  295. <td style="font-family: 黑体; font-size: 13px; @tmp">@logisticsFee</td>
  296. <td style="font-family: 黑体; font-size: 13px; @tmp">@totalprice</td>
  297. <td style="text-align: center; border-right: 1px solid #888383; @tmp">@totalNoTaxprice</td>
  298. }
  299. </tr>
  300. ldAccontTotal += orderSend.totalprice;
  301. //ldNoTaxTotal += (orderSend.SendQuantity ?? 0) * orderSend.AfterTaxPrice;
  302. ldNoTaxTotal += orderSend.AfterTaxTotalprice;
  303. index++;
  304. }
  305. string lcAccontTotal = string.Format("{0:N3}", ldAccontTotal);
  306. string lcNoTaxTotal = string.Format("{0:N3}", ldNoTaxTotal);
  307. }
  308. </table>
  309. </td>
  310. </tr>
  311. @if (isCanViewPrice)
  312. {
  313. <tr>
  314. <td style="text-align: right;" colspan="16">
  315. <strong>总金额(@currencyId):</strong>
  316. </td>
  317. <td style="text-align: right;" colspan="2">@lcAccontTotal&nbsp;&nbsp;&nbsp;@lcNoTaxTotal</td>
  318. </tr>
  319. }
  320. </table>
  321. </div>
  322. <script src="~/Content/Scripts/Jquery/jquery-3.3.1.min.js"></script>
  323. @*<script src="~/Content/Plugins/printThis/printThis.js"></script>*@
  324. <script src="~/Content/Plugins/PrintPreView/print-preView.js"></script>
  325. <script src="~/Content/Scripts/MyScript/ExportExcel.js"></script>
  326. <script src="~/Abp/Framework/scripts/abp.js"></script>
  327. <script src="~/Abp/Framework/scripts/libs/abp.jquery.js"></script>
  328. <script src="~/Content/Scripts/MyScript/UtilJs.js"></script>
  329. <script>
  330. $(function () {
  331. /*$("#printBtn").on('click',
  332. function () {
  333. $("#printContent").printThis({
  334. debug: false, // show the iframe for debugging
  335. importCSS: true, // import page CSS
  336. importStyle: false, // import style tags
  337. printContainer: true, // grab outer container as well as the contents of the selector
  338. //loadCSS: "path/to/my.css", // path to additional css file - use an array [] for multiple
  339. pageTitle: "", // add title to print page
  340. removeInline: false, // remove all inline styles from print elements
  341. printDelay: 333, // variable print delay
  342. header: null, // prefix to html
  343. footer: null, // postfix to html
  344. base: false, // preserve the BASE tag, or accept a string for the URL
  345. formValues: true, // preserve input/form values
  346. canvas: false, // copy canvas elements (experimental)
  347. //doctypeString: "...", // enter a different doctype for older markup
  348. removeScripts: false, // remove script tags from print content
  349. copyTagClasses: false // copy classes from the html & body tag#1#
  350. });
  351. });*/
  352. $("#printBtn").printPreview({
  353. printBody: "#printContent",
  354. modalWidth: 1050
  355. });
  356. //$("#exportReport").on('click',
  357. // function (e) {
  358. // var urlPath = window.document.location.href; //浏览器显示地址 http://10.15.5.83:5555/ISV/demo.aspx?a=1&b=2
  359. // var docPath = window.document.location.pathname; //文件在服务器相对地址 /ISV/demo.aspx
  360. // var index = urlPath.indexOf(docPath);
  361. // var serverPath = urlPath.substring(0, index); //服务器地址 http://10.15.5.83:5555
  362. // var imgTr = $("#tableHeader").find('tr:first').clone();
  363. // $("#tableHeader").find('tr:first img')
  364. // .attr("src", serverPath + "/Content/Images/excle/report2.png");
  365. // $("#tableHeader").find('tr:first td')
  366. // .css({ "height": "120px" });
  367. // $("#tableHeader").find('tr:first td img').css({ "width": "800px" });
  368. // ExportExcel('printContent', '发票明细', 'exportCss');
  369. // $("#tableHeader").find('tr:first').remove();
  370. // $("#tableHeader").prepend(imgTr);
  371. // //var imgTr = $("#tableHeader").find('tr:first').clone();
  372. // //$("#tableHeader").find('tr:first').remove();
  373. // //ExportExcel('printContent', '发票明细', 'exportCss');
  374. // //$("#tableHeader").prepend(imgTr);
  375. // });
  376. $("#exportReport").on('click',
  377. function(e) {
  378. SaveAjax({
  379. url: "/api/services/app/OrderStickBill/ExportStatementBill",
  380. isValidate: false,
  381. isAlert: false,
  382. data: { id: '@sendStickBillNo' },
  383. success: function (res) {
  384. var urlPath = window.document.location.href; //浏览器显示地址 http://10.15.5.83:5555/ISV/demo.aspx?a=1&b=2
  385. var docPath = window.document.location.pathname; //文件在服务器相对地址 /ISV/demo.aspx
  386. var index = urlPath.indexOf(docPath);
  387. var serverPath = urlPath.substring(0, index); //服务器地址 http://10.15.5.83:5555
  388. window.location.href = serverPath+"/" + res;
  389. }
  390. });
  391. });
  392. })
  393. </script>
  394. </body>
  395. </html>