Bladeren bron

Merge branch 'hw' of http://121.41.102.225:8099/Nidong/jiufang

# Conflicts:
#	package-lock.json
Andy 3 jaren geleden
bovenliggende
commit
2cf9f15576

+ 6 - 40
package-lock.json

@@ -6734,8 +6734,14 @@
     },
     "jquery": {
       "version": "3.6.0",
+<<<<<<< HEAD
       "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz",
       "integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw=="
+=======
+      "resolved": "https://registry.nlark.com/jquery/download/jquery-3.6.0.tgz",
+      "integrity": "sha1-xyoJ8Vwb3OFC9J2/EXC9+K2sJHA=",
+      "dev": true
+>>>>>>> b1f44f50a8fae607da9483cb4578647393b834f2
     },
     "js-base64": {
       "version": "2.6.4",
@@ -9120,11 +9126,6 @@
       "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=",
       "dev": true
     },
-    "qrcodejs2": {
-      "version": "0.0.2",
-      "resolved": "https://registry.npm.taobao.org/qrcodejs2/download/qrcodejs2-0.0.2.tgz",
-      "integrity": "sha1-Rlr+Xjnxn6zsuTLBH3oYYQkUauE="
-    },
     "qs": {
       "version": "6.5.2",
       "resolved": "https://registry.npm.taobao.org/qs/download/qs-6.5.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fqs%2Fdownload%2Fqs-6.5.2.tgz",
@@ -11499,41 +11500,6 @@
         }
       }
     },
-    "vue-print-nb": {
-      "version": "1.6.0",
-      "resolved": "https://registry.npm.taobao.org/vue-print-nb/download/vue-print-nb-1.6.0.tgz",
-      "integrity": "sha1-hF5dvrfoo0+tceYliQ4D8Qx396k=",
-      "requires": {
-        "core-js": "^3.6.5",
-        "echarts": "^5.0.2",
-        "qrcodejs2": "0.0.2",
-        "vue": "^2.6.11"
-      },
-      "dependencies": {
-        "echarts": {
-          "version": "5.0.2",
-          "resolved": "https://registry.npm.taobao.org/echarts/download/echarts-5.0.2.tgz?cache=0&sync_timestamp=1612592464414&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fecharts%2Fdownload%2Fecharts-5.0.2.tgz",
-          "integrity": "sha1-FybRelfPBdYs0FZ7QyXhIBpWuvY=",
-          "requires": {
-            "tslib": "2.0.3",
-            "zrender": "5.0.4"
-          }
-        },
-        "tslib": {
-          "version": "2.0.3",
-          "resolved": "https://registry.npm.taobao.org/tslib/download/tslib-2.0.3.tgz",
-          "integrity": "sha1-jgdBrEX8DCJuWKF7/D5kubxsphw="
-        },
-        "zrender": {
-          "version": "5.0.4",
-          "resolved": "https://registry.npm.taobao.org/zrender/download/zrender-5.0.4.tgz?cache=0&sync_timestamp=1612184221868&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fzrender%2Fdownload%2Fzrender-5.0.4.tgz",
-          "integrity": "sha1-icNVr5CLn2SjAbOPdRt5UfLIqVo=",
-          "requires": {
-            "tslib": "2.0.3"
-          }
-        }
-      }
-    },
     "vue-property-decorator": {
       "version": "8.5.1",
       "resolved": "https://registry.npm.taobao.org/vue-property-decorator/download/vue-property-decorator-8.5.1.tgz?cache=0&sync_timestamp=1615347750035&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-property-decorator%2Fdownload%2Fvue-property-decorator-8.5.1.tgz",

+ 1 - 1
package.json

@@ -24,7 +24,6 @@
     "view-design": "^4.3.2",
     "vue": "^2.6.13",
     "vue-img-previewer": "^0.2.3",
-    "vue-print-nb": "^1.5.0",
     "vue-router": "^3.4.1",
     "vue-slicksort": "^1.1.3",
     "vuex": "^3.5.1",
@@ -38,6 +37,7 @@
     "babel-eslint": "^10.1.0",
     "eslint": "^6.7.2",
     "eslint-plugin-vue": "^6.2.2",
+    "jquery": "^3.6.0",
     "lib-flexible": "^0.3.2",
     "vue-template-compiler": "^2.6.13"
   },

+ 525 - 0
src/assets/index.html

@@ -0,0 +1,525 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="utf-8">
+    <script src="./jquery.min.js"></script>
+</head>
+
+<body>
+    <div class="table-box">
+        <button onclick="printTable()">打印</button>
+        <div class="show-table"></div>
+        <div class="print-table"></div>
+
+
+        <!-- <table cellspacing="0" cellpadding="0"> -->
+            <!-- <thead>
+                <tr>
+                    <td colspan="23" style="border: 0;">
+                        <div class="table-header">
+                            <h1 class="table-title">升升概念订货订单</h1>
+                        </div>
+                    </td>
+                </tr>
+                <tr>
+                    <td colspan="23">
+                        <p style="text-align: left;padding-left: 20px;"><span class="part_content"
+                                style="font-size:16px;margin-right:40px">木门哑口套</span><span class="custom">客户:将录音
+                                地址:杭州市已成两元</span></p>
+                    </td>
+                </tr>
+                <tr class="header">
+                    <td rowspan="2">
+                        <p>序号</p>
+                    </td>
+                    <td rowspan="2">
+                        <p style="width:80px ;">位置</p>
+                    </td>
+                    <td rowspan="2">
+                        <p style="width:80px ;">材质</p>
+                    </td>
+                    <td rowspan="2">
+                        <p style="width:80px ;">型号</p>
+                    </td>
+                    <td rowspan="2">
+                        <p style="width:80px ;">工艺</p>
+                    </td>
+                    <td rowspan="2">
+                        <p style="width:80px ;">木皮/颜色</p>
+                    </td>
+                    <td>
+                        <p>门洞尺寸(MM)</p>
+                    </td>
+                    <td>
+                        <p>门扇尺寸(MM)</p>
+                    </td>
+                    <td>
+                        <p>门套尺寸(MM)</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>数量</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>单位</p>
+                    </td>
+                    <td>
+                        <p>平方</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>单价</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>附加</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>金额</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>备注</p>
+                    </td>
+                </tr>
+                <tr class="header">
+
+                    <td>
+                        <p>高*宽*厚度</p>
+                    </td>
+                    <td>
+                        <p>高*宽*厚度</p>
+                    </td>
+                    <td>
+                        <p>高*宽*厚度</p>
+                    </td>
+
+                    <td>
+                        <p>米</p>
+                    </td>
+                </tr>
+            </thead> -->
+
+            <!-- <tbody class="content">
+            </tbody> -->
+
+            <!-- <tfoot>
+                <tr>
+                    <td class="amount-index" align="center"></td>
+                    <td colspan="11"></td>
+                    <td colspan="2">合计:</td>
+                    <td class="xt_total"></td>
+                    <td></td>
+                </tr>
+
+                <tr>
+                    <td colspan="12" class="remark" style="padding-left: 20px;"></td>
+                    <td colspan="2">返点:</td>
+                    <td class="return"></td>
+                    <td></td>
+                </tr>
+
+                <tr>
+                    <td colspan="12" class="remark1" style="padding-left: 20px;"></td>
+                    <td colspan="2">尾款:</td>
+                    <td class="end_price"></td>
+                    <td></td>
+                </tr>
+
+                <tr>
+                    <td colspan="16" style="padding-left: 20px;">
+                        <p class="amount_detail" style="height: 24px;"></p>
+                    </td>
+                </tr>
+
+                <tr>
+                    <td colspan="16" class="order_info" style="padding-left: 20px;">客户备注:<span
+                            class="customer_remark"></span>订货日期:<span class="crt_time"></span>交货日期:<span
+                            class="end_time"></span>业务经理:<span class="saleman"></span>制单人:<span
+                            class="crt_id"></span>审核:<span class="oa"></span>客户确认:<span class="is_confirm"></span></td>
+                </tr>
+            </tfoot> -->
+        <!-- </table> -->
+
+    </div>
+    <script>
+        function printTable() {
+            window.print();
+
+        }
+        $(() => {
+            $.ajax({
+                url: 'https://asdkjasdklj.isongmei.com/Wap/hy1/tt1111',
+                type: 'get',
+                success: res => {
+                    let data = JSON.parse(res);
+                    // table-box
+                    console.log(data)
+
+                    let newArr=chunk(data.list,15);
+                    console.log(newArr)
+                    let theadStr = `<thead>
+                <tr>
+                    <td colspan="23" style="border: 0;">
+                        <div class="table-header">
+                            <img class="left-img" src=${data.logo} alt="">
+                            <h1 class="table-title">${data.title}</h1><img class="right-img1" src=${data.right_logo1} alt=""><img class="right-img2" src=${data.right_logo2} alt="">
+                        </div>
+                    </td>
+                </tr>
+                <tr>
+                    <td colspan="23">
+                        <p style="text-align: left;padding-left: 20px;"><span class="part_content"
+                                style="font-size:16px;margin-right:40px">${data.part_content}</span><span class="custom">${data.custom}</span></p>
+                    </td>
+                </tr>
+                <tr class="header">
+                    <td rowspan="2">
+                        <p>序号</p>
+                    </td>
+                    <td rowspan="2">
+                        <p style="width:80px ;">位置</p>
+                    </td>
+                    <td rowspan="2">
+                        <p style="width:80px ;">材质</p>
+                    </td>
+                    <td rowspan="2">
+                        <p style="width:80px ;">型号</p>
+                    </td>
+                    <td rowspan="2">
+                        <p style="width:80px ;">工艺</p>
+                    </td>
+                    <td rowspan="2">
+                        <p style="width:80px ;">木皮/颜色</p>
+                    </td>
+                    <td>
+                        <p>门洞尺寸(MM)</p>
+                    </td>
+                    <td>
+                        <p>门扇尺寸(MM)</p>
+                    </td>
+                    <td>
+                        <p>门套尺寸(MM)</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>数量</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>单位</p>
+                    </td>
+                    <td>
+                        <p>平方</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>单价</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>附加</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>金额</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>备注</p>
+                    </td>
+                </tr>
+                <tr class="header">
+
+                    <td>
+                        <p>高*宽*厚度</p>
+                    </td>
+                    <td>
+                        <p>高*宽*厚度</p>
+                    </td>
+                    <td>
+                        <p>高*宽*厚度</p>
+                    </td>
+
+                    <td>
+                        <p>米</p>
+                    </td>
+                </tr>
+            </thead>`
+                   
+
+                    let tfootStr=`<tfoot>
+                <tr>
+                    <td class="amount-index" align="center">${data.list.length + 1}</td>
+                    <td colspan="11"></td>
+                    <td colspan="2">合计:</td>
+                    <td class="xt_total">${data.foot.xt_total}</td>
+                    <td></td>
+                </tr>
+
+                <tr>
+                    <td colspan="12" class="remark" style="padding-left: 20px;">${data.foot.remark}</td>
+                    <td colspan="2">返点:</td>
+                    <td class="return">${data.foot.return}</td>
+                    <td></td>
+                </tr>
+
+                <tr>
+                    <td colspan="12" class="remark1" style="padding-left: 20px;">${data.foot.remark1}</td>
+                    <td colspan="2">尾款:</td>
+                    <td class="end_price">${data.foot.end_price}</td>
+                    <td></td>
+                </tr>
+
+                <tr>
+                    <td colspan="16" style="padding-left: 20px;">
+                        <p class="amount_detail" style="height: 24px;">${data.foot.amount_detail}</p>
+                    </td>
+                </tr>
+
+                <tr>
+                    <td colspan="16" class="order_info" style="padding-left: 20px;">客户备注:<span
+                            class="customer_remark">${data.foot.customer_remark}</span>订货日期:<span class="crt_time">${data.foot.crt_time}</span>交货日期:<span
+                            class="end_time">${data.foot.end_time}</span>业务经理:<span class="saleman">${data.foot.saleman}</span>制单人:<span
+                            class="crt_id">${data.foot.crt_id}</span>审核:<span class="oa">${data.foot.oa}</span>客户确认:<span class="is_confirm">${data.foot.is_confirm}</span></td>
+                </tr>
+            </tfoot>`
+                    
+                    let showTableContentStr=''
+                    data.list.map(item => {
+                        showTableContentStr += `<tr>
+                                <td>
+                                    <p>${item.sort}</p>
+                                </td>
+                                <td>
+                                    <p>${item.postion}</p>
+                                </td>
+                                <td>
+                                    <p>${item.process}</p>
+                                </td>
+                                <td>
+                                    <p>${item.model}</p>
+                                </td>
+                                <td>
+                                    <p>${item.workmanship}</p>
+                                </td>
+                                <td>
+                                    <p>${item.color}</p>
+                                </td>
+                                <td>
+                                    <p>${item.measure1}</p>
+                                </td>
+                                <td>
+                                    <p>${item.measure2}</p>
+                                </td>
+                                <td>
+                                    <p>${item.measure3}</p>
+                                </td>
+                                <td>
+                                    <p>${item.num}</p>
+                                </td>
+                                <td>
+                                    <p>${item.unit}</p>
+                                </td>
+                                <td>
+                                    <p>${item.square}</p>
+                                </td>
+                                <td>
+                                    <p>${item.unit_price}</p>
+                                </td>
+                                <td>
+                                    <p>${item.ext}</p>
+                                </td>
+                                <td>
+                                    <p>${item.price}</p>
+                                </td>
+                                <td>
+                                    <p>${item.remark}</p>
+                                </td>
+                            </tr>`
+                    })
+                    $(".show-table").append(`<table cellspacing="0" cellpadding="0">${theadStr}<tbody class="content">${showTableContentStr}
+                        </tbody>${tfootStr}</table>`)
+                    
+                    
+                    let tableStr='';
+                    newArr.map(arr=>{
+                        let str ='';
+                        arr.map(item => {
+                            str += `<tr>
+                                <td>
+                                    <p>${item.sort}</p>
+                                </td>
+                                <td>
+                                    <p>${item.postion}</p>
+                                </td>
+                                <td>
+                                    <p>${item.process}</p>
+                                </td>
+                                <td>
+                                    <p>${item.model}</p>
+                                </td>
+                                <td>
+                                    <p>${item.workmanship}</p>
+                                </td>
+                                <td>
+                                    <p>${item.color}</p>
+                                </td>
+                                <td>
+                                    <p>${item.measure1}</p>
+                                </td>
+                                <td>
+                                    <p>${item.measure2}</p>
+                                </td>
+                                <td>
+                                    <p>${item.measure3}</p>
+                                </td>
+                                <td>
+                                    <p>${item.num}</p>
+                                </td>
+                                <td>
+                                    <p>${item.unit}</p>
+                                </td>
+                                <td>
+                                    <p>${item.square}</p>
+                                </td>
+                                <td>
+                                    <p>${item.unit_price}</p>
+                                </td>
+                                <td>
+                                    <p>${item.ext}</p>
+                                </td>
+                                <td>
+                                    <p>${item.price}</p>
+                                </td>
+                                <td>
+                                    <p>${item.remark}</p>
+                                </td>
+                            </tr>`
+                        })
+                        tableStr+=`<table cellspacing="0" cellpadding="0">${theadStr}<tbody class="content">${str}
+                        </tbody>${tfootStr}</table><div style="page-break-after: always;"></div>`
+                    })
+                    $(".print-table").append(tableStr)
+                    
+                }
+            })
+        })
+
+        function chunk(array, size) {
+            //获取数组的长度,如果你传入的不是数组,那么获取到的就是undefined
+            const length = array.length
+            //判断不是数组,或者size没有设置,size小于1,就返回空数组
+            if (!length || !size || size < 1) {
+              return []
+            }
+            //核心部分
+            let index = 0 //用来表示切割元素的范围start
+            let resIndex = 0 //用来递增表示输出数组的下标
+          
+            //根据length和size算出输出数组的长度,并且创建它。
+            let result = new Array(Math.ceil(length / size))
+            //进行循环
+            while (index < length) {
+              //循环过程中设置result[0]和result[1]的值。该值根据array.slice切割得到。
+              result[resIndex++] = array.slice(index, (index += size))
+            }
+            //输出新数组
+            return result
+          }
+    </script>
+</body>
+<style>
+    * {
+        margin: 0;
+        padding: 0;
+        font-size: 14px;
+    }
+
+    button {
+        position: absolute;
+        right: 40px;
+        width: 60px;
+    }
+
+    h1 {
+        text-align: center;
+        font-size: 18px;
+        margin-bottom: 10px;
+        margin-top: 20px;
+    }
+
+    p {
+        text-align: center;
+    }
+
+    table {
+        width: 100%;
+        border-collapse: collapse;
+    }
+
+    td {
+        border: 1px solid #000;
+
+    }
+
+    .right-img1 {
+        position: absolute;
+        right: 0;
+        width: 150px;
+        margin-bottom: 10px;
+        height: 60px;
+        top: 0;
+    }
+
+    .right-img2 {
+        position: absolute;
+        width: 150px;
+        right: 180px;
+        margin-bottom: 10px;
+        height: 60px;
+        top: 0;
+    }
+
+    .table-header {
+        position: relative;
+        height: 80px;
+        line-height: 80px;
+    }
+
+    .left-img {
+        position: absolute;
+        left: 0;
+        width: 150px;
+        height: 60px;
+        top: 0;
+    }
+
+    .table-box {
+        padding: 0 20px;
+        width: 1000px;
+        margin: 0 auto;
+        margin-top: 40px;
+    }
+
+    .order_info span {
+        margin-right: 28px;
+    }
+
+    .pageSeparator {
+        visibility: hidden;
+        page-break-after: always;
+        overflow: hidden;
+        height: 0px;
+    }
+    .print-table{
+        display: none;
+    }
+    @media print {
+        button {
+            display: none;
+        }
+        .print-table{
+            display: block;
+        }
+        .show-table{
+            display: none;
+        }
+        @page {
+            margin: 60px 0 0 0;
+        }
+    }
+</style>
+
+</html>

File diff suppressed because it is too large
+ 1 - 0
src/assets/jquery.min.js


+ 2 - 3
src/main.js

@@ -18,17 +18,16 @@ import VXETable from 'vxe-table'
 import 'vxe-table/lib/style.css'
 import ElementUI from 'element-ui';
 import 'element-ui/lib/theme-chalk/index.css';
+import Print from '@/plugs/print';
 Vue.use(ElementUI);
+Vue.use(Print)
 Vue.use(VXETable)
 import 'lib-flexible'
-import Print from 'vue-print-nb'
 Vue.use(Viewer);
 Viewer.setDefaults({
   Options: { "inline": true, "button": true, "navbar": true, "title": true, "toolbar": true, "tooltip": true, "movable": true, "zoomable": true, "rotatable": true, "scalable": true, "transition": true, "fullscreen": true, "keyboard": true, "url": "data-source" }
 });
 
-Vue.use(Print)
-
 Vue.use(ViewUI)
 
 Vue.use(IconFont)

+ 135 - 0
src/plugs/print.js

@@ -0,0 +1,135 @@
+// 打印类属性、方法定义
+/* eslint-disable */
+const Print = function (dom, options) {
+    if (!(this instanceof Print)) return new Print(dom, options);
+   
+    this.options = this.extend({
+      'noPrint': '.no-print'
+    }, options);
+   
+    if ((typeof dom) === "string") {
+      this.dom = document.querySelector(dom);
+    } else {
+      this.isDOM(dom)
+      this.dom = this.isDOM(dom) ? dom : dom.$el;
+    }
+   
+    this.init();
+  };
+  Print.prototype = {
+    init: function () {
+      var content = this.getStyle() + this.getHtml();
+      this.writeIframe(content);
+    },
+    extend: function (obj, obj2) {
+      for (var k in obj2) {
+        obj[k] = obj2[k];
+      }
+      return obj;
+    },
+   
+    getStyle: function () {
+      var str = "",
+        styles = document.querySelectorAll('style,link');
+      for (var i = 0; i < styles.length; i++) {
+        str += styles[i].outerHTML;
+      }
+      str += "<style>" + (this.options.noPrint ? this.options.noPrint : '.no-print') + "{display:none;}</style>";
+      str += "<style>html,body,div{height: auto!important;font-size:14px}</style>";
+      return str;
+    },
+   
+    getHtml: function () {
+      var inputs = document.querySelectorAll('input');
+      var textareas = document.querySelectorAll('textarea');
+      var selects = document.querySelectorAll('select');
+   
+      for (var k = 0; k < inputs.length; k++) {
+        if (inputs[k].type == "checkbox" || inputs[k].type == "radio") {
+          if (inputs[k].checked == true) {
+            inputs[k].setAttribute('checked', "checked")
+          } else {
+            inputs[k].removeAttribute('checked')
+          }
+        } else if (inputs[k].type == "text") {
+          inputs[k].setAttribute('value', inputs[k].value)
+        } else {
+          inputs[k].setAttribute('value', inputs[k].value)
+        }
+      }
+   
+      for (var k2 = 0; k2 < textareas.length; k2++) {
+        if (textareas[k2].type == 'textarea') {
+          textareas[k2].innerHTML = textareas[k2].value
+        }
+      }
+   
+      for (var k3 = 0; k3 < selects.length; k3++) {
+        if (selects[k3].type == 'select-one') {
+          var child = selects[k3].children;
+          for (var i in child) {
+            if (child[i].tagName == 'OPTION') {
+              if (child[i].selected == true) {
+                child[i].setAttribute('selected', "selected")
+              } else {
+                child[i].removeAttribute('selected')
+              }
+            }
+          }
+        }
+      }
+   
+      return this.dom.outerHTML;
+    },
+   
+    writeIframe: function (content) {
+      var w, doc, iframe = document.createElement('iframe'),
+        f = document.body.appendChild(iframe);
+      iframe.id = "myIframe";
+      //iframe.style = "position:absolute;width:0;height:0;top:-10px;left:-10px;";
+      iframe.setAttribute('style', 'position:absolute;width:0;height:0;top:-10px;left:-10px;');
+      w = f.contentWindow || f.contentDocument;
+      doc = f.contentDocument || f.contentWindow.document;
+      doc.open();
+      doc.write(content);
+      doc.close();
+      var _this = this
+      iframe.onload = function(){
+        _this.toPrint(w);
+        setTimeout(function () {
+          document.body.removeChild(iframe)
+        }, 100)
+      }
+    },
+   
+    toPrint: function (frameWindow) {
+      try {
+        setTimeout(function () {
+          frameWindow.focus();
+          try {
+            if (!frameWindow.document.execCommand('print', false, null)) {
+              frameWindow.print();
+            }
+          } catch (e) {
+            frameWindow.print();
+          }
+          frameWindow.close();
+        }, 10);
+      } catch (err) {
+        console.log('err', err);
+      }
+    },
+    isDOM: (typeof HTMLElement === 'object') ?
+      function (obj) {
+        return obj instanceof HTMLElement;
+      } :
+      function (obj) {
+        return obj && typeof obj === 'object' && obj.nodeType === 1 && typeof obj.nodeName === 'string';
+      }
+  };
+  const MyPlugin = {}
+  MyPlugin.install = function (Vue, options) {
+    // 4. 添加实例方法
+    Vue.prototype.$print = Print
+  }
+  export default MyPlugin

+ 10 - 0
src/routerMap/index.js

@@ -392,6 +392,16 @@ const routerMap = [{
             require(['@/views/OrderMannage/BusinessOrderlist/list'], resolve),
     },
     {
+        path: '/cms/ordermannage/businessorderlist/printlist',
+        name: 'BusinessOrderlist', //订单管理-->家装订单-->列表-->详情-->打印列表
+        meta: {
+            index: 4,
+            keepAlive: true
+        },
+        component: (resolve) =>
+            require(['@/views/OrderMannage/BusinessOrderlist/printlist'], resolve),
+    },
+    {
         path: '/cms/ordermannage/businessorderlist/decorationlist',
         name: 'BusinessOrderDecorationlist', //订单管理-->业务订单列表-->工装订单列表
         meta: {

+ 14 - 1
src/views/OrderMannage/BusinessOrderlist/edit.vue

@@ -3,7 +3,15 @@
     <Toptitle
       :title="type == 1 ? '新增订单' : type == 2 ? '编辑订单' : '订单详情'"
     >
-      <Button @click="back" type="primary" ghost style="margin-right: 10px"
+      <Button 
+      @click="print" 
+      type="primary" 
+      ghost 
+      v-show="type == 3"
+      style="margin-right: 10px"
+        >打印</Button
+      >
+       <Button @click="back" type="primary" ghost style="margin-right: 10px"
         >返回</Button
       >
       <Button
@@ -2804,6 +2812,11 @@ export default {
           }
         });
     },
+    print(){
+      this.$router.push({path:"/cms/ordermannage/businessorderlist/printlist",query:{
+       order_no:this.$route.query.order_no
+      }})
+    },
     back() {
       // this.$router.go(-1);
       this.$router.push({

+ 530 - 0
src/views/OrderMannage/BusinessOrderlist/printlist.vue

@@ -0,0 +1,530 @@
+<template>
+    <div class="printcontent"> 
+          <div class="table-box">
+        <button @click="PrintRow">打印</button>
+        <div id="show-table" >
+            <table cellspacing="0" cellpadding="0">
+                <thead>
+                <tr>
+                    <td colspan="23" style="border: 0;">
+                        <div class="table-header">
+                            <img class="left-img" :src="$store.state.ip + showTable.logo" alt="">
+                            <h1 class="table-title">{{showTable.title}}</h1><img class="right-img1" :src='$store.state.ip + showTable.right_logo1' alt=""><img class="right-img2" :src='$store.state.ip + showTable.right_logo2' alt="">
+                        </div>
+                    </td>
+                </tr>
+                <tr>
+                    <td colspan="23">
+                        <p style="text-align: left;padding-left: 20px;"><span class="part_content"
+                                style="font-size:16px;margin-right:40px">{{showTable.part_content}}</span><span class="custom">{{showTable.custom}}</span></p>
+                    </td>
+                </tr>
+                <tr class="header">
+                    <td rowspan="2">
+                        <p>序号</p>
+                    </td>
+                    <td rowspan="2">
+                        <p style="width:80px ;">位置</p>
+                    </td>
+                    <td rowspan="2">
+                        <p style="width:80px ;">材质</p>
+                    </td>
+                    <td rowspan="2">
+                        <p style="width:80px ;">型号</p>
+                    </td>
+                    <td rowspan="2">
+                        <p style="width:80px ;">工艺</p>
+                    </td>
+                    <td rowspan="2">
+                        <p style="width:80px ;">木皮/颜色</p>
+                    </td>
+                    <td>
+                        <p>门洞尺寸(MM)</p>
+                    </td>
+                    <td>
+                        <p>门扇尺寸(MM)</p>
+                    </td>
+                    <td>
+                        <p>门套尺寸(MM)</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>数量</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>单位</p>
+                    </td>
+                    <td>
+                        <p>平方</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>单价</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>附加</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>金额</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>备注</p>
+                    </td>
+                </tr>
+                <tr class="header">
+
+                    <td>
+                        <p>高*宽*厚度</p>
+                    </td>
+                    <td>
+                        <p>高*宽*厚度</p>
+                    </td>
+                    <td>
+                        <p>高*宽*厚度</p>
+                    </td>
+
+                    <td>
+                        <p>米</p>
+                    </td>
+                </tr>
+            </thead>
+                <tbody class="content">
+                   <tr v-for="(item,index) in showTableContentStr" :key="index">
+                                <td>
+                                    <p>{{item.sort}}</p>
+                                </td>
+                                <td>
+                                    <p>{{item.postion}}</p>
+                                </td>
+                                <td>
+                                    <p>{{item.process}}</p>
+                                </td>
+                                <td>
+                                    <p>{{item.model}}</p>
+                                </td>
+                                <td>
+                                    <p>{{item.workmanship}}</p>
+                                </td>
+                                <td>
+                                    <p>{{item.color}}</p>
+                                </td>
+                                <td>
+                                    <p>{{item.measure1}}</p>
+                                </td>
+                                <td>
+                                    <p>{{item.measure2}}</p>
+                                </td>
+                                <td>
+                                    <p>{{item.measure3}}</p>
+                                </td>
+                                <td>
+                                    <p>{{item.num}}</p>
+                                </td>
+                                <td>
+                                    <p>{{item.unit}}</p>
+                                </td>
+                                <td>
+                                    <p>{{item.square}}</p>
+                                </td>
+                                <td>
+                                    <p>{{item.unit_price}}</p>
+                                </td>
+                                <td>
+                                    <p>{{item.ext}}</p>
+                                </td>
+                                <td>
+                                    <p>{{item.price}}</p>
+                                </td>
+                                <td>
+                                    <p>{{item.remark}}</p>
+                                </td>
+                     </tr>
+                    </tbody>
+                   <tfoot>
+                <tr>
+                    <td class="amount-index" align="center">{{showTable.list.length + 1}}</td>
+                    <td colspan="11"></td>
+                    <td colspan="2">合计:</td>
+                    <td class="xt_total">{{showTable.foot.xt_total}}</td>
+                    <td></td>
+                </tr>
+
+                <tr>
+                    <td colspan="12" class="remark" style="padding-left: 20px;">{{showTable.foot.remark}}</td>
+                    <td colspan="2">返点:</td>
+                    <td class="return">{{showTable.foot.return}}</td>
+                    <td></td>
+                </tr>
+
+                <tr>
+                    <td colspan="12" class="remark1" style="padding-left: 20px;">{{showTable.foot.remark1}}</td>
+                    <td colspan="2">尾款:</td>
+                    <td class="end_price">{{showTable.foot.end_price}}</td>
+                    <td></td>
+                </tr>
+
+                <tr>
+                    <td colspan="16" style="padding-left: 20px;">
+                        <p class="amount_detail" style="height: 24px;">{{showTable.foot.amount_detail}}</p>
+                    </td>
+                </tr>
+
+                <tr>
+                    <td colspan="16" class="order_info" style="padding-left: 20px;">客户备注:<span
+                            class="customer_remark">{{showTable.foot.customer_remark}}</span>订货日期:<span class="crt_time">{{showTable.foot.crt_time}}</span>交货日期:<span
+                            class="end_time">{{showTable.foot.end_time}}</span>业务经理:<span class="saleman">{{showTable.foot.saleman}}</span>制单人:<span
+                            class="crt_id">{{showTable.foot.crt_id}}</span>审核:<span class="oa">{{showTable.foot.oa}}</span>客户确认:<span class="is_confirm">{{showTable.foot.is_confirm}}</span></td>
+                </tr>
+            </tfoot>
+              </table>
+        </div>
+        <div class="print-table" ref="print">
+           <table cellspacing="0" cellpadding="0" v-for="(item,index) in newArr" :key="index" class="print-cell">
+                <thead>
+                <tr>
+                    <td colspan="23" style="border: 0;">
+                        <div class="table-header">
+                            <img class="left-img" :src='showTable.logo' alt="">
+                            <h1 class="table-title">{{showTable.title}}</h1><img class="right-img1" :src='showTable.right_logo1' alt=""><img class="right-img2" :src='showTable.right_logo2' alt="">
+                        </div>
+                    </td>
+                </tr>
+                <tr>
+                    <td colspan="23">
+                        <p style="text-align: left;padding-left: 20px;"><span class="part_content"
+                                style="font-size:16px;margin-right:40px">{{showTable.part_content}}</span><span class="custom">{{showTable.custom}}</span></p>
+                    </td>
+                </tr>
+                <tr class="header">
+                    <td rowspan="2">
+                        <p>序号</p>
+                    </td>
+                    <td rowspan="2">
+                        <p style="width:80px ;">位置</p>
+                    </td>
+                    <td rowspan="2">
+                        <p style="width:80px ;">材质</p>
+                    </td>
+                    <td rowspan="2">
+                        <p style="width:80px ;">型号</p>
+                    </td>
+                    <td rowspan="2">
+                        <p style="width:80px ;">工艺</p>
+                    </td>
+                    <td rowspan="2">
+                        <p style="width:80px ;">木皮/颜色</p>
+                    </td>
+                    <td>
+                        <p>门洞尺寸(MM)</p>
+                    </td>
+                    <td>
+                        <p>门扇尺寸(MM)</p>
+                    </td>
+                    <td>
+                        <p>门套尺寸 (MM)</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>数量</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>单位</p>
+                    </td>
+                    <td>
+                        <p>平方</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>单价</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>附加</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>金额</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>备注</p>
+                    </td>
+                </tr>
+                <tr class="header">
+
+                    <td>
+                        <p>高*宽*厚度</p>
+                    </td>
+                    <td>
+                        <p>高*宽*厚度</p>
+                    </td>
+                    <td>
+                        <p>高*宽*厚度</p>
+                    </td>
+
+                    <td>
+                        <p>米</p>
+                    </td>
+                </tr>
+            </thead>
+                <tbody class="content" >
+                   <tr v-for="(_item,_index) in item" :key="_index">
+                                <td>
+                                    <p>{{_item.sort}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.postion}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.process}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.model}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.workmanship}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.color}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.measure1}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.measure2}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.measure3}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.num}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.unit}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.square}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.unit_price}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.ext}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.price}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.remark}}</p>
+                                </td>
+                     </tr>
+                    </tbody>
+                   <tfoot>
+                <tr>
+                    <td class="amount-index" align="center">{{showTable.list.length + 1}}</td>
+                    <td colspan="11"></td>
+                    <td colspan="2">合计:</td>
+                    <td class="xt_total">{{showTable.foot.xt_total}}</td>
+                    <td></td>
+                </tr>
+
+                <tr>
+                    <td colspan="12" class="remark" style="padding-left: 20px;">{{showTable.foot.remark}}</td>
+                    <td colspan="2">返点:</td>
+                    <td class="return">{{showTable.foot.return}}</td>
+                    <td></td>
+                </tr>
+
+                <tr>
+                    <td colspan="12" class="remark1" style="padding-left: 20px;">{{showTable.foot.remark1}}</td>
+                    <td colspan="2">尾款:</td>
+                    <td class="end_price">{{showTable.foot.end_price}}</td>
+                    <td></td>
+                </tr>
+
+                <tr>
+                    <td colspan="16" style="padding-left: 20px;">
+                        <p class="amount_detail" style="height: 24px;">{{showTable.foot.amount_detail}}</p>
+                    </td>
+                </tr>
+
+                <tr>
+                    <td colspan="16" class="order_info" style="padding-left: 20px;">客户备注:<span
+                            class="customer_remark">{{showTable.foot.customer_remark}}</span>订货日期:<span class="crt_time">{{showTable.foot.crt_time}}</span>交货日期:<span
+                            class="end_time">{{showTable.foot.end_time}}</span>业务经理:<span class="saleman">{{showTable.foot.saleman}}</span>制单人:<span
+                            class="crt_id">{{showTable.foot.crt_id}}</span>审核:<span class="oa">{{showTable.foot.oa}}</span>客户确认:<span class="is_confirm">{{showTable.foot.is_confirm}}</span></td>
+                </tr>
+            </tfoot>
+              </table>
+        </div>
+        </div>
+    </div>
+</template>
+<script>
+export default {
+    name:"printlist",
+    data(){
+        return {
+            showTableContentStr:[],
+            showTable:{
+                list:[],
+                foot:{}
+            },
+            newArr:''
+        }
+    },
+    computed:{
+    },
+    mounted(){
+        this.axios({
+            method:'get',
+            url:'/api/printe_order_detail',
+            params:{
+                order_no:this.$route.query.order_no
+            }
+        }).then(res=>{
+            this.showTableContentStr = res.msg.list
+            this.showTable = res.msg
+            this.newArr = this.chunk(this.showTableContentStr,15)
+        });
+    },
+    methods:{
+                //打印
+        PrintRow(index, row){
+            this.$print(this.$refs.print) // 使用
+        },
+        printTable() {
+            // let printData = document.getElementsByClassName('printcontent')[0].innerHTML;
+            // let all = document.body.innerHTML;
+            // document.body.innerHTML = printData
+            window.print();
+            // document.body.innerHTML = all;
+        },
+        chunk(array, size) {
+            //获取数组的长度,如果你传入的不是数组,那么获取到的就是undefined
+            const length = array.length
+            //判断不是数组,或者size没有设置,size小于1,就返回空数组
+            if (!length || !size || size < 1) {
+              return []
+            }
+            //核心部分
+            let index = 0 //用来表示切割元素的范围start
+            let resIndex = 0 //用来递增表示输出数组的下标
+          
+            //根据length和size算出输出数组的长度,并且创建它。
+            let result = new Array(Math.ceil(length / size))
+            //进行循环
+            while (index < length) {
+              //循环过程中设置result[0]和result[1]的值。该值根据array.slice切割得到。
+              result[resIndex++] = array.slice(index, (index += size))
+            }
+            //输出新数组
+            return result
+          }
+    }
+}
+</script>
+<style scoped>
+* {
+        margin: 0;
+        padding: 0;
+        font-size: 14px;
+    }
+.printcontent{
+    overflow-y: auto;
+    overflow-x: auto;
+}
+  button {
+        position: absolute;
+        right: 40px;
+        width: 60px;
+    }
+
+    h1 {
+        text-align: center;
+        font-size: 18px;
+        margin-bottom: 10px;
+        margin-top: 20px;
+    }
+
+    p {
+        text-align: center;
+    }
+
+    table {
+        width: 100%;
+        border-collapse: collapse;
+    }
+
+    td {
+        border: 1px solid #000;
+
+    }
+
+    .right-img1 {
+        position: absolute;
+        right: 0;
+        width: 150px;
+        margin-bottom: 10px;
+        height: 60px;
+        top: 0;
+    }
+
+    .right-img2 {
+        position: absolute;
+        width: 150px;
+        right: 180px;
+        margin-bottom: 10px;
+        height: 60px;
+        top: 0;
+    }
+
+    .table-header {
+        position: relative;
+        height: 76px;
+        line-height: 76px;
+    }
+
+    .left-img {
+        position: absolute;
+        left: 0;
+        width: 150px;
+        height: 60px;
+        top: 0;
+    }
+
+    .table-box {
+        padding: 0 20px;
+        width: 1000px;
+        margin: 0 auto;
+        margin-top: 40px;
+    }
+
+    .order_info span {
+        margin-right: 28px;
+    }
+
+    .pageSeparator {
+        visibility: hidden;
+        page-break-after: always;
+        overflow: hidden;
+        height: 0px;
+    }
+    .print-table{
+        display: none;
+    }
+    @media print {
+        button {
+            display: none;
+        }
+        .print-table{
+            display: block;
+            width: 100%;
+        }
+        .print-cell{
+            color: black;
+            margin:16mm 8mm;
+            width: 262mm;
+            height: auto;
+        }
+        #show-table{
+           display: none;
+           
+        }
+        @page {
+        }
+    }
+</style>

Some files were not shown because too many files changed in this diff