OrderDetail.cshtml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. @using IwbZero.Setting
  2. @using NPOI.SS.Formula.Functions
  3. @using ShwasherSys.Authorization.Permissions
  4. @using ShwasherSys.CustomerInfo
  5. @using ShwasherSys.Models.OrderInfo
  6. @using ShwasherSys.Order.Dto
  7. @using ShwasherSys.OrderSendInfo
  8. @using ShwasherSys.OrderSendInfo.Dto
  9. @{
  10. Layout = null;
  11. ViewBag.Title = "OrderDetail";
  12. /*Customer customerInfo = ViewBag.CustomerInfo;
  13. OrderSendBillDto sendBill = ViewBag.SendBill;
  14. List<ViewOrderSend> orderSends = ViewBag.OrderSends;
  15. string sendTitle = SettingManager.GetSettingValue("SysUserCop") + SettingManager.GetSettingValue("SENDBILLTITLE");
  16. string sendAddress = SettingManager.GetSettingValue("SENDADDRESS");
  17. string sendTel = SettingManager.GetSettingValue("SENDTELEPHONE");
  18. string tddate = "日期: " + DateTime.Now.Year + " 年 " + DateTime.Now.Month + " 月 " + DateTime.Now.Day + " 日 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";*/
  19. OrderHeaderDto orderHeader = ViewBag.OrderHeadDto;
  20. Customer customer = ViewBag.Customer;
  21. CustomerSend customerSend = ViewBag.CustomerSend;
  22. List<OrderItemSendDto> orderItemSendDtos = ViewBag.OrderItemSendDtos;
  23. Boolean isCanViewPrice = IsGranted(PermissionNames.PagesOrderInfoOrderStatusMgQueryOrderPrice);
  24. }
  25. <html>
  26. <head>
  27. <title>订单明细信息</title>
  28. <link href="~/Content/Css/PrintPage.css" rel="stylesheet" media="all" />
  29. <link href="~/Content/Plugins/PrintPreView/print-preview.css" rel="stylesheet" />
  30. @*<link href="~/Content/Plugins/jquery-print-preview/src/css/print-preview.css" rel="stylesheet" media="screen" />
  31. <script src="https://cdn.bootcss.com/jquery-tools/1.2.7/jquery.tools.min.js"></script>
  32. <script src="~/Content/Plugins/jquery-print-preview/src/jquery.print-preview.js"></script>*@
  33. @*<script src="~/Content/Plugins/PrintPreView/print-preView.js"></script>*@
  34. </head>
  35. <body style="font-size: 10px;">
  36. <header style="height: 40px;">
  37. <div style="position: absolute;left: calc(50% - 100px)">
  38. <input type="button" value="打印" class="btn" id="printBtn" />
  39. </div>
  40. <hr class="hr01" />
  41. </header>
  42. <div id="printContent">
  43. <table border="1" align="center" cellPadding="1" cellSpacing="1" bgColor="#3d5db2" class="table-body" style="width: 1000px" >
  44. <tr bgColor="#8caae7">
  45. <td colSpan="9" style="text-align: center; height: 19px;">
  46. <span style="font-size: 12pt">&nbsp;<strong><span style="font-size: 11pt">订单基本资料</span></strong></span>
  47. </td>
  48. </tr>
  49. <tr>
  50. <td bgColor="#c6dbff" >
  51. <div style="text-align: right"> <strong>流水号</strong>:</div>
  52. </td>
  53. <td bgColor="#ffffff" colspan="2">@orderHeader.Id</td>
  54. <td bgColor="#c6dbff" >
  55. <div style="text-align: right" > <strong>客户订单号</strong>:</div>
  56. </td>
  57. <td bgColor="#ffffff" colspan="2">@orderHeader.StockNo</td>
  58. <td bgColor="#c6dbff" width="10%">
  59. <div style="text-align: right"> <strong>客户编号</strong>:</div>
  60. </td>
  61. <td bgColor="#ffffff" colspan="2">@orderHeader.CustomerId</td>
  62. </tr>
  63. <tr>
  64. <td bgColor="#c6dbff" width="10%">
  65. <div style="text-align: right"> <strong>联系人</strong>:</div>
  66. </td>
  67. <td bgColor="#ffffff" colspan="2">@orderHeader.LinkName</td>
  68. <td bgColor="#c6dbff" width="10%">
  69. <div style="text-align: right"> <strong>电话</strong>:</div>
  70. </td>
  71. <td bgColor="#ffffff" colspan="2">@orderHeader.Telephone</td>
  72. <td bgColor="#c6dbff" width="10%">
  73. <div style="text-align: right"> <strong>客户名称</strong>:</div>
  74. </td>
  75. <td bgColor="#ffffff" colspan="2">@customer.CustomerName</td>
  76. </tr>
  77. <tr>
  78. <td bgColor="#c6dbff" width="10%">
  79. <div style="text-align: right"><strong>传真</strong>:</div>
  80. </td>
  81. <td bgColor="#ffffff" colspan="2">@orderHeader.Fax</td>
  82. <td bgColor="#c6dbff" width="10%">
  83. <div style="text-align: right"><strong> 订单日期</strong>:</div>
  84. </td>
  85. <td bgColor="#ffffff" colspan="2">@orderHeader.OrderDate</td>
  86. <td bgColor="#c6dbff" width="10%">
  87. <strong>送货地址</strong>:
  88. </td>
  89. <td bgColor="#ffffff" colspan="2">@customerSend.SendAdress</td>
  90. </tr>
  91. </table>
  92. <table id="OrderDetailTBL" align="center" class="table-body" style="width: 1000px;table-layout:auto; " >
  93. <tr bgColor="#8caae7">
  94. <td colSpan="15" style="text-align: center; height: 19px;">
  95. <span style="font-size: 12pt">&nbsp;<strong><span style="font-size: 11pt">订单详细信息</span></strong></span>
  96. </td>
  97. </tr>
  98. <tr>
  99. <td bgColor="#c6dbff" align=center style="width: 15px ; height: 18px;">
  100. <div>
  101. <strong>序号</strong>
  102. </div>
  103. </td>
  104. <td bgColor="#c6dbff" align=center style="height: 18px; width:auto;">
  105. <strong>产品编号</strong>
  106. </td>
  107. <td bgColor="#c6dbff" align=center style="height: 18px; width:auto;">
  108. <strong>零件号</strong>
  109. </td>
  110. <td bgColor="#c6dbff" align=center style="width:auto; height: 18px;">
  111. <strong>规格</strong>
  112. </td>
  113. <td bgColor="#c6dbff" align=center style="width:auto;height: 18px;">
  114. <strong>材质</strong>
  115. </td>
  116. <td height="18" align=center bgColor="#c6dbff" style="width:auto;">
  117. <strong>型号</strong>
  118. </td>
  119. <td bgColor="#c6dbff" align=center style="width:auto;height: 18px;">
  120. <div>
  121. <strong>表色</strong>
  122. </div>
  123. </td>
  124. <td bgColor="#c6dbff" align=center style="height: 18px;width:auto;">
  125. <strong>硬度</strong>
  126. </td>
  127. <td bgColor="#c6dbff" align=center style="width:auto; height: 18px;">
  128. <strong>数量</strong>
  129. </td>
  130. <td bgColor="#c6dbff" align=center style="width:auto; height: 18px;">
  131. <strong>单位</strong>
  132. </td>
  133. @if (isCanViewPrice)
  134. {
  135. <td height="18" align=center bgColor="#c6dbff" style="width:auto;" id="tdprice">
  136. <div><strong>单价</strong></div>
  137. </td>
  138. <td height="18" align=center bgColor="#c6dbff" style="width:auto;" id="totalPrice">
  139. <div><strong>总金额</strong></div>
  140. </td>
  141. }
  142. <td height="18" align=center bgColor="#c6dbff" style="width:auto;">
  143. <div>
  144. <strong>送货日期</strong>
  145. </div>
  146. </td>
  147. <td bgColor="#c6dbff" align=center style="width:auto; height: 18px;">
  148. <div>
  149. <strong>检验报告</strong>
  150. </div>
  151. </td>
  152. <td height="18" align=center bgColor="#c6dbff" style="width:auto;">
  153. <div>
  154. <strong>备注</strong>
  155. </div>
  156. </td>
  157. </tr>
  158. @{
  159. string remark = @" 1,发货单编号<font color=red>红色</font>显示则表示该发货单还没有开票<br>
  160. 2,尚没有生成发货单,则显示<font color=blue>未生成</font><br>
  161. 3,每个明细还有剩余未发送,则剩余数量<font color=red>红色</font>显示<br>
  162. 4,送货时间显示<font color=#00ff00>绿色</font>时候,表示离要求发货日期还有三天<br>
  163. 5,送货日期显示<font color=#ff0000>红色</font>时,表示已超过要求的发货日期
  164. ";
  165. int index = 1;
  166. decimal totalAllPrice = 0;
  167. foreach (var itemSendDto in orderItemSendDtos)
  168. {
  169. DateTime loDt = itemSendDto.SendDate;
  170. DateTime loNow = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
  171. TimeSpan loSpan = loDt - loNow;
  172. string lcSendDate = string.Format("{0:d}", itemSendDto.SendDate);
  173. if (loSpan.Days < 0)
  174. {
  175. lcSendDate = "<font color='#ff0000'>" + lcSendDate + "</font>";
  176. }
  177. if (loSpan.Days > -1 && loSpan.Days < 4)
  178. {
  179. lcSendDate = "<font color='#00ff00'>" + lcSendDate + "</font>";
  180. }
  181. string lcReport = itemSendDto.IsReport=="Y" ? "需要" : "不需要";
  182. string lcStatusName = "";
  183. switch (itemSendDto.OrderItemStatusId)
  184. {
  185. case 15:
  186. lcStatusName = "完成审核";
  187. break;
  188. case 9:
  189. lcStatusName = "发货";
  190. break;
  191. case 11:
  192. lcStatusName = "结束";
  193. break;
  194. }
  195. string lcIsPartSend = (itemSendDto.IsPartSend == "Y" ? "可以" : "不可以") + " 部分送货";
  196. decimal isSendQuantity = itemSendDto.IsSendQuantity ?? 0;
  197. decimal loLeftNub = itemSendDto.Quantity - isSendQuantity;
  198. <tr class="trColor">
  199. <td rowspan="2" width="5px">@index</td>
  200. <td >@itemSendDto.ProductNo</td>
  201. <td >@itemSendDto.PartNo</td>
  202. <td >@itemSendDto.Model</td>
  203. <td >@itemSendDto.Material</td>
  204. <td >@itemSendDto.ProductName</td>
  205. <td >@itemSendDto.SurfaceColor</td>
  206. <td >@itemSendDto.Rigidity</td>
  207. <td >@itemSendDto.Quantity</td>
  208. <td >@itemSendDto.OrderUnitName</td>
  209. @if (isCanViewPrice)
  210. {
  211. <td >@itemSendDto.Price @itemSendDto.CurrencyId</td>
  212. <td>@itemSendDto.TotalPrice @itemSendDto.CurrencyId</td>
  213. }
  214. <td >@Html.Raw(lcSendDate)</td>
  215. <td >@lcReport</td>
  216. <td >@itemSendDto.OrderItemDesc</td>
  217. </tr>
  218. <tr>
  219. <td colspan="14">
  220. <table align="center" border="1" CellPadding="1" CellSpacing="1" class="table-body" style="width: 830px">
  221. <tr>
  222. <td>状态:@lcStatusName</td>
  223. <td>@lcIsPartSend</td>
  224. <td>
  225. @if (loSpan.Days < 0)
  226. {
  227. <span>超期的天数:@loSpan.Days</span>
  228. }
  229. else
  230. {
  231. <span>剩余的天数:@loSpan.Days</span>
  232. }
  233. </td>
  234. <td>已发货数量:@isSendQuantity</td>
  235. <td >剩余数量:<span style="color: red;">@loLeftNub</span></td>
  236. </tr>
  237. @if (itemSendDto.ViewOrderSendStickBills.Count>0)
  238. {
  239. <tr>
  240. <td>发货单号</td>
  241. <td>发货数量</td>
  242. <td>发货时间</td>
  243. <td>操作人编号</td>
  244. <td>发货备注</td>
  245. </tr>
  246. foreach (var sendItem in itemSendDto.ViewOrderSendStickBills)
  247. {
  248. string lcSendBillNo = sendItem.OrderSendBillNo;
  249. if (!string.IsNullOrEmpty(lcSendBillNo))
  250. {
  251. if (string.IsNullOrEmpty(sendItem.OrderStickBillNo))
  252. {
  253. lcSendBillNo = "<font color=red>" + lcSendBillNo + "</font>";
  254. }
  255. }
  256. else
  257. {
  258. lcSendBillNo= "<font color=blue><strong>未生成</strong></font>";
  259. }
  260. <tr class="trColor">
  261. <td>@Html.Raw(lcSendBillNo)</td>
  262. <td>@sendItem.SendQuantity</td>
  263. <td>@sendItem.SendDate</td>
  264. <td>@sendItem.UserIDLastMod</td>
  265. <td>@sendItem.Remark</td>
  266. </tr>
  267. }
  268. }
  269. </table>
  270. </td>
  271. </tr>
  272. index++;
  273. totalAllPrice += itemSendDto.TotalPrice;
  274. }
  275. }
  276. @if (isCanViewPrice)
  277. {
  278. <tr>
  279. <td colspan="3" align="right"><b>合计:</b></td>
  280. <td colspan="8" align="right">总金额:@totalAllPrice</td>
  281. <td colspan="4" align="left"></td>
  282. </tr>
  283. }
  284. <tr>
  285. <td colspan="3" align="right"><b>说明:</b></td>
  286. <td colspan="12" align="left">@Html.Raw(remark)</td>
  287. </tr>
  288. </table>
  289. </div>
  290. <script src="~/Content/Scripts/Jquery/jquery-3.3.1.min.js"></script>
  291. @*<script src="~/Content/Plugins/printThis/printThis.js"></script>*@
  292. <script src="~/Content/Plugins/PrintPreView/print-preView.js"></script>
  293. <script>
  294. $(function () {
  295. /*$("#printBtn").on('click',
  296. function () {
  297. $("#printContent").printThis({
  298. debug: false, // show the iframe for debugging
  299. importCSS: true, // import page CSS
  300. importStyle: false, // import style tags
  301. printContainer: true, // grab outer container as well as the contents of the selector
  302. //loadCSS: "path/to/my.css", // path to additional css file - use an array [] for multiple
  303. pageTitle: "", // add title to print page
  304. removeInline: false, // remove all inline styles from print elements
  305. printDelay: 333, // variable print delay
  306. header: null, // prefix to html
  307. footer: null, // postfix to html
  308. base: false, // preserve the BASE tag, or accept a string for the URL
  309. formValues: true, // preserve input/form values
  310. canvas: false, // copy canvas elements (experimental)
  311. //doctypeString: "...", // enter a different doctype for older markup
  312. removeScripts: false, // remove script tags from print content
  313. copyTagClasses: false // copy classes from the html & body tag#1#
  314. });
  315. });*/
  316. $("#printBtn").printPreview({
  317. printBody: "#printContent"
  318. });
  319. })
  320. </script>
  321. </body>
  322. </html>