Преглед изворни кода

请款,打款页面:增加浏览器打印

lxf пре 1 година
родитељ
комит
a34cbe488e

+ 11 - 2
src/views/finance/fundManage/accountPayment/index.vue

@@ -139,10 +139,13 @@
     </el-dialog>
 
     <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="840px">
-      <FundsPDF v-if="rowData.type != '20'" :rowData="rowData"></FundsPDF>
-      <PaymentPDF v-else :rowData="rowData"></PaymentPDF>
+      <div id="printMe">
+        <FundsPDF v-if="rowData.type != '20'" :rowData="rowData"></FundsPDF>
+        <PaymentPDF v-else :rowData="rowData"></PaymentPDF>
+      </div>
       <template #footer>
         <el-button @click="openPrint = false" size="large">取消</el-button>
+        <el-button v-print="printObj" size="large">打印</el-button>
         <el-button type="primary" @click="clickDownload()" size="large">下载PDF</el-button>
       </template>
     </el-dialog>
@@ -854,6 +857,12 @@ const clickDetail = () => {
   formOption.disabled = true;
   getDtl(rowData.value);
 };
+const printObj = ref({
+  id: "printMe",
+  popTitle: "",
+  extraCss: "https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css, https://cdn.bootcdn.net/ajax/libs/hover.css/2.3.1/css/hover-min.css",
+  extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
+});
 </script>
 
 <style lang="scss" scoped>

+ 11 - 2
src/views/finance/fundManage/funds/index.vue

@@ -33,9 +33,12 @@
     </div>
 
     <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="840px">
-      <FundsPDF :rowData="rowData"></FundsPDF>
+      <div id="printMe">
+        <FundsPDF :rowData="rowData"></FundsPDF>
+      </div>
       <template #footer>
         <el-button @click="openPrint = false" size="large">取消</el-button>
+        <el-button v-print="printObj" size="large">打印</el-button>
         <el-button type="primary" @click="clickDownload()" size="large">下载PDF</el-button>
       </template>
     </el-dialog>
@@ -547,7 +550,7 @@ const submitSearch = () => {
     return ElMessage("开始时间不能大于结束时间");
   }
   openSearch.value = false;
-  sourceList.value.pagination.keyword = '';
+  sourceList.value.pagination.keyword = "";
   sourceList.value.pagination.pageNum = 1;
   getList();
 };
@@ -564,6 +567,12 @@ const pushProcessApproval = (row) => {
   });
   return;
 };
+const printObj = ref({
+  id: "printMe",
+  popTitle: "",
+  extraCss: "https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css, https://cdn.bootcdn.net/ajax/libs/hover.css/2.3.1/css/hover-min.css",
+  extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
+});
 </script>
 
 <style lang="scss" scoped>