提交 dd647a0c authored 作者: 宋雄's avatar 宋雄

优化

上级 bdea32ac
......@@ -80,6 +80,7 @@ const getAccountListByIdApi = (params)=>getAction("/property-community/property/
const companyAuditAccountPageApi = (params)=>postAction("/property-community/property/communityReconciliation/companyAudit",params);
const getCommunityRecordListApi = (params)=>getAction("/property-central/property/auditRecord/getRecordList",params);
const companySubCentralApi = (params)=>getAction("/property-community/property/communityReconciliation/companySubCentral",params);
const companySubAuditApi = (params)=>getAction("/property-community/property/communityReconciliation/companySubAudit",params);
//数据字典
const addDict = (params)=>postAction("/sys/dict/add",params);
......@@ -196,6 +197,7 @@ export {
companyAuditAccountPageApi,
getCommunityRecordListApi,
companySubCentralApi,
companySubAuditApi
}
......
......@@ -43,12 +43,18 @@
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button :disabled="selectedRowKeys.length === 0" @click="onReconciliation()" type="primary" icon="audit">申请对账</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="onReconciliation()"><a-icon type="audit" />批量审核</a-menu-item>
<a-menu-item key="2" @click="onSubmit()"><a-icon type="audit" />批量申请对账</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<a-table ref="table" size="middle" :scroll="{x:true}" bordered rowKey="id" :columns="columns" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
<a-table ref="table" size="middle" :scroll="{x:true}" bordered rowKey="id" :columns="columns" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, getCheckboxProps: onCheckboxProps}"
:dataSource="dataSource" :pagination="ipagination" :loading="loading" class="j-table-force-nowrap" @change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a href="javascript:;" @click="propertyDetails(1, record.id)">详情</a>
......@@ -58,17 +64,29 @@
</template>
<template v-if="record.companyAuditStatus === 'companyAuditPass' && !record.centralAuditStatus">
<a-divider type="vertical" />
<a href="javascript:;" @click="onReconciliation(record.id)">申请对账</a>
<a href="javascript:;" @click="onSubmit(record.id)">申请对账</a>
</template>
</span>
</a-table>
</div>
<!-- table区域-end -->
<a-modal v-model="visibleAudit" :width="400">
<template slot="footer">
<a-button key="back" @click="visibleAudit = false">取消</a-button>
<a-button key="reject" type="danger" @click="handleAudit('refuse')">驳回</a-button>
<a-button key="submit" type="primary" @click="handleAudit('auditPass')">通过</a-button>
</template>
<div class="ant-modal-confirm-body">
<a-icon type="question-circle" style="color:#faad14;margin-right: 16px;font-size:22px;" />
<span class="ant-modal-confirm-title">确认要审核当前对账吗?</span>
</div>
</a-modal>
</a-card>
</template>
<script>
import { companySubCentralApi } from '@/api/api'
import { companySubAuditApi, companySubCentralApi } from '@/api/api'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { filterDictTextByStatic, COMPANY_AUDIT_STATUS, CENTRAL_AUDIT_STATUS } from '@/assets/static.js'
......@@ -154,10 +172,17 @@ export default {
list: '/property-community/property/communityReconciliation/companyAuditList',
delete: '/property-central/property/communityReconciliation/delete',
deleteBatch: '/property-central/property/communityReconciliation/deleteBatch',
}
},
visibleAudit: false
}
},
methods: {
onCheckboxProps: record=> ({
props: {
disabled: record.companyAuditStatus === 'companyRefuse' || (record.companyAuditStatus === 'companyAuditPass' && (record.centralAuditStatus === 'centralWaitAudit' || record.centralAuditStatus === 'centralAuditPass')),
name: record.id
}
}),
propertyDetails(type, id) {
this.$router.push({
path: '/base/RecordDetails?type=' + type +'&id=' + id
......@@ -171,22 +196,46 @@ export default {
this.handleDetail(record)
}
},
onReconciliation(id) {
let ids = id || this.selectedRowKeys.join(',')
let that = this
this.$confirm({
title: '确认要申请当前对账吗?',
closable: true,
okText: '确认',
onOk() {
return companySubCentralApi({
ids
}).then((res) => {
that.$message.success('申请对账成功!')
that.searchQuery()
})
}
handleAudit(type) {
let ids = this.selectedRowKeys.join(',')
companySubAuditApi({
ids,
auditStatus: type
}).then(res=> {
this.visibleAudit = false
this.$message.success(`${type === 'auditPass' ? '审核' : '驳回'}成功!`)
this.searchQuery()
})
},
onReconciliation() {
let flag = this.selectionRows.some(item=>item.companyAuditStatus !== 'companyWaitAudit')
if(flag) {
this.$message.warning('请注意,已选数据中有 已审核 账单!')
} else {
this.visibleAudit = true
}
},
onSubmit(id) {
let flag = this.selectionRows.some(item=>item.companyAuditStatus === 'companyWaitAudit')
if(flag) {
this.$message.warning('请注意,已选数据中有 未审核 账单!')
} else {
let ids = id || this.selectedRowKeys.join(',')
let that = this
this.$confirm({
title: '确认要申请当前对账吗?',
closable: true,
okText: '确认',
onOk() {
return companySubCentralApi({
ids
}).then((res) => {
that.$message.success('申请对账成功!')
that.searchQuery()
})
}
})
}
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论