|
@@ -50,7 +50,7 @@
|
|
</a-row>
|
|
</a-row>
|
|
</a-form>
|
|
</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>
|
|
<a-button type="primary" @click="handlePlPrint()" class="button-error">批量打印</a-button>
|
|
<span style="margin-left: 8px">
|
|
<span style="margin-left: 8px">
|
|
<template v-if="rowSelectionInfo && rowSelectionInfo.selectedRowKeys.length>0">{{ `已选 ${rowSelectionInfo.selectedRowKeys.length} 项` }}</template>
|
|
<template v-if="rowSelectionInfo && rowSelectionInfo.selectedRowKeys.length>0">{{ `已选 ${rowSelectionInfo.selectedRowKeys.length} 项` }}</template>
|
|
@@ -62,7 +62,7 @@
|
|
class="sTable fixPagination"
|
|
class="sTable fixPagination"
|
|
ref="table"
|
|
ref="table"
|
|
:style="{ height: tableHeight+80.5+'px' }"
|
|
: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"
|
|
@rowSelection="rowSelectionFun"
|
|
size="small"
|
|
size="small"
|
|
:rowKey="(record) => record.id"
|
|
:rowKey="(record) => record.id"
|
|
@@ -132,7 +132,7 @@ import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
|
|
import commonModal from '@/views/common/commonModal.vue'
|
|
import commonModal from '@/views/common/commonModal.vue'
|
|
import recordModal from './recordModal.vue'
|
|
import recordModal from './recordModal.vue'
|
|
import printModel from './printModel.vue'
|
|
import printModel from './printModel.vue'
|
|
-import { financeBookDetailList, updateFinanceBookDetail } from '@/api/financeBook'
|
|
|
|
|
|
+import { financeBookDetailList, updateFinanceBookDetail, getBatchLastProcessInstance } from '@/api/financeBook'
|
|
export default {
|
|
export default {
|
|
name: 'ReceiptPrintList',
|
|
name: 'ReceiptPrintList',
|
|
mixins: [commonMixin],
|
|
mixins: [commonMixin],
|
|
@@ -221,22 +221,25 @@ export default {
|
|
this.rowSelectionInfo = obj || null
|
|
this.rowSelectionInfo = obj || null
|
|
},
|
|
},
|
|
// 批量打印
|
|
// 批量打印
|
|
- handlePlPrint () {
|
|
|
|
|
|
+ async handlePlPrint () {
|
|
const _this = this
|
|
const _this = this
|
|
const rows = _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows || []
|
|
const rows = _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows || []
|
|
const slen = rows.length
|
|
const slen = rows.length
|
|
if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && slen < 1)) {
|
|
if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && slen < 1)) {
|
|
_this.$message.warning('请在列表勾选后再进行批量操作!')
|
|
_this.$message.warning('请在列表勾选后再进行批量操作!')
|
|
|
|
+ return false
|
|
}
|
|
}
|
|
- const bookNos = []
|
|
|
|
|
|
+ const bookSns = []
|
|
rows.map(item => {
|
|
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 = []
|
|
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 = ''
|
|
let detailItemUseStr = ''
|
|
rs.map(b => {
|
|
rs.map(b => {
|
|
if (b.detailItemUseList) {
|
|
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, '------------')
|
|
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
|
|
this.showTipModal = true
|
|
let detailItemUseStr = ''
|
|
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(() => {
|
|
this.$nextTick(() => {
|
|
if (type == 0 && row.detailItemUseList) {
|
|
if (type == 0 && row.detailItemUseList) {
|
|
row.detailItemUseList.map(k => {
|
|
row.detailItemUseList.map(k => {
|
|
detailItemUseStr = detailItemUseStr + k.itemName + '(' + k.itemAmount + ');'
|
|
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 () {
|
|
printOk () {
|
|
@@ -320,6 +328,7 @@ export default {
|
|
printStatus: this.currentTab == 2 ? 'NO_PRINT' : undefined
|
|
printStatus: this.currentTab == 2 ? 'NO_PRINT' : undefined
|
|
}
|
|
}
|
|
this.$refs.table.refresh(true)
|
|
this.$refs.table.refresh(true)
|
|
|
|
+ this.$refs.table.clearSelected()
|
|
},
|
|
},
|
|
pageInit () {
|
|
pageInit () {
|
|
const _this = this
|
|
const _this = this
|