lilei 2 лет назад
Родитель
Сommit
1ecf36da2d

+ 18 - 12
src/views/salesManagement/receiptPrint/list.vue

@@ -161,7 +161,7 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        if(this.currentTab == 1){
+        if (this.currentTab == 1) {
           this.queryParam.isAll = '1'
           this.queryParam.status = 'AUDIT_PASS'
         }
@@ -241,25 +241,29 @@ export default {
         let detailItemUseStr = ''
         rs.map(b => {
           if (b.detailItemUseList) {
-            b.detailItemUseList.map((k,i) => {
-              detailItemUseStr = detailItemUseStr + k.itemName + '(' + k.itemAmount + ')' + (i==b.detailItemUseList.length-1 ? '。':';')
+            b.detailItemUseList.map((k, i) => {
+              detailItemUseStr = detailItemUseStr + k.itemName + '(' + k.itemAmount + ')' + (i == b.detailItemUseList.length - 1 ? '。' : ';')
             })
           }
         })
         // 审核信息
-        let auditStr = ''
-        const auditList = auditInfo[item]
-        if(auditList&&auditList.taskVOList){
-          const auditLists = auditList.taskVOList.filter(item => item.userType == '审批人')
-          auditLists.map((a,i)=>{
-            auditStr = auditStr + a.userName + '(' + a.state + ')' + (i==auditLists.length-1 ? '。':';')
-          })
-        }
+        const auditStr = this.getAuditInfo(auditInfo[item])
         retArr.push({ audit: auditStr, detail: detailItemUseStr, subList: rs })
       })
       console.log(retArr, '------------')
       this.handlePrint(retArr, 1, rows, bookSns)
     },
+    // 获取审核信息
+    getAuditInfo (auditList) {
+      let auditStr = ''
+      if (auditList && auditList.taskVOList) {
+        const auditLists = auditList.taskVOList.filter(item => item.userType == '审批人')
+        auditLists.map((a, i) => {
+          auditStr = auditStr + a.userName + '(' + a.state + ')' + (i == auditLists.length - 1 ? '。' : ';')
+        })
+      }
+      return auditStr
+    },
     // 收款打印
     async handlePrint (row, type, list, bookSns) {
       this.spinning = true
@@ -276,7 +280,9 @@ export default {
             detailItemUseStr = detailItemUseStr + k.itemName + '(' + k.itemAmount + ');'
           })
         }
-        this.$refs.printModel.getData(type ? row : [{ audit: auditInfo[list.bookSn], detail: detailItemUseStr, subList: [row] }], type ? list : [list])
+        // 审核信息
+        const auditStr = auditInfo ? this.getAuditInfo(auditInfo[list.bookSn]) : ''
+        this.$refs.printModel.getData(type ? row : [{ audit: auditStr, detail: detailItemUseStr, subList: [row] }], type ? list : [list])
       })
     },
     printOk () {

+ 53 - 15
src/views/salesManagement/salesCollection/voucherModal.vue

@@ -78,19 +78,11 @@
       </div>
       <div class="btn-box">
         <a-button @click="handleCommonCancel" v-if="isCancel">{{ cancelText }}</a-button>
-        <a-button :loading="spinning" type="primary" @click="handlePrint()">收款打印</a-button>
+        <a-button v-if="detail&&detail.keepType =='RELATION_BOOK'" :loading="spinning" type="primary" @click="handlePrint()">收款打印</a-button>
       </div>
     </a-spin>
     <!-- 收款打印 -->
-    <commonModal
-      modalTit="收款打印预览"
-      bodyPadding="10px"
-      width="1024px"
-      :showFooter="false"
-      :openModal="showTipModal"
-      @cancel="canselPrintView">
-      <printModel ref="printModel" @cancel="showTipModal=false"></printModel>
-    </commonModal>
+    <printModel ref="printModel" @cancel="canselPrintView"></printModel>
     <!-- 查看财务收款详情 -->
     <commonModal
       modalTit="财务收款详情"
@@ -118,7 +110,8 @@ import commonModal from '@/views/common/commonModal.vue'
 import printModel from '../receiptPrint/printModel.vue'
 import detailModal from '@/views/financialManagement/financialCollection/detail.vue'
 import collectDetailModal from './detailModal.vue'
-import { settleReceiptFindBySn, settleReceiptBookBatch } from '@/api/settleReceipt.js'
+import { settleReceiptFindBySn } from '@/api/settleReceipt.js'
+import { getBatchLastProcessInstance } from '@/api/financeBook'
 export default {
   name: 'VoucherModal',
   components: { STable, VSelect, commonModal, printModel, detailModal, collectDetailModal },
@@ -190,16 +183,61 @@ export default {
         this.spinning = false
       })
     },
+    // 获取审核信息
+    getAuditInfo (auditList) {
+      let auditStr = ''
+      if (auditList && auditList.taskVOList) {
+        const auditLists = auditList.taskVOList.filter(item => item.userType == '审批人')
+        auditLists.map((a, i) => {
+          auditStr = auditStr + a.userName + '(' + a.state + ')' + (i == auditLists.length - 1 ? '。' : ';')
+        })
+      }
+      return auditStr
+    },
+    // 批量打印
+    async handlePlPrint () {
+      const rows = this.tableData
+      this.spinning = true
+      const bookSns = []
+      rows.map(item => {
+        if (bookSns.indexOf(item.bookSn) < 0) {
+          bookSns.push(item.bookSn)
+        }
+      })
+      const retArr = []
+      const auditInfo = await getBatchLastProcessInstance({ 'businessType': 'FINANCE_BOOK', 'businessSnList': bookSns }).then(res => res.data)
+      console.log(auditInfo)
+      bookSns.map(item => {
+        // 授信明细
+        const rs = rows.filter(a => a.bookSn == item)
+        let detailItemUseStr = ''
+        rs.map(b => {
+          if (b.detailItemUseList) {
+            b.detailItemUseList.map((k, i) => {
+              detailItemUseStr = detailItemUseStr + k.itemName + '(' + k.itemAmount + ')' + (i == b.detailItemUseList.length - 1 ? '。' : ';')
+            })
+          }
+        })
+        // 审核信息
+        const auditStr = this.getAuditInfo(auditInfo[item])
+        retArr.push({ audit: auditStr, detail: detailItemUseStr, subList: rs })
+      })
+      console.log(retArr, '------------')
+      this.handlePrint(retArr, rows)
+    },
     // 收款打印
-    handlePrint () {
+    async handlePrint (row, list) {
+      this.spinning = true
       this.showTipModal = true
       this.$nextTick(() => {
-        this.$refs.printModel.getData(this.detail, true)
+        // 审核信息
+        this.$refs.printModel.getData(row, list)
       })
     },
     canselPrintView () {
       this.showTipModal = false
-      this.$refs.printModel.handleCommonCancel()
+      this.spinning = false
+      this.$refs.printModel.clearData()
     },
     // 取消
     handleCommonCancel () {
@@ -212,7 +250,7 @@ export default {
       const snList = []
       snList.push(this.handlePlData.accountReceiptSn)
       this.showCollectDetail = true
-      this.$nextTick(()=>{
+      this.$nextTick(() => {
         this.$refs.collectDetailModal.setData([this.handlePlData], snList)
       })
     },