瀏覽代碼

批量打印

lilei 2 年之前
父節點
當前提交
878b511c09

+ 10 - 0
src/api/financeBook.js

@@ -210,3 +210,13 @@ export const deleteSettleReceiptFinanceBook = (params) => {
     method: 'post'
   })
 }
+
+// 批量获取钉钉审核信息
+export const getBatchLastProcessInstance = (params) => {
+  const url = `/dingTalk/getBatchLastProcessInstance`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 22 - 13
src/views/salesManagement/receiptPrint/list.vue

@@ -50,7 +50,7 @@
             </a-row>
           </a-form>
           <!-- 操作按钮 -->
-          <div class="table-operator">
+          <div class="table-operator" v-if="$hasPermissions('B_SkPrint')">
             <a-button type="primary" @click="handlePlPrint()" class="button-error">批量打印</a-button>
             <span style="margin-left: 8px">
               <template v-if="rowSelectionInfo && rowSelectionInfo.selectedRowKeys.length>0">{{ `已选 ${rowSelectionInfo.selectedRowKeys.length} 项` }}</template>
@@ -62,7 +62,7 @@
           class="sTable fixPagination"
           ref="table"
           :style="{ height: tableHeight+80.5+'px' }"
-          :row-selection="{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: (record.printStatus !== 'NO_PRINT'&&record.printStatus !== 'PRINT') } })}"
+          :row-selection="$hasPermissions('B_SkPrint')?{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: (record.printStatus !== 'NO_PRINT'&&record.printStatus !== 'PRINT') } })}:null"
           @rowSelection="rowSelectionFun"
           size="small"
           :rowKey="(record) => record.id"
@@ -132,7 +132,7 @@ import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import commonModal from '@/views/common/commonModal.vue'
 import recordModal from './recordModal.vue'
 import printModel from './printModel.vue'
-import { financeBookDetailList, updateFinanceBookDetail } from '@/api/financeBook'
+import { financeBookDetailList, updateFinanceBookDetail, getBatchLastProcessInstance } from '@/api/financeBook'
 export default {
   name: 'ReceiptPrintList',
   mixins: [commonMixin],
@@ -221,22 +221,25 @@ export default {
       this.rowSelectionInfo = obj || null
     },
     // 批量打印
-    handlePlPrint () {
+    async handlePlPrint () {
       const _this = this
       const rows = _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows || []
       const slen = rows.length
       if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && slen < 1)) {
         _this.$message.warning('请在列表勾选后再进行批量操作!')
+        return false
       }
-      const bookNos = []
+      const bookSns = []
       rows.map(item => {
-        if (bookNos.indexOf(item.bookNo) < 0) {
-          bookNos.push(item.bookNo)
+        if (bookSns.indexOf(item.bookSn) < 0) {
+          bookSns.push(item.bookSn)
         }
       })
       const retArr = []
-      bookNos.map(item => {
-        const rs = rows.filter(a => a.bookNo == item)
+      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) {
@@ -245,22 +248,27 @@ export default {
             })
           }
         })
-        retArr.push({ detail: detailItemUseStr, subList: rs })
+        retArr.push({ audit: auditInfo[item], detail: detailItemUseStr, subList: rs })
       })
       console.log(retArr, '------------')
-      this.handlePrint(retArr, 1, rows)
+      this.handlePrint(retArr, 1, rows, bookSns)
     },
     // 收款打印
-    handlePrint (row, type, list) {
+    async handlePrint (row, type, list, bookSns) {
       this.showTipModal = true
       let detailItemUseStr = ''
+      let auditInfo = null
+      if (type == 0) {
+        auditInfo = await getBatchLastProcessInstance({ 'businessType': 'FINANCE_BOOK', 'businessSnList': [list.bookSn] }).then(res => res.data)
+      }
+      console.log(auditInfo)
       this.$nextTick(() => {
         if (type == 0 && row.detailItemUseList) {
           row.detailItemUseList.map(k => {
             detailItemUseStr = detailItemUseStr + k.itemName + '(' + k.itemAmount + ');'
           })
         }
-        this.$refs.printModel.getData(type ? row : [{ detail: detailItemUseStr, subList: [row] }], type ? list : [list])
+        this.$refs.printModel.getData(type ? row : [{ audit: auditInfo[list.bookSn], detail: detailItemUseStr, subList: [row] }], type ? list : [list])
       })
     },
     printOk () {
@@ -320,6 +328,7 @@ export default {
         printStatus: this.currentTab == 2 ? 'NO_PRINT' : undefined
       }
       this.$refs.table.refresh(true)
+      this.$refs.table.clearSelected()
     },
     pageInit () {
       const _this = this

+ 15 - 6
src/views/salesManagement/receiptPrint/printModel.vue

@@ -5,6 +5,7 @@
       <div
         v-for="(fcItem,index) in financeBookList"
         :key="index+'-fcitem'"
+        style="width: 562pt;margin:0 auto;font-size:14px;"
       >
         <table
           ref="printBox"
@@ -19,8 +20,8 @@
                 <div>
                   <table border="1" style="width: 562pt;border-collapse: collapse;text-align: center;">
                     <tr>
-                      <th style="line-height: 20pt;width: 50pt;background:#f6f6f6;">日期</th>
-                      <th style="line-height: 20pt;width: 82pt;background:#f6f6f6;">客户名称</th>
+                      <th style="line-height: 20pt;width: 52pt;background:#f6f6f6;">日期</th>
+                      <th style="line-height: 20pt;width: 80pt;background:#f6f6f6;">客户名称</th>
                       <th style="line-height: 20pt;width: 60pt;background:#f6f6f6;">订单金额</th>
                       <th style="line-height: 20pt;width: 60pt;background:#f6f6f6;">收款金额</th>
                       <th style="line-height: 20pt;width: 60pt;background:#f6f6f6;">使用授信</th>
@@ -30,8 +31,8 @@
                       <th style="line-height: 20pt;width: 70pt;background:#f6f6f6;">说明</th>
                     </tr>
                     <tr v-for="item in fcItem.subList" :key="item.bookDetailSn">
-                      <td style="padding:3pt;width: 44pt;">{{ moment(item.receiptDate).format('M月D日') }}</td>
-                      <td style="padding:3pt;width: 76pt;text-align:left;">
+                      <td style="padding:3pt;width: 46pt;">{{ moment(item.receiptDate).format('M月D日') }}</td>
+                      <td style="padding:3pt;width: 74pt;text-align:left;">
                         {{ item.payerName }}
                         <div>
                           {{ item.dealerEntity ? item.dealerEntity.kdMidCustomerFnumber : '' }}
@@ -57,8 +58,16 @@
                       <td style="padding:3pt;width: 84pt;word-break:break-all;">{{ item.remarks }}</td>
                     </tr>
                   </table>
-                  <div style="line-height: 30pt;border-bottom: 1px solid #666;">使用授信明细:{{ fcItem.detail }}</div>
-                  <div style="line-height: 30pt;">审批人员:</div>
+                  <div style="line-height: 30pt;border-bottom: 1px solid #666;">使用授信明细:{{ fcItem.detail||'--' }}</div>
+                  <div style="line-height: 30pt;" v-if="fcItem.audit&&fcItem.audit.taskVOList">
+                    审批人员:
+                    <span v-for="audit in fcItem.audit.taskVOList" :key="audit.processInstanceId">
+                      {{ audit.userName }}({{ audit.state }});
+                    </span>
+                  </div>
+                  <div style="line-height: 30pt;" v-else>
+                    审批人员:--
+                  </div>
                 </div>
               </div>
             </div>

+ 5 - 5
src/views/salesManagement/salesCollection/list.vue

@@ -204,9 +204,9 @@
           <div style="padding: 15px 0;font-weight: bold;">请选择收款类型</div>
           <div>
             <a-radio-group v-model="collectionType">
-              <a-radio :value="1">
+              <!-- <a-radio :value="1">
                 关联收款单
-              </a-radio>
+              </a-radio> -->
               <a-radio :value="0">
                 仅标记收款
               </a-radio>
@@ -305,7 +305,7 @@ export default {
       total: 0, // 合计
       rowSelectionInfo: null, // 批量选择的数据
       handlePlData: [], // 收款临时数据
-      collectionType: 1 // 收款类型
+      collectionType: 0 // 收款类型
     }
   },
   // 根据权限显示列表字段
@@ -460,7 +460,7 @@ export default {
         this.showDetail = true
         this.$refs.detailModal.setData(this.handlePlData, snList)
         this.showSkModal = false
-        _this.collectionType = 1
+        _this.collectionType = 0
       } else {
         // 仅标记收款
         _this.spinning = true
@@ -470,7 +470,7 @@ export default {
             _this.$message.success(res.message)
             _this.$refs.table.refresh()
             _this.spinning = false
-            _this.collectionType = 1
+            _this.collectionType = 0
           } else {
             _this.spinning = false
           }