LiuTeng 1 tahun lalu
induk
melakukan
bef373cf94

+ 8 - 0
src/api/report.js

@@ -114,5 +114,13 @@ export function pzhd(data) {
   })
 }
 
+//pdf
+export function tjbgPdf(data) {
+  return request({
+    url: `/tax/pdf/tjbgPdf`,
+    method: 'post',
+    data
+  })
+}
 
 

+ 704 - 0
src/views/report/components/lookReport copy.vue

@@ -0,0 +1,704 @@
+<template>
+  <div class="brushCard">
+    <div class="control control-v">
+      <div class="button back" @click="back">
+        <img class="background" src="@/assets/report/control-bg.png" />
+        <div class="button-style">
+          <div class="icon">
+            <img src="@/assets/report/back.png" />
+          </div>
+          <div class="name">返回上层</div>
+        </div>
+      </div>
+      <div class="button home" @click="home">
+        <img class="background" src="@/assets/report/control-bg.png" />
+        <div class="button-style">
+          <div class="icon">
+            <img src="@/assets/report/home.png" />
+          </div>
+          <div class="name">返回首页</div>
+        </div>
+      </div>
+    </div>
+    <div class="pdf-box" ref="dyzsdpdf">
+      <div class="file">
+        <div class="imgUrl">
+          <img :src="imgUrl" />
+        </div>
+        <table class="table">
+          <tr class="thead">
+            <td colspan="6">企业体检报告</td>
+          </tr>
+          <tr>
+            <td class="table_title1">税务机关(章)</td>
+            <td colspan="3">{{ message.zgswjmc }}</td>
+            <td class="table_title">打印日期</td>
+            <td>{{ dateTime }}</td>
+          </tr>
+          <tr>
+            <td class="table_title1 title" rowspan="3">企业基本信息</td>
+            <td class="table_title table_title2">企业名称</td>
+            <td colspan="2">{{ message.nsrmc }}</td>
+            <td class="table_title table_title2">统一社会信用代码</td>
+            <td>{{ message.shxydm }}</td>
+          </tr>
+          <tr>
+            <td class="table_title table_title2">纳税人状态</td>
+            <td colspan="2">{{ message.nsrztmc }}</td>
+            <td class="table_title table_title2">注册日期</td>
+            <td>{{ message.djrq ? message.djrq.substring(0, 10) : "" }}</td>
+          </tr>
+          <tr>
+            <td class="table_title table_title2">注册地址</td>
+            <td colspan="2">{{ message.zcdz }}</td>
+            <td class="table_title table_title2">法人代表</td>
+            <td>{{ message.fddbrxm }}</td>
+          </tr>
+          <tr>
+            <td
+              class="table_title1 title"
+              :rowspan="rankList.length > 0 ? 3 + rankList.length : 4"
+            >
+              纳税信用等级信息(如果本年度尚未评出,则显示最近年度评价结果)
+            </td>
+            <td class="table_title table_title2">级别</td>
+            <td colspan="2">{{ rank.pjjb }}</td>
+            <td class="table_title table_title2">分值</td>
+            <td>{{ rank.pjfs }}</td>
+          </tr>
+          <tr>
+            <td colspan="5">主要扣分明细</td>
+          </tr>
+          <tr>
+            <td class="table_title table_title2">指标代码</td>
+            <td class="table_title2" colspan="3">指标名称</td>
+            <td class="table_title2">评价扣分</td>
+          </tr>
+          <tr v-if="rankList.length == 0">
+            <td colspan="5">未查询到相关信息</td>
+          </tr>
+          <tr v-else v-for="(item, index) in rankList" :key="index">
+            <td class="table_title">{{ item.zb.zbdm }}</td>
+            <td colspan="3">{{ item.zb.zbmc }}</td>
+            <td>{{ item.zb.zbpjfs }}</td>
+          </tr>
+          <tr>
+            <td
+              class="table_title1 title"
+              :rowspan="record.length > 0 ? 1 + record.length : 2"
+            >
+              申报纳税信息
+            </td>
+            <td class="table_title table_title2">税款名称</td>
+            <td class="table_title2" colspan="2">申报税额(元)</td>
+            <td class="table_title table_title2">入库税额(元)</td>
+            <td class="table_title2">所属年度</td>
+          </tr>
+          <tr v-if="record.length == 0">
+            <td colspan="5">未查到相关数据信息</td>
+          </tr>
+          <tr v-else v-for="(item, index) in record" :key="'A' + index">
+            <td class="table_title">{{ item.zsxmmc }}</td>
+            <td colspan="2">{{ item.sjje }}</td>
+            <td class="table_title">{{ item.sjje }}</td>
+            <td>{{ item.date }}年度</td>
+          </tr>
+          <tr>
+            <td
+              class="table_title1 title"
+              :rowspan="TaxList.length > 0 ? 1 + TaxList.length : 2"
+            >
+              欠税信息
+            </td>
+            <td class="table_title table_title2">类型</td>
+            <td class="table_title2" colspan="3">税款所属起止</td>
+            <td class="table_title2">税额</td>
+          </tr>
+          <tr v-if="TaxList.length == 0">
+            <td colspan="5">未查到相关数据信息</td>
+          </tr>
+          <tr v-else v-for="(item, index) in TaxList" :key="'B' + index">
+            <td class="table_title">{{ item.zsxmMc }}</td>
+            <td colspan="3">{{ item.skssqq }}到{{ item.skssqz }}</td>
+            <td>{{ item.ybtse }}</td>
+          </tr>
+          <tr>
+            <td
+              class="table_title1 title"
+              :rowspan="wfwzList.length > 0 ? 1 + wfwzList.length : 2"
+            >
+              违法违章信息
+            </td>
+            <td class="table_title table_title2">类型</td>
+            <td class="table_title2" colspan="3">内容</td>
+            <td class="table_title2">处理状态</td>
+          </tr>
+          <tr v-if="wfwzList.length == 0">
+            <td colspan="5">未查到相关数据信息</td>
+          </tr>
+          <tr v-else v-for="(item, index) in wfwzList" :key="'C' + index">
+            <td class="table_title">{{ item.wfxwmc }}</td>
+            <td colspan="3">{{ item.wfss }}</td>
+            <td>{{ item.wfxwclztmc }}</td>
+          </tr>
+        </table>
+        <table
+          class="table table1"
+          v-for="(item, index) in pzhd"
+          :key="'H' + index"
+        >
+          <tr>
+            <td class="table_title1 title" rowspan="4">票种核定部分</td>
+            <td class="table_title2">发票类别</td>
+            <td colspan="4" class="table_title2">发票种类名称</td>
+          </tr>
+          <tr>
+            <td>{{ item.fplbmc }}</td>
+            <td colspan="4">{{ item.fpzlmc }}</td>
+          </tr>
+          <tr>
+            <td class="table_title2">每月最高购票数量</td>
+            <td class="table_title2">单张发票开票限</td>
+            <td class="table_title2">开票限额</td>
+            <td class="table_title2">有效期起</td>
+            <td class="table_title2">有效期止</td>
+          </tr>
+          <tr>
+            <td>{{ item.myzggpsl }}</td>
+            <td>{{ item.dffpzgkpxe }}</td>
+            <td>{{ kpxe(item.yzgkpxe) }}</td>
+            <td>{{ item.yxqq }}</td>
+            <td>{{ item.yxqz }}</td>
+          </tr>
+        </table>
+        <table class="table table1">
+          <tr>
+            <td
+              class="table_title1 title"
+              :rowspan="dbsxList.length > 0 ? 1 + dbsxList.length : 2"
+            >
+              待办事项
+            </td>
+            <td class="table_title2">征税项目名称</td>
+            <td class="table_title2">征税品目名称</td>
+            <td class="table_title2 title1">税款申报起止</td>
+            <td class="table_title2">纳税申报名称</td>
+            <td class="table_title2">申报期限</td>
+          </tr>
+          <tr v-if="!dbsxList || dbsxList.length == 0">
+            <td colspan="5">未查到相关数据信息</td>
+          </tr>
+          <tr v-else v-for="(item, index) in dbsxList" :key="'D' + index">
+            <td>{{ item.ZSXMMC }}</td>
+            <td>{{ item.ZSPMMC }}</td>
+            <td>{{ item.SKSSQQ }} 至 {{ item.SKSSQQ }}</td>
+            <td>{{ item.NSQXMC }}</td>
+            <td>{{ item.SBQX }}</td>
+          </tr>
+          <tr>
+            <td
+              class="table_title1 title"
+              :rowspan="fxtxList.length > 0 ? 1 + fxtxList.length : 2"
+            >
+              风险提醒
+            </td>
+            <td class="table_title2">征税项目名称</td>
+            <td class="table_title2">征税品目名称</td>
+            <td class="table_title2 title1">税款申报起止</td>
+            <td class="table_title2">纳税申报名称</td>
+            <td class="table_title2">申报期限</td>
+          </tr>
+          <tr v-if="!fxtxList || fxtxList.length == 0">
+            <td colspan="5">未查到相关数据信息</td>
+          </tr>
+          <tr v-else v-for="(item, index) in fxtxList" :key="'E' + index">
+            <td>{{ item.ZSXMMC }}</td>
+            <td>{{ item.ZSPMMC }}</td>
+            <td>{{ item.SKSSQQ }} 至 {{ item.SKSSQQ }}</td>
+            <td>{{ item.NSQXMC }}</td>
+            <td>{{ item.SBQX }}</td>
+          </tr>
+        </table>
+        <div class="info">
+          相关数据仅供参考,若有疑问请到税务窗口或登录电子税务进一步查询确认
+        </div>
+      </div>
+    </div>
+    <div class="control control-h">
+      <div class="button back" @click="back">
+        <img class="background" src="@/assets/report/control-bg.png" />
+        <div class="button-style">
+          <div class="icon">
+            <img src="@/assets/report/back.png" />
+          </div>
+          <div class="name">返回上层</div>
+        </div>
+      </div>
+      <div class="button home" @click="home">
+        <img class="background" src="@/assets/report/control-bg.png" />
+        <div class="button-style">
+          <div class="icon">
+            <img src="@/assets/report/home.png" />
+          </div>
+          <div class="name">返回首页</div>
+        </div>
+      </div>
+    </div>
+    <transition name="msgbox">
+      <div class="msgbox" v-if="showPrint">
+        <div class="msgbox-content">
+          <div class="close">
+            <div @click="showPrint = false">
+              <img src="@/assets/report/close.png" />
+            </div>
+          </div>
+          <div class="content">打印企业体检报告?</div>
+          <div class="button" @click="surePrint">确定</div>
+        </div>
+      </div>
+    </transition>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "ZhtLookReport",
+
+  data() {
+    return {
+      timer: null,
+      showPrint: false,
+      message: {},
+      dateTime: {},
+      rank: {},
+      rankList: [],
+      record: [],
+      TaxList: [],
+      wfwzList: [],
+      dbsxList: [],
+      fxtxList: [],
+      pzhd: [],
+      imgUrl: "",
+    };
+  },
+
+  created() {
+    this.$emit("update:indexClass", "center-other");
+  },
+
+  mounted() {
+    this.$emit("update:timerTime", 30);
+    this.getDatetime();
+    this.getInfo();
+    this.timer = setTimeout(() => {
+      this.showPrint = true;
+    }, 5000);
+  },
+
+  methods: {
+    getInfo() {
+      let message = JSON.parse(sessionStorage.getItem("MESSAGE"));
+      if (message) {
+        this.message = message;
+      }
+      let rank = JSON.parse(sessionStorage.getItem("RANK"));
+      if (rank) {
+        this.rank = rank;
+      }
+      let rankList = JSON.parse(sessionStorage.getItem("RANKLIST"));
+      if (rankList) {
+        this.rankList = rankList;
+      }
+      let record = JSON.parse(sessionStorage.getItem("RECORD"));
+      if (record) {
+        this.record = record;
+      }
+      let TaxList = JSON.parse(sessionStorage.getItem("TAXLIST"));
+      if (TaxList) {
+        this.TaxList = TaxList;
+      }
+      let wfwzList = JSON.parse(sessionStorage.getItem("WFWZLIST"));
+      if (wfwzList) {
+        this.wfwzList = wfwzList;
+      }
+      let dbsxList = JSON.parse(sessionStorage.getItem("DBSXLIST"));
+      if (dbsxList) {
+        this.dbsxList = dbsxList;
+      }
+      let fxtxList = JSON.parse(sessionStorage.getItem("FXTXLIST"));
+      if (fxtxList) {
+        this.fxtxList = fxtxList;
+      }
+      let imgUrl = sessionStorage.getItem("IMGURL");
+      if (imgUrl) {
+        this.imgUrl = imgUrl;
+      }
+      let pzhd = sessionStorage.getItem("PZHDXX");
+      if (pzhd) {
+        this.pzhd = JSON.parse(pzhd);
+      }
+    },
+    getDatetime() {
+      let date = new Date();
+      let y = date.getFullYear();
+      let m =
+        date.getMonth() + 1 < 10
+          ? "0" + (date.getMonth() + 1)
+          : date.getMonth() + 1;
+      let d = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
+      this.dateTime = y + "-" + m + "-" + d;
+    },
+
+    kpxe(e) {
+      if (e) {
+        let fm = e.split("E+");
+        let res = "";
+        if (fm.length == 1) {
+          res = e;
+        } else {
+          res = Number(fm[0]) * Math.pow(10, Number(fm[1]));
+        }
+        return res
+      } else {
+        return "";
+      }
+    },
+    surePrint() {
+      this.showPrint = false;
+      this.print();
+    },
+    print() {
+      let iframe = document.createElement("iframe");
+      iframe.src = "/reportPdf";
+      iframe.style.display = "none";
+      this.$refs.dyzsdpdf.appendChild(iframe);
+      iframe.contentWindow.print();
+      setTimeout(() => {
+        this.$refs.dyzsdpdf.removeChild(iframe);
+      }, 5000);
+    },
+    back() {
+      this.$emit("update:timerTime", 60);
+      this.$emit("update:nowPage", {
+        page: "selectDate",
+        timestamp: Date.now(),
+      });
+      sessionStorage.removeItem("RECORD");
+      sessionStorage.removeItem("FXTXLIST");
+      sessionStorage.removeItem("DBSXLIST");
+      sessionStorage.removeItem("RANK");
+      sessionStorage.removeItem("RANKLIST");
+      sessionStorage.removeItem("WFWZLIST");
+      sessionStorage.removeItem("IMGURL");
+      sessionStorage.removeItem("MESSAGE");
+    },
+    home() {
+      this.$emit("update:timerTime", -1);
+      this.$emit("update:nowPage", {
+        page: "index",
+        timestamp: Date.now(),
+      });
+    },
+  },
+  beforeDestroy() {
+    clearTimeout(this.timer);
+    this.timer = null;
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.brushCard {
+  width: 100%;
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+  justify-content: space-between;
+
+  .control {
+    padding-top: 60px;
+    width: 100%;
+    height: 130px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+
+    .button {
+      position: relative;
+      width: 361px;
+      height: 100%;
+      cursor: pointer;
+
+      .background {
+        position: absolute;
+        top: 0;
+        left: 0;
+        z-index: -1;
+        width: 100%;
+      }
+
+      .button-style {
+        padding: 0 50px;
+        width: 100;
+        height: 100%;
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        box-sizing: border-box;
+
+        .icon {
+          width: 53px;
+          height: 100%;
+          display: flex;
+          align-items: center;
+
+          img {
+            width: 100%;
+          }
+        }
+
+        .name {
+          font-size: 47px;
+          color: #1e6ceb;
+        }
+      }
+    }
+
+    .button:active {
+      opacity: 0.6;
+    }
+
+    .back {
+      margin-right: 30px;
+    }
+  }
+  @tableTitleSize: 12px;
+  .pdf-box {
+    margin: auto;
+    overflow-x: hidden;
+    overflow-y: auto;
+    border-radius: 10px;
+    background: #ffffff;
+
+    .file {
+      position: relative;
+      width: 21cm;
+      height: auto;
+      margin: auto;
+      background: #fff;
+      padding: 50px 37px 37px;
+      box-sizing: border-box;
+      overflow-x: hidden;
+      overflow-y: auto;
+      border-radius: 10px;
+      box-sizing: border-box;
+
+      .imgUrl {
+        width: 130px;
+        height: 130px;
+        position: absolute;
+        top: 40px;
+        left: 90px;
+        z-index: 9;
+
+        img {
+          width: 100%;
+          height: 100%;
+        }
+      }
+
+      table,
+      th,
+      td {
+        border: 1px solid #515151;
+        border-collapse: collapse;
+      }
+
+      .table {
+        width: 100%;
+
+        .thead {
+          td {
+            height: 45px;
+            font-size: 22px;
+            text-align: center;
+            color: #111111;
+            font-family: "苹方简M";
+          }
+        }
+        tr {
+          td {
+            height: 30px;
+            font-size: @tableTitleSize;
+            text-align: center;
+            color: #111111;
+          }
+
+          .table_title1 {
+            padding: 0 5px;
+            width: 95px;
+          }
+
+          .table_title {
+            width: 105px;
+          }
+
+          .table_title2 {
+            font-family: "苹方简M";
+          }
+
+          .title {
+            color: #515151;
+          }
+
+          .title1 {
+            width: 150px;
+          }
+        }
+      }
+
+      .table1 {
+        margin-top: -1px;
+        border-top: 0px solid transparent;
+      }
+
+      .info {
+        height: 30px;
+        line-height: 30px;
+        font-size: @tableTitleSize;
+      }
+    }
+  }
+
+  .pdf-box::-webkit-scrollbar {
+    width: 4px;
+  }
+  .pdf-box::-webkit-scrollbar-thumb {
+    border-radius: 10px;
+    background: rgba(0, 0, 0, 0.2);
+  }
+  .pdf-box::-webkit-scrollbar-track {
+    border-radius: 0;
+    background: rgba(0, 0, 0, 0.1);
+  }
+
+  .msgbox {
+    position: fixed;
+    top: 0;
+    left: 0;
+    z-index: 999;
+    width: 100%;
+    height: 100%;
+    background: rgba(0, 0, 0, 0.3);
+
+    .msgbox-content {
+      position: fixed;
+      top: calc(50% - 250px);
+      left: calc(50% - 400px);
+      width: 800px;
+      height: 500px;
+      border-radius: 50px;
+      background: #fff;
+
+      .close {
+        margin-top: 40px;
+        padding: 0 40px;
+        width: 100%;
+        height: 80px;
+        display: flex;
+        justify-content: flex-end;
+        box-sizing: border-box;
+
+        div {
+          width: 80px;
+          height: 80px;
+          cursor: pointer;
+
+          img {
+            width: 100%;
+            height: 100%;
+          }
+        }
+        div:active {
+          opacity: 0.7;
+        }
+      }
+
+      .content {
+        margin-top: 80px;
+        width: 100%;
+        height: auto;
+        font-size: 50px;
+        font-family: "苹方简M";
+        color: #333333;
+        text-align: center;
+        letter-spacing: 10px;
+      }
+
+      .button {
+        margin: auto;
+        margin-top: 60px;
+        height: 80px;
+        width: 200px;
+        font-size: 45px;
+        line-height: 80px;
+        text-align: center;
+        color: #ffffff;
+        border-radius: 80px;
+        background: #3391df;
+        cursor: pointer;
+      }
+      .button:active {
+        opacity: 0.7;
+      }
+    }
+  }
+
+  .msgbox-enter-active,
+  .msgbox-leave-active {
+    transition: opacity 0.5s;
+  }
+  .msgbox-enter,
+  .msgbox-leave-to {
+    opacity: 0;
+  }
+}
+// 横屏
+@media screen and (orientation: landscape) {
+  .brushCard {
+    .control-v {
+      display: none !important;
+    }
+
+    .control-h {
+      padding-top: 30px;
+      transform: scale(0.8);
+    }
+
+    .pdf-box {
+      margin-top: 40px;
+      width: 1140px;
+      height: 0;
+      flex: 1;
+    }
+  }
+}
+// 竖屏
+@media screen and (orientation: portrait) {
+  .brushCard {
+    .control-h {
+      display: none !important;
+    }
+
+    .control-v {
+      padding-top: 60px;
+    }
+
+    .pdf-box {
+      margin-top: 20px;
+      width: calc(100% - 80px);
+      height: calc(100% - 260px);
+    }
+  }
+}
+</style>

+ 36 - 387
src/views/report/components/lookReport.vue

@@ -21,208 +21,12 @@
       </div>
     </div>
     <div class="pdf-box" ref="dyzsdpdf">
-      <div class="file">
-        <div class="imgUrl">
-          <img :src="imgUrl" />
-        </div>
-        <table class="table">
-          <tr class="thead">
-            <td colspan="6">企业体检报告</td>
-          </tr>
-          <tr>
-            <td class="table_title1">税务机关(章)</td>
-            <td colspan="3">{{ message.zgswjmc }}</td>
-            <td class="table_title">打印日期</td>
-            <td>{{ dateTime }}</td>
-          </tr>
-          <tr>
-            <td class="table_title1 title" rowspan="3">企业基本信息</td>
-            <td class="table_title table_title2">企业名称</td>
-            <td colspan="2">{{ message.nsrmc }}</td>
-            <td class="table_title table_title2">统一社会信用代码</td>
-            <td>{{ message.shxydm }}</td>
-          </tr>
-          <tr>
-            <td class="table_title table_title2">纳税人状态</td>
-            <td colspan="2">{{ message.nsrztmc }}</td>
-            <td class="table_title table_title2">注册日期</td>
-            <td>{{ message.djrq ? message.djrq.substring(0, 10) : "" }}</td>
-          </tr>
-          <tr>
-            <td class="table_title table_title2">注册地址</td>
-            <td colspan="2">{{ message.zcdz }}</td>
-            <td class="table_title table_title2">法人代表</td>
-            <td>{{ message.fddbrxm }}</td>
-          </tr>
-          <tr>
-            <td
-              class="table_title1 title"
-              :rowspan="rankList.length > 0 ? 3 + rankList.length : 4"
-            >
-              纳税信用等级信息(如果本年度尚未评出,则显示最近年度评价结果)
-            </td>
-            <td class="table_title table_title2">级别</td>
-            <td colspan="2">{{ rank.pjjb }}</td>
-            <td class="table_title table_title2">分值</td>
-            <td>{{ rank.pjfs }}</td>
-          </tr>
-          <tr>
-            <td colspan="5">主要扣分明细</td>
-          </tr>
-          <tr>
-            <td class="table_title table_title2">指标代码</td>
-            <td class="table_title2" colspan="3">指标名称</td>
-            <td class="table_title2">评价扣分</td>
-          </tr>
-          <tr v-if="rankList.length == 0">
-            <td colspan="5">未查询到相关信息</td>
-          </tr>
-          <tr v-else v-for="(item, index) in rankList" :key="index">
-            <td class="table_title">{{ item.zb.zbdm }}</td>
-            <td colspan="3">{{ item.zb.zbmc }}</td>
-            <td>{{ item.zb.zbpjfs }}</td>
-          </tr>
-          <tr>
-            <td
-              class="table_title1 title"
-              :rowspan="record.length > 0 ? 1 + record.length : 2"
-            >
-              申报纳税信息
-            </td>
-            <td class="table_title table_title2">税款名称</td>
-            <td class="table_title2" colspan="2">申报税额(元)</td>
-            <td class="table_title table_title2">入库税额(元)</td>
-            <td class="table_title2">所属年度</td>
-          </tr>
-          <tr v-if="record.length == 0">
-            <td colspan="5">未查到相关数据信息</td>
-          </tr>
-          <tr v-else v-for="(item, index) in record" :key="'A' + index">
-            <td class="table_title">{{ item.zsxmmc }}</td>
-            <td colspan="2">{{ item.sjje }}</td>
-            <td class="table_title">{{ item.sjje }}</td>
-            <td>{{ item.date }}年度</td>
-          </tr>
-          <tr>
-            <td
-              class="table_title1 title"
-              :rowspan="TaxList.length > 0 ? 1 + TaxList.length : 2"
-            >
-              欠税信息
-            </td>
-            <td class="table_title table_title2">类型</td>
-            <td class="table_title2" colspan="3">税款所属起止</td>
-            <td class="table_title2">税额</td>
-          </tr>
-          <tr v-if="TaxList.length == 0">
-            <td colspan="5">未查到相关数据信息</td>
-          </tr>
-          <tr v-else v-for="(item, index) in TaxList" :key="'B' + index">
-            <td class="table_title">{{ item.zsxmMc }}</td>
-            <td colspan="3">{{ item.skssqq }}到{{ item.skssqz }}</td>
-            <td>{{ item.ybtse }}</td>
-          </tr>
-          <tr>
-            <td
-              class="table_title1 title"
-              :rowspan="wfwzList.length > 0 ? 1 + wfwzList.length : 2"
-            >
-              违法违章信息
-            </td>
-            <td class="table_title table_title2">类型</td>
-            <td class="table_title2" colspan="3">内容</td>
-            <td class="table_title2">处理状态</td>
-          </tr>
-          <tr v-if="wfwzList.length == 0">
-            <td colspan="5">未查到相关数据信息</td>
-          </tr>
-          <tr v-else v-for="(item, index) in wfwzList" :key="'C' + index">
-            <td class="table_title">{{ item.wfxwmc }}</td>
-            <td colspan="3">{{ item.wfss }}</td>
-            <td>{{ item.wfxwclztmc }}</td>
-          </tr>
-        </table>
-        <table
-          class="table table1"
-          v-for="(item, index) in pzhd"
-          :key="'H' + index"
-        >
-          <tr>
-            <td class="table_title1 title" rowspan="4">票种核定部分</td>
-            <td class="table_title2">发票类别</td>
-            <td colspan="4" class="table_title2">发票种类名称</td>
-          </tr>
-          <tr>
-            <td>{{ item.fplbmc }}</td>
-            <td colspan="4">{{ item.fpzlmc }}</td>
-          </tr>
-          <tr>
-            <td class="table_title2">每月最高购票数量</td>
-            <td class="table_title2">单张发票开票限</td>
-            <td class="table_title2">开票限额</td>
-            <td class="table_title2">有效期起</td>
-            <td class="table_title2">有效期止</td>
-          </tr>
-          <tr>
-            <td>{{ item.myzggpsl }}</td>
-            <td>{{ item.dffpzgkpxe }}</td>
-            <td>{{ kpxe(item.yzgkpxe) }}</td>
-            <td>{{ item.yxqq }}</td>
-            <td>{{ item.yxqz }}</td>
-          </tr>
-        </table>
-        <table class="table table1">
-          <tr>
-            <td
-              class="table_title1 title"
-              :rowspan="dbsxList.length > 0 ? 1 + dbsxList.length : 2"
-            >
-              待办事项
-            </td>
-            <td class="table_title2">征税项目名称</td>
-            <td class="table_title2">征税品目名称</td>
-            <td class="table_title2 title1">税款申报起止</td>
-            <td class="table_title2">纳税申报名称</td>
-            <td class="table_title2">申报期限</td>
-          </tr>
-          <tr v-if="!dbsxList || dbsxList.length == 0">
-            <td colspan="5">未查到相关数据信息</td>
-          </tr>
-          <tr v-else v-for="(item, index) in dbsxList" :key="'D' + index">
-            <td>{{ item.ZSXMMC }}</td>
-            <td>{{ item.ZSPMMC }}</td>
-            <td>{{ item.SKSSQQ }} 至 {{ item.SKSSQQ }}</td>
-            <td>{{ item.NSQXMC }}</td>
-            <td>{{ item.SBQX }}</td>
-          </tr>
-          <tr>
-            <td
-              class="table_title1 title"
-              :rowspan="fxtxList.length > 0 ? 1 + fxtxList.length : 2"
-            >
-              风险提醒
-            </td>
-            <td class="table_title2">征税项目名称</td>
-            <td class="table_title2">征税品目名称</td>
-            <td class="table_title2 title1">税款申报起止</td>
-            <td class="table_title2">纳税申报名称</td>
-            <td class="table_title2">申报期限</td>
-          </tr>
-          <tr v-if="!fxtxList || fxtxList.length == 0">
-            <td colspan="5">未查到相关数据信息</td>
-          </tr>
-          <tr v-else v-for="(item, index) in fxtxList" :key="'E' + index">
-            <td>{{ item.ZSXMMC }}</td>
-            <td>{{ item.ZSPMMC }}</td>
-            <td>{{ item.SKSSQQ }} 至 {{ item.SKSSQQ }}</td>
-            <td>{{ item.NSQXMC }}</td>
-            <td>{{ item.SBQX }}</td>
-          </tr>
-        </table>
-        <div class="info">
-          相关数据仅供参考,若有疑问请到税务窗口或登录电子税务进一步查询确认
-        </div>
-      </div>
+      <iframe
+        :src="
+          pdfSrc.length > 0 ? 'data:application/pdf;base64,' + pdfSrc : pdfSrc
+        "
+        frameborder="0"
+      ></iframe>
     </div>
     <div class="control control-h">
       <div class="button back" @click="back">
@@ -252,7 +56,7 @@
               <img src="@/assets/report/close.png" />
             </div>
           </div>
-          <div class="content">打印企业体检报告?</div>
+          <div class="content">{{ boxContent }}</div>
           <div class="button" @click="surePrint">确定</div>
         </div>
       </div>
@@ -261,24 +65,21 @@
 </template>
 
 <script>
+import { GetMac } from "@/api/report";
 export default {
   name: "ZhtLookReport",
 
+  props: {
+    pdfSrc: {
+      default: "",
+      boxContent: "",
+    },
+  },
+
   data() {
     return {
       timer: null,
       showPrint: false,
-      message: {},
-      dateTime: {},
-      rank: {},
-      rankList: [],
-      record: [],
-      TaxList: [],
-      wfwzList: [],
-      dbsxList: [],
-      fxtxList: [],
-      pzhd: [],
-      imgUrl: "",
     };
   },
 
@@ -288,94 +89,34 @@ export default {
 
   mounted() {
     this.$emit("update:timerTime", 30);
-    this.getDatetime();
-    this.getInfo();
     this.timer = setTimeout(() => {
+      this.boxContent = "打印企业体检报告?";
       this.showPrint = true;
     }, 5000);
   },
 
   methods: {
-    getInfo() {
-      let message = JSON.parse(sessionStorage.getItem("MESSAGE"));
-      if (message) {
-        this.message = message;
-      }
-      let rank = JSON.parse(sessionStorage.getItem("RANK"));
-      if (rank) {
-        this.rank = rank;
-      }
-      let rankList = JSON.parse(sessionStorage.getItem("RANKLIST"));
-      if (rankList) {
-        this.rankList = rankList;
-      }
-      let record = JSON.parse(sessionStorage.getItem("RECORD"));
-      if (record) {
-        this.record = record;
-      }
-      let TaxList = JSON.parse(sessionStorage.getItem("TAXLIST"));
-      if (TaxList) {
-        this.TaxList = TaxList;
-      }
-      let wfwzList = JSON.parse(sessionStorage.getItem("WFWZLIST"));
-      if (wfwzList) {
-        this.wfwzList = wfwzList;
-      }
-      let dbsxList = JSON.parse(sessionStorage.getItem("DBSXLIST"));
-      if (dbsxList) {
-        this.dbsxList = dbsxList;
-      }
-      let fxtxList = JSON.parse(sessionStorage.getItem("FXTXLIST"));
-      if (fxtxList) {
-        this.fxtxList = fxtxList;
-      }
-      let imgUrl = sessionStorage.getItem("IMGURL");
-      if (imgUrl) {
-        this.imgUrl = imgUrl;
-      }
-      let pzhd = sessionStorage.getItem("PZHDXX");
-      if (pzhd) {
-        this.pzhd = JSON.parse(pzhd);
-      }
-    },
-    getDatetime() {
-      let date = new Date();
-      let y = date.getFullYear();
-      let m =
-        date.getMonth() + 1 < 10
-          ? "0" + (date.getMonth() + 1)
-          : date.getMonth() + 1;
-      let d = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
-      this.dateTime = y + "-" + m + "-" + d;
-    },
-
-    kpxe(e) {
-      if (e) {
-        let fm = e.split("E+");
-        let res = "";
-        if (fm.length == 1) {
-          res = e;
-        } else {
-          res = Number(fm[0]) * Math.pow(10, Number(fm[1]));
-        }
-        return res
-      } else {
-        return "";
-      }
-    },
     surePrint() {
-      this.showPrint = false;
+      this.boxContent = "正在启动打印机,请耐心等待(大概需要5-10s)";
       this.print();
+      setTimeout(() => {
+        this.showPrint = false;
+      }, 5 * 1000);
     },
     print() {
-      let iframe = document.createElement("iframe");
-      iframe.src = "/reportPdf";
-      iframe.style.display = "none";
-      this.$refs.dyzsdpdf.appendChild(iframe);
-      iframe.contentWindow.print();
-      setTimeout(() => {
-        this.$refs.dyzsdpdf.removeChild(iframe);
-      }, 5000);
+      let form = {};
+      form.namespace = "ServiceApp.service";
+      form.serviceId = "FileService";
+      form.funcId = "PrintFile";
+      form.xlh = "123456789987654321";
+      var data = { fileType: "pdf", datatype: "base64", base64: this.pdfSrc };
+      form.data = data;
+      GetMac(JSON.stringify(form)).then((res) => {
+        if (res.code == "000") {
+        } else {
+          this.$tip("打印失败,请联系现场管理人员", "error");
+        }
+      });
     },
     back() {
       this.$emit("update:timerTime", 60);
@@ -383,14 +124,6 @@ export default {
         page: "selectDate",
         timestamp: Date.now(),
       });
-      sessionStorage.removeItem("RECORD");
-      sessionStorage.removeItem("FXTXLIST");
-      sessionStorage.removeItem("DBSXLIST");
-      sessionStorage.removeItem("RANK");
-      sessionStorage.removeItem("RANKLIST");
-      sessionStorage.removeItem("WFWZLIST");
-      sessionStorage.removeItem("IMGURL");
-      sessionStorage.removeItem("MESSAGE");
     },
     home() {
       this.$emit("update:timerTime", -1);
@@ -480,93 +213,9 @@ export default {
     border-radius: 10px;
     background: #ffffff;
 
-    .file {
-      position: relative;
-      width: 21cm;
-      height: auto;
-      margin: auto;
-      background: #fff;
-      padding: 50px 37px 37px;
-      box-sizing: border-box;
-      overflow-x: hidden;
-      overflow-y: auto;
-      border-radius: 10px;
-      box-sizing: border-box;
-
-      .imgUrl {
-        width: 130px;
-        height: 130px;
-        position: absolute;
-        top: 40px;
-        left: 90px;
-        z-index: 9;
-
-        img {
-          width: 100%;
-          height: 100%;
-        }
-      }
-
-      table,
-      th,
-      td {
-        border: 1px solid #515151;
-        border-collapse: collapse;
-      }
-
-      .table {
-        width: 100%;
-
-        .thead {
-          td {
-            height: 45px;
-            font-size: 22px;
-            text-align: center;
-            color: #111111;
-            font-family: "苹方简M";
-          }
-        }
-        tr {
-          td {
-            height: 30px;
-            font-size: @tableTitleSize;
-            text-align: center;
-            color: #111111;
-          }
-
-          .table_title1 {
-            padding: 0 5px;
-            width: 95px;
-          }
-
-          .table_title {
-            width: 105px;
-          }
-
-          .table_title2 {
-            font-family: "苹方简M";
-          }
-
-          .title {
-            color: #515151;
-          }
-
-          .title1 {
-            width: 150px;
-          }
-        }
-      }
-
-      .table1 {
-        margin-top: -1px;
-        border-top: 0px solid transparent;
-      }
-
-      .info {
-        height: 30px;
-        line-height: 30px;
-        font-size: @tableTitleSize;
-      }
+    iframe {
+      width: 100%;
+      height: 100%;
     }
   }
 

+ 61 - 52
src/views/report/components/selectDate.vue

@@ -113,6 +113,7 @@ import {
   getGZ,
   ysbxxcx,
   yqwsbcx,
+  tjbgPdf,
 } from "@/api/report";
 export default {
   name: "ZhtSelectDate",
@@ -197,31 +198,48 @@ export default {
     },
     async nextStep() {
       this.showLoading = true;
-      await this.getGZ();
-      await this.nsrxx();
-      await this.nsxyjb();
-      await this.skxx();
-      await this.qsxx();
-      await this.wfwzxx();
-      await this.dbsx();
-      await this.fxtx();
-      await this.pzhd();
-      setTimeout(() => {
+      let nsrInfo = await this.nsrxx();
+      let nsxydj = await this.nsxyjb();
+      let form = {};
+      form.imgUrl = await this.getGZ();
+      form.zgswjmc = nsrInfo.zgswjmc || "";
+      form.nsrmc = nsrInfo.nsrmc || "";
+      form.shxydm = nsrInfo.nsrsbh || "";
+      form.nsrztmc = nsrInfo.nsrztmc || "";
+      form.scjyqxq = nsrInfo.scjyqxq || "";
+      form.zcdz = nsrInfo.zcdz || "";
+      form.fddbrxm = nsrInfo.fddbrxm || "";
+      form.pjjg = nsxydj.pjjg || "";
+      form.pjfs = nsxydj.pjfs || "";
+      form.nsrxydjListList = nsxydj.zbList || [];
+      form.sbnsxxLists = await this.skxx();
+      form.qsxxLists = await this.qsxx();
+      form.wfwzxxLists = await this.wfwzxx();
+      form.dbsxLists = await this.dbsx();
+      form.fxtxLists = await this.fxtx();
+      form.pzhdLists = await this.pzhd();
+      tjbgPdf(form).then((res) => {
         this.showLoading = false;
-        this.$emit("update:nowPage", {
-          page: "lookReport",
-          timestamp: Date.now(),
-        });
-      }, 500);
+        if (res.code == 200) {
+          this.$emit("update:pdfSrc", res.message);
+          this.$emit("update:nowPage", {
+            page: "lookReport",
+            timestamp: Date.now(),
+          });
+        } else {
+            this.$tip("生成pdf失败", "error");
+        }
+      });
     },
     //获取章子
     getGZ() {
       return new Promise((resolve, reject) => {
         getGZ().then((res) => {
           if (res.code == 200) {
-            sessionStorage.setItem("IMGURL", res.result[0].imageUrl);
+            resolve(res.result[0].imageUrl || "");
+          } else {
+            resolve("");
           }
-          resolve();
         });
       });
     },
@@ -239,12 +257,10 @@ export default {
         from.headVo = headVo;
         nsrxx(from).then((res) => {
           if (res.code == 200) {
-            sessionStorage.setItem(
-              "MESSAGE",
-              JSON.stringify(res.data.nsrxxGridlb[0])
-            );
+            resolve(res.data.nsrxxGridlb[0] || {});
+          } else {
+            resolve({});
           }
-          resolve();
         });
       });
     },
@@ -262,17 +278,10 @@ export default {
         };
         nsxyjb(from).then((res) => {
           if (res.code == 200 && res.data != null) {
-            sessionStorage.setItem("RANK", JSON.stringify(res.data));
-            if (res.data.zbList) {
-              if (res.data.zbList.length > 0) {
-                sessionStorage.setItem(
-                  "RANKLIST",
-                  JSON.stringify(res.data.zbList)
-                );
-              }
-            }
+            resolve(res.data || {});
+          } else {
+            resolve({});
           }
-          resolve();
         });
       });
     },
@@ -303,9 +312,10 @@ export default {
         };
         skxx(from).then((res) => {
           if (res.code == 200) {
-            sessionStorage.setItem("RECORD", JSON.stringify(res.result));
+            resolve(res.result || []);
+          } else {
+            resolve([]);
           }
-          resolve();
         });
       });
     },
@@ -322,12 +332,10 @@ export default {
         };
         qsxx(from).then((res) => {
           if (res.code == 200) {
-            sessionStorage.setItem(
-              "TAXLIST",
-              JSON.stringify(res.data.nsrwqjxxGridlb)
-            );
+            resolve(res.data.nsrwqjxxGridlb || []);
+          } else {
+            resolve([]);
           }
-          resolve();
         });
       });
     },
@@ -345,12 +353,10 @@ export default {
         };
         wfwzxx(from).then((res) => {
           if (res.code == 200 && res.data.wfwzxxGridlb) {
-            sessionStorage.setItem(
-              "WFWZLIST",
-              JSON.stringify(res.data.wfwzxxGridlb)
-            );
+            resolve(res.data.wfwzxxGridlb || []);
+          } else {
+            resolve([]);
           }
-          resolve();
         });
       });
     },
@@ -361,9 +367,10 @@ export default {
         };
         ysbxxcx(form).then((res) => {
           if (res.code == 200) {
-            sessionStorage.setItem("DBSXLIST", JSON.stringify(res.result));
+            resolve(res.result || []);
+          } else {
+            resolve([]);
           }
-          resolve();
         });
       });
     },
@@ -374,9 +381,10 @@ export default {
         };
         yqwsbcx(form).then((res) => {
           if (res.code == 200) {
-            sessionStorage.setItem("FXTXLIST", JSON.stringify(res.result));
+            resolve(res.result || []);
+          } else {
+            resolve([]);
           }
-          resolve();
         });
       });
     },
@@ -389,12 +397,13 @@ export default {
           sjjg: "16109970500",
           sjry: "96109970015",
         };
-        pzhd(from).then(res => {
+        pzhd(from).then((res) => {
           if (res.code == 200) {
-            sessionStorage.setItem("PZHDXX", JSON.stringify(res.data));
+            resolve(res.data || []);
+          } else {
+            resolve([]);
           }
-          resolve();
-        })
+        });
       });
     },
     back() {

+ 2 - 0
src/views/report/index.vue

@@ -27,6 +27,7 @@
           :nowPage.sync="nowPage"
           :timerTime.sync="timerTime"
           :indexClass.sync="indexClass"
+          :pdfSrc.sync="pdfSrc"
         ></component>
       </div>
       <div class="bottom">
@@ -89,6 +90,7 @@ export default {
         page: "index",
         timestamp: "000000",
       },
+      pdfSrc: "",
     };
   },