Kaynağa Gözat

付费打印

wangzhuo 1 yıl önce
ebeveyn
işleme
514a7a121d
2 değiştirilmiş dosya ile 127 ekleme ve 168 silme
  1. 18 1
      src/api/finance/payment.js
  2. 109 167
      src/views/finance/payment/index.vue

+ 18 - 1
src/api/finance/payment.js

@@ -25,6 +25,14 @@ export function getCharge(fId) {
     method: 'get'
   })
 }
+
+// 查询财务数据主详细
+export function getPrintCharge(fId) {
+  return request({
+    url: '/finance/payment/print/info/' + fId,
+    method: 'get'
+  })
+}
 // 查询财务数据主详细
 export function getCharges(fId) {
   return request({
@@ -67,6 +75,15 @@ export function updateCharges(data) {
   })
 }
 
+// 修改打印次数
+export function payPrintTimes(data) {
+  return request({
+    url: '/finance/payment/printTimes',
+    method: 'put',
+    data:data
+  })
+}
+
 
 // 删除财务数据主
 export function delCharge(fId) {
@@ -240,4 +257,4 @@ export function setPrintTime(data) {
     method: 'post',
     data: data
   })
-}
+}

+ 109 - 167
src/views/finance/payment/index.vue

@@ -821,7 +821,8 @@
           >
 
           <el-button type="danger" @click="approvalRevocation":disabled="isApproved" size="mini">撤销审核</el-button>
-
+<!--          <el-button type="info" @click="printFunction" size="mini" v-hasPermi="['finance:payment:printTimes']">打印</el-button>-->
+          <el-button type="info" @click="printFunction" size="mini">打印</el-button>
 <!--          <el-button type="warning" size="mini" :disabled="isApproved" v-hasPermi="['finance:payment:printTFeeB']" @click="printFunction">打印</el-button>-->
 <!--          <el-button type="primary" @click="addPage" size="mini">新 增</el-button>-->
         </div>
@@ -2470,66 +2471,59 @@
     >
       <div ref="print">
         <table class="table table-striped table-bordered" align="center" valign="center">
-
-
-
           <tr>
             <td colspan="6"></td>
-            <td colspan="2">打印次数:{{ printSlipData.fNumberPrint + 1 }}</td>
-            <td colspan="3">打印日期:{{ printSlipData.fPrintTime }}</td>
+            <td colspan="2">打印次数:{{ printSlipData.tFee.fPayNumberPrint + 1 }}</td>
+            <td colspan="3">打印日期:{{ printSlipData.tFee.fPrintTime }}</td>
           </tr>
           <tr>
-            <td style="font-size: 24px;font-weight:bold" class="column" colspan="11">货款单据</td>
-          </tr>
-          <tr>
-            <td class="column" style="width: 9%;">供应商</td>
-            <td class="column" colspan="2" style="width: 19%;">{{ printSlipData.fCorpName }}</td>
-            <td class="column" style="width: 8%;">付费日期</td>
-            <td class="column" style="width: 9%;">{{ printSlipData.fAccbilldate }}</td>
-            <td class="column" style="width: 9%;">账务日期起</td>
-            <td class="column" style="width: 9.5%;">{{ printSlipData.fBsdateStart }}</td>
-            <td class="column" style="width: 9%;">账务日期止</td>
-            <td class="column" style="width: 9.5%;">{{ printSlipData.fBsdateEnd }}</td>
-            <td class="column" style="width: 9.5%;">系统编号</td>
-            <td class="column" style="width: 10%;">{{ printSlipData.fBillno }}</td>
+            <td style="font-size: 24px;font-weight:bold" class="column" colspan="12">付费</td>
           </tr>
           <tr>
+            <td class="column">供应商</td>
+            <td class="column" colspan="3">{{ printSlipData.tFee.fCorpidName }}</td>
+            <td class="column">账务日期起</td>
+            <td class="column">{{ printSlipData.tFee.fBsdateStart }}</td>
+            <td class="column">账务日期止</td>
+            <td class="column">{{ printSlipData.tFee.fBsdateEnd }}</td>
             <td class="column">付款公司</td>
-            <td class="column" colspan="4">{{ printSlipData.fCtrlcorpName }}</td>
-
-
-            <td class="column">制单人</td>
-            <td class="column" colspan="2">{{ printSlipData.createBy }}</td>
-            <td class="column">制单日期</td>
-            <td class="column" colspan="2">{{ printSlipData.createTime }}</td>
+            <td class="column" colspan="3">{{ printSlipData.tFee.fCtrlcorpName }}</td>
           </tr>
 
           <tr>
             <td class="column">付款银行</td>
-            <td class="column" colspan="3">{{ printSlipData.bank }}</td>
+            <td class="column" colspan="3">{{ printSlipData.tFee.bank }}</td>
             <td class="column">付款账号</td>
-            <td class="column" colspan="3">{{ printSlipData.invoiceNo }}</td>
+            <td class="column" colspan="3">{{ printSlipData.tFee.invoiceNo }}</td>
             <td class="column">流水号</td>
-            <td class="column" colspan="3">{{ printSlipData.waterBillNo }}</td>
+            <td class="column" colspan="3">{{ printSlipData.tFee.waterBillNo }}</td>
           </tr>
 
           <tr>
+            <td class="column">付费金额</td>
+            <td class="column" colspan="2">{{ printSlipData.tFee.fAmtcr }}</td>
             <td class="column">备注</td>
-            <td class="column" colspan="10">{{ printSlipData.fRemarks }}</td>
+            <td class="column" colspan="8">{{ printSlipData.tFee.fRemarks }}</td>
           </tr>
 
           <tr>
-            <td class="column">货款金额(小写):</td>
-            <td class="column" colspan="5">{{ printSlipData.fAmtdr }}</td>
-            <td class="column">货款金额(大写):</td>
-            <td class="column" colspan="5">{{ printSlipData.fAmtdrB }}</td>
+            <td class="column">序号</td>
+            <td class="column">业务日期</td>
+            <td class="column" colspan="3">供应商</td>
+            <td class="column" colspan="3">开票单位</td>
+            <td class="column">余额</td>
+            <td class="column">本次付费</td>
+            <td class="column" colspan="2">备注</td>
           </tr>
-
-          <tr>
-            <td class="column">付款金额(小写):</td>
-            <td class="column" colspan="5">{{ printSlipData.fAmtcr }}</td>
-            <td class="column">付款金额(大写):</td>
-            <td class="column" colspan="5">{{ printSlipData.fAmtcrB }}</td>
+          <!-- feeDoList -->
+          <tr v-for="(item,index) in printSlipData.feeDoList" :key="index">
+            <td class="column">{{ Number(index) + 1 }}</td>
+            <td class="column">{{ item.fBsdate }}</td>
+            <td class="column" colspan="3">{{ item.fName }}</td>
+            <td class="column" colspan="3">{{ item.fSbuName }}</td>
+            <td class="column">{{ item.fAmtBlc }}</td>
+            <td class="column">{{ item.fAmt }}</td>
+            <td class="column" colspan="2">{{ item.remark }}</td>
           </tr>
         </table>
         <table class="table table-striped table-bordered" align="center" valign="center">
@@ -2583,7 +2577,8 @@ import {
   revoke,
   cancelAPayment,
   setPrintTime,
-  printTFeeB
+  printTFeeB,
+  getPrintCharge
 } from "@/api/finance/payment";
 import { listFees } from "@/api/basicdata/fees";
 import print from "print-js";
@@ -2600,6 +2595,9 @@ import { MessageBox } from 'element-ui'
 import { getClient } from "@/api/basicdata/corps";
 import { userPullDown } from "@/api/system/user"
 
+import { payPrintTimes } from '@/api/finance/payment'
+import { getApproved } from '../../../api/finance/applyForInvoice/chargeInvoice'
+
 Vue.directive("dialogDrag", {
   bind(el, binding, vnode, oldVnode) {
     const dialogHeaderEl = el.querySelector(".el-dialog__header");
@@ -2661,9 +2659,14 @@ export default {
   name: "Charge",
   data() {
     return {
+      dataId: '',
       login:Cookies.get('sysType'),
       // 打印单数据
-      printSlipData: {},
+      printSlipData: {
+        tFee: {},
+        corps: [],
+        feeDoList: []
+      },
       // 打印窗口显示或隐藏
       printTheDialogBox: false,
       // 是否审批通过
@@ -2679,108 +2682,6 @@ export default {
       show:false,
       drag: false,
       mainTable:false,
-      // tableDate: [
-      //   {
-      //     surface: "1",
-      //     label: "createBy",
-      //     name: "制单人",
-      //     checked: 0,
-      //     fixed: "left",
-      //     width: 100,
-      //   },
-      //   {
-      //     surface: "2",
-      //     label: "fBillno",
-      //     name: "系统编号",
-      //     checked: 0,
-      //     fixed: "left",
-      //     width: 100,
-      //   },
-      //   {
-      //     surface: "3",
-      //     label: "fCtrlcorpid",
-      //     name: "货权方",
-      //     checked: 0,
-      //     width: 100,
-      //   },
-      //   {
-      //     surface: "4",
-      //     label: "createTime",
-      //     name: "制单日期",
-      //     checked: 0,
-      //     width: 100,
-      //   },
-      //   {
-      //     surface: "5",
-      //     label: "fAccbilldate",
-      //     name: "收费日期",
-      //     checked: 0,
-      //     width: 100,
-      //   },
-      //   {
-      //     surface: "6",
-      //     label: "tMblno",
-      //     name: "提单号",
-      //     checked: 0,
-      //     width: 100,
-      //   },
-      //   {
-      //     surface: "7",
-      //     label: "chargingMethod",
-      //     name: "收费方式",
-      //     checked: 0,
-      //     width: 100,
-      //   },
-      //   {
-      //     surface: "8",
-      //     label: "invoiceNo",
-      //     name: "发票号",
-      //     checked: 0,
-      //     width: 100,
-      //   },
-      //   {
-      //     surface: "9",
-      //     label: "bank",
-      //     name: "收款银行",
-      //     checked: 0,
-      //     width: 100,
-      //   },
-      //   {
-      //     surface: "10",
-      //     label: "waterBillNo",
-      //     name: "水单号",
-      //     checked: 0,
-      //     width: 100,
-      //   },
-      //   {
-      //     surface: "11",
-      //     label: "fAmtdr",
-      //     name: "应付合计",
-      //     checked: 0,
-      //     width: 100,
-      //   },
-      //   {
-      //     surface: "12",
-      //     label: "fAmtcr",
-      //     name: "实付合计",
-      //     checked: 0,
-      //     width: 100,
-      //   },
-      //   {
-      //     surface: "13",
-      //     label: "fRemarks",
-      //     name: "备注",
-      //     checked: 0,
-      //     width: 100,
-      //   },
-      //   {
-      //     surface: "14",
-      //     label: "fBillstatus",
-      //     name: "状态",
-      //     checked: 0,
-      //     width: 100,
-      //   },
-      // ],
       tableDate: [
         {
           surface: "1",
@@ -3726,6 +3627,7 @@ export default {
         if (Cookies.get("sysType") == 1 || Cookies.get("sysType") == 4) {
           //大木
           getCharge(this.approval.billId).then((response) => {
+            this.dataId = response.data.tFee.fId;
             this.Operator = response.data.tFee.createBy;
             if (response.data.feeDoList != 0) {
               response.data.feeDoList.map((e) => {
@@ -3782,6 +3684,7 @@ export default {
           });
         }else if(Cookies.get("sysType") == 3){
           getCharge(this.approval.billId).then((response) => {
+            this.dataId = response.data.tFee.fId;
             this.Operator = response.data.tFee.createBy;
             if (response.data.feeDoList != 0) {
               response.data.feeDoList.map((e) => {
@@ -3859,13 +3762,11 @@ export default {
     },
     // 查看审批流
     addOrUpdateHandle() {
-
       if (this.queryParams.fId == null || this.queryParams.fId == '') {
         this.$message({
           message: '当前数据没有审批',
           type: 'warning'
         });
-
         return;
       }
 
@@ -3940,6 +3841,7 @@ export default {
       if (Cookies.get("sysType") == 1 || Cookies.get("sysType") == 4) {
         //大木
         getCharge(row.fId).then((response) => {
+            this.dataId = response.data.tFee.fId;
           // 审批通过,撤销审批通过付费允许点击
           if (response.data.tFee.fAuditType == 2) {
             console.log("审批通过,撤销审批通过付费允许点击");
@@ -3992,6 +3894,7 @@ export default {
               };
               const fId = row.fId || this.ids;
               getCharge(fId).then((response) => {
+              this.dataId = response.data.tFee.fId;
                 if (response.data.feeDoList != 0) {
                   response.data.feeDoList.map((e) => {
                     if (e.fBsdate) {
@@ -4030,6 +3933,7 @@ export default {
             };
             const fId = row.fId || this.ids;
             getCharge(fId).then((response) => {
+            this.dataId = response.data.tFee.fId;
               if (response.data.feeDoList != 0) {
                 response.data.feeDoList.map((e) => {
                   if (e.fBsdate) {
@@ -4157,6 +4061,7 @@ export default {
         });
       }else if(Cookies.get("sysType") == 3){
         getCharge(row.fId).then((response) => {
+            this.dataId = response.data.tFee.fId;
           this.Operator = response.data.tFee.createBy;
           if (response.data.feeDoList != 0) {
             response.data.feeDoList.map((e) => {
@@ -4189,6 +4094,7 @@ export default {
               };
               const fId = row.fId || this.ids;
               getCharge(fId).then((response) => {
+            this.dataId = response.data.tFee.fId;
                 if (response.data.feeDoList != 0) {
                   response.data.feeDoList.map((e) => {
                     if (e.fBsdate) {
@@ -4220,6 +4126,7 @@ export default {
             };
             const fId = row.fId || this.ids;
             getCharge(fId).then((response) => {
+            this.dataId = response.data.tFee.fId;
               if (response.data.feeDoList != 0) {
                 response.data.feeDoList.map((e) => {
                   if (e.fBsdate) {
@@ -4925,6 +4832,7 @@ export default {
 
         //大木
         getCharge(fId).then((response) => {
+            this.dataId = response.data.tFee.fId;
           if (response.data.tFee.fAuditType === 1) {
             this.isPay = true;
             this.isCancelAPayment = true;
@@ -4967,6 +4875,7 @@ export default {
                 // this.handleUpdate(response.data.tFee);
 
                 getCharge(response.data.tFee.fId).then((response) => {
+            this.dataId = response.data.tFee.fId;
                   if (response.data.tFee.fAuditType === 1) {
                     this.isPay = true;
                     this.isCancelAPayment = true;
@@ -5037,6 +4946,7 @@ export default {
                 this.getList();
 
                 getCharge(response.data.tFee.fId).then((response) => {
+                this.dataId = response.data.tFee.fId;
 
                   console.log("getCharge");
                   console.log(response);
@@ -5254,38 +5164,70 @@ export default {
     },
     // 打印
     printFunction() {
-      this.printTheDialogBox = true;
 
-      printTFeeB(this.queryParams.fId).then((res) => {
-          console.log(res);
-          this.printSlipData = res.data;
 
+      let data = {
+        id: this.queryParams.fId,
+        actId: 450,
+      };
+      if(Cookies.get("sysType") == 3){
+        data.actId = 450
+      }else{
+        data.actId = this.contrastId
+      }
+
+
+      getApproved(data).then(res => {
+        var approval = res.data.pop()
+        if(approval == null) {
+          this.$message.warning('未审核或未通过审核')
+          return
+        }
+        if (approval.auditStatus != "A") {
+          this.$message.warning('未审核或未通过审核')
+          return
+        }
+
+
+        getPrintCharge(this.dataId).then(res => {
+          this.printSlipData = res.data
           let printDate = new Date();
-          this.printSlipData.fPrintTime = printDate.toLocaleString();
+          this.printSlipData.tFee.fPrintTime = printDate.toLocaleString();
+          this.printTheDialogBox = true;
+          // console.log(this.printSlipData.fCorpid);
+        })
+      })
 
-          // 供货商名赋值
-          for (const key in this.vendorList) {
-            if (this.vendorList[key].fId == this.printSlipData.fCorpid) {
-              this.printSlipData.fCorpName = this.vendorList[key].fName;
-            }
-          }
+      // printTFeeB(this.queryParams.fId).then((res) => {
+      //     console.log(res);
+      //     this.printSlipData = res.data;
 
-          // 付款公司名赋值
-          for (const key in this.billingList) {
-            if (this.billingList[key].fId == this.printSlipData.fCtrlcorpidLong) {
-              this.printSlipData.fCtrlcorpName = this.billingList[key].fName;
-            }
-          }
-      });
+
+
+      //     // 供货商名赋值
+      //     for (const key in this.vendorList) {
+      //       if (this.vendorList[key].fId == this.printSlipData.fCorpid) {
+      //         this.printSlipData.fCorpName = this.vendorList[key].fName;
+      //       }
+      //     }
+
+      //     // 付款公司名赋值
+      //     for (const key in this.billingList) {
+      //       if (this.billingList[key].fId == this.printSlipData.fCtrlcorpidLong) {
+      //         this.printSlipData.fCtrlcorpName = this.billingList[key].fName;
+      //       }
+      //     }
+      // });
     },
     // 确认打印
     confirmPrinting() {
       // 添加打印次数
       let data = {
-        id : this.printSlipData.fId + '',
-        printDate : this.printSlipData.fPrintTime
+        id : this.printSlipData.tFee.fId + '',
+        printDate : this.printSlipData.tFee.fPrintTime
       };
-      setPrintTime(data).then(res => {
+
+      payPrintTimes(data).then(res => {
         if (res.code === 200) {
           this.$print(this.$refs.print)
         } else {