|
@@ -70,7 +70,7 @@
|
|
|
</div>
|
|
|
<!-- alert -->
|
|
|
<a-alert type="info" showIcon style="margin-bottom:15px">
|
|
|
- <div slot="message">共 <strong>6</strong> 条记录,金额共计 <strong>¥14</strong></div>
|
|
|
+ <div slot="message">共 <strong>{{ totalData.count }}</strong> 条记录,金额共计 <strong>¥{{ totalData.totalAmount }}</strong></div>
|
|
|
</a-alert>
|
|
|
<!-- 列表 -->
|
|
|
<s-table
|
|
@@ -80,7 +80,7 @@
|
|
|
:rowKey="(record) => record.id"
|
|
|
:columns="columns"
|
|
|
:data="loadData"
|
|
|
- :scroll="{ x: 1120 }"
|
|
|
+ :scroll="{ x: 1120, y: 300 }"
|
|
|
bordered>
|
|
|
<!-- 状态 -->
|
|
|
<template slot="state" slot-scope="text, record">
|
|
@@ -103,7 +103,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
-import { settleExpenseQuery, delExpense } from '@/api/settleExpense'
|
|
|
+import { settleExpenseQuery, delExpense, settleExpenseQuerySum } from '@/api/settleExpense'
|
|
|
import { costTypeAllQuery } from '@/api/costType'
|
|
|
import expenseManagementDetailModal from './detailModal.vue'
|
|
|
import moment from 'moment'
|
|
@@ -119,21 +119,26 @@ export default {
|
|
|
// 查询参数
|
|
|
queryParam: {
|
|
|
accountExpensesNo: '',
|
|
|
- expensesTypeSn: '',
|
|
|
expensesTypeSn1: '',
|
|
|
expensesTypeSn2: '',
|
|
|
+ expensesTypeSn3: '',
|
|
|
billStatus: '',
|
|
|
settleState: '',
|
|
|
beginDate: '',
|
|
|
endDate: ''
|
|
|
},
|
|
|
+ // 汇总
|
|
|
+ totalData: {
|
|
|
+ count: 0,
|
|
|
+ totalAmount: 0
|
|
|
+ },
|
|
|
// 表头
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
|
- { title: '费用单号', dataIndex: 'accountExpensesSn', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '费用单号', dataIndex: 'accountExpensesSn', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '费用类型', dataIndex: 'name', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '金额', dataIndex: 'settleAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '费用类型', dataIndex: 'name', width: 300, align: 'center', customRender: function (text, record) { return [record.expensesTypeSn1, record.expensesTypeSn2, record.expensesTypeSn3].join(' > ') } },
|
|
|
+ { title: '金额', dataIndex: 'settleAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
|
|
|
{ title: '单据状态', scopedSlots: { customRender: 'auditStatus' }, width: 110, align: 'center' },
|
|
|
{ title: '结算状态', dataIndex: 'settleState', width: 110, align: 'center' },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 450, align: 'center', fixed: 'right' }
|
|
@@ -156,6 +161,9 @@ export default {
|
|
|
if (this.costTypeList.length == 0) {
|
|
|
this.getCostTypeList()
|
|
|
}
|
|
|
+ // 汇总
|
|
|
+ this.totalData.count = data.count
|
|
|
+ this.settleExpenseQuerySum(Object.assign(parameter, this.queryParam))
|
|
|
return data
|
|
|
})
|
|
|
},
|
|
@@ -186,13 +194,13 @@ export default {
|
|
|
},
|
|
|
// 费用类型 change
|
|
|
changeCostType (val, opt) {
|
|
|
- this.queryParam.expensesTypeSn = val[0] ? val[0] : ''
|
|
|
- this.queryParam.expensesTypeSn1 = val[1] ? val[1] : ''
|
|
|
- this.queryParam.expensesTypeSn2 = val[2] ? val[2] : ''
|
|
|
+ this.queryParam.expensesTypeSn1 = val[0] ? val[0] : ''
|
|
|
+ this.queryParam.expensesTypeSn2 = val[1] ? val[1] : ''
|
|
|
+ this.queryParam.expensesTypeSn3 = val[2] ? val[2] : ''
|
|
|
},
|
|
|
// 新增/编辑
|
|
|
handleEdit (row) {
|
|
|
- this.$router.push({ path: `/financialManagement/expenseManagement/add` })
|
|
|
+ this.$router.push({ name: 'expenseManagementEdit', params: { id: row.id } })
|
|
|
},
|
|
|
// 提交
|
|
|
handleSubmit (row) {
|
|
@@ -256,12 +264,18 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 汇总
|
|
|
+ settleExpenseQuerySum (params) {
|
|
|
+ settleExpenseQuerySum(params).then(res => {
|
|
|
+ this.totalData.totalAmount = res.data.settleAmount || 0
|
|
|
+ })
|
|
|
+ },
|
|
|
// 重置
|
|
|
resetSearchForm () {
|
|
|
this.queryParam.accountExpensesNo = ''
|
|
|
- this.queryParam.expensesTypeSn = ''
|
|
|
this.queryParam.expensesTypeSn1 = ''
|
|
|
this.queryParam.expensesTypeSn2 = ''
|
|
|
+ this.queryParam.expensesTypeSn3 = ''
|
|
|
this.queryParam.billStatus = ''
|
|
|
this.queryParam.settleState = ''
|
|
|
this.queryParam.beginDate = ''
|