|
@@ -0,0 +1,272 @@
|
|
|
+<!DOCTYPE html>
|
|
|
+<html>
|
|
|
+ <head>
|
|
|
+ <title>二级市场订单表-电子交易协议</title>
|
|
|
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
|
+ <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
|
|
|
+
|
|
|
+ <link rel="stylesheet" href="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
|
|
|
+ <link rel="stylesheet" href="../../static/sa.css">
|
|
|
+ <script src="../../static/kj/vue.min.js"></script>
|
|
|
+ <script src="../../static/kj/element-ui/index.js"></script>
|
|
|
+ <script src="../../static/kj/httpVueLoader.js"></script>
|
|
|
+ <script src="../../static/kj/jquery.min.js"></script>
|
|
|
+ <script src="../../static/kj/layer/layer.js"></script>
|
|
|
+ <script src="../../static/sa.js"></script>
|
|
|
+ <script src="../../static/kj/upload-util.js"></script>
|
|
|
+
|
|
|
+ <script src="../../static/kj/html2canvas.min.js"></script>
|
|
|
+ <script src="../../static/kj/jspdf.umd.min.js"></script>
|
|
|
+ <style type="text/css">
|
|
|
+ .c-panel .c-label{width: 8em;}
|
|
|
+ table {
|
|
|
+ font-family: arial, sans-serif;
|
|
|
+ border-collapse: collapse;
|
|
|
+ width: 90%;
|
|
|
+ margin-top: 20px ;
|
|
|
+ margin-left: auto;
|
|
|
+ margin-right: auto;
|
|
|
+ }
|
|
|
+ th {
|
|
|
+ border: 1px solid darkgray;
|
|
|
+ text-align: left;
|
|
|
+ height: 24px;
|
|
|
+ padding: 8px;
|
|
|
+ background-color: #dddddd;
|
|
|
+ }
|
|
|
+ td {
|
|
|
+ border: 1px solid darkgray;
|
|
|
+ text-align: left;
|
|
|
+ padding: 8px;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+ </head>
|
|
|
+ <body>
|
|
|
+ <div class="vue-box sbot" style="display: none;" :style="'display: block;'">
|
|
|
+
|
|
|
+ <div class="s-body">
|
|
|
+ <div class="c-panel" id="content-to-convert" ref="contentToConvert">
|
|
|
+ <el-form v-if="m">
|
|
|
+ <table>
|
|
|
+ <tr>
|
|
|
+ <td colspan='6' style="text-align:center;font-weight: bold; border: 0 0 1px 0; " >电子交易协议</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td colspan='6' style="font-weight: bold;" >一、交易信息</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>订单编号</th>
|
|
|
+ <td colspan='2'>{{m.orderNo}}</td>
|
|
|
+ <th>结算单号</th>
|
|
|
+ <td colspan='2'></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>交易日期</th>
|
|
|
+ <td colspan='2'></td>
|
|
|
+ <th>交货日期</th>
|
|
|
+ <td colspan='2'></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>银行流水号</th>
|
|
|
+ <td colspan='5'></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>商品名称</th>
|
|
|
+ <th>数量</th>
|
|
|
+ <th>重量(KG)</th>
|
|
|
+ <th>单价(元)</th>
|
|
|
+ <th>合计(元)</th>
|
|
|
+ <th>备注</th>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>木薯淀粉</td>
|
|
|
+ <td>24</td>
|
|
|
+ <td>3.23</td>
|
|
|
+ <td>345.01</td>
|
|
|
+ <td>34663.33</td>
|
|
|
+ <td>含税价</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>龙虾</td>
|
|
|
+ <td>24</td>
|
|
|
+ <td>3.23</td>
|
|
|
+ <td>345.01</td>
|
|
|
+ <td>34663.33</td>
|
|
|
+ <td>含税价</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>合计</td>
|
|
|
+ <td>7.23</td>
|
|
|
+ <td>12</td>
|
|
|
+ <td>322.01</td>
|
|
|
+ <td>344455</td>
|
|
|
+ <td>含税价</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td colspan='6'>合计金额人民币(大写):xxxxxxxxx</th>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td colspan='6' style="font-weight: bold;" >二、卖方信息</th>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>卖方</th>
|
|
|
+ <td colspan='2'></td>
|
|
|
+ <th>联系人及方式</th>
|
|
|
+ <td colspan='2'></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>开户行</th>
|
|
|
+ <td colspan='2'></td>
|
|
|
+ <th rowspan='2'>统一信用代码</th>
|
|
|
+ <td colspan='2' rowspan='2'></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>银行账号</th>
|
|
|
+ <td colspan='2'>/td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td colspan='6' style="font-weight: bold;" >三、买方信息</th>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>买方</th>
|
|
|
+ <td colspan='2'></td>
|
|
|
+ <th>联系人及方式</th>
|
|
|
+ <td colspan='2'></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>开户行</th>
|
|
|
+ <td colspan='2'></td>
|
|
|
+ <th rowspan='2'>统一信用代码</th>
|
|
|
+ <td colspan='2' rowspan='2'></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>银行账号</th>
|
|
|
+ <td colspan='2'></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td colspan='6' style="font-weight: bold;" >四、其它信息</th>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>交货地点</th>
|
|
|
+ <td colspan='5'>{{m.unloadingAddress}}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>提货方式</th>
|
|
|
+ <td colspan='5'></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>付款方式</th>
|
|
|
+ <td colspan='5'></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>发票类型</th>
|
|
|
+ <td colspan='5'></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>其它约定</th>
|
|
|
+ <td colspan='5'></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>补充说明</th>
|
|
|
+ <td colspan='5'></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td colspan='3'>
|
|
|
+ 卖方:xxxxxxx <br>
|
|
|
+ 法定代表人或授权委托人:xxxxxxxxxxx
|
|
|
+ </td>
|
|
|
+ <td colspan='3'>
|
|
|
+ 买方:xxxxxxx <br>
|
|
|
+ 法定代表人或授权委托人:xxxxxxxxxxx
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="s-foot">
|
|
|
+
|
|
|
+ <el-button type="primary" icon="el-icon-printer" @click="downloadToPdf()">下载凭证</el-button>
|
|
|
+ <el-button @click="sa.closeCurrIframe()">取消</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <script>
|
|
|
+ var app = new Vue({
|
|
|
+ components: {
|
|
|
+ "sa-info": httpVueLoader('../../sa-frame/com/sa-info.vue')
|
|
|
+ },
|
|
|
+ el: '.vue-box',
|
|
|
+ data: {
|
|
|
+ id: sa.p('id', 0), // 获取数据ID
|
|
|
+ m: null
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ downloadToPdf() {
|
|
|
+ const element = document.getElementById('content-to-convert');
|
|
|
+ html2canvas(element).then(canvas => {
|
|
|
+ // 使用 jsPDF 将 canvas 转换成 PDF
|
|
|
+ const imgData = canvas.toDataURL('image/png');
|
|
|
+ const pdf = new jspdf.jsPDF({
|
|
|
+ orientation: 'p',
|
|
|
+ unit: 'px',
|
|
|
+ format: [canvas.width, canvas.height]
|
|
|
+ });
|
|
|
+
|
|
|
+ const imgProps = pdf.getImageProperties(imgData);
|
|
|
+ const pdfWidth = pdf.internal.pageSize.getWidth();
|
|
|
+ const pdfHeight = (imgProps.height * pdfWidth) / imgProps.width;
|
|
|
+
|
|
|
+ // 添加图片,适应页面大小
|
|
|
+ pdf.addImage(imgData, 'PNG', 0, 0, pdfWidth, pdfHeight);
|
|
|
+ pdf.save(Date.now()+'.pdf');
|
|
|
+ });
|
|
|
+ },
|
|
|
+ htmlToPdf() {
|
|
|
+ const element = document.getElementById('content-to-convert');
|
|
|
+ html2canvas(element).then(canvas => {
|
|
|
+ // 使用 jsPDF 将 canvas 转换成 PDF
|
|
|
+ const imgData = canvas.toDataURL('image/png');
|
|
|
+ const pdf = new jspdf.jsPDF({
|
|
|
+ orientation: 'p',
|
|
|
+ unit: 'px',
|
|
|
+ format: [canvas.width, canvas.height]
|
|
|
+ });
|
|
|
+
|
|
|
+ const imgProps = pdf.getImageProperties(imgData);
|
|
|
+ const pdfWidth = pdf.internal.pageSize.getWidth();
|
|
|
+ const pdfHeight = (imgProps.height * pdfWidth) / imgProps.width;
|
|
|
+
|
|
|
+ // 添加图片,适应页面大小
|
|
|
+ pdf.addImage(imgData, 'PNG', 0, 0, pdfWidth, pdfHeight);
|
|
|
+ // 将 PDF 保存为 Blob 并处理它 这里需要处理跨域问题
|
|
|
+ pdf.output('blob').then(function(blob) {
|
|
|
+ var blobURL = URL.createObjectURL(blob);
|
|
|
+ var newWindow = window.open(blobURL, '_blank');
|
|
|
+ if (newWindow) {
|
|
|
+ newWindow.focus();
|
|
|
+ } else {
|
|
|
+ alert('请允许弹出窗口或在新标签页中手动查看 PDF。');
|
|
|
+ }
|
|
|
+
|
|
|
+ // 清理:当不再需要时,可以释放 Blob URL
|
|
|
+ // setTimeout(function() {
|
|
|
+ // URL.revokeObjectURL(blobURL);
|
|
|
+ // }, 5000);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ mounted: function() {
|
|
|
+ sa.ajax('/level-two-server/TbOrders/getById?id=' + this.id, function(res) {
|
|
|
+ this.m = res.data;
|
|
|
+ if(res.data == null) {
|
|
|
+ sa.alert('未能查找到 id=' + this.id + " 详细数据");
|
|
|
+ }
|
|
|
+ }.bind(this))
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ </script>
|
|
|
+ </body>
|
|
|
+</html>
|