浏览代码

添加单据打印示例

RuoYi 4 年之前
父节点
当前提交
9d81ccb528

+ 9 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/demo/controller/DemoFormController.java

@@ -89,6 +89,15 @@ public class DemoFormController
         return prefix + "/sortable";
     }
 
+    /**
+     * 单据打印
+     */
+    @GetMapping("/invoice")
+    public String invoice()
+    {
+        return prefix + "/invoice";
+    }
+
     /**
      * 选项卡 & 面板
      */

+ 121 - 0
ruoyi-admin/src/main/resources/templates/demo/form/invoice.html

@@ -0,0 +1,121 @@
+<!DOCTYPE html>
+<html lang="zh">
+<head>
+	<th:block th:include="include :: header('单据打印')" />
+</head>
+<body class="gray-bg">
+    <div class="wrapper wrapper-content animated fadeInRight">
+
+        <div class="row">
+            <div class="col-sm-12">
+                <div class="ibox-content p-xl">
+                    <div class="row">
+                        <div class="col-sm-6">
+                            <address>
+                                        <strong>北京百度在线网络技术有限公司</strong><br>
+                                        北京市海淀区上地十街10号<br>
+                                        <abbr title="Phone">总机:</abbr> (+86 10) 5992 8888
+                                    </address>
+                        </div>
+
+                        <div class="col-sm-6 text-right">
+                            <h4>单据编号:</h4>
+                            <h4 class="text-navy">H+-000567F7-00</h4>
+                            <address>
+                                        <strong>阿里巴巴集团</strong><br>
+                                        中国杭州市华星路99号东部软件园创业大厦6层(310099)<br>
+                                        <abbr title="Phone">总机:</abbr> (86) 571-8502-2088
+                                    </address>
+                            <p>
+                                <span><strong>日期:</strong> 2014-11-11</span>
+                            </p>
+                        </div>
+                    </div>
+
+                    <div class="table-responsive m-t">
+                        <table class="table invoice-table">
+                            <thead>
+                                <tr>
+                                    <th>清单</th>
+                                    <th>数量</th>
+                                    <th>单价</th>
+                                    <th>税率</th>
+                                    <th>总价</th>
+                                </tr>
+                            </thead>
+                            <tbody>
+                                <tr>
+                                    <td>
+                                        <div><strong>尚都比拉2013冬装新款女装 韩版修身呢子大衣 秋冬气质羊毛呢外套</strong>
+                                        </div>
+                                    </td>
+                                    <td>1</td>
+                                    <td>&yen;26.00</td>
+                                    <td>&yen;1.20</td>
+                                    <td>&yen;31,98</td>
+                                </tr>
+                                <tr>
+                                    <td>
+                                        <div><strong>11*11夏娜 新款斗篷毛呢外套 女秋冬呢子大衣 韩版大码宽松呢大衣</strong>
+                                        </div>
+                                        <small>双十一特价
+                                            </small>
+                                    </td>
+                                    <td>2</td>
+                                    <td>&yen;80.00</td>
+                                    <td>&yen;1.20</td>
+                                    <td>&yen;196.80</td>
+                                </tr>
+                                <tr>
+                                    <td>
+                                        <div><strong>2013秋装 新款女装韩版学生秋冬加厚加绒保暖开衫卫衣 百搭女外套</strong>
+                                        </div>
+                                    </td>
+                                    <td>3</td>
+                                    <td>&yen;420.00</td>
+                                    <td>&yen;1.20</td>
+                                    <td>&yen;1033.20</td>
+                                </tr>
+
+                            </tbody>
+                        </table>
+                    </div>
+                    <!-- /table-responsive -->
+
+                    <table class="table invoice-total">
+                        <tbody>
+                            <tr>
+                                <td><strong>总价:</strong>
+                                </td>
+                                <td>&yen;1026.00</td>
+                            </tr>
+                            <tr>
+                                <td><strong>税:</strong>
+                                </td>
+                                <td>&yen;235.98</td>
+                            </tr>
+                            <tr>
+                                <td><strong>总计</strong>
+                                </td>
+                                <td>&yen;1261.98</td>
+                            </tr>
+                        </tbody>
+                    </table>
+                    <div class="text-right">
+                        <button class="btn btn-primary" onclick="printPage()"><i class="fa fa-print"></i> 打印</button>
+                    </div>
+
+                    <div class="well m-t"><strong>注意:</strong> 请在30日内完成付款,否则订单会自动取消。
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+    <th:block th:include="include :: footer" />
+    <script type="text/javascript">
+        function printPage() {
+            window.print();
+        }
+    </script>
+</body>
+</html>

+ 1 - 0
ruoyi-admin/src/main/resources/templates/index-topnav.html

@@ -102,6 +102,7 @@
 					<li><a class="menuItem" th:href="@{/demo/form/cards}">卡片列表</a></li>
 					<li><a class="menuItem" th:href="@{/demo/form/jasny}">功能扩展</a></li>
 					<li><a class="menuItem" th:href="@{/demo/form/sortable}">拖动排序</a></li>
+					<li><a class="menuItem" th:href="@{/demo/form/invoice}">单据打印</a></li>
 					<li><a class="menuItem" th:href="@{/demo/form/tabs_panels}">选项卡 & 面板</a></li>
 					<li><a class="menuItem" th:href="@{/demo/form/validate}">表单校验</a></li>
 					<li><a class="menuItem" th:href="@{/demo/form/wizard}">表单向导</a></li>

+ 1 - 0
ruoyi-admin/src/main/resources/templates/index.html

@@ -84,6 +84,7 @@
 								<li><a class="menuItem" th:href="@{/demo/form/cards}">卡片列表</a></li>
 								<li><a class="menuItem" th:href="@{/demo/form/jasny}">功能扩展</a></li>
 								<li><a class="menuItem" th:href="@{/demo/form/sortable}">拖动排序</a></li>
+								<li><a class="menuItem" th:href="@{/demo/form/invoice}">单据打印</a></li>
 								<li><a class="menuItem" th:href="@{/demo/form/tabs_panels}">选项卡 & 面板</a></li>
 								<li><a class="menuItem" th:href="@{/demo/form/validate}">表单校验</a></li>
 								<li><a class="menuItem" th:href="@{/demo/form/wizard}">表单向导</a></li>