ソースを参照

添加“打印发票入账单”

jz.kai 3 年 前
コミット
12df8da693

+ 1 - 2
.env.development

@@ -1,4 +1,3 @@
 OUT_PUT_DIR=dist/comparison-portal
 
-VUE_APP_BACKEND_URL=http://localhost:8086/comparison-server
-# VUE_APP_BACKEND_URL=http://192.168.15.99:8080/comparison-server
+VUE_APP_BACKEND_URL=http://localhost:8086/comparison-server

+ 5 - 1
src/api/base/auditing.js

@@ -21,6 +21,10 @@ function exportXlsFPRZD(formData){
   return request.post(constant.serverUrl + "/base/auditing/exportXlsFPRZD",formData);
 }
 
+function showFPRZDData(formData){
+  return request.post(constant.serverUrl + "/base/auditing/showFPRZDData",formData);
+}
+
 export default {
-  pageList,remove,workflowStart,listPending,exportXlsFPRZD
+  pageList,remove,workflowStart,listPending,exportXlsFPRZD,showFPRZDData
 }

+ 126 - 0
src/views/base/auditing-billing.vue

@@ -0,0 +1,126 @@
+<style scoped>
+  .user-panel {
+    margin: 10px auto;
+  }
+  table.gridtable {
+    font-family: verdana,arial,sans-serif;
+    font-size:11px;
+    color:#333333;
+    border-width: 1px;
+    border-color: #666666;
+    border-collapse: collapse;
+ }
+  table.gridtable th {
+    border-width: 1px;
+    padding: 8px;
+    border-style: solid;
+    border-color: #666666;
+    background-color: #dedede;
+  }
+  table.gridtable td {
+    border-width: 1px;
+    padding: 8px;
+    border-style: solid;
+    border-color: #666666;
+    background-color: #ffffff;
+  }
+</style>
+<template>
+  <el-dialog
+    :visible.sync="showDialog"
+    :title="title"
+    :modal-append-to-body="false"
+    style="text-align: left"
+    width="70%"
+    @close="closeDialog"
+    :close-on-click-modal="false"
+  >
+    <div class="user-panel">
+      <table ref="printContent" class="gridtable" border="1" width="100%" cellspacing="0" cellpadding="0">
+        <tr>
+          <td style="height:50px" colspan="8">发票入账单</td>
+        </tr>
+        <tr>
+          <td style="height:50px" colspan="3"></td>
+          <td style="height:50px" colspan="5"></td>
+        </tr>
+        <tr>
+          <td style="height:50px" colspan="3"></td>
+          <td style="height:50px" colspan="5"></td>
+        </tr>
+        <tr>
+          <td style="height:50px" colspan="3"></td>
+          <td style="height:50px" colspan="5"></td>
+        </tr>
+        <tr>
+          <td style="height:50px" colspan="3"></td>
+          <td style="height:50px" colspan="5"></td>
+        </tr>
+        <tr>
+          <td style="height:50px" colspan="3"></td>
+          <td style="height:50px" colspan="5"></td>
+        </tr>
+        <tr>
+          <td style="height:50px" colspan="3"></td>
+          <td style="height:50px" colspan="5"></td>
+        </tr>
+        <tr>
+          <td style="height:50px" colspan="2"></td>
+          <td style="height:50px" colspan="2"></td>
+          <td style="height:50px" colspan="2"></td>
+          <td style="height:50px" colspan="2"></td>
+        </tr>
+      </table>
+    </div>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="printDialog">打 印</el-button>
+      <el-button @click="closeDialog">关 闭</el-button>
+    </span>
+  </el-dialog>
+</template>
+<script>
+import Constant from "@/constant";
+import auditingApi from "@/api/base/auditing";
+
+export default {
+  props: ["businessKey", "title"],
+  data() {
+    return {
+      showDialog: true,
+      showData: {},
+    };
+  },
+  methods: {
+    closeDialog() {
+      this.$emit("close", false);
+    },
+    printDialog() {
+      var oldHtml = document.body;
+      var printbox = this.$refs.printContent.innerHTML;
+      document.body.innerHTML = printbox;
+      window.print();
+      // document.body.innerHTML = oldHtml;
+      // location.reload();
+      console.log(oldHtml);
+      console.log(printbox);
+    },
+  },
+  mounted: function () {
+    var self = this;
+
+    //发票入账单数据
+    var formData = new FormData();
+    formData.append("auditingId", self.businessKey);
+    auditingApi
+    .showFPRZDData(formData)
+    .then(function (response) {
+      var jsonData = response.data.data;
+      self.showFPRZDData = jsonData;
+      // console.log(self.showFPRZDData);
+    })
+    .catch((error) => {
+      // self.$message.error(error + "");
+    });
+  },
+};
+</script>

+ 12 - 11
src/views/base/auditing-list.vue

@@ -90,7 +90,8 @@
       <el-table-column label="操作">
         <template slot-scope="{row}">
           <el-button size="mini" type="info" @click="handleEdit(row)">详情</el-button>
-          <el-button size="mini" type="primary" @click="handleFPRZD(row)">发票入账单</el-button>
+          <!-- <el-button size="mini" type="primary" @click="handleFPRZD(row)">发票入账单</el-button> -->
+          <el-button size="mini" type="success" @click="handleBilling(row)">发票入账单</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -108,18 +109,18 @@
       :title="modalTitle"
       @close="onDetailModalClose"
     ></auditing-detail>
-    <auditing-next
-      v-if="showNext"
+    <auditing-billing
+      v-if="showBilling"
       :businessKey="businessKey"
       :title="modalTitle"
       @close="onDetailModalClose"
-    ></auditing-next>
+    ></auditing-billing>
   </div>
 </template>
 <script>
 import Constant from "@/constant";
 import AuditingDetail from "./auditing-detail";
-import AuditingNext from "./auditing-next";
+import AuditingBilling from "./auditing-billing";
 import auditingApi from "@/api/base/auditing";
 import workflowDetailApi from "@/api/base/workflowDetail";
 import dataDictionaryApi from "@/api/sys/dataDictionary";
@@ -148,7 +149,7 @@ export default {
       pageSizeList: [10, 20, 30],
       multipleSelection: [],
       showModal: false,
-      showNext: false,
+      showBilling: false,
       modalTitle: "",
       businessKey: "",
       workflowResult: [],
@@ -225,10 +226,10 @@ export default {
       this.businessKey = record.id;
       this.showModal = true;
     },
-    handleNext(record) {
-      this.modalTitle = "审核";
+    handleBilling(record) {
+      this.modalTitle = "发票入账单";
       this.businessKey = record.id;
-      this.showNext = true;
+      this.showBilling = true;
     },
     handleFPRZD(record) {
       var self = this;
@@ -309,7 +310,7 @@ export default {
     onDetailModalClose(refreshed) {
       //保存成功后回调
       this.showModal = false;
-      this.showNext = false;
+      this.showBilling = false;
 
       if (refreshed) {
         this.changePage(this.pageIndex);
@@ -345,7 +346,7 @@ export default {
   },
   components: {
     "auditing-detail": AuditingDetail,
-    "auditing-next": AuditingNext,
+    "auditing-billing": AuditingBilling,
   },
 };
 </script>