|
@@ -10,12 +10,12 @@
|
|
|
<a-input id="salesManagementList-expenseAccountNo" v-model.trim="queryParam.expenseAccountNo" allowClear placeholder="请输入销售单号"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
+ <a-col :md="4" :sm="24">
|
|
|
<a-form-item label="申请人" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
|
<employee style="width: 100%;" id="salesManagementList-Employee" v-model="queryParam.applyPersonSn"></employee>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
+ <a-col :md="4" :sm="24">
|
|
|
<a-form-item label="费用类型">
|
|
|
<expenseType
|
|
|
id="salesManagementList-expenseType"
|
|
@@ -26,8 +26,7 @@
|
|
|
></expenseType>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <template v-if="advanced">
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
+ <a-col :md="4" :sm="24">
|
|
|
<a-form-item label="费用发生月份">
|
|
|
<a-month-picker
|
|
|
placeholder="请选择月份"
|
|
@@ -38,12 +37,24 @@
|
|
|
style="width: 100%;"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
+ <template v-if="advanced">
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="主题">
|
|
|
<a-input id="salesManagementList-title" v-model.trim="queryParam.title" allowClear placeholder="请输入主题"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
+ <a-col :md="4" :sm="24">
|
|
|
+ <a-form-item label="打印状态">
|
|
|
+ <v-select
|
|
|
+ v-model="queryParam.printStatus"
|
|
|
+ ref="printStatus"
|
|
|
+ id="pushOrder-printStatus"
|
|
|
+ code="PRINT_STATUS"
|
|
|
+ placeholder="请选择打印状态"
|
|
|
+ allowClear></v-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="4" :sm="24">
|
|
|
<a-form-item label="状态">
|
|
|
<v-select
|
|
|
v-model="queryParam.state"
|
|
@@ -71,11 +82,17 @@
|
|
|
<!-- 操作按钮 -->
|
|
|
<div class="table-operator">
|
|
|
<a-button type="primary" class="button-error" v-if="$hasPermissions('B_eRNew')" @click="handleEdit()">新增</a-button>
|
|
|
+ <a-button type="primary" :loading="spinning" @click="handlePlPrint()" ghost>批量打印</a-button>
|
|
|
+ <span style="margin-left: 8px">
|
|
|
+ <template v-if="rowSelectionInfo && rowSelectionInfo.selectedRowKeys.length>0">{{ `已选 ${rowSelectionInfo.selectedRowKeys.length} 项` }}</template>
|
|
|
+ </span>
|
|
|
</div>
|
|
|
<!-- 列表 -->
|
|
|
<s-table
|
|
|
class="sTable fixPagination"
|
|
|
ref="table"
|
|
|
+ :row-selection="$hasPermissions('B_eRPrint')?{ columnWidth: '4%', getCheckboxProps: record => ({ props: { disabled: false } })}:null"
|
|
|
+ @rowSelection="rowSelectionFun"
|
|
|
:style="{ height: tableHeight+70.5+'px' }"
|
|
|
size="small"
|
|
|
:rowKey="(record) => record.id"
|
|
@@ -143,6 +160,8 @@
|
|
|
<verifyModal v-drag :openModal="openModal" :itemSn="itemSn" @close="openModal=false"></verifyModal>
|
|
|
<!-- 新增 -->
|
|
|
<baseDataModal :show="openBaseModal" @close="openBaseModal=false"></baseDataModal>
|
|
|
+ <!-- 打印预览 -->
|
|
|
+ <previewModal ref="printModal" @printOk="printOk"></previewModal>
|
|
|
</a-card>
|
|
|
</template>
|
|
|
|
|
@@ -154,13 +173,15 @@ import subarea from '@/views/common/subarea.js'
|
|
|
import employee from './employee.js'
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import verifyModal from './verifyModal.vue'
|
|
|
+import previewModal from './previewModal.vue'
|
|
|
import expenseType from '@/views/common/expenseType.js'
|
|
|
-import { expenseAccountList, expenseAccountDelete, expenseAccountAgainEdit } from '@/api/expenseManagement'
|
|
|
+import { getBatchLastProcessInstance } from '@/api/financeBook'
|
|
|
+import { expenseAccountList, expenseAccountDelete, expenseAccountAgainEdit, expenseAcctDetailFindList } from '@/api/expenseManagement'
|
|
|
import baseDataModal from './baseDataModal.vue'
|
|
|
export default {
|
|
|
name: 'ExpenseReimbursementList',
|
|
|
mixins: [commonMixin],
|
|
|
- components: { STable, VSelect, subarea, verifyModal, baseDataModal, employee, expenseType },
|
|
|
+ components: { STable, VSelect, subarea, verifyModal, baseDataModal, employee, expenseType, previewModal },
|
|
|
data () {
|
|
|
let _this=this
|
|
|
return {
|
|
@@ -180,8 +201,24 @@ export default {
|
|
|
title: '', // 主题
|
|
|
expenseType: undefined, // 费用类型
|
|
|
expenseType2: undefined, // 费用类型2
|
|
|
+ printStatus: undefined, // 打印状态
|
|
|
state: undefined // 状态
|
|
|
},
|
|
|
+ columns: [
|
|
|
+ { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
|
+ { title: '费用单号', width: '8%', align: 'center', scopedSlots: { customRender: 'expenseAccountNo' } },
|
|
|
+ { title: '申请人', dataIndex: 'applyPersonName', width: '6%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '申请部门', dataIndex: 'applyDepartmentName', width: '8%', align: 'left', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '费用类型', scopedSlots: { customRender: 'expenseType' }, width: '8%', align: 'left' },
|
|
|
+ { title: '费用发生月份', dataIndex: 'expenseDate', width: '6%', align: 'center', customRender: function (text) { return moment(text).format('YYYY年MM月') || '--' } },
|
|
|
+ { title: '主题', dataIndex: 'title', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '合计金额', dataIndex: 'applyExpenseTotal', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '审核时间', dataIndex: 'finishDate', width: '8%', align: 'center', customRender: function (text, record) { return record.state == 'AUDIT_REJECT' || record.state == 'AUDIT_PASS' ? text : '--' } },
|
|
|
+ { title: '打印状态', dataIndex: 'printStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
|
|
|
+ ],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
@@ -199,6 +236,7 @@ export default {
|
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
|
data.list[i].no = no + i + 1
|
|
|
+ data.list[i].content = data.list[i].content ? data.list[i].content.replace(/\n+/, '\n').split('\n') : ''
|
|
|
}
|
|
|
this.disabled = false
|
|
|
}
|
|
@@ -206,21 +244,55 @@ export default {
|
|
|
return data
|
|
|
})
|
|
|
},
|
|
|
- columns: [{ title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
|
- { title: '费用单号', width: '12%', align: 'center', scopedSlots: { customRender: 'expenseAccountNo' } },
|
|
|
- { title: '申请人', dataIndex: 'applyPersonName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '申请部门', dataIndex: 'applyDepartmentName', width: '8%', align: 'left', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '费用类型', scopedSlots: { customRender: 'expenseType' }, width: '6%', align: 'center' },
|
|
|
- { title: '费用发生月份', dataIndex: 'expenseDate', width: '6%', align: 'center', customRender: function (text) { return moment(text).format('YYYY年MM月') || '--' } },
|
|
|
- { title: '主题', dataIndex: 'title', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '合计金额', dataIndex: 'applyExpenseTotal', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
- { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '审核时间', dataIndex: 'finishDate', width: '8%', align: 'center', customRender: function (text, record) { return record.state == 'AUDIT_REJECT' || record.state == 'AUDIT_PASS' ? text : '--' } },
|
|
|
- { title: '状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }]
|
|
|
+ rowSelectionInfo: null // 批量选择的数据
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 表格选中项
|
|
|
+ rowSelectionFun (obj) {
|
|
|
+ this.rowSelectionInfo = obj || null
|
|
|
+ },
|
|
|
+ printOk(res){
|
|
|
+ this.spinning = false
|
|
|
+ if(res&&res.status == 200){
|
|
|
+ this.$refs.table.refresh()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 批量打印
|
|
|
+ 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
|
|
|
+ }
|
|
|
+ this.spinning = true
|
|
|
+ const pageData = []
|
|
|
+ const businessSnList = []
|
|
|
+
|
|
|
+ for(let i=0;i<rows.length;i++){
|
|
|
+ // 费用明细
|
|
|
+ const fyListData = await expenseAcctDetailFindList({ expenseAccountSn: rows[i].expenseAccountSn }).then(res => res.data)
|
|
|
+ // 审核明细,待提交状态不获取
|
|
|
+ if(rows[i].state != 'WAIT_SUBMIT'){
|
|
|
+ businessSnList.push(rows[i].expenseAccountSn)
|
|
|
+ }
|
|
|
+ pageData.push({
|
|
|
+ expenseInfo: rows[i],
|
|
|
+ fyListData: fyListData,
|
|
|
+ spListData: []
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 获取审核进度信息
|
|
|
+ const spListData = await getBatchLastProcessInstance({ 'businessType': 'EXPENSES', 'businessSnList': businessSnList }).then(res => res.data)
|
|
|
+ pageData.map(item => {
|
|
|
+ const sp = spListData[item.expenseInfo.expenseAccountSn]
|
|
|
+ item.spListData = sp ? sp.taskVOList : []
|
|
|
+ })
|
|
|
+ console.log(pageData)
|
|
|
+ this.$refs.printModal.setData(pageData)
|
|
|
+ },
|
|
|
onChange (date, dateString) {
|
|
|
this.queryParam.expenseDate = dateString
|
|
|
},
|
|
@@ -314,7 +386,7 @@ export default {
|
|
|
},
|
|
|
setTableH () {
|
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
|
- this.tableHeight = window.innerHeight - tableSearchH - 235
|
|
|
+ this.tableHeight = window.innerHeight - tableSearchH - 220
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -354,7 +426,6 @@ export default {
|
|
|
<style lang="less">
|
|
|
.salesManagementList-wrap{
|
|
|
.sTable{
|
|
|
- margin-top: 10px;
|
|
|
.badge-con-t{
|
|
|
.ant-badge-count{
|
|
|
transform: scale(0.8);
|