OrderSendBillDetail.cshtml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. @using IwbZero.Setting
  2. @using NPOI.SS.Formula.Functions
  3. @using ShwasherSys.Common
  4. @using ShwasherSys.CustomerInfo
  5. @using ShwasherSys.OrderSendInfo
  6. @using ShwasherSys.OrderSendInfo.Dto
  7. @using ShwasherSys.ProductInfo
  8. @{
  9. Layout = null;
  10. ViewBag.Title = "OrderSendBillDetail";
  11. Customer customerInfo = ViewBag.CustomerInfo;
  12. OrderSendBillDto sendBill = ViewBag.SendBill;
  13. List<ViewOrderSend> orderSends = ViewBag.OrderSends;
  14. string sendTitle = SettingManager.GetSettingValue("SysUserCop") + SettingManager.GetSettingValue("SENDBILLTITLE");
  15. string sendAddress = SettingManager.GetSettingValue("SENDADDRESS");
  16. string sendTel = SettingManager.GetSettingValue("SENDTELEPHONE");
  17. string tddate = "日期: " + DateTime.Now.Year + " 年 " + DateTime.Now.Month + " 月 " + DateTime.Now.Day + " 日 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
  18. ShwasherSys.Inspection.TemplateInfo templateInfo = ViewBag.TemplateInfo;
  19. string tmpKey ="";
  20. if (templateInfo != null)
  21. {
  22. tmpKey = templateInfo.TempKey;
  23. }
  24. List<CustomerDefaultProduct> customerDefaultProducts = ViewBag.CustomerDefaultProducts;
  25. List<ProductProperty> productProperties = ViewBag.MaterialProductProperties;
  26. }
  27. <html>
  28. <head>
  29. <title>发货单打印</title>
  30. <link href="~/Content/Css/PrintPage.css" rel="stylesheet" media="all" />
  31. <link href="~/Content/Plugins/PrintPreView/print-preview.css" rel="stylesheet" />
  32. @*<link href="~/Content/Plugins/jquery-print-preview/src/css/print-preview.css" rel="stylesheet" media="screen" />
  33. <script src="https://cdn.bootcss.com/jquery-tools/1.2.7/jquery.tools.min.js"></script>
  34. <script src="~/Content/Plugins/jquery-print-preview/src/jquery.print-preview.js"></script>*@
  35. @*<script src="~/Content/Plugins/PrintPreView/print-preView.js"></script>*@
  36. <script src="~/Content/Scripts/Jquery/jquery-3.3.1.js"></script>
  37. <script src="~/Content/Plugins/jquery.validate/jquery.validate.js"></script>
  38. <script src="~/Content/Plugins/PrintPreView/print-preView.js"></script>
  39. <script src="~/Content/Scripts/MyScript/ExportExcel.js"></script>
  40. <script src="~/Abp/Framework/scripts/abp.js"></script>
  41. <script src="~/Abp/Framework/scripts/libs/abp.jquery.js"></script>
  42. <script src="~/Content/Scripts/MyScript/UtilJs.js"></script>
  43. <script>
  44. $(function () {
  45. $("#printBtn").printPreview({
  46. printBody: "#printContent",
  47. modalWidth: 1100
  48. });
  49. $("#exportBtn").on('click',
  50. function (e) {
  51. var key = '@tmpKey';
  52. var serverUrl = (key.length > 0) ? "ExportOrderSend" : "ExportOrderSendCommon";
  53. SaveAjax({
  54. //url: "/api/services/app/OrderSendBill/"+serverUrl,
  55. url: "/api/services/app/OrderSendBill/ExportOrderSendCommon",
  56. isValidate: false,
  57. isAlert: false,
  58. data: { id: '@sendBill.Id' },
  59. success: function (res) {
  60. var urlPath = window.document.location.href; //浏览器显示地址 http://10.15.5.83:5555/ISV/demo.aspx?a=1&b=2
  61. var docPath = window.document.location.pathname; //文件在服务器相对地址 /ISV/demo.aspx
  62. var index = urlPath.indexOf(docPath);
  63. var serverPath = urlPath.substring(0, index); //服务器地址 http://10.15.5.83:5555
  64. window.location.href = serverPath+"/" + res;
  65. }
  66. });
  67. });
  68. })
  69. </script>
  70. </head>
  71. <body>
  72. <header style="height: 40px;">
  73. <div style="position: absolute;left: calc(50% - 100px)">
  74. <input type="button" value="打印" class="btn" id="printBtn" />
  75. <input type="button" value="导入Excel" class="btn" id="exportBtn" />
  76. </div>
  77. <hr class="hr01" />
  78. </header>
  79. <div id="printContent">
  80. <table style="width: 1000px; margin-left: calc(50% - 500px); text-align: center;" id='tbheader' name='tbheader'>
  81. <tr>
  82. <td colspan="15" style="width: auto ; height: auto ; text-align: center">
  83. <strong>
  84. <span style="font-size: 20pt; font-family: STFangsong;">
  85. <label style="width: 509px; display: inline;">@sendTitle</label>
  86. </span>
  87. </strong>
  88. </td>
  89. </tr>
  90. <tr>
  91. <td colspan="15" style="width: auto ; height: auto ; text-align: right" id="tddanhao"><strong>单号:@sendBill.Id</strong></td>
  92. </tr>
  93. <tr>
  94. <td colspan="15" style="width: auto ; height: auto ; text-align: center" id="tdSendAddress">
  95. <span style="font-size: 10pt">
  96. @sendAddress
  97. </span>
  98. </td>
  99. </tr>
  100. <tr>
  101. <td colspan="15" style="width:auto ; text-align:center; height:auto ;" id="tdSendTelephone">
  102. <span style="font-size: 10pt">
  103. @Html.Raw(sendTel)
  104. </span>
  105. </td>
  106. </tr>
  107. </table>
  108. <table style="table-layout: auto; margin: 0 auto; width: 1000px; " id='tbheader2'>
  109. <tr style="height:auto ">
  110. <td style="width:80px;">
  111. <strong><span style="font-size: 11pt">客户:</span></strong>
  112. </td>
  113. <td colspan="7" style="width:400px; " id="tdcustormer">@customerInfo.CustomerName</td>
  114. <td style="width:60px; ">
  115. <strong><span style="font-size: 11pt">地址:</span></strong>
  116. </td>
  117. <td colspan="6" style="width:auto;" id="tdsendaddr">@sendBill.SendAddress</td>
  118. </tr>
  119. <tr style="height:auto ">
  120. <td style="width:80px; ">
  121. <strong><span style="font-size: 11pt">联系电话:</span></strong>
  122. </td>
  123. <td colspan="7" style="width:400px; text-align: left;" id="tdtel">@sendBill.ContactTels</td>
  124. <td style="width:60px ;">
  125. <strong><span style="font-size: 11pt">联系人:</span></strong>
  126. </td>
  127. <td colspan="6" style="width: auto ; " id="tdlinkman">@sendBill.ContactMan</td>
  128. </tr>
  129. <tr style="height:auto ">
  130. <td colspan="15" style="width:auto;text-align: right;">@Html.Raw(tddate)</td>
  131. </tr>
  132. </table>
  133. <table class="table-body" style="table-layout: fixed; margin: 0 auto; width: 1100px;" id="fhdataTBL">
  134. <tr>
  135. <td style="width: 15px; text-align: center; border: thin solid #000000;" rowspan="2">
  136. <strong>序号</strong>
  137. </td>
  138. <td style="width: 60px ; text-align: center;border: thin solid #000000;" rowspan="2">
  139. <strong>
  140. 客户订单号
  141. </strong>
  142. </td>
  143. <td style="width: 60px ; text-align: center;border: thin solid #000000;" rowspan="2">
  144. <strong>
  145. 零件号
  146. </strong>
  147. </td>
  148. <td style="width: 60px ; text-align: center;border: thin solid #000000;" rowspan="2">
  149. <strong>
  150. 描述
  151. </strong>
  152. </td>
  153. <td style="width: 60px ; text-align: center;border: thin solid #000000;" rowspan="2">
  154. <strong>
  155. 规格
  156. </strong>
  157. </td>
  158. <td style="width: 50px ; text-align: center;border: thin solid #000000;" rowspan="2">
  159. <strong>
  160. 表色
  161. </strong>
  162. </td>
  163. <td style="width: 60px ; text-align: center;border: thin solid #000000;" rowspan="2">
  164. <strong>
  165. 材质
  166. </strong>
  167. </td>
  168. <td style="width: 60px ; text-align: center;border: thin solid #000000;" rowspan="2">
  169. <strong>
  170. 硬度
  171. </strong>
  172. </td>
  173. <td style="width: 20px ; text-align: center;border: thin solid #000000;" rowspan="2">
  174. <strong>
  175. 单位
  176. </strong>
  177. </td>
  178. <td style="width: 20px ; text-align: center;border: thin solid #000000;" rowspan="2">
  179. <strong>
  180. 数量
  181. </strong>
  182. </td>
  183. <td style="width: 20px ; text-align: center;border: thin solid #000000;" rowspan="2">
  184. <strong>
  185. 产品海关编号
  186. </strong>
  187. </td>
  188. <td style="width: 20px ; text-align: center;border: thin solid #000000;" rowspan="2">
  189. <strong>
  190. 材料海关编号
  191. </strong>
  192. </td>
  193. <td style="text-align: center;width: 115px ;border: thin solid #000000;" colspan="4">
  194. <strong>
  195. (箱数*千件数+零头数=发货数)
  196. </strong>
  197. </td>
  198. <td style="width: 50px ; text-align: center;border: thin solid #000000;" rowspan="2">
  199. <strong>
  200. 批次号
  201. </strong>
  202. </td>
  203. </tr>
  204. <tr>
  205. <td style="text-align:center; width: 15px;border: thin solid #000000;">
  206. <strong>箱数</strong>
  207. </td>
  208. <td style="text-align: center; width: 40px;border: thin solid #000000;">
  209. <strong>千件/箱</strong>
  210. </td>
  211. <td style=" text-align: center; width: 30px;border: thin solid #000000;">
  212. <strong>零头</strong>
  213. </td>
  214. <td style="text-align: center; width: 30px;border: thin solid #000000;">
  215. <strong>总数</strong>
  216. </td>
  217. </tr>
  218. @{
  219. int index = 1;
  220. foreach (var orderSend in orderSends)
  221. {
  222. var sendQuantity = Math.Round(Math.Floor(orderSend.SendQuantity * 1000) / 1000, 3);//发货数量
  223. var quantityPerPack = orderSend.QuantityPerPack ?? 0;
  224. quantityPerPack = quantityPerPack == 0 ? sendQuantity : quantityPerPack;//每包数量,如果为0则等于发货数量
  225. decimal packageCount = sendQuantity == 0 ? 0 : (sendQuantity <= quantityPerPack ? 1 : Math.Floor(orderSend.SendQuantity / quantityPerPack));
  226. var sysl = sendQuantity - quantityPerPack * packageCount;
  227. string mHsCode = CommonQueryService.GetMaterialHsCode(orderSend.ProductNo, productProperties);
  228. string productHsCode = CommonQueryService.GetProductHsCode(orderSend.CustomerId, orderSend.ProductNo, customerDefaultProducts);
  229. <tr class="trColor">
  230. <td style="border: thin solid #000000;">@index</td>
  231. @if (string.IsNullOrEmpty(orderSend.StockNo))
  232. {
  233. <td style="border: thin solid #000000;">@orderSend.OrderNo</td>
  234. }
  235. else
  236. {
  237. <td style="border: thin solid #000000;">@orderSend.StockNo</td>
  238. }
  239. <td style="border: thin solid #000000;">@orderSend.PartNo</td>
  240. <td style="border: thin solid #000000;">@orderSend.ProductName</td>
  241. <td style="border: thin solid #000000;">@orderSend.Model</td>
  242. <td style="border: thin solid #000000;">@orderSend.SurfaceColor</td>
  243. <td style="border: thin solid #000000;">@orderSend.Material</td>
  244. <td style="border: thin solid #000000;">@orderSend.Rigidity</td>
  245. <td style="border: thin solid #000000;">千件</td>
  246. <td style="border: thin solid #000000;">@sendQuantity</td>
  247. <td style="border: thin solid #000000;">@productHsCode</td>
  248. <td style="border: thin solid #000000;">@mHsCode</td>
  249. <td style="border: thin solid #000000;">@packageCount</td>
  250. <td style="border: thin solid #000000;">@quantityPerPack</td>
  251. <td style="border: thin solid #000000;">@sysl</td>
  252. <td style="border: thin solid #000000;">@sendQuantity</td>
  253. <td style="border: thin solid #000000;">@orderSend.ProductBatchNum</td>
  254. </tr>
  255. index++;
  256. }
  257. }
  258. </table>
  259. <table style="width: 1000px; margin: 0 auto;" id='tbfooter' name='tbfooter'>
  260. <tr>
  261. <td></td>
  262. <td></td>
  263. <td></td>
  264. <td></td>
  265. <td></td>
  266. <td></td>
  267. <td></td>
  268. <td></td>
  269. <td></td>
  270. <td></td>
  271. <td></td>
  272. <td></td>
  273. <td></td>
  274. <td></td>
  275. <td></td>
  276. </tr>
  277. <tr>
  278. <td>制表人:</td>
  279. <td></td>
  280. <td></td>
  281. <td></td>
  282. <td>送货人:</td>
  283. <td></td>
  284. <td></td>
  285. <td></td>
  286. <td> 签收人:</td>
  287. <td></td>
  288. <td></td>
  289. <td>送货日期:</td>
  290. <td></td>
  291. <td></td>
  292. <td></td>
  293. </tr>
  294. </table>
  295. </div>
  296. </body>
  297. </html>