Browse Source

pdf添加打印

asd26269546 1 year ago
parent
commit
d0f0a4820f

+ 5 - 2
src/views/salesMange/saleContract/contract/index.vue

@@ -575,6 +575,7 @@ const getDict = () => {
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
+  getTotal()
   proxy.post("/contract/page", sourceList.value.pagination).then((res) => {
     sourceList.value.data = res.rows;
     sourceList.value.pagination.total = res.total;
@@ -596,9 +597,11 @@ getDict();
 if (route.query.code) {
   sourceList.value.pagination.keyword = route.query.code;
 }
-getList();
+onMounted(() => {
+  getList()
+})
 const getTotal = () => {
-  proxy.get("/contract/getHeadCustomerStatistics").then((res) => {
+  proxy.get("/contract/getHeadCustomerStatistics",sourceList.value.pagination).then((res) => {
     statConfig.value[0].data = [];
     statConfig.value[0].data.push({
       label:'合计',

+ 12 - 1
src/views/salesMange/shipmentMange/document/index.vue

@@ -1196,8 +1196,9 @@
       <template #footer>
         <el-button @click="openPrint = false" size="large">取消</el-button>
         <el-button type="primary" @click="clickDownload()" size="large"
-          >下载PDF</el-button
+          >下载PDF </el-button
         >
+        <el-button v-print="printObj" size="large">打印</el-button>
       </template>
     </el-dialog>
 
@@ -2159,6 +2160,7 @@
         <el-button type="primary" @click="clickSave()" size="large"
           >保存</el-button
         >
+        <el-button v-print="printObj" size="large">打印</el-button>
       </template>
     </el-dialog>
 
@@ -2512,6 +2514,7 @@
         <el-button type="primary" @click="clickSave()" size="large"
           >保存</el-button
         >
+        <el-button v-print="pdfDomOne2" size="large">打印</el-button>
       </template>
     </el-dialog>
   </div>
@@ -3316,6 +3319,14 @@ const printObj = ref({
   extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
 });
 
+const pdfDomOne2 = ref({
+  id: "pdfDomOne",
+  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"/>',
+});
+
 const getChineseDate = (date) => {
   if (date) {
     const newDate = new Date(date);