|
@@ -36,65 +36,66 @@
|
|
|
:scroll="{ y: tableHeight }"
|
|
|
:defaultLoadData="false"
|
|
|
bordered>
|
|
|
- <!-- 费用类别 -->
|
|
|
- <template slot="expensesType" slot-scope="text, record">
|
|
|
- {{ record.expensesTypeName1 }} <span v-if="record.expensesTypeName2">>{{ record.expensesTypeName2 }}</span> <span v-if="record.expensesTypeName3">>{{ record.expensesTypeName3 }}</span>
|
|
|
- </template>
|
|
|
- <!-- 审核 -->
|
|
|
- <template slot="audit" slot-scope="text, record">
|
|
|
- <stateIcon :title="record.stateDictValue" :state="record.state == 'AUDIT_PASS'?'1':'2'"></stateIcon>
|
|
|
- </template>
|
|
|
<!-- 操作 -->
|
|
|
<template slot="action" slot-scope="text, record">
|
|
|
<a-button
|
|
|
size="small"
|
|
|
type="link"
|
|
|
- v-if="record.state == 'WAIT_AUDIT' && $hasPermissions('B_expenseAudit')"
|
|
|
+ v-if="record.state == 'ENABLE'||record.state == 'DISABLE'"
|
|
|
+ class="button-primary"
|
|
|
+ @click="handleEnable(record)"
|
|
|
+ id="foundAcount-enable-btn">
|
|
|
+ {{ record.state == 'ENABLE'?'禁用':'' }}
|
|
|
+ {{ record.state == 'DISABLE'?'启用':'' }}
|
|
|
+ </a-button>
|
|
|
+ <a-button
|
|
|
+ size="small"
|
|
|
+ type="link"
|
|
|
+ v-if="record.state == 'ENABLE'||record.state == 'DISABLE'"
|
|
|
class="button-primary"
|
|
|
@click="handleDetail(record)"
|
|
|
id="foundAcount-detail-btn">资金明细</a-button>
|
|
|
<a-button
|
|
|
size="small"
|
|
|
type="link"
|
|
|
- v-if="record.state == 'WAIT_AUDIT' && $hasPermissions('B_expenseAudit')"
|
|
|
+ v-if="record.state == 'WAIT'"
|
|
|
class="button-primary"
|
|
|
@click="handleAudit(record)"
|
|
|
id="foundAcount-audit-btn">审核</a-button>
|
|
|
<a-button
|
|
|
size="small"
|
|
|
type="link"
|
|
|
- v-if="record.state == 'WAIT_AUDIT' && $hasPermissions('B_expenseEdit')"
|
|
|
+ v-if="record.state == 'WAIT'"
|
|
|
class="button-primary"
|
|
|
@click="handleEdit(record)"
|
|
|
id="foundAcount-edit-btn">编辑</a-button>
|
|
|
<a-button
|
|
|
size="small"
|
|
|
type="link"
|
|
|
- v-if="record.state == 'WAIT_AUDIT' && $hasPermissions('B_expenseDel')"
|
|
|
+ v-if="record.state == 'WAIT'"
|
|
|
class="button-error"
|
|
|
@click="handleDel(record)"
|
|
|
id="foundAcount-del-btn">删除</a-button>
|
|
|
- <span v-if="record.state != 'WAIT_AUDIT'||( !$hasPermissions('B_expenseAudit')&& !$hasPermissions('B_expenseEdit') && !$hasPermissions('B_expenseDel'))">--</span>
|
|
|
</template>
|
|
|
</s-table>
|
|
|
</a-card>
|
|
|
|
|
|
</a-spin>
|
|
|
- <!-- 详情 -->
|
|
|
- <addModal :openModal="openModal" :itemId="itemId" @close="closeAddModal" />
|
|
|
+ <!-- 新增编辑 -->
|
|
|
+ <addModal ref="addModal" :openModal="openModal" @ok="addSuccess" @close="closeAddModal" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
+import { mapActions } from 'vuex'
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
-import { settleExpenseQuery, delExpense, auditExpense } from '@/api/settleExpense'
|
|
|
import addModal from './addModal.vue'
|
|
|
-import stateIcon from '@/views/common/stateIcon'
|
|
|
+import { settleAccountList, settleAccountEnable, settleAccountDelete, settleAccountAudit } from '@/api/settleAcount'
|
|
|
export default {
|
|
|
name: 'ExpenseManagementList',
|
|
|
- components: { STable, VSelect, addModal, rangeDate, stateIcon },
|
|
|
+ components: { STable, VSelect, addModal, rangeDate },
|
|
|
mixins: [commonMixin],
|
|
|
data () {
|
|
|
return {
|
|
@@ -102,26 +103,25 @@ export default {
|
|
|
tableHeight: 0,
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
advanced: true, // 高级搜索 展开/关闭
|
|
|
- enableFundAccount: '1',
|
|
|
+ enableFundAccount: '',
|
|
|
// 查询参数
|
|
|
queryParam: {},
|
|
|
// 表头
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
|
|
|
- { title: '账户类型', dataIndex: 'accountExpensesNo', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '账户名称', dataIndex: 'createDate', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '账户号码', scopedSlots: { customRender: 'expensesType' }, width: '20%', align: 'center' },
|
|
|
- { title: '收入金额', dataIndex: 'settleAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
|
|
|
- { title: '支出金额', dataIndex: 'settleAmount1', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
|
|
|
- { title: '启用', scopedSlots: { customRender: 'enable' }, width: '3%', align: 'center' },
|
|
|
- { title: '审核', scopedSlots: { customRender: 'audit' }, width: '3%', align: 'center' },
|
|
|
+ { title: '账户类型', dataIndex: 'settleStyleName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '账户名称', dataIndex: 'accountName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '账户号码', dataIndex: 'accountNo', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '收入金额', dataIndex: 'totalIncomeAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
|
|
|
+ { title: '支出金额', dataIndex: 'totalExpendAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
|
|
|
+ { title: '状态', dataIndex: 'stateDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' }
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
|
this.spinning = true
|
|
|
- return settleExpenseQuery(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
+ return settleAccountList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
let data
|
|
|
if (res.status == 200) {
|
|
|
data = res.data
|
|
@@ -140,8 +140,14 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ ...mapActions(['UpdateSettleAccount', 'GetSettleAccountState']),
|
|
|
enableFundAccountChange (v) {
|
|
|
-
|
|
|
+ this.UpdateSettleAccount({ enableFlag: v.target.value }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.GetSettleAccountState()
|
|
|
+ }
|
|
|
+ this.$message.info(res.message)
|
|
|
+ })
|
|
|
},
|
|
|
// 关闭弹框
|
|
|
closeAddModal () {
|
|
@@ -150,8 +156,13 @@ export default {
|
|
|
},
|
|
|
// 新增/编辑
|
|
|
handleEdit (row) {
|
|
|
- this.itemId = row ? row.id : null
|
|
|
this.openModal = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.addModal.setData(row)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ addSuccess () {
|
|
|
+ this.$refs.table.refresh()
|
|
|
},
|
|
|
// 资金明细
|
|
|
handleDetail (row) {
|
|
@@ -162,20 +173,41 @@ export default {
|
|
|
const _this = this
|
|
|
this.$confirm({
|
|
|
title: '提示',
|
|
|
- content: '确定要审核吗?',
|
|
|
+ content: '审核通过后,账户信息不能再修改,确认审核通过吗?',
|
|
|
centered: true,
|
|
|
onOk () {
|
|
|
_this.spinning = true
|
|
|
- auditExpense({
|
|
|
- id: row.id
|
|
|
+ settleAccountAudit({
|
|
|
+ settleAccountSn: row.settleAccountSn,
|
|
|
+ auditState: 'PASS'
|
|
|
}).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.$message.success(res.message)
|
|
|
_this.$refs.table.refresh()
|
|
|
- _this.spinning = false
|
|
|
- } else {
|
|
|
- _this.spinning = false
|
|
|
}
|
|
|
+ _this.spinning = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 启用,禁用
|
|
|
+ handleEnable (row) {
|
|
|
+ const _this = this
|
|
|
+ this.$confirm({
|
|
|
+ title: '提示',
|
|
|
+ content: row.state == 'ENABLE' ? '确认禁用该账户吗?' : '确认启用该账户吗?',
|
|
|
+ centered: true,
|
|
|
+ onOk () {
|
|
|
+ _this.spinning = true
|
|
|
+ settleAccountEnable({
|
|
|
+ settleAccountSn: row.settleAccountSn,
|
|
|
+ enableFlag: row.state == 'ENABLE' ? 'DISABLE' : 'ENABLE'
|
|
|
+ }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.$message.success(res.message)
|
|
|
+ _this.$refs.table.refresh()
|
|
|
+ }
|
|
|
+ _this.spinning = false
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -183,21 +215,18 @@ export default {
|
|
|
// 删除
|
|
|
handleDel (row) {
|
|
|
const _this = this
|
|
|
- _this.itemId = row.id
|
|
|
_this.$confirm({
|
|
|
title: '提示',
|
|
|
content: '删除后原数据不可恢复,是否删除?',
|
|
|
centered: true,
|
|
|
onOk () {
|
|
|
_this.spinning = true
|
|
|
- delExpense({ id: _this.itemId }).then(res => {
|
|
|
+ settleAccountDelete({ settleAccountSn: row.settleAccountSn }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.$message.success(res.message)
|
|
|
_this.$refs.table.refresh()
|
|
|
- _this.spinning = false
|
|
|
- } else {
|
|
|
- _this.spinning = false
|
|
|
}
|
|
|
+ _this.spinning = false
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -211,6 +240,12 @@ export default {
|
|
|
this.$nextTick(() => { // 页面渲染完成后的回调
|
|
|
_this.setTableH()
|
|
|
})
|
|
|
+ // 结算账户状态查询
|
|
|
+ this.GetSettleAccountState().then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.enableFundAccount = res.data.functionEnableFlag
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
setTableH () {
|
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|