Browse Source

Finish Hotfix-zh-259

howie 3 years ago
parent
commit
f405bcd871

+ 47 - 115
src/views/finance/components/design/preview.vue

@@ -1,30 +1,38 @@
 <template>
-  <el-dialog :visible.sync="visible" :show-close="false" :maskClosable="false" :close-on-click-modal="false"
-    @cancel="hideModal" :width="350 + 'mm'">
+  <el-dialog
+    :visible.sync="visible"
+    :show-close="false"
+    :maskClosable="false"
+    :close-on-click-modal="false"
+    @cancel="hideModal"
+    :width="350 + 'mm'"
+  >
     <div :spinning="spinning" style="min-height: 100px">
-      <div id="preview_content" ref="printDom">
-              444444
-      </div>
+      <div id="preview_content" ref="printDom"></div>
     </div>
     <template slot="title">
       <div>
         <!-- <div style="margin-right: 20px">打印预览</div> -->
-        <el-button :loading="waitShowPrinter" type="primary" icon="printer" @click.stop="print">打印</el-button>
+        <el-button
+          :loading="waitShowPrinter"
+          type="primary"
+          icon="printer"
+          @click.stop="print"
+          >打印</el-button
+        >
         <!-- <el-button type="primary" icon="printer" @click.stop="toPdf">pdf</el-button> -->
       </div>
     </template>
     <template slot="footer">
-      <el-button key="close" type="info" @click="hideModal">
-        关闭
-      </el-button>
+      <el-button key="close" type="info" @click="hideModal"> 关闭 </el-button>
     </template>
   </el-dialog>
 </template>
 
 <script>
 // import { downloadPDF } from '@/utils/pdf'
-import { addPrint } from './print-data'
-import { detailArr } from './print-data'
+import { addPrint } from "./print-data";
+import { detailArr } from "./print-data";
 export default {
   name: "printPreview",
   props: {},
@@ -38,51 +46,55 @@ export default {
       // 模板
       hiprintTemplate: {},
       // 数据
-      printData: {}
-    }
+      printData: {},
+    };
   },
   computed: {},
   watch: {},
-  created() {
-  },
-  mounted() {
-  },
+  created() {},
+  mounted() {},
   methods: {
     // handleExport() {
     //   downloadPDF(this.$refs.printDom);
     // },
     hideModal() {
-      this.visible = false
-      this.waitShowPrinter = false
+      this.visible = false;
+      this.waitShowPrinter = false;
       // console.log(this.$parent);
     },
-    show(hiprintTemplate, printData, width = '210') {
-      this.visible = true
-      this.spinning = true
-      this.width = width
-      this.hiprintTemplate = hiprintTemplate
-      printData.addPrintHtml({ options: { width: 140, height: 35, top: 180, left: 20, content:this.$refs.printData } });
+    show(hiprintTemplate, printData, width = "210") {
+      this.visible = true;
+      this.width = width;
+      this.hiprintTemplate = hiprintTemplate;
+      printData.addPrintHtml({
+        options: {
+          width: 140,
+          height: 35,
+          top: 180,
+          left: 20,
+          content: this.$refs.printData,
+        },
+      });
 
       setTimeout(() => {
         // eslint-disable-next-line no-undef
-        $('#preview_content').html(hiprintTemplate.getHtml(printData))
-        this.spinning = false
-      }, 500)
+        $("#preview_content").html(hiprintTemplate.getHtml(printData));
+        this.spinning = false;
+      }, 500);
     },
     print() {
-     this.hiprintTemplate.print({});
+      this.hiprintTemplate.print({});
 
-      setTimeout(()=>{
-        this.hideModal()
-      },2000)
+      setTimeout(() => {
+        this.hideModal();
+      }, 2000);
     },
     // toPdf() {
     //   downloadPDF(this.$refs.printDom);
     //   this.hiprintTemplate.toPdf({}, '打印预览');
     // },
-  }
-}
-
+  },
+};
 </script>
 
 <style scoped>
@@ -90,7 +102,6 @@ export default {
   padding: 0;
 }
 
-
 ::v-deep tr {
   height: 40px !important;
 }
@@ -114,86 +125,7 @@ export default {
 
 .ant-modal-content {
   margin-bottom: 24px;
-
 }
 
-@media print {
-
-/*
-  td {
-    border: none !important;
-  } */
-
-  .drag_item_box {
-    height: 100%;
-    padding: 6px;
-  }
-
-  .drag_item_box>div {
-    height: 100%;
-    width: 100%;
-    background-color: #fff;
-    display: flex;
-    justify-content: center;
-    align-items: center;
-  }
-
-  .drag_item_box>div>a {
-    text-align: center;
-    text-decoration-line: none;
-  }
-
-  .drag_item_box>div>a>span {
-    font-size: 28px;
-  }
 
-  .drag_item_box>div>a>p {
-    margin: 0;
-  }
-
-  .drag_item_title {
-    font-size: 16px;
-    padding: 12px 6px 0 6px;
-    font-weight: bold;
-  }
-
-
-  .card-design {
-    overflow: hidden;
-    overflow-x: auto;
-    overflow-y: auto;
-  }
-
-  ::v-deep .el-dialog__body {
-    padding: 0;
-  }
-
-  ::v-deep table {
-    height: 240px !important;
-  }
-
-  ::v-deep tr {
-    height: 40px !important;
-  }
-
-  ::v-deep .hiprint-printPaper {
-    margin: 0 auto;
-  }
-
-  ::v-deep tr td {
-    border: 0 !important;
-    /* width: 911px !important;
-    height: 529px !important; */
-  }
-
-
-  .ant-modal-body {
-    padding: 0px;
-  }
-
-  .ant-modal-content {
-    margin-bottom: 24px;
-
-  }
-}
 </style>

+ 79 - 19
src/views/finance/receipt_list.vue

@@ -361,12 +361,12 @@
                   @click="seeFn(scope.row.id)"
                   >查看</el-button
                 >
-                <!-- <el-button
+                <el-button
                   type="text"
                   class="textColor"
                   @click="toPrint(scope.row, 2)"
                   >打印</el-button
-                > -->
+                >
               </template>
             </el-table-column>
           </el-table>
@@ -398,12 +398,9 @@
 </template>
 
 <script>
-import {
-  disAutoConnect,
-  hiprint,
-} from "vue-plugin-hiprint";
+import { disAutoConnect, hiprint } from "vue-plugin-hiprint";
 disAutoConnect();
-import printPreview from './components/design/preview.vue'
+import printPreview from "./components/design/preview.vue";
 import { getCustomerList } from "@/api/finance/wallet";
 import {
   getK3ReceiptList,
@@ -413,6 +410,7 @@ import ReceiptListDetail from "./components/receipt_list-detail";
 import ReceiptPrint from "@/views/finance/components/receipt_print.vue";
 
 import { numToFixed } from "@/filters";
+import ret from "bluebird/js/release/util";
 export default {
   components: {
     ReceiptPrint,
@@ -440,8 +438,8 @@ export default {
       detailId: null,
       queryItem: {},
       tableSelection: [],
-      panel:'',
-      hiprintTemplate:''
+      panel: "",
+      hiprintTemplate: "",
     };
   },
   computed: {
@@ -455,9 +453,7 @@ export default {
     this.getDataList({ pageSize: this.pageSize, pageNum: this.currentPage });
     this.getCustomerDataList();
   },
-  mounted() {
-
-  },
+  mounted() {},
   methods: {
     //获取经销商列表
     async getCustomerDataList() {
@@ -566,15 +562,26 @@ export default {
     toPrint(row, type) {
       hiprint.init();
       this.hiprintTemplate = new hiprint.PrintTemplate();
-       this.panel = this.hiprintTemplate.addPrintPanel({
-        width: 100,
-        height: 130,
+      this.panel = this.hiprintTemplate.addPrintPanel({
+        height: 140,
+        width: 241,
+        fontFamily: "黑体",
+        fontSize: 12.5,
         paperFooter: 340,
         paperHeader: 10,
         paperNumberDisabled: true,
       });
+      this.panel.addPrintHtml({
+        options: {
+          width: 633,
+          top: 30,
+          left: 20,
+          fontFamily: "黑体",
+          fontSize: 12.5,
+          content: this.setTableDom(),
+        },
+      });
 
-      //打印
       // this.tableSelection = this.$refs.table.selection;
       if (!type) {
         // getDetail(this.tableSelection);
@@ -582,9 +589,62 @@ export default {
         this.queryItem = row;
         // getDetail(row.id)
       }
-      this.$refs.preView.show(this.hiprintTemplate,this.panel)
-
-
+      this.$refs.preView.show(this.hiprintTemplate, this.panel);
+    },
+    // 收款单打印模板
+    setTableDom() {
+      return `
+       <div style="font-family:'黑体';">
+          <h1 style="text-align:center">弘格贸易有限公司其他收款单</h1>
+          <div >
+            <table border=".5" cellspacing="0" width="856" height="250"
+             style="border-color: rgb(0,0,0);
+              border-collapse: collapse;
+              border-style: none;
+              border: 1px solid rgb(0,0,0);
+              font-weight: normal;
+              direction: ltr;
+              padding-bottom: 0pt;
+              padding-left: 4pt;
+              padding-right: 4pt;
+              padding-top: 0pt;
+              text-decoration: none;
+              vertical-align: middle;
+              box-sizing: border-box;
+              word-wrap: break-word;
+              word-break: break-all;">
+                <tr>
+                  <td>单据编号</td>
+                  <td>January</td>
+                  <td>业务日期</td>
+                  <td>January</td>
+                  <td>打印日期</td>
+                  <td>January</td>
+                </tr>
+                <tr>
+                  <td>付款单位</td>
+                  <td colspan="3">January</td>
+                  <td>项目费用名称</td>
+                  <td>January</td>
+                </tr>
+                <tr>
+                  <td>钱包</td>
+                  <td>January</td>
+                  <td>实收金额</td>
+                  <td>January</td>
+                  <td colspan="2"></td>
+                </tr>
+                <tr>
+                  <td>备注</td>
+                  <td colspan="5">January</td>
+                </tr>
+            </table>
+          </div>
+          <div style="margin:100px 0 0 0">
+            <div>打印</div>
+          </div>
+       </div>
+      `;
     },
   },
 };

+ 1 - 1
src/views/supply/engin/commerce_list.vue

@@ -150,7 +150,7 @@
               </template>
             </el-table-column>
             <el-table-column align="left" label="工程编号" prop="refProjectNo" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="left" label="工程信息单号" prop="refEnginRecordNo" min-width="200" show-overflow-tooltip>
+            <el-table-column align="left" label="工程登录编号" prop="refEnginRecordNo" min-width="200" show-overflow-tooltip>
               <template slot-scope="scope">
                 <CopyButton :copyText="scope.row.refEnginRecordNo" />
                 <span>{{scope.row.refEnginRecordNo}}</span>

+ 1 - 1
src/views/supply/engin/components/commerce_detail.vue

@@ -13,7 +13,7 @@
         <div class="diy-table-1">
           <el-row>
             <el-col :span="8" class="item">
-              <div class="label">工程订单号</div>
+              <div class="label">工程登录编号</div>
               <div class="value">{{detailData.enginOrderNo}}</div>
             </el-col>
             <el-col :span="8" class="item">

+ 1 - 1
src/views/supply/engin/components/commerce_examine.vue

@@ -9,7 +9,7 @@
     <div class="diy-table-1">
       <el-row>
         <el-col :span="8" class="item">
-          <div class="label">工程订单号</div>
+          <div class="label">工程登录编号</div>
           <div class="value">{{detailData.enginOrderNo}}</div>
         </el-col>
         <el-col :span="8" class="item">

+ 1 - 1
src/views/supply/engin/components/commerce_form.vue

@@ -64,7 +64,7 @@
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
-          <el-form-item label="工程信息单号" prop="enginOrderNum">
+          <el-form-item label="工程登录编号" prop="enginOrderNum">
             <div style="display: flex;">
               <el-input v-model="mainForm.enginOrderNum" placeholder="请引用工程登录" disabled></el-input>
               <el-button style="margin-left: 10px;" @click="openShareDetail">引用</el-button>

+ 1 - 1
src/views/supply/engin/components/commerce_return.vue

@@ -9,7 +9,7 @@
     <div class="diy-table-1">
       <el-row>
         <el-col :span="8" class="item">
-          <div class="label">工程订单号</div>
+          <div class="label">工程登录编号</div>
           <div class="value">{{detailData.enginOrderNo}}</div>
         </el-col>
         <el-col :span="8" class="item">

+ 1 - 1
src/views/supply/engin/components/engin_detail.vue

@@ -9,7 +9,7 @@
     <div class="diy-table-1">
       <el-row>
         <el-col :span="8" class="item">
-          <div class="label">工程信息单号</div>
+          <div class="label">工程登录编号</div>
           <div class="value">{{detailData.enginInfoNo}}</div>
         </el-col>
         <el-col :span="8" class="item">

+ 1 - 1
src/views/supply/engin/components/engin_examine.vue

@@ -9,7 +9,7 @@
     <div class="diy-table-1">
       <el-row>
         <el-col :span="8" class="item">
-          <div class="label">工程信息单号</div>
+          <div class="label">工程登录编号</div>
           <div class="value">{{detailData.enginInfoNo}}</div>
         </el-col>
         <el-col :span="8" class="item">

+ 1 - 1
src/views/supply/engin/components/engin_form.vue

@@ -9,7 +9,7 @@
     <el-form ref="mainForm" :model="mainForm" :rules="mainFormRules" label-width="110px" size="small" label-position="right">
       <el-row :gutter="20">
         <el-col :xs="24" :sm="12" :lg="8">
-          <el-form-item label="工程信息单号" prop="orderNum">
+          <el-form-item label="工程登录编号" prop="orderNum">
             <el-input v-model="mainForm.orderNum" placeholder="系统自动生成" disabled></el-input>
           </el-form-item>
         </el-col>

+ 1 - 1
src/views/supply/engin/engin_list.vue

@@ -130,7 +130,7 @@
                 {{scope.row.examineStatus | statusFilter}}
               </template>
             </el-table-column>
-            <el-table-column align="left" label="工程信息单号" sortable prop="enginInfoNo" min-width="150" show-overflow-tooltip>
+            <el-table-column align="left" label="工程登录编号" sortable prop="enginInfoNo" min-width="150" show-overflow-tooltip>
               <template slot-scope="scope">
                 <CopyButton :copyText="scope.row.enginInfoNo" />
                 <span>{{scope.row.enginInfoNo}}</span>